@costrict/csc 4.1.0 → 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-jj0pqphf.js → chunk-03g34taj.js} +55 -52
  2. package/dist/{chunk-srntgfa4.js → chunk-04h1dzn8.js} +58 -55
  3. package/dist/{chunk-bnqe1rhv.js → chunk-04js9982.js} +14 -14
  4. package/dist/{chunk-a40pqd86.js → chunk-0cm9fcaq.js} +4 -4
  5. package/dist/{chunk-3710m54v.js → chunk-0d8p649e.js} +205 -1297
  6. package/dist/{chunk-q4z98yeq.js → chunk-0ftbdtb6.js} +57909 -57909
  7. package/dist/{chunk-x1xw4k8y.js → chunk-0kv76cch.js} +69 -66
  8. package/dist/{chunk-5fmdr8kf.js → chunk-0q8601fc.js} +56 -53
  9. package/dist/{chunk-99ch3v87.js → chunk-0s2qjxt0.js} +2 -2
  10. package/dist/{chunk-wvexwzsv.js → chunk-0vjhwg78.js} +4 -4
  11. package/dist/{chunk-n20s9kza.js → chunk-0wfby4jk.js} +55 -52
  12. package/dist/{chunk-qsq0dead.js → chunk-0wzfz235.js} +55 -52
  13. package/dist/{chunk-jkkca78b.js → chunk-0z3swktk.js} +58 -55
  14. package/dist/{chunk-b50c6d9d.js → chunk-0zwtzj7s.js} +4 -4
  15. package/dist/{chunk-j4smny6q.js → chunk-12b1dsca.js} +3 -3
  16. package/dist/{chunk-xstgv88m.js → chunk-172aq1cm.js} +3 -3
  17. package/dist/{chunk-4cve1vrz.js → chunk-1928vvnf.js} +16 -16
  18. package/dist/{chunk-18vnrzf5.js → chunk-1gta3pqg.js} +26 -1390
  19. package/dist/{chunk-jkb9g66a.js → chunk-1hr30g9j.js} +56 -53
  20. package/dist/{chunk-qkewrphe.js → chunk-1ta87008.js} +13 -13
  21. package/dist/{chunk-c110nsx0.js → chunk-1tsg5bqp.js} +7 -7
  22. package/dist/{chunk-9ey1xvcm.js → chunk-1xdybmyp.js} +2 -2
  23. package/dist/{chunk-zdkvcpbe.js → chunk-1xqh8b38.js} +2 -2
  24. package/dist/{chunk-pb9tbzx4.js → chunk-1z6393pz.js} +55 -52
  25. package/dist/{chunk-rq1rj0fm.js → chunk-20rdctr8.js} +59 -56
  26. package/dist/{chunk-n99mdb05.js → chunk-2278qvvz.js} +82 -69
  27. package/dist/{chunk-1r3w86w2.js → chunk-27rca2qk.js} +14 -14
  28. package/dist/{chunk-0yw7zdrk.js → chunk-28p3x5mq.js} +58 -55
  29. package/dist/{chunk-cdcg7rv7.js → chunk-29n8fs0h.js} +3 -3
  30. package/dist/{chunk-eemwbs1k.js → chunk-2bahqsy8.js} +5 -5
  31. package/dist/{chunk-vmnb4fe2.js → chunk-2d4az1sb.js} +1051 -213
  32. package/dist/{chunk-bbm8cs3b.js → chunk-2dtsff0m.js} +2 -2
  33. package/dist/{chunk-epb6vn7a.js → chunk-2dvsb5m8.js} +3 -3
  34. package/dist/{chunk-hh9e110e.js → chunk-2ea63hn5.js} +55 -52
  35. package/dist/{chunk-2wzw1ch2.js → chunk-2heyngx7.js} +55 -52
  36. package/dist/{chunk-exy61tq9.js → chunk-2n4jnkr3.js} +5 -5
  37. package/dist/{chunk-04fesxxb.js → chunk-2npy5n4d.js} +3 -3
  38. package/dist/chunk-2yz7ej7r.js +215 -0
  39. package/dist/{chunk-6dszbr2m.js → chunk-347n8wrb.js} +56 -53
  40. package/dist/{chunk-ac8h9vfx.js → chunk-365z3p8q.js} +4 -4
  41. package/dist/{chunk-2bjxdx6v.js → chunk-3ax3g4ky.js} +5 -5
  42. package/dist/{chunk-6tgdp97d.js → chunk-3c22f5y8.js} +4 -4
  43. package/dist/{chunk-y8h1t9ak.js → chunk-3ed5qycn.js} +59 -56
  44. package/dist/{chunk-2afnxgdd.js → chunk-3hw6pcqt.js} +12 -12
  45. package/dist/chunk-3j0f3yyd.js +20 -0
  46. package/dist/{chunk-yc2nybgd.js → chunk-3keyh8d3.js} +2 -2
  47. package/dist/{chunk-hegr0s7q.js → chunk-3n8prx9k.js} +3 -3
  48. package/dist/{chunk-8fvbvp8b.js → chunk-3tnabt1t.js} +2 -2
  49. package/dist/{chunk-0jehknrf.js → chunk-3ydfy1vc.js} +2 -2
  50. package/dist/{chunk-246ewz3k.js → chunk-41ncbfk7.js} +3 -3
  51. package/dist/{chunk-9qdc1dr7.js → chunk-45ynv6r6.js} +2 -2
  52. package/dist/chunk-46sfycpp.js +125 -0
  53. package/dist/{chunk-a1mp5wrb.js → chunk-496449vy.js} +2 -2
  54. package/dist/{chunk-a8w0ptwp.js → chunk-49z79885.js} +3 -3
  55. package/dist/{chunk-25j8nzw3.js → chunk-4c8mdzm1.js} +4 -4
  56. package/dist/{chunk-frafv5eb.js → chunk-4f56n8y8.js} +4 -4
  57. package/dist/{chunk-1mft5mam.js → chunk-4ffz1d36.js} +4 -4
  58. package/dist/{chunk-9jkv01k5.js → chunk-4hgk89n9.js} +59 -56
  59. package/dist/{chunk-g2z79a35.js → chunk-4k4kn7h2.js} +18 -18
  60. package/dist/{chunk-vf5aqnmh.js → chunk-4ks3c21q.js} +64 -61
  61. package/dist/{chunk-bazg62tk.js → chunk-4v3p8phf.js} +15 -15
  62. package/dist/chunk-4vzg1cn7.js +264 -0
  63. package/dist/{chunk-ex5da5zw.js → chunk-4xp653hr.js} +55 -52
  64. package/dist/{chunk-szhqm62n.js → chunk-4zvptd40.js} +60 -56
  65. package/dist/{chunk-70ygvt3c.js → chunk-503675yy.js} +2 -2
  66. package/dist/{chunk-cpmwecza.js → chunk-52d0caw3.js} +58 -55
  67. package/dist/{chunk-x0vsajns.js → chunk-56speggn.js} +3 -3
  68. package/dist/{chunk-94zksc1x.js → chunk-58jcwxyh.js} +14 -14
  69. package/dist/{chunk-ff33xk7c.js → chunk-5bd0sf0q.js} +2 -2
  70. package/dist/chunk-5cxetff3.js +443 -0
  71. package/dist/{chunk-10k5cmhr.js → chunk-5dm3xwms.js} +6 -6
  72. package/dist/{chunk-kb3arncw.js → chunk-5e4sk6wr.js} +3 -3
  73. package/dist/{chunk-azj0n2d5.js → chunk-5fny1a0a.js} +48 -17
  74. package/dist/{chunk-vavwasjv.js → chunk-5hn85d4q.js} +58 -55
  75. package/dist/{chunk-h8mre2wt.js → chunk-5p3bwhcw.js} +5 -5
  76. package/dist/{chunk-sgmscys1.js → chunk-5r57a99p.js} +15 -15
  77. package/dist/{chunk-9t6bcs6h.js → chunk-5thf5z45.js} +136 -44
  78. package/dist/chunk-5vbtjcd2.js +624 -0
  79. package/dist/{chunk-16mcxht8.js → chunk-5w9qcjjt.js} +61 -58
  80. package/dist/{chunk-wvevgh1a.js → chunk-5xj3z42h.js} +5 -5
  81. package/dist/{chunk-r3ve8thc.js → chunk-62r8rxkw.js} +4 -4
  82. package/dist/chunk-64wm5777.js +85 -0
  83. package/dist/{chunk-mht29n4v.js → chunk-6a32d602.js} +55 -52
  84. package/dist/{chunk-007h648h.js → chunk-6aevda19.js} +2 -2
  85. package/dist/{chunk-445bwfcz.js → chunk-6bb0gyhh.js} +55 -52
  86. package/dist/{chunk-72jyr3w9.js → chunk-6d9njm1w.js} +2 -2
  87. package/dist/{chunk-7fxmzq5j.js → chunk-6fbvxhan.js} +3 -3
  88. package/dist/{chunk-d988v6vq.js → chunk-6kddkcqk.js} +57 -54
  89. package/dist/{chunk-ejds7a1j.js → chunk-6sytfk68.js} +5 -5
  90. package/dist/{chunk-7z7d0s4n.js → chunk-6ypvw68g.js} +55 -52
  91. package/dist/{chunk-cga8jcd5.js → chunk-6zkxtny0.js} +4 -4
  92. package/dist/{chunk-k7mg4se1.js → chunk-6zn0szv5.js} +19 -17
  93. package/dist/{chunk-yqb19vg0.js → chunk-71053xes.js} +14 -14
  94. package/dist/chunk-758qmraw.js +66 -0
  95. package/dist/{chunk-41rte42b.js → chunk-76g1m8sa.js} +16 -4
  96. package/dist/{chunk-t7d66zgt.js → chunk-7b1ze28c.js} +55 -52
  97. package/dist/{chunk-a3m8brwc.js → chunk-7bq6az8b.js} +3 -3
  98. package/dist/{chunk-p5zfk1p0.js → chunk-7ckqn3c3.js} +55 -52
  99. package/dist/chunk-7d5gzxsx.js +145 -0
  100. package/dist/{chunk-wwcagza5.js → chunk-7gyjd00q.js} +3 -3
  101. package/dist/{chunk-weq1878z.js → chunk-7hnmt967.js} +84 -80
  102. package/dist/{chunk-07bx2jcz.js → chunk-7jbeh3g8.js} +3 -3
  103. package/dist/{chunk-nk4avpbc.js → chunk-7k0h27s8.js} +7 -7
  104. package/dist/{chunk-zyjnx7p3.js → chunk-7myptjaa.js} +5 -5
  105. package/dist/{chunk-gj458fct.js → chunk-7yq22pd2.js} +57 -54
  106. package/dist/{chunk-jzngaehg.js → chunk-7zxvjs3d.js} +2 -2
  107. package/dist/{chunk-1yw96d3f.js → chunk-83v18n96.js} +14 -14
  108. package/dist/{chunk-cehe5fzp.js → chunk-84a79s9g.js} +124 -149
  109. package/dist/{chunk-188vmn2q.js → chunk-86n03xsk.js} +60 -57
  110. package/dist/{chunk-yrx21nzs.js → chunk-87ddk39d.js} +6 -6
  111. package/dist/{chunk-91pgjs9c.js → chunk-89jrgnx3.js} +15 -15
  112. package/dist/{chunk-0g5nbhfx.js → chunk-8dehkx39.js} +5 -5
  113. package/dist/{chunk-r5m7dsya.js → chunk-8fm77brm.js} +59 -56
  114. package/dist/{chunk-65q352pt.js → chunk-8fqa9v4h.js} +55 -52
  115. package/dist/{chunk-kr7tq75r.js → chunk-8pqe4w62.js} +62 -59
  116. package/dist/{chunk-bnma4wvz.js → chunk-8qp0ytjr.js} +2 -2
  117. package/dist/{chunk-3bz9rf07.js → chunk-8v8n8gxv.js} +3 -3
  118. package/dist/{chunk-nq3atbmt.js → chunk-94jqjx3g.js} +59 -56
  119. package/dist/chunk-9663bsk0.js +18 -0
  120. package/dist/{chunk-k927esxr.js → chunk-96gwphgv.js} +3 -3
  121. package/dist/{chunk-22gbyh19.js → chunk-9bf696cj.js} +95 -87
  122. package/dist/{chunk-50dqzjnc.js → chunk-9cw6etxe.js} +56 -53
  123. package/dist/{chunk-r7a5cqdw.js → chunk-9dwdn2sk.js} +7 -7
  124. package/dist/{chunk-w5hj47pg.js → chunk-9ggwn844.js} +55 -68
  125. package/dist/{chunk-3wdtayab.js → chunk-9gxdrrd5.js} +55 -52
  126. package/dist/{chunk-91n8b2bh.js → chunk-9q952pw0.js} +2 -2
  127. package/dist/{chunk-rh4c6hqb.js → chunk-9qgzdk8y.js} +7 -7
  128. package/dist/{chunk-308mgh4v.js → chunk-9qj9t1g4.js} +2 -2
  129. package/dist/{chunk-fepvmnye.js → chunk-9sr5cheh.js} +55 -52
  130. package/dist/{chunk-4ksc1s3d.js → chunk-9vvffdb6.js} +64 -61
  131. package/dist/chunk-a18ypbnr.js +151 -0
  132. package/dist/{chunk-agp8g4vs.js → chunk-a80y3b1p.js} +3 -3
  133. package/dist/{chunk-82e5ecfq.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-42m1b4hy.js → chunk-am5zfwnf.js} +19 -19
  137. package/dist/{chunk-dz9y4ynp.js → chunk-b21j3y4h.js} +2 -2
  138. package/dist/{chunk-k85dxf7e.js → chunk-b52sketm.js} +55 -52
  139. package/dist/{chunk-nda7wdyd.js → chunk-b7fcydvv.js} +18 -18
  140. package/dist/{chunk-tfy2cfmx.js → chunk-bb9h35x7.js} +55 -52
  141. package/dist/{chunk-8yvwvs92.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-6qjny6s9.js → chunk-be8pcep0.js} +2 -2
  145. package/dist/{chunk-gb253fe4.js → chunk-bgpftrxc.js} +56 -53
  146. package/dist/{chunk-1psvq5k9.js → chunk-bh4k9q9y.js} +4 -4
  147. package/dist/{chunk-1ht0vtnv.js → chunk-bjc8f709.js} +62 -59
  148. package/dist/{chunk-3xn43gdg.js → chunk-bm5370d5.js} +14 -14
  149. package/dist/{chunk-g14bjgw2.js → chunk-br1qf4bc.js} +12 -21
  150. package/dist/{chunk-wmxdjz06.js → chunk-bxmc7435.js} +7 -7
  151. package/dist/chunk-c36xznt7.js +1045 -0
  152. package/dist/{chunk-3153jw2k.js → chunk-c3z2f4aq.js} +58 -55
  153. package/dist/chunk-cchv4yn8.js +214 -0
  154. package/dist/{chunk-j4rqvdds.js → chunk-cewbt8ah.js} +2 -2
  155. package/dist/{chunk-txcczr8d.js → chunk-cfeakba6.js} +55 -52
  156. package/dist/{chunk-b0rzqvdk.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-nynqcpbc.js → chunk-cwpxrn2d.js} +17 -17
  161. package/dist/chunk-cy223s48.js +881 -0
  162. package/dist/{chunk-7btb0pt0.js → chunk-cydd546q.js} +57 -53
  163. package/dist/{chunk-vwppfk3m.js → chunk-cz5ycdta.js} +3 -3
  164. package/dist/{chunk-mkqj6971.js → chunk-da7f9a81.js} +105 -29
  165. package/dist/{chunk-6w9vbmda.js → chunk-dfzfxt1y.js} +7 -7
  166. package/dist/{chunk-qwn30dmv.js → chunk-dj6y2sr8.js} +3 -3
  167. package/dist/{chunk-cbhwxy49.js → chunk-djbawqmw.js} +55 -52
  168. package/dist/{chunk-n0qw1yqs.js → chunk-dpb1kvb9.js} +56 -53
  169. package/dist/{chunk-gr3hsybk.js → chunk-dt5c48mh.js} +2 -2
  170. package/dist/{chunk-sffjkpkr.js → chunk-e1m95nec.js} +6 -6
  171. package/dist/{chunk-gy5e77gm.js → chunk-e26hypm4.js} +56 -53
  172. package/dist/{chunk-8z65azad.js → chunk-e5kn4hwp.js} +56 -53
  173. package/dist/{chunk-750k6p99.js → chunk-e6dq8apj.js} +55 -52
  174. package/dist/{chunk-afjvd592.js → chunk-e6p5x2p4.js} +4 -4
  175. package/dist/{chunk-4bwmnypz.js → chunk-eb6x30zz.js} +57 -54
  176. package/dist/{chunk-mcmhgv5a.js → chunk-ebfv6acv.js} +12 -12
  177. package/dist/{chunk-zgt8wev2.js → chunk-egkwv0bp.js} +2 -2
  178. package/dist/{chunk-7e6cm3rj.js → chunk-ennzq1s5.js} +14 -4
  179. package/dist/{chunk-4am10fzg.js → chunk-envqyd27.js} +59 -55
  180. package/dist/{chunk-d9c2bj73.js → chunk-epprxdgg.js} +2 -2
  181. package/dist/{chunk-2nrg59n8.js → chunk-et42fzf1.js} +22 -22
  182. package/dist/{chunk-h0rbjg6x.js → chunk-f2mhrmww.js} +10 -3
  183. package/dist/{chunk-ywmprz18.js → chunk-fb5ehysd.js} +57 -54
  184. package/dist/chunk-fbtp7vga.js +37 -0
  185. package/dist/{chunk-d2148dsd.js → chunk-fgna18nd.js} +6 -6
  186. package/dist/{chunk-wzheh2yr.js → chunk-fknjgxt4.js} +56 -53
  187. package/dist/{chunk-y1jcd7xx.js → chunk-fpb43g1s.js} +6 -6
  188. package/dist/{chunk-d24kfzcv.js → chunk-ftfz2eh3.js} +2 -2
  189. package/dist/{chunk-3j8vq1pf.js → chunk-fv94gm4h.js} +56 -53
  190. package/dist/{chunk-fjqp3q7c.js → chunk-fx7pr1g4.js} +13 -13
  191. package/dist/{chunk-ryqepdpz.js → chunk-g0axk7cx.js} +56 -53
  192. package/dist/chunk-g6d9avms.js +205 -0
  193. package/dist/{chunk-xjfqctzs.js → chunk-g9caj6wj.js} +66 -63
  194. package/dist/{chunk-nfbw6f7k.js → chunk-gbekxw41.js} +56 -53
  195. package/dist/{chunk-ahq40vpt.js → chunk-gcpc6b2z.js} +2 -2
  196. package/dist/{chunk-98174mf4.js → chunk-gfycetpg.js} +5 -5
  197. package/dist/{chunk-sjjq8xdb.js → chunk-gn0ja3k5.js} +5 -5
  198. package/dist/{chunk-j2zvdmqh.js → chunk-gt9gwwdh.js} +5 -5
  199. package/dist/{chunk-cf8d6pz4.js → chunk-gz0nj0mm.js} +55 -52
  200. package/dist/{chunk-msr65xs2.js → chunk-gz6pze8f.js} +57 -54
  201. package/dist/{chunk-7m8k6pa3.js → chunk-h1frxdrg.js} +56 -54
  202. package/dist/{chunk-eac7ypee.js → chunk-h93ve2g2.js} +14 -14
  203. package/dist/{chunk-vee2y2a3.js → chunk-h9mr8ey4.js} +13 -13
  204. package/dist/{chunk-59bwmnpt.js → chunk-hd8ydnzq.js} +15 -15
  205. package/dist/{chunk-kgcmddnw.js → chunk-hebz2z6z.js} +58 -55
  206. package/dist/chunk-hgxb4qn5.js +390 -0
  207. package/dist/{chunk-00hg5r38.js → chunk-hh6kgtq5.js} +3 -3
  208. package/dist/{chunk-hd9nkrx3.js → chunk-hhcx2jjn.js} +3 -3
  209. package/dist/{chunk-6x5h6cqf.js → chunk-hjp1yckp.js} +56 -53
  210. package/dist/{chunk-bqbxmdjy.js → chunk-hjxz7a04.js} +58 -55
  211. package/dist/{chunk-0v69sn62.js → chunk-hkkz8rde.js} +55 -52
  212. package/dist/{chunk-677p38pg.js → chunk-hnms0snx.js} +2 -2
  213. package/dist/{chunk-y15fkqed.js → chunk-hq4jd1fy.js} +23 -23
  214. package/dist/{chunk-hknjwtbv.js → chunk-hthfhdty.js} +15 -15
  215. package/dist/{chunk-xkavy09t.js → chunk-hy5vd50e.js} +3 -3
  216. package/dist/{chunk-86nrce87.js → chunk-hyztfnyq.js} +468 -226
  217. package/dist/{chunk-45m4a7v2.js → chunk-j5rnevxw.js} +62 -59
  218. package/dist/{chunk-26g6w0ah.js → chunk-j74ctwq9.js} +3 -3
  219. package/dist/{chunk-nt0qt25w.js → chunk-jcdv05ym.js} +33 -5
  220. package/dist/{chunk-bdjevwn2.js → chunk-jd5xs374.js} +55 -52
  221. package/dist/{chunk-rz56zge4.js → chunk-jgbz49jh.js} +6 -4
  222. package/dist/{chunk-7hsedj2m.js → chunk-jhdtyhk5.js} +57 -54
  223. package/dist/{chunk-e40wen38.js → chunk-jkbkp0ek.js} +14 -14
  224. package/dist/{chunk-kf6gt482.js → chunk-jkyn6ge9.js} +5 -5
  225. package/dist/{chunk-nb02zd8m.js → chunk-jn7qa13m.js} +3 -3
  226. package/dist/{chunk-4ah5x35c.js → chunk-jt7ea6rq.js} +55 -52
  227. package/dist/{chunk-827qm1sh.js → chunk-jt7wch8z.js} +2 -2
  228. package/dist/{chunk-v4vcp64e.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-dkazyend.js → chunk-k11m1rfc.js} +57 -54
  232. package/dist/{chunk-z2yjcarh.js → chunk-k3mghke5.js} +57 -86
  233. package/dist/{chunk-a0dd5hkn.js → chunk-k5rrrd0q.js} +78 -75
  234. package/dist/{chunk-2wbwn8g8.js → chunk-kbbjfeb8.js} +2 -2
  235. package/dist/chunk-kcz5b7xv.js +73 -0
  236. package/dist/{chunk-173gkvba.js → chunk-khnxj5vx.js} +3 -3
  237. package/dist/{chunk-cgqv2grs.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-qgbfcm47.js → chunk-kszphewb.js} +63 -54
  241. package/dist/{chunk-h9j4zz8p.js → chunk-kxn6mzy3.js} +4 -4
  242. package/dist/{chunk-bjgz0wdj.js → chunk-m0zzdgkt.js} +31 -26
  243. package/dist/{chunk-xpvj19fq.js → chunk-m7qa1fqb.js} +3 -3
  244. package/dist/{chunk-ffg51hwt.js → chunk-mdm5cbxy.js} +55 -52
  245. package/dist/chunk-mnqvtfd5.js +78 -0
  246. package/dist/{chunk-429gckc3.js → chunk-mp5km99q.js} +20 -20
  247. package/dist/{chunk-psbm5jsc.js → chunk-mpxcgg5f.js} +6 -6
  248. package/dist/{chunk-a5615tp4.js → chunk-mqr18cwx.js} +4 -4
  249. package/dist/chunk-n014czx3.js +18 -0
  250. package/dist/{chunk-wtcd14r5.js → chunk-n40kbp9f.js} +55 -52
  251. package/dist/{chunk-z3qy0rgg.js → chunk-n51s6m60.js} +14 -14
  252. package/dist/{chunk-0rr38kc5.js → chunk-n87c314c.js} +56 -53
  253. package/dist/{chunk-qrzeq3x3.js → chunk-nevf0mb9.js} +15 -15
  254. package/dist/{chunk-fe3f357e.js → chunk-nkeknzb2.js} +4 -4
  255. package/dist/{chunk-xcvezw4b.js → chunk-nkgq6a5q.js} +28 -28
  256. package/dist/{chunk-3208ghtw.js → chunk-nmj9qx2x.js} +65 -62
  257. package/dist/{chunk-26bfvj72.js → chunk-nmyfe9j9.js} +57 -54
  258. package/dist/{chunk-fz2zjx1x.js → chunk-nmzy0qjn.js} +7 -7
  259. package/dist/{chunk-gdajxwh7.js → chunk-np05dg07.js} +55 -52
  260. package/dist/{chunk-w51sng2s.js → chunk-npgyhaqc.js} +2 -2
  261. package/dist/{chunk-chfh2dha.js → chunk-nr2skyv7.js} +56 -53
  262. package/dist/{chunk-5wrrjqyd.js → chunk-nv5rddp1.js} +55 -52
  263. package/dist/{chunk-7aeww2z6.js → chunk-p10xajeq.js} +69 -66
  264. package/dist/{chunk-2kajewxj.js → chunk-p1wxbhgj.js} +4 -4
  265. package/dist/{chunk-q65zt8zd.js → chunk-p6fhtt1h.js} +4 -4
  266. package/dist/{chunk-5w18hvcs.js → chunk-p8d1q69a.js} +55 -52
  267. package/dist/{chunk-rrcsw70h.js → chunk-pbmy8ktp.js} +7 -7
  268. package/dist/{chunk-wvp9qznk.js → chunk-pqrb30bj.js} +2 -2
  269. package/dist/{chunk-etd086w1.js → chunk-pr321r8d.js} +3 -3
  270. package/dist/{chunk-t4f85b5b.js → chunk-psq9gtg7.js} +2 -2
  271. package/dist/{chunk-wt40qpf8.js → chunk-ptermrp1.js} +60 -57
  272. package/dist/{chunk-ybpn8zcq.js → chunk-pyfrphvc.js} +57 -54
  273. package/dist/{chunk-vajyw4ea.js → chunk-pzb2zc4x.js} +6 -6
  274. package/dist/{chunk-9p4wsdjj.js → chunk-q0w614e1.js} +3 -3
  275. package/dist/{chunk-x8khmg37.js → chunk-q110twdj.js} +59 -116
  276. package/dist/{chunk-v3ynnwf5.js → chunk-q72dtjqy.js} +2 -2
  277. package/dist/{chunk-73zyqp47.js → chunk-q90bcq6v.js} +59 -56
  278. package/dist/{chunk-cmk5fvhp.js → chunk-qavfmmqd.js} +6 -6
  279. package/dist/{chunk-fsr3wqt8.js → chunk-qjx52q61.js} +2 -2
  280. package/dist/{chunk-fw4y0f76.js → chunk-qk2tvn8y.js} +56 -53
  281. package/dist/{chunk-2d9752es.js → chunk-qm3k6vez.js} +13 -13
  282. package/dist/{chunk-h2q4v2te.js → chunk-qmp50hjb.js} +19 -19
  283. package/dist/{chunk-tvnzqcya.js → chunk-qnztz65r.js} +56 -53
  284. package/dist/{chunk-0c1d11gp.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-gmyt1kr3.js → chunk-r3fadmd6.js} +5 -5
  289. package/dist/{chunk-sgw20vr8.js → chunk-r4mec6w5.js} +3 -3
  290. package/dist/chunk-r6g3xx75.js +415 -0
  291. package/dist/{chunk-3d8wynhd.js → chunk-r8ywba1h.js} +14 -14
  292. package/dist/{chunk-pc761fjv.js → chunk-r974358t.js} +13 -13
  293. package/dist/{chunk-s996ghdk.js → chunk-r9qnxgqt.js} +5 -5
  294. package/dist/{chunk-vyc908t4.js → chunk-rasdgp8g.js} +4 -4
  295. package/dist/{chunk-z4et0c5h.js → chunk-rbr0tsrz.js} +55 -52
  296. package/dist/{chunk-qak319wf.js → chunk-re5p7q2e.js} +4 -4
  297. package/dist/{chunk-ndfk4pk7.js → chunk-rfvzhq5x.js} +55 -52
  298. package/dist/{chunk-bqxeky5x.js → chunk-rfxctace.js} +3 -4
  299. package/dist/chunk-rhqffqzf.js +189 -0
  300. package/dist/{chunk-56qq2p9r.js → chunk-rnjtkqzg.js} +4 -4
  301. package/dist/{chunk-ws77frz2.js → chunk-rqa3fz1t.js} +55 -52
  302. package/dist/{chunk-ss1c88v5.js → chunk-rtgff67y.js} +63 -60
  303. package/dist/{chunk-2vvwrqnf.js → chunk-rw1070pc.js} +4 -4
  304. package/dist/{chunk-cxkxps51.js → chunk-rzrm7j9x.js} +2 -2
  305. package/dist/{chunk-bat87bmz.js → chunk-s262tfgm.js} +3 -3
  306. package/dist/{chunk-mj4zph9q.js → chunk-s4pjm9jw.js} +55 -52
  307. package/dist/chunk-s5pnejsn.js +216 -0
  308. package/dist/{chunk-6fp3tvak.js → chunk-sczmmmvj.js} +2 -2
  309. package/dist/{chunk-pynkknss.js → chunk-sd2g0s0k.js} +9 -9
  310. package/dist/{chunk-rnsws47e.js → chunk-sg5nsm4p.js} +3 -3
  311. package/dist/{chunk-c5sm4sc3.js → chunk-stqsfa68.js} +3 -3
  312. package/dist/{chunk-pxmfaad7.js → chunk-svb5eqfz.js} +14 -14
  313. package/dist/{chunk-5tbfphgg.js → chunk-swr65v0j.js} +10 -10
  314. package/dist/{chunk-4gkqm4bn.js → chunk-swtk97hy.js} +14 -14
  315. package/dist/{chunk-rrbsm1d2.js → chunk-sx4gbak5.js} +56 -53
  316. package/dist/{chunk-4n3kmsaj.js → chunk-t12d6tby.js} +3 -3
  317. package/dist/{chunk-w9dy1w2w.js → chunk-t20f5mnk.js} +14 -14
  318. package/dist/{chunk-rkwfpq4m.js → chunk-t408adb9.js} +56 -53
  319. package/dist/{chunk-gz1jqh8a.js → chunk-t7434h4s.js} +55 -52
  320. package/dist/{chunk-dve0wwbm.js → chunk-t7y6mg54.js} +13 -13
  321. package/dist/{chunk-tdpx7hh3.js → chunk-tdkwcv57.js} +4 -4
  322. package/dist/{chunk-crpj1nw0.js → chunk-tfew976a.js} +55 -52
  323. package/dist/{chunk-n9d1qnp6.js → chunk-thzmxfnt.js} +2 -2
  324. package/dist/{chunk-vh81ygd3.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-h9c871q9.js → chunk-tnqjynvy.js} +14 -14
  328. package/dist/{chunk-2hevw9te.js → chunk-tq32b105.js} +3 -3
  329. package/dist/{chunk-gzpsa71f.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-xs5ncg1b.js → chunk-ttzyw0y7.js} +17 -17
  333. package/dist/{chunk-997z9was.js → chunk-tw0b366n.js} +55 -52
  334. package/dist/{chunk-w2z0zq63.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-t15y7qj2.js → chunk-v21ssxkp.js} +2 -2
  338. package/dist/{chunk-dn3k7jx0.js → chunk-v2vzfj4h.js} +55 -52
  339. package/dist/{chunk-f6xc2rtk.js → chunk-v4h7dscd.js} +27 -249
  340. package/dist/{chunk-vn0y1222.js → chunk-v522k1r4.js} +70 -67
  341. package/dist/{chunk-b1akqr40.js → chunk-v9b2rh8h.js} +58 -55
  342. package/dist/{chunk-g8e4wwak.js → chunk-vacje5g9.js} +4 -4
  343. package/dist/{chunk-x36cer09.js → chunk-vetj2j2n.js} +60 -57
  344. package/dist/{chunk-354nk8fp.js → chunk-vpn54vqg.js} +6 -6
  345. package/dist/{chunk-xytm9792.js → chunk-vqhgs52z.js} +7 -7
  346. package/dist/{chunk-0yyajtmg.js → chunk-vtnm80k9.js} +13 -13
  347. package/dist/{chunk-0q17nthv.js → chunk-vvk6wx6b.js} +14 -14
  348. package/dist/{chunk-k4r2smrc.js → chunk-vym5zrn6.js} +4944 -2380
  349. package/dist/{chunk-9ej0hnae.js → chunk-vzxtxv4a.js} +56 -53
  350. package/dist/{chunk-pydt2a2n.js → chunk-w3wdqhv0.js} +62 -59
  351. package/dist/{chunk-esmecavs.js → chunk-w59jkye4.js} +56 -53
  352. package/dist/{chunk-r86f5rq0.js → chunk-w60fa5cj.js} +65 -62
  353. package/dist/{chunk-rnr60956.js → chunk-w8xchcwf.js} +3 -3
  354. package/dist/{chunk-f0a3t1s8.js → chunk-w9fptpp9.js} +64 -61
  355. package/dist/{chunk-4pc3744p.js → chunk-wa7g3yv7.js} +13 -13
  356. package/dist/{chunk-appan6jz.js → chunk-wdn3pb9r.js} +3 -3
  357. package/dist/{chunk-ta3mpea5.js → chunk-wqk03hpc.js} +55 -52
  358. package/dist/{chunk-6hywp0n9.js → chunk-wvs8wv8t.js} +2 -2
  359. package/dist/{chunk-nb32etb5.js → chunk-wwfe7gg7.js} +58 -55
  360. package/dist/{chunk-nmaxmbg9.js → chunk-wz18c465.js} +4 -4
  361. package/dist/{chunk-9gy4amsa.js → chunk-wz34c685.js} +15 -15
  362. package/dist/{chunk-5tg67tyt.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-4n33zjr2.js → chunk-x41dz9y9.js} +2 -2
  366. package/dist/chunk-x48x54hx.js +3942 -0
  367. package/dist/{chunk-fapmq0mf.js → chunk-x6cjkxqe.js} +5 -5
  368. package/dist/{chunk-37va52e9.js → chunk-x89sscn0.js} +2 -2
  369. package/dist/chunk-x9qqj8wc.js +153 -0
  370. package/dist/{chunk-wt541mkc.js → chunk-xa9xpah3.js} +3041 -2505
  371. package/dist/{chunk-644422j5.js → chunk-xcxcysx3.js} +2 -2
  372. package/dist/{chunk-qemwdcf4.js → chunk-xftqvncz.js} +9 -46
  373. package/dist/{chunk-zhmz5pc1.js → chunk-xhnmweqe.js} +86 -61
  374. package/dist/{chunk-jvnjg83j.js → chunk-xm6t6khx.js} +56 -53
  375. package/dist/chunk-xt65mfby.js +1395 -0
  376. package/dist/{chunk-e59fmxpj.js → chunk-xvmtyz8q.js} +2 -2
  377. package/dist/{chunk-55cx3c4n.js → chunk-xxfz08mf.js} +55 -52
  378. package/dist/{chunk-9zd21fw9.js → chunk-y061xbn9.js} +5 -5
  379. package/dist/{chunk-1tc6spqh.js → chunk-y0z468z2.js} +56 -53
  380. package/dist/{chunk-8x3wqyv3.js → chunk-y3cshvgb.js} +2 -2
  381. package/dist/{chunk-jakgz278.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-4zbc59gv.js → chunk-ycdbp5q4.js} +55 -52
  385. package/dist/{chunk-q6vrrdxm.js → chunk-ycsh7pst.js} +13 -13
  386. package/dist/{chunk-00c1cny7.js → chunk-yedzdc0a.js} +14 -8
  387. package/dist/{chunk-f0613fz6.js → chunk-yrr4d26k.js} +56 -53
  388. package/dist/{chunk-0mmyn5gx.js → chunk-yt5gwdg5.js} +7 -60
  389. package/dist/{chunk-bdd27pgp.js → chunk-yteefw26.js} +55 -52
  390. package/dist/{chunk-m0hg4ry7.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-pa6m6zh8.js → chunk-zb7ctc11.js} +55 -52
  394. package/dist/{chunk-tx6c6zpp.js → chunk-zc2mfxy0.js} +58 -55
  395. package/dist/{chunk-yh935z65.js → chunk-zdsqreyq.js} +3 -3
  396. package/dist/chunk-zf5btqc3.js +54 -0
  397. package/dist/{chunk-s6afn83n.js → chunk-zfwgjjde.js} +2 -2
  398. package/dist/{chunk-35se2h9e.js → chunk-zgvyn6yk.js} +55 -52
  399. package/dist/{chunk-hryyyanp.js → chunk-zmj9sehj.js} +56 -53
  400. package/dist/{chunk-cv2hk4fq.js → chunk-zr750mg3.js} +93 -56
  401. package/dist/{chunk-z1b4600y.js → chunk-zshw91dr.js} +5 -5
  402. package/dist/{chunk-m2epey0s.js → chunk-zyhpq0w1.js} +17 -5
  403. package/dist/{chunk-arnzwvcj.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-2s9sfj9h.js +0 -99
  409. package/dist/chunk-76xcw4kg.js +0 -138
  410. package/dist/chunk-7bdscsqe.js +0 -197
  411. package/dist/chunk-pppfybd8.js +0 -183
  412. package/dist/chunk-q2pkj7sp.js +0 -18
  413. package/dist/chunk-zbn3eb68.js +0 -57
@@ -0,0 +1,1045 @@
1
+ // @bun
2
+ import {
3
+ buildSystemInitMessage,
4
+ exports_MessageSelector,
5
+ init_MessageSelector,
6
+ processUserInput,
7
+ sdkCompatToolName
8
+ } from "./chunk-xt65mfby.js";
9
+ import {
10
+ init_systemTheme,
11
+ resolveThemeSetting
12
+ } from "./chunk-cnsj3vq2.js";
13
+ import {
14
+ init_mappers,
15
+ localCommandOutputToSDKAssistantMessage,
16
+ toSDKCompactMetadata
17
+ } from "./chunk-0cm9fcaq.js";
18
+ import {
19
+ SYNTHETIC_MESSAGES,
20
+ accumulateUsage,
21
+ buildEffectiveSystemPrompt,
22
+ categorizeRetryableAPIError,
23
+ countToolCalls,
24
+ createAbortController,
25
+ exports_snipCompact,
26
+ exports_snipProjection,
27
+ fileHistoryEnabled,
28
+ fileHistoryMakeSnapshot,
29
+ flushSessionStorage,
30
+ getScratchpadDir,
31
+ getSlashCommandToolSkills,
32
+ getSystemContext,
33
+ getSystemPrompt,
34
+ getUserContext,
35
+ handleOrphanedPermission,
36
+ headlessProfilerCheckpoint,
37
+ init_Shell,
38
+ init_abortController,
39
+ init_claude,
40
+ init_commands1 as init_commands,
41
+ init_context,
42
+ init_cost_tracker,
43
+ init_errors,
44
+ init_fileHistory,
45
+ init_filesystem,
46
+ init_headlessProfiler,
47
+ init_hookHelpers,
48
+ init_last,
49
+ init_loadAgentsDir,
50
+ init_memdir,
51
+ init_messages1 as init_messages,
52
+ init_pluginLoader,
53
+ init_prompts1 as init_prompts,
54
+ init_query,
55
+ init_queryHelpers,
56
+ init_sessionStorage,
57
+ init_snipCompact,
58
+ init_snipProjection,
59
+ init_systemPrompt,
60
+ init_systemPromptType,
61
+ init_thinking,
62
+ isBuiltInAgent,
63
+ isResultSuccessful,
64
+ isScratchpadEnabled,
65
+ last_default,
66
+ loadAllPluginsCacheOnly,
67
+ loadMemoryPrompt,
68
+ normalizeMessage,
69
+ query,
70
+ recordTranscript,
71
+ registerStructuredOutputEnforcement,
72
+ setCwd,
73
+ shouldEnableThinkingByDefault,
74
+ updateUsage
75
+ } from "./chunk-vym5zrn6.js";
76
+ import {
77
+ EMPTY_USAGE,
78
+ asSystemPrompt,
79
+ init_src
80
+ } from "./chunk-9ggwn844.js";
81
+ import {
82
+ cloneFileStateCache,
83
+ init_fileStateCache
84
+ } from "./chunk-qzp51m93.js";
85
+ import {
86
+ SYNTHETIC_OUTPUT_TOOL_NAME,
87
+ init_SyntheticOutputTool,
88
+ init_Tool,
89
+ toolMatchesName
90
+ } from "./chunk-ennzq1s5.js";
91
+ import {
92
+ getFastModeState,
93
+ getGlobalConfig,
94
+ getMainLoopModel,
95
+ hasAutoMemPathOverride,
96
+ init_config1 as init_config,
97
+ init_fastMode,
98
+ init_model,
99
+ init_paths,
100
+ parseUserSpecifiedModel
101
+ } from "./chunk-5thf5z45.js";
102
+ import {
103
+ init_strip_ansi,
104
+ stripAnsi
105
+ } from "./chunk-zyhpq0w1.js";
106
+ import {
107
+ getCwd,
108
+ init_cwd
109
+ } from "./chunk-ftfz2eh3.js";
110
+ import {
111
+ LOCAL_COMMAND_STDERR_TAG,
112
+ LOCAL_COMMAND_STDOUT_TAG,
113
+ getInMemoryErrors,
114
+ init_log,
115
+ init_xml
116
+ } from "./chunk-vtcqe66h.js";
117
+ import {
118
+ getModelUsage,
119
+ getSessionId,
120
+ getTotalAPIDuration,
121
+ getTotalCostUSD,
122
+ init_state,
123
+ isSessionPersistenceDisabled
124
+ } from "./chunk-rcxtkewg.js";
125
+ import {
126
+ init_envUtils,
127
+ isBareMode,
128
+ isEnvTruthy
129
+ } from "./chunk-hxhwzgnn.js";
130
+ import {
131
+ __toCommonJS
132
+ } from "./chunk-qp2qdcda.js";
133
+
134
+ // src/utils/queryContext.ts
135
+ init_prompts();
136
+ init_context();
137
+ init_abortController();
138
+ init_model();
139
+ init_systemPromptType();
140
+ init_thinking();
141
+ async function fetchSystemPromptParts({
142
+ tools,
143
+ mainLoopModel,
144
+ additionalWorkingDirectories,
145
+ mcpClients,
146
+ customSystemPrompt
147
+ }) {
148
+ const [defaultSystemPrompt, userContext, systemContext] = await Promise.all([
149
+ customSystemPrompt !== undefined ? Promise.resolve([]) : getSystemPrompt(tools, mainLoopModel, additionalWorkingDirectories, mcpClients),
150
+ getUserContext(),
151
+ customSystemPrompt !== undefined ? Promise.resolve({}) : getSystemContext()
152
+ ]);
153
+ return { defaultSystemPrompt, userContext, systemContext };
154
+ }
155
+ async function buildSideQuestionFallbackParams({
156
+ tools,
157
+ commands,
158
+ mcpClients,
159
+ messages,
160
+ readFileState,
161
+ getAppState,
162
+ setAppState,
163
+ customSystemPrompt,
164
+ appendSystemPrompt,
165
+ thinkingConfig,
166
+ agents
167
+ }) {
168
+ const mainLoopModel = getMainLoopModel();
169
+ const appState = getAppState();
170
+ const { defaultSystemPrompt, userContext, systemContext } = await fetchSystemPromptParts({
171
+ tools,
172
+ mainLoopModel,
173
+ additionalWorkingDirectories: Array.from(appState.toolPermissionContext.additionalWorkingDirectories.keys()),
174
+ mcpClients,
175
+ customSystemPrompt
176
+ });
177
+ const systemPrompt = asSystemPrompt([
178
+ ...customSystemPrompt !== undefined ? [customSystemPrompt] : defaultSystemPrompt,
179
+ ...appendSystemPrompt ? [appendSystemPrompt] : []
180
+ ]);
181
+ const last = messages.at(-1);
182
+ const forkContextMessages = last?.type === "assistant" && last.message.stop_reason === null ? messages.slice(0, -1) : messages;
183
+ const toolUseContext = {
184
+ options: {
185
+ commands,
186
+ debug: false,
187
+ mainLoopModel,
188
+ tools,
189
+ verbose: false,
190
+ thinkingConfig: thinkingConfig ?? (shouldEnableThinkingByDefault() !== false ? { type: "adaptive" } : { type: "disabled" }),
191
+ mcpClients,
192
+ mcpResources: {},
193
+ isNonInteractiveSession: true,
194
+ agentDefinitions: { activeAgents: agents, allAgents: [] },
195
+ customSystemPrompt,
196
+ appendSystemPrompt
197
+ },
198
+ abortController: createAbortController(),
199
+ readFileState,
200
+ getAppState,
201
+ setAppState,
202
+ messages: forkContextMessages,
203
+ setInProgressToolUseIDs: () => {},
204
+ setResponseLength: () => {},
205
+ updateFileHistoryState: () => {},
206
+ updateAttributionState: () => {}
207
+ };
208
+ return {
209
+ systemPrompt,
210
+ userContext,
211
+ systemContext,
212
+ toolUseContext,
213
+ forkContextMessages
214
+ };
215
+ }
216
+
217
+ // src/QueryEngine.ts
218
+ init_last();
219
+ init_state();
220
+ init_claude();
221
+ init_src();
222
+ init_strip_ansi();
223
+ init_commands();
224
+ init_xml();
225
+ init_cost_tracker();
226
+ init_memdir();
227
+ init_paths();
228
+ init_query();
229
+ init_errors();
230
+ init_Tool();
231
+ init_loadAgentsDir();
232
+ init_SyntheticOutputTool();
233
+ init_abortController();
234
+ init_config();
235
+ init_cwd();
236
+ init_envUtils();
237
+ init_fastMode();
238
+ init_fileHistory();
239
+ init_fileStateCache();
240
+ init_headlessProfiler();
241
+ init_hookHelpers();
242
+ init_log();
243
+ init_messages();
244
+ init_model();
245
+ init_pluginLoader();
246
+ import { randomUUID } from "crypto";
247
+ init_Shell();
248
+ init_sessionStorage();
249
+ init_systemPrompt();
250
+ init_systemTheme();
251
+ init_thinking();
252
+ init_mappers();
253
+ init_filesystem();
254
+ init_queryHelpers();
255
+ var messageSelector = () => {
256
+ try {
257
+ return init_MessageSelector(), __toCommonJS(exports_MessageSelector);
258
+ } catch {
259
+ return null;
260
+ }
261
+ };
262
+ var getCoordinatorUserContext = () => ({});
263
+ var snipModule = (init_snipCompact(), __toCommonJS(exports_snipCompact));
264
+ var snipProjection = (init_snipProjection(), __toCommonJS(exports_snipProjection));
265
+
266
+ class QueryEngine {
267
+ config;
268
+ mutableMessages;
269
+ abortController;
270
+ permissionDenials;
271
+ totalUsage;
272
+ hasHandledOrphanedPermission = false;
273
+ readFileState;
274
+ discoveredSkillNames = new Set;
275
+ loadedNestedMemoryPaths = new Set;
276
+ constructor(config) {
277
+ this.config = config;
278
+ this.mutableMessages = config.initialMessages ?? [];
279
+ this.abortController = config.abortController ?? createAbortController();
280
+ this.permissionDenials = [];
281
+ this.readFileState = config.readFileCache;
282
+ this.totalUsage = EMPTY_USAGE;
283
+ }
284
+ async* submitMessage(prompt, options) {
285
+ const {
286
+ cwd,
287
+ commands,
288
+ tools,
289
+ mcpClients,
290
+ verbose = false,
291
+ thinkingConfig,
292
+ maxTurns,
293
+ maxBudgetUsd,
294
+ taskBudget,
295
+ canUseTool,
296
+ customSystemPrompt,
297
+ appendSystemPrompt,
298
+ mainThreadAgentDefinition,
299
+ userSpecifiedModel,
300
+ fallbackModel,
301
+ jsonSchema,
302
+ getAppState,
303
+ setAppState,
304
+ replayUserMessages = false,
305
+ includePartialMessages = false,
306
+ agents = [],
307
+ allowedAgentTypes,
308
+ setSDKStatus,
309
+ orphanedPermission
310
+ } = this.config;
311
+ this.discoveredSkillNames.clear();
312
+ this.permissionDenials = [];
313
+ setCwd(cwd);
314
+ const persistSession = !isSessionPersistenceDisabled();
315
+ const startTime = Date.now();
316
+ const wrappedCanUseTool = async (tool, input, toolUseContext, assistantMessage, toolUseID, forceDecision) => {
317
+ const result2 = await canUseTool(tool, input, toolUseContext, assistantMessage, toolUseID, forceDecision);
318
+ if (result2.behavior !== "allow") {
319
+ this.permissionDenials.push({
320
+ type: "permission_denial",
321
+ tool_name: sdkCompatToolName(tool.name),
322
+ tool_use_id: toolUseID,
323
+ tool_input: input
324
+ });
325
+ }
326
+ return result2;
327
+ };
328
+ const initialAppState = getAppState();
329
+ const initialMainLoopModel = userSpecifiedModel ? parseUserSpecifiedModel(userSpecifiedModel) : getMainLoopModel();
330
+ const initialThinkingConfig = thinkingConfig ? thinkingConfig : shouldEnableThinkingByDefault() !== false ? { type: "adaptive" } : { type: "disabled" };
331
+ headlessProfilerCheckpoint("before_getSystemPrompt");
332
+ const customPrompt = typeof customSystemPrompt === "string" ? customSystemPrompt : undefined;
333
+ const customPromptForFetch = mainThreadAgentDefinition && isBuiltInAgent(mainThreadAgentDefinition) ? undefined : customPrompt;
334
+ const {
335
+ defaultSystemPrompt,
336
+ userContext: baseUserContext,
337
+ systemContext
338
+ } = await fetchSystemPromptParts({
339
+ tools,
340
+ mainLoopModel: initialMainLoopModel,
341
+ additionalWorkingDirectories: Array.from(initialAppState.toolPermissionContext.additionalWorkingDirectories.keys()),
342
+ mcpClients,
343
+ customSystemPrompt: customPromptForFetch
344
+ });
345
+ headlessProfilerCheckpoint("after_getSystemPrompt");
346
+ const userContext = {
347
+ ...baseUserContext,
348
+ ...getCoordinatorUserContext(mcpClients, isScratchpadEnabled() ? getScratchpadDir() : undefined)
349
+ };
350
+ const memoryMechanicsPrompt = customPrompt !== undefined && hasAutoMemPathOverride() ? await loadMemoryPrompt() : null;
351
+ const combinedAppendSystemPrompt = [
352
+ ...memoryMechanicsPrompt ? [memoryMechanicsPrompt] : [],
353
+ ...appendSystemPrompt ? [appendSystemPrompt] : []
354
+ ].join(`
355
+ `) || undefined;
356
+ const systemPrompt = buildEffectiveSystemPrompt({
357
+ mainThreadAgentDefinition,
358
+ toolUseContext: { options: { customSystemPrompt: customPrompt } },
359
+ customSystemPrompt: customPrompt,
360
+ defaultSystemPrompt,
361
+ appendSystemPrompt: combinedAppendSystemPrompt
362
+ });
363
+ const hasStructuredOutputTool = tools.some((t) => toolMatchesName(t, SYNTHETIC_OUTPUT_TOOL_NAME));
364
+ if (jsonSchema && hasStructuredOutputTool) {
365
+ registerStructuredOutputEnforcement(setAppState, getSessionId());
366
+ }
367
+ let processUserInputContext = {
368
+ messages: this.mutableMessages,
369
+ setMessages: (fn) => {
370
+ this.mutableMessages = fn(this.mutableMessages);
371
+ },
372
+ onChangeAPIKey: () => {},
373
+ handleElicitation: this.config.handleElicitation,
374
+ options: {
375
+ commands,
376
+ debug: false,
377
+ tools,
378
+ verbose,
379
+ mainLoopModel: initialMainLoopModel,
380
+ thinkingConfig: initialThinkingConfig,
381
+ mcpClients,
382
+ mcpResources: {},
383
+ ideInstallationStatus: null,
384
+ isNonInteractiveSession: true,
385
+ customSystemPrompt,
386
+ appendSystemPrompt,
387
+ agentDefinitions: { activeAgents: agents, allAgents: [], ...allowedAgentTypes ? { allowedAgentTypes } : {} },
388
+ theme: resolveThemeSetting(getGlobalConfig().theme),
389
+ maxBudgetUsd
390
+ },
391
+ getAppState,
392
+ setAppState,
393
+ abortController: this.abortController,
394
+ readFileState: this.readFileState,
395
+ nestedMemoryAttachmentTriggers: new Set,
396
+ loadedNestedMemoryPaths: this.loadedNestedMemoryPaths,
397
+ dynamicSkillDirTriggers: new Set,
398
+ discoveredSkillNames: this.discoveredSkillNames,
399
+ setInProgressToolUseIDs: () => {},
400
+ setResponseLength: () => {},
401
+ updateFileHistoryState: (updater) => {
402
+ setAppState((prev) => {
403
+ const updated = updater(prev.fileHistory);
404
+ if (updated === prev.fileHistory)
405
+ return prev;
406
+ return { ...prev, fileHistory: updated };
407
+ });
408
+ },
409
+ updateAttributionState: (updater) => {
410
+ setAppState((prev) => {
411
+ const updated = updater(prev.attribution);
412
+ if (updated === prev.attribution)
413
+ return prev;
414
+ return { ...prev, attribution: updated };
415
+ });
416
+ },
417
+ setSDKStatus
418
+ };
419
+ if (orphanedPermission && !this.hasHandledOrphanedPermission) {
420
+ this.hasHandledOrphanedPermission = true;
421
+ for await (const message of handleOrphanedPermission(orphanedPermission, tools, this.mutableMessages, processUserInputContext)) {
422
+ yield message;
423
+ }
424
+ }
425
+ const {
426
+ messages: messagesFromUserInput,
427
+ shouldQuery,
428
+ allowedTools,
429
+ model: modelFromUserInput,
430
+ resultText
431
+ } = await processUserInput({
432
+ input: prompt,
433
+ mode: "prompt",
434
+ setToolJSX: () => {},
435
+ context: {
436
+ ...processUserInputContext,
437
+ messages: this.mutableMessages
438
+ },
439
+ messages: this.mutableMessages,
440
+ uuid: options?.uuid,
441
+ isMeta: options?.isMeta,
442
+ querySource: "sdk"
443
+ });
444
+ this.mutableMessages.push(...messagesFromUserInput);
445
+ const messages = [...this.mutableMessages];
446
+ if (persistSession && messagesFromUserInput.length > 0) {
447
+ const transcriptPromise = recordTranscript(messages);
448
+ if (isBareMode()) {} else {
449
+ await transcriptPromise;
450
+ if (isEnvTruthy(process.env.CLAUDE_CODE_EAGER_FLUSH) || isEnvTruthy(process.env.CLAUDE_CODE_IS_COWORK)) {
451
+ await flushSessionStorage();
452
+ }
453
+ }
454
+ }
455
+ const _selector = messageSelector();
456
+ const replayableMessages = messagesFromUserInput.filter((msg) => msg.type === "user" && !msg.isMeta && !msg.toolUseResult && (_selector?.selectableUserMessagesFilter(msg) ?? true) || msg.type === "system" && msg.subtype === "compact_boundary");
457
+ const messagesToAck = replayUserMessages ? replayableMessages : [];
458
+ setAppState((prev) => ({
459
+ ...prev,
460
+ toolPermissionContext: {
461
+ ...prev.toolPermissionContext,
462
+ alwaysAllowRules: {
463
+ ...prev.toolPermissionContext.alwaysAllowRules,
464
+ command: allowedTools
465
+ }
466
+ }
467
+ }));
468
+ const mainLoopModel = modelFromUserInput ?? initialMainLoopModel;
469
+ processUserInputContext = {
470
+ messages,
471
+ setMessages: () => {},
472
+ onChangeAPIKey: () => {},
473
+ handleElicitation: this.config.handleElicitation,
474
+ options: {
475
+ commands,
476
+ debug: false,
477
+ tools,
478
+ verbose,
479
+ mainLoopModel,
480
+ thinkingConfig: initialThinkingConfig,
481
+ mcpClients,
482
+ mcpResources: {},
483
+ ideInstallationStatus: null,
484
+ isNonInteractiveSession: true,
485
+ customSystemPrompt,
486
+ appendSystemPrompt,
487
+ theme: resolveThemeSetting(getGlobalConfig().theme),
488
+ agentDefinitions: { activeAgents: agents, allAgents: [], ...allowedAgentTypes ? { allowedAgentTypes } : {} },
489
+ maxBudgetUsd
490
+ },
491
+ getAppState,
492
+ setAppState,
493
+ abortController: this.abortController,
494
+ readFileState: this.readFileState,
495
+ nestedMemoryAttachmentTriggers: new Set,
496
+ loadedNestedMemoryPaths: this.loadedNestedMemoryPaths,
497
+ dynamicSkillDirTriggers: new Set,
498
+ discoveredSkillNames: this.discoveredSkillNames,
499
+ setInProgressToolUseIDs: () => {},
500
+ setResponseLength: () => {},
501
+ updateFileHistoryState: processUserInputContext.updateFileHistoryState,
502
+ updateAttributionState: processUserInputContext.updateAttributionState,
503
+ setSDKStatus
504
+ };
505
+ headlessProfilerCheckpoint("before_skills_plugins");
506
+ const [skills, { enabled: enabledPlugins }] = await Promise.all([
507
+ getSlashCommandToolSkills(getCwd()),
508
+ loadAllPluginsCacheOnly()
509
+ ]);
510
+ headlessProfilerCheckpoint("after_skills_plugins");
511
+ yield buildSystemInitMessage({
512
+ tools,
513
+ mcpClients,
514
+ model: mainLoopModel,
515
+ permissionMode: initialAppState.toolPermissionContext.mode,
516
+ commands,
517
+ agents,
518
+ skills,
519
+ plugins: enabledPlugins,
520
+ fastMode: initialAppState.fastMode
521
+ });
522
+ headlessProfilerCheckpoint("system_message_yielded");
523
+ if (!shouldQuery) {
524
+ for (const msg of messagesFromUserInput) {
525
+ 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)) {
526
+ yield {
527
+ type: "user",
528
+ message: {
529
+ ...msg.message,
530
+ content: stripAnsi(msg.message.content)
531
+ },
532
+ session_id: getSessionId(),
533
+ parent_tool_use_id: null,
534
+ uuid: msg.uuid,
535
+ timestamp: msg.timestamp,
536
+ isReplay: !msg.isCompactSummary,
537
+ isSynthetic: msg.isMeta || msg.isVisibleInTranscriptOnly
538
+ };
539
+ }
540
+ 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}>`))) {
541
+ yield localCommandOutputToSDKAssistantMessage(msg.content, msg.uuid);
542
+ }
543
+ if (msg.type === "system" && msg.subtype === "compact_boundary") {
544
+ const compactMsg = msg;
545
+ yield {
546
+ type: "system",
547
+ subtype: "compact_boundary",
548
+ session_id: getSessionId(),
549
+ uuid: msg.uuid,
550
+ compact_metadata: toSDKCompactMetadata(compactMsg.compactMetadata)
551
+ };
552
+ }
553
+ }
554
+ if (persistSession) {
555
+ await recordTranscript(messages);
556
+ if (isEnvTruthy(process.env.CLAUDE_CODE_EAGER_FLUSH) || isEnvTruthy(process.env.CLAUDE_CODE_IS_COWORK)) {
557
+ await flushSessionStorage();
558
+ }
559
+ }
560
+ yield {
561
+ type: "result",
562
+ subtype: "success",
563
+ is_error: false,
564
+ duration_ms: Date.now() - startTime,
565
+ duration_api_ms: getTotalAPIDuration(),
566
+ num_turns: messages.length - 1,
567
+ result: resultText ?? "",
568
+ stop_reason: null,
569
+ session_id: getSessionId(),
570
+ total_cost_usd: getTotalCostUSD(),
571
+ usage: this.totalUsage,
572
+ modelUsage: getModelUsage(),
573
+ permission_denials: this.permissionDenials,
574
+ fast_mode_state: getFastModeState(mainLoopModel, initialAppState.fastMode),
575
+ uuid: randomUUID()
576
+ };
577
+ return;
578
+ }
579
+ if (fileHistoryEnabled() && persistSession) {
580
+ const _sel = messageSelector();
581
+ const _filter = _sel?.selectableUserMessagesFilter ?? ((_msg) => true);
582
+ messagesFromUserInput.filter(_filter).forEach((message) => {
583
+ fileHistoryMakeSnapshot((updater) => {
584
+ setAppState((prev) => ({
585
+ ...prev,
586
+ fileHistory: updater(prev.fileHistory)
587
+ }));
588
+ }, message.uuid);
589
+ });
590
+ }
591
+ let currentMessageUsage = EMPTY_USAGE;
592
+ let turnCount = 1;
593
+ let hasAcknowledgedInitialMessages = false;
594
+ let structuredOutputFromTool;
595
+ let lastStopReason = null;
596
+ const errorLogWatermark = getInMemoryErrors().at(-1);
597
+ const initialStructuredOutputCalls = jsonSchema ? countToolCalls(this.mutableMessages, SYNTHETIC_OUTPUT_TOOL_NAME) : 0;
598
+ for await (const message of query({
599
+ messages,
600
+ systemPrompt,
601
+ userContext,
602
+ systemContext,
603
+ canUseTool: wrappedCanUseTool,
604
+ toolUseContext: processUserInputContext,
605
+ fallbackModel,
606
+ querySource: "sdk",
607
+ maxTurns,
608
+ taskBudget
609
+ })) {
610
+ if (message.type === "assistant" || message.type === "user" || message.type === "system" && message.subtype === "compact_boundary") {
611
+ if (persistSession && message.type === "system" && message.subtype === "compact_boundary") {
612
+ const compactMsg = message;
613
+ const tailUuid = compactMsg.compactMetadata?.preservedSegment?.tailUuid;
614
+ if (tailUuid) {
615
+ const tailIdx = this.mutableMessages.findLastIndex((m) => m.uuid === tailUuid);
616
+ if (tailIdx !== -1) {
617
+ await recordTranscript(this.mutableMessages.slice(0, tailIdx + 1));
618
+ }
619
+ }
620
+ }
621
+ messages.push(message);
622
+ if (persistSession) {
623
+ if (message.type === "assistant") {
624
+ recordTranscript(messages);
625
+ } else {
626
+ await recordTranscript(messages);
627
+ }
628
+ }
629
+ if (!hasAcknowledgedInitialMessages && messagesToAck.length > 0) {
630
+ hasAcknowledgedInitialMessages = true;
631
+ for (const msgToAck of messagesToAck) {
632
+ if (msgToAck.type === "user") {
633
+ yield {
634
+ type: "user",
635
+ message: msgToAck.message,
636
+ session_id: getSessionId(),
637
+ parent_tool_use_id: null,
638
+ uuid: msgToAck.uuid,
639
+ timestamp: msgToAck.timestamp,
640
+ isReplay: true
641
+ };
642
+ }
643
+ }
644
+ }
645
+ }
646
+ if (message.type === "user") {
647
+ turnCount++;
648
+ }
649
+ switch (message.type) {
650
+ case "tombstone":
651
+ break;
652
+ case "assistant": {
653
+ const msg = message;
654
+ const stopReason = msg.message?.stop_reason;
655
+ if (stopReason != null) {
656
+ lastStopReason = stopReason;
657
+ }
658
+ this.mutableMessages.push(msg);
659
+ yield* normalizeMessage(msg);
660
+ break;
661
+ }
662
+ case "progress": {
663
+ const msg = message;
664
+ this.mutableMessages.push(msg);
665
+ if (persistSession) {
666
+ messages.push(msg);
667
+ recordTranscript(messages);
668
+ }
669
+ yield* normalizeMessage(msg);
670
+ break;
671
+ }
672
+ case "user": {
673
+ const msg = message;
674
+ this.mutableMessages.push(msg);
675
+ yield* normalizeMessage(msg);
676
+ break;
677
+ }
678
+ case "stream_event": {
679
+ const event = message.event;
680
+ if (event.type === "message_start") {
681
+ currentMessageUsage = EMPTY_USAGE;
682
+ const eventMessage = event.message;
683
+ currentMessageUsage = updateUsage(currentMessageUsage, eventMessage.usage);
684
+ }
685
+ if (event.type === "message_delta") {
686
+ currentMessageUsage = updateUsage(currentMessageUsage, event.usage);
687
+ const delta = event.delta;
688
+ if (delta.stop_reason != null) {
689
+ lastStopReason = delta.stop_reason;
690
+ }
691
+ }
692
+ if (event.type === "message_stop") {
693
+ this.totalUsage = accumulateUsage(this.totalUsage, currentMessageUsage);
694
+ }
695
+ yield {
696
+ type: "stream_event",
697
+ event,
698
+ session_id: getSessionId(),
699
+ parent_tool_use_id: null,
700
+ uuid: randomUUID()
701
+ };
702
+ break;
703
+ }
704
+ case "attachment": {
705
+ const msg = message;
706
+ this.mutableMessages.push(msg);
707
+ if (persistSession) {
708
+ messages.push(msg);
709
+ recordTranscript(messages);
710
+ }
711
+ const attachment = msg.attachment;
712
+ if (attachment.type === "structured_output") {
713
+ structuredOutputFromTool = attachment.data;
714
+ } else if (attachment.type === "max_turns_reached") {
715
+ if (persistSession) {
716
+ if (isEnvTruthy(process.env.CLAUDE_CODE_EAGER_FLUSH) || isEnvTruthy(process.env.CLAUDE_CODE_IS_COWORK)) {
717
+ await flushSessionStorage();
718
+ }
719
+ }
720
+ yield {
721
+ type: "result",
722
+ subtype: "error_max_turns",
723
+ duration_ms: Date.now() - startTime,
724
+ duration_api_ms: getTotalAPIDuration(),
725
+ is_error: true,
726
+ num_turns: attachment.turnCount,
727
+ stop_reason: lastStopReason,
728
+ session_id: getSessionId(),
729
+ total_cost_usd: getTotalCostUSD(),
730
+ usage: this.totalUsage,
731
+ modelUsage: getModelUsage(),
732
+ permission_denials: this.permissionDenials,
733
+ fast_mode_state: getFastModeState(mainLoopModel, initialAppState.fastMode),
734
+ uuid: randomUUID(),
735
+ errors: [
736
+ `Reached maximum number of turns (${attachment.maxTurns})`
737
+ ]
738
+ };
739
+ return;
740
+ } else if (replayUserMessages && attachment.type === "queued_command") {
741
+ yield {
742
+ type: "user",
743
+ message: {
744
+ role: "user",
745
+ content: attachment.prompt
746
+ },
747
+ session_id: getSessionId(),
748
+ parent_tool_use_id: null,
749
+ uuid: attachment.source_uuid || msg.uuid,
750
+ timestamp: msg.timestamp,
751
+ isReplay: true
752
+ };
753
+ }
754
+ break;
755
+ }
756
+ case "stream_request_start":
757
+ break;
758
+ case "system": {
759
+ const msg = message;
760
+ const snipResult = this.config.snipReplay?.(msg, this.mutableMessages);
761
+ if (snipResult !== undefined) {
762
+ if (snipResult.executed) {
763
+ this.mutableMessages.length = 0;
764
+ this.mutableMessages.push(...snipResult.messages);
765
+ }
766
+ break;
767
+ }
768
+ this.mutableMessages.push(msg);
769
+ if (msg.subtype === "compact_boundary" && msg.compactMetadata) {
770
+ const compactMsg = msg;
771
+ const mutableBoundaryIdx = this.mutableMessages.length - 1;
772
+ if (mutableBoundaryIdx > 0) {
773
+ this.mutableMessages.splice(0, mutableBoundaryIdx);
774
+ }
775
+ const localBoundaryIdx = messages.length - 1;
776
+ if (localBoundaryIdx > 0) {
777
+ messages.splice(0, localBoundaryIdx);
778
+ }
779
+ yield {
780
+ type: "system",
781
+ subtype: "compact_boundary",
782
+ session_id: getSessionId(),
783
+ uuid: msg.uuid,
784
+ compact_metadata: toSDKCompactMetadata(compactMsg.compactMetadata)
785
+ };
786
+ }
787
+ if (msg.subtype === "api_error") {
788
+ const apiErrorMsg = msg;
789
+ yield {
790
+ type: "system",
791
+ subtype: "api_retry",
792
+ attempt: apiErrorMsg.retryAttempt,
793
+ max_retries: apiErrorMsg.maxRetries,
794
+ retry_delay_ms: apiErrorMsg.retryInMs,
795
+ error_status: apiErrorMsg.error.status ?? null,
796
+ error: categorizeRetryableAPIError(apiErrorMsg.error),
797
+ session_id: getSessionId(),
798
+ uuid: msg.uuid
799
+ };
800
+ }
801
+ break;
802
+ }
803
+ case "tool_use_summary": {
804
+ const msg = message;
805
+ yield {
806
+ type: "tool_use_summary",
807
+ summary: msg.summary,
808
+ preceding_tool_use_ids: msg.precedingToolUseIds,
809
+ session_id: getSessionId(),
810
+ uuid: msg.uuid
811
+ };
812
+ break;
813
+ }
814
+ }
815
+ if (maxBudgetUsd !== undefined && getTotalCostUSD() >= maxBudgetUsd) {
816
+ if (persistSession) {
817
+ if (isEnvTruthy(process.env.CLAUDE_CODE_EAGER_FLUSH) || isEnvTruthy(process.env.CLAUDE_CODE_IS_COWORK)) {
818
+ await flushSessionStorage();
819
+ }
820
+ }
821
+ yield {
822
+ type: "result",
823
+ subtype: "error_max_budget_usd",
824
+ duration_ms: Date.now() - startTime,
825
+ duration_api_ms: getTotalAPIDuration(),
826
+ is_error: true,
827
+ num_turns: turnCount,
828
+ stop_reason: lastStopReason,
829
+ session_id: getSessionId(),
830
+ total_cost_usd: getTotalCostUSD(),
831
+ usage: this.totalUsage,
832
+ modelUsage: getModelUsage(),
833
+ permission_denials: this.permissionDenials,
834
+ fast_mode_state: getFastModeState(mainLoopModel, initialAppState.fastMode),
835
+ uuid: randomUUID(),
836
+ errors: [
837
+ `Reached maximum budget ($${maxBudgetUsd}). Increase the limit with --max-budget-usd or start a new session.`
838
+ ]
839
+ };
840
+ return;
841
+ }
842
+ if (message.type === "user" && jsonSchema) {
843
+ const currentCalls = countToolCalls(this.mutableMessages, SYNTHETIC_OUTPUT_TOOL_NAME);
844
+ const callsThisQuery = currentCalls - initialStructuredOutputCalls;
845
+ const maxRetries = parseInt(process.env.MAX_STRUCTURED_OUTPUT_RETRIES || "5", 10);
846
+ if (callsThisQuery >= maxRetries) {
847
+ if (persistSession) {
848
+ if (isEnvTruthy(process.env.CLAUDE_CODE_EAGER_FLUSH) || isEnvTruthy(process.env.CLAUDE_CODE_IS_COWORK)) {
849
+ await flushSessionStorage();
850
+ }
851
+ }
852
+ yield {
853
+ type: "result",
854
+ subtype: "error_max_structured_output_retries",
855
+ duration_ms: Date.now() - startTime,
856
+ duration_api_ms: getTotalAPIDuration(),
857
+ is_error: true,
858
+ num_turns: turnCount,
859
+ stop_reason: lastStopReason,
860
+ session_id: getSessionId(),
861
+ total_cost_usd: getTotalCostUSD(),
862
+ usage: this.totalUsage,
863
+ modelUsage: getModelUsage(),
864
+ permission_denials: this.permissionDenials,
865
+ fast_mode_state: getFastModeState(mainLoopModel, initialAppState.fastMode),
866
+ uuid: randomUUID(),
867
+ errors: [
868
+ `Failed to provide valid structured output after ${maxRetries} attempts`
869
+ ]
870
+ };
871
+ return;
872
+ }
873
+ }
874
+ }
875
+ const result = messages.findLast((m) => m.type === "assistant" || m.type === "user");
876
+ const edeResultType = result?.type ?? "undefined";
877
+ const edeLastContentType = result?.type === "assistant" ? last_default(result.message.content)?.type ?? "none" : "n/a";
878
+ if (persistSession) {
879
+ if (isEnvTruthy(process.env.CLAUDE_CODE_EAGER_FLUSH) || isEnvTruthy(process.env.CLAUDE_CODE_IS_COWORK)) {
880
+ await flushSessionStorage();
881
+ }
882
+ }
883
+ if (!isResultSuccessful(result, lastStopReason)) {
884
+ yield {
885
+ type: "result",
886
+ subtype: "error_during_execution",
887
+ duration_ms: Date.now() - startTime,
888
+ duration_api_ms: getTotalAPIDuration(),
889
+ is_error: true,
890
+ is_interrupted: this.abortController.signal.aborted,
891
+ num_turns: turnCount,
892
+ stop_reason: lastStopReason,
893
+ session_id: getSessionId(),
894
+ total_cost_usd: getTotalCostUSD(),
895
+ usage: this.totalUsage,
896
+ modelUsage: getModelUsage(),
897
+ permission_denials: this.permissionDenials,
898
+ fast_mode_state: getFastModeState(mainLoopModel, initialAppState.fastMode),
899
+ uuid: randomUUID(),
900
+ errors: (() => {
901
+ const all = getInMemoryErrors();
902
+ const start = errorLogWatermark ? all.lastIndexOf(errorLogWatermark) + 1 : 0;
903
+ return [
904
+ `[ede_diagnostic] result_type=${edeResultType} last_content_type=${edeLastContentType} stop_reason=${lastStopReason}`,
905
+ ...all.slice(start).map((_) => _.error)
906
+ ];
907
+ })()
908
+ };
909
+ return;
910
+ }
911
+ let textResult = "";
912
+ let isApiError = false;
913
+ if (result.type === "assistant") {
914
+ const lastContent = last_default(result.message.content);
915
+ if (lastContent?.type === "text" && !SYNTHETIC_MESSAGES.has(lastContent.text)) {
916
+ textResult = lastContent.text;
917
+ }
918
+ isApiError = Boolean(result.isApiErrorMessage);
919
+ }
920
+ yield {
921
+ type: "result",
922
+ subtype: "success",
923
+ is_error: isApiError,
924
+ duration_ms: Date.now() - startTime,
925
+ duration_api_ms: getTotalAPIDuration(),
926
+ num_turns: turnCount,
927
+ result: textResult,
928
+ stop_reason: lastStopReason,
929
+ session_id: getSessionId(),
930
+ total_cost_usd: getTotalCostUSD(),
931
+ usage: this.totalUsage,
932
+ modelUsage: getModelUsage(),
933
+ permission_denials: this.permissionDenials,
934
+ structured_output: structuredOutputFromTool,
935
+ fast_mode_state: getFastModeState(mainLoopModel, initialAppState.fastMode),
936
+ uuid: randomUUID()
937
+ };
938
+ }
939
+ interrupt() {
940
+ this.abortController.abort();
941
+ }
942
+ resetAbortController() {
943
+ this.abortController = createAbortController();
944
+ }
945
+ getAbortSignal() {
946
+ return this.abortController.signal;
947
+ }
948
+ getMessages() {
949
+ return this.mutableMessages;
950
+ }
951
+ getReadFileState() {
952
+ return this.readFileState;
953
+ }
954
+ getSessionId() {
955
+ return getSessionId();
956
+ }
957
+ setModel(model) {
958
+ this.config.userSpecifiedModel = model;
959
+ }
960
+ }
961
+ async function* ask({
962
+ commands,
963
+ prompt,
964
+ promptUuid,
965
+ isMeta,
966
+ cwd,
967
+ tools,
968
+ mcpClients,
969
+ verbose = false,
970
+ thinkingConfig,
971
+ maxTurns,
972
+ maxBudgetUsd,
973
+ taskBudget,
974
+ canUseTool,
975
+ mutableMessages = [],
976
+ getReadFileCache,
977
+ setReadFileCache,
978
+ customSystemPrompt,
979
+ appendSystemPrompt,
980
+ mainThreadAgentDefinition,
981
+ userSpecifiedModel,
982
+ fallbackModel,
983
+ jsonSchema,
984
+ getAppState,
985
+ setAppState,
986
+ abortController,
987
+ replayUserMessages = false,
988
+ includePartialMessages = false,
989
+ handleElicitation,
990
+ agents = [],
991
+ allowedAgentTypes,
992
+ setSDKStatus,
993
+ orphanedPermission
994
+ }) {
995
+ const engine = new QueryEngine({
996
+ cwd,
997
+ tools,
998
+ commands,
999
+ mcpClients,
1000
+ agents: agents ?? [],
1001
+ allowedAgentTypes,
1002
+ canUseTool,
1003
+ getAppState,
1004
+ setAppState,
1005
+ initialMessages: mutableMessages,
1006
+ readFileCache: cloneFileStateCache(getReadFileCache()),
1007
+ customSystemPrompt,
1008
+ appendSystemPrompt,
1009
+ mainThreadAgentDefinition,
1010
+ userSpecifiedModel,
1011
+ fallbackModel,
1012
+ thinkingConfig,
1013
+ maxTurns,
1014
+ maxBudgetUsd,
1015
+ taskBudget,
1016
+ jsonSchema,
1017
+ verbose,
1018
+ handleElicitation,
1019
+ replayUserMessages,
1020
+ includePartialMessages,
1021
+ setSDKStatus,
1022
+ abortController,
1023
+ orphanedPermission,
1024
+ ...{
1025
+ snipReplay: (yielded, store) => {
1026
+ if (!snipProjection.isSnipBoundaryMessage(yielded))
1027
+ return;
1028
+ return snipModule.snipCompactIfNeeded(store, { force: true });
1029
+ }
1030
+ }
1031
+ });
1032
+ try {
1033
+ yield* engine.submitMessage(prompt, {
1034
+ uuid: promptUuid,
1035
+ isMeta
1036
+ });
1037
+ } finally {
1038
+ setReadFileCache(engine.getReadFileState());
1039
+ }
1040
+ }
1041
+
1042
+ export { buildSideQuestionFallbackParams, QueryEngine, ask };
1043
+
1044
+ //# debugId=979C7CFAC474DC9664756E2164756E21
1045
+ //# sourceMappingURL=chunk-c36xznt7.js.map