@qitqode/qitqode-android-arm64 0.2.15 → 0.2.16

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 (412) hide show
  1. package/bundle/{chunk-wrzn87w0.js → chunk-098mr0zz.js} +1 -1
  2. package/bundle/{chunk-j15wejz0.js → chunk-0catm9vq.js} +1 -1
  3. package/bundle/{chunk-q896qkhe.js → chunk-0cqs1qkh.js} +1 -1
  4. package/bundle/{chunk-d10qre1b.js → chunk-0f3ncvfe.js} +1 -1
  5. package/bundle/{chunk-yhpwceqg.js → chunk-0gqwvt8w.js} +2 -2
  6. package/bundle/chunk-0mb55ytc.js +2 -0
  7. package/bundle/{chunk-dpbm03yh.js → chunk-0n2ncnwz.js} +1 -1
  8. package/bundle/chunk-0y0hm0m5.js +2 -0
  9. package/bundle/chunk-120e8yr1.js +2 -0
  10. package/bundle/{chunk-spcdwmy4.js → chunk-1aneepm5.js} +1 -1
  11. package/bundle/chunk-1dxm8yev.js +2 -0
  12. package/bundle/{chunk-96sra8g8.js → chunk-1jg7cybp.js} +1 -1
  13. package/bundle/{chunk-qk6jh32z.js → chunk-1k5nfw7g.js} +1 -1
  14. package/bundle/{chunk-fmcg649e.js → chunk-1kksj8cn.js} +1 -1
  15. package/bundle/chunk-1pgpv979.js +2 -0
  16. package/bundle/{chunk-szfqmkj6.js → chunk-1xsjkf4c.js} +1 -1
  17. package/bundle/{chunk-zx63mepv.js → chunk-1yetxft4.js} +1 -1
  18. package/bundle/chunk-23zh9s18.js +2 -0
  19. package/bundle/{chunk-8qpfphdz.js → chunk-24pf9s68.js} +1 -1
  20. package/bundle/chunk-2a0zf12g.js +2 -0
  21. package/bundle/chunk-2b8x31p3.js +2 -0
  22. package/bundle/chunk-2cvmdss3.js +2 -0
  23. package/bundle/{chunk-zhhcfqhh.js → chunk-2kvghwar.js} +1 -1
  24. package/bundle/{chunk-ch7s512a.js → chunk-2nkjwqpm.js} +1 -1
  25. package/bundle/chunk-2qbsg6dp.js +2 -0
  26. package/bundle/{chunk-9ttebtcf.js → chunk-2rvs18fx.js} +1 -1
  27. package/bundle/{chunk-rxt6gktt.js → chunk-2thbax1j.js} +1 -1
  28. package/bundle/{chunk-zbt53cb5.js → chunk-2zxygnx4.js} +1 -1
  29. package/bundle/{chunk-zgwasq3p.js → chunk-36kg3v3k.js} +1 -1
  30. package/bundle/{chunk-b6m5tr80.js → chunk-37hh7eee.js} +1 -1
  31. package/bundle/chunk-39mwv068.js +2 -0
  32. package/bundle/{chunk-set1f1wr.js → chunk-39z0qxkt.js} +1 -1
  33. package/bundle/{chunk-p0852vfn.js → chunk-3dfy9k0t.js} +2 -2
  34. package/bundle/{chunk-et3tgx7t.js → chunk-3e26pryk.js} +1 -1
  35. package/bundle/{chunk-w0t1ajhg.js → chunk-3eddms0g.js} +1 -1
  36. package/bundle/chunk-3re79hkf.js +2 -0
  37. package/bundle/{chunk-sy76e7nr.js → chunk-3vjs8aht.js} +1 -1
  38. package/bundle/{chunk-k769v1ds.js → chunk-3z7r4c0p.js} +1 -1
  39. package/bundle/chunk-40pe0tde.js +11 -0
  40. package/bundle/{chunk-0ejx0yqx.js → chunk-47nber5v.js} +1 -1
  41. package/bundle/{chunk-estc7tzt.js → chunk-491f4ab9.js} +2 -2
  42. package/bundle/{chunk-3152y1q9.js → chunk-4bp91rza.js} +1 -1
  43. package/bundle/{chunk-pdcxmr6x.js → chunk-4dy64hgp.js} +1 -1
  44. package/bundle/{chunk-0mztgsxp.js → chunk-4fqwg54p.js} +1 -1
  45. package/bundle/{chunk-2w3n0q9m.js → chunk-4gv7nsdd.js} +2 -2
  46. package/bundle/{chunk-csy1v12x.js → chunk-4nw19yab.js} +1 -1
  47. package/bundle/chunk-51fyaa6r.js +2 -0
  48. package/bundle/{chunk-kegvr7wt.js → chunk-52f62kr0.js} +2 -2
  49. package/bundle/chunk-52n4tdeh.js +5 -0
  50. package/bundle/{chunk-x4jnyj09.js → chunk-543jma8r.js} +1 -1
  51. package/bundle/chunk-58q03ah1.js +2 -0
  52. package/bundle/{chunk-hrcqbadm.js → chunk-5fhy0wb0.js} +1 -1
  53. package/bundle/{chunk-8zpsgfb6.js → chunk-5fym1zr2.js} +1 -1
  54. package/bundle/{chunk-a3g8de96.js → chunk-5k5jdayv.js} +1 -1
  55. package/bundle/chunk-5nmqgqj2.js +2 -0
  56. package/bundle/{chunk-psmwrvqs.js → chunk-5t69v8jg.js} +2 -2
  57. package/bundle/{chunk-7w571q26.js → chunk-5vtbg7pj.js} +1 -1
  58. package/bundle/{chunk-y4cz5s3h.js → chunk-5xmtzs15.js} +2 -2
  59. package/bundle/chunk-5ydg5ny1.js +2 -0
  60. package/bundle/{chunk-v5me0cj9.js → chunk-5z5rk3ng.js} +1 -1
  61. package/bundle/{chunk-5dvy83ms.js → chunk-62mb6wxm.js} +2 -2
  62. package/bundle/chunk-62mytrwv.js +2 -0
  63. package/bundle/{chunk-edvfqxfr.js → chunk-6396bg4p.js} +1 -1
  64. package/bundle/chunk-63bccmze.js +2 -0
  65. package/bundle/{chunk-1ypzf18e.js → chunk-64x1vtdq.js} +1 -1
  66. package/bundle/{chunk-9mabvb06.js → chunk-6kx4atkt.js} +1 -1
  67. package/bundle/{chunk-dmb0ez0m.js → chunk-6r7vm4xc.js} +3 -3
  68. package/bundle/{chunk-tcyzj3rz.js → chunk-6rggm6tm.js} +1 -1
  69. package/bundle/{chunk-fp2xgnjn.js → chunk-6vpc1y3w.js} +2 -2
  70. package/bundle/{chunk-71jmhvef.js → chunk-6vxddv5w.js} +2 -2
  71. package/bundle/chunk-6ynaebaw.js +2 -0
  72. package/bundle/{chunk-ep4drmt9.js → chunk-700jhn67.js} +1 -1
  73. package/bundle/{chunk-fdmz0502.js → chunk-76jbys6j.js} +2 -2
  74. package/bundle/chunk-782y3dm8.js +2 -0
  75. package/bundle/{chunk-d7h1dp0h.js → chunk-89g9wzc2.js} +1 -1
  76. package/bundle/chunk-8q50bha4.js +2 -0
  77. package/bundle/chunk-8v6qbhm1.js +2 -0
  78. package/bundle/chunk-955jtenj.js +2 -0
  79. package/bundle/chunk-95yzwxpf.js +2 -0
  80. package/bundle/{chunk-76wm7tw8.js → chunk-96281xfb.js} +2 -2
  81. package/bundle/{chunk-bdcd2mcb.js → chunk-96657nrr.js} +2 -2
  82. package/bundle/chunk-99ansgsj.js +2 -0
  83. package/bundle/{chunk-3c73rngn.js → chunk-9dd2krfn.js} +1 -1
  84. package/bundle/chunk-9exxjnxc.js +2 -0
  85. package/bundle/{chunk-eqsank84.js → chunk-9ge1mkfs.js} +1 -1
  86. package/bundle/{chunk-4r7fbkcm.js → chunk-9mmaja9n.js} +1 -1
  87. package/bundle/{chunk-mjkwd1sz.js → chunk-9rd7q5e9.js} +1 -1
  88. package/bundle/{chunk-6cztstry.js → chunk-9skj2w9e.js} +2 -2
  89. package/bundle/{chunk-nb4xtk1n.js → chunk-9tdbts1r.js} +1 -1
  90. package/bundle/{chunk-sg9enzsp.js → chunk-9tfm1dk2.js} +2 -2
  91. package/bundle/{chunk-z6qyx227.js → chunk-9xaea8h1.js} +1 -1
  92. package/bundle/{chunk-meehnnv9.js → chunk-a0c6w901.js} +2 -2
  93. package/bundle/chunk-a2tp2f6s.js +2 -0
  94. package/bundle/{chunk-69htq8kq.js → chunk-a3ynq3h7.js} +1 -1
  95. package/bundle/chunk-a4y0wjtq.js +3 -0
  96. package/bundle/{chunk-6dd2dx69.js → chunk-afagt413.js} +2 -2
  97. package/bundle/{chunk-px69995t.js → chunk-afzx47y2.js} +1 -1
  98. package/bundle/chunk-ag3s3t7x.js +2 -0
  99. package/bundle/{chunk-n7zd97hy.js → chunk-ajdn1n77.js} +2 -2
  100. package/bundle/chunk-arwm1qxm.js +2 -0
  101. package/bundle/{chunk-adws0hhk.js → chunk-awt3q88j.js} +2 -2
  102. package/bundle/{chunk-qn1fhqyw.js → chunk-az2pxgx6.js} +2 -2
  103. package/bundle/chunk-b0gq0s8a.js +2 -0
  104. package/bundle/{chunk-48rg4yhk.js → chunk-b2zfr7jz.js} +2 -2
  105. package/bundle/{chunk-mbmaeq0a.js → chunk-b63733cw.js} +1 -1
  106. package/bundle/chunk-b7430vg8.js +2 -0
  107. package/bundle/{chunk-4b56k59w.js → chunk-b7dw5ged.js} +1 -1
  108. package/bundle/{chunk-prz2fkn9.js → chunk-b83qf145.js} +1 -1
  109. package/bundle/{chunk-veptx3fk.js → chunk-b8w33ck9.js} +1 -1
  110. package/bundle/{chunk-674pexjx.js → chunk-bd21p9zz.js} +2 -2
  111. package/bundle/chunk-be2z0tr4.js +2 -0
  112. package/bundle/{chunk-x0de4z05.js → chunk-bkqemdv8.js} +2 -2
  113. package/bundle/chunk-bq585t67.js +2 -0
  114. package/bundle/chunk-bts3gw8w.js +2 -0
  115. package/bundle/{chunk-yvtkx4x4.js → chunk-c0sr83np.js} +1 -1
  116. package/bundle/{chunk-zh7e6kqs.js → chunk-c4tdfar1.js} +1 -1
  117. package/bundle/chunk-c6ege2yp.js +2 -0
  118. package/bundle/{chunk-00ft63qn.js → chunk-chs4bkgh.js} +1 -1
  119. package/bundle/{chunk-hmmn62jg.js → chunk-cm426ssg.js} +1 -1
  120. package/bundle/{chunk-crqycrs4.js → chunk-d4y5hyjg.js} +2 -2
  121. package/bundle/chunk-de0edzjs.js +2 -0
  122. package/bundle/{chunk-4xcwnwd6.js → chunk-der5kj1b.js} +1 -1
  123. package/bundle/{chunk-rk4c0zat.js → chunk-dhykktcp.js} +1 -1
  124. package/bundle/{chunk-mnjz8nqs.js → chunk-dm7hfb7f.js} +2 -2
  125. package/bundle/chunk-dntnvfdz.js +2 -0
  126. package/bundle/{chunk-q1dmxn63.js → chunk-dptvy1zn.js} +2 -2
  127. package/bundle/{chunk-2k2szpze.js → chunk-dqt8rrey.js} +1 -1
  128. package/bundle/{chunk-ky3fhz9z.js → chunk-dr003xka.js} +1 -1
  129. package/bundle/chunk-dtyzk0j7.js +2 -0
  130. package/bundle/{chunk-qrztx1b4.js → chunk-dwza14dk.js} +2 -2
  131. package/bundle/chunk-e3tmbywr.js +2 -0
  132. package/bundle/{chunk-ej0yzstw.js → chunk-e4nap6v9.js} +2 -2
  133. package/bundle/{chunk-5h1s0akp.js → chunk-e7x8v549.js} +1 -1
  134. package/bundle/{chunk-1e75j4m1.js → chunk-e826jvr2.js} +2 -2
  135. package/bundle/{chunk-djdfpezf.js → chunk-edm4c812.js} +1 -1
  136. package/bundle/{chunk-ws720v4j.js → chunk-eearwfay.js} +1 -1
  137. package/bundle/{chunk-knqpyc7s.js → chunk-ekavngf7.js} +1 -1
  138. package/bundle/chunk-em637k9q.js +2 -0
  139. package/bundle/{chunk-8gkz5550.js → chunk-epncmz5t.js} +1 -1
  140. package/bundle/{chunk-mdxtt9wv.js → chunk-eytpz91c.js} +2 -2
  141. package/bundle/chunk-f4qcwbx0.js +2 -0
  142. package/bundle/{chunk-a8askx4y.js → chunk-f6gd8809.js} +1 -1
  143. package/bundle/{chunk-878sb0es.js → chunk-fcbmedh3.js} +2 -2
  144. package/bundle/{chunk-4ycg2c6f.js → chunk-fg5f3a8a.js} +2 -2
  145. package/bundle/chunk-fj7jcv7m.js +2 -0
  146. package/bundle/{chunk-4gzggzc0.js → chunk-ft4msj4z.js} +3 -3
  147. package/bundle/chunk-fyntc5hj.js +2 -0
  148. package/bundle/chunk-fyt4yaq7.js +2 -0
  149. package/bundle/chunk-g4hcxhfs.js +2 -0
  150. package/bundle/{chunk-c5cyt23k.js → chunk-g7twcprm.js} +2 -2
  151. package/bundle/{chunk-9amnqaeq.js → chunk-g8844pb4.js} +1 -1
  152. package/bundle/{chunk-w136zswr.js → chunk-ganwjd6s.js} +3 -3
  153. package/bundle/chunk-gdew108b.js +2 -0
  154. package/bundle/chunk-gdy74wte.js +2 -0
  155. package/bundle/{chunk-e37gd3p2.js → chunk-gse0cgqc.js} +1 -1
  156. package/bundle/{chunk-z0dj15g9.js → chunk-gsjgbm0d.js} +1 -1
  157. package/bundle/{chunk-a1mbach4.js → chunk-gt10s0ks.js} +1 -1
  158. package/bundle/{chunk-qpk7jp6t.js → chunk-gxpx2nd8.js} +1 -1
  159. package/bundle/{chunk-8mqcar7f.js → chunk-gxq2fwnc.js} +1 -1
  160. package/bundle/chunk-gz90qgcn.js +2 -0
  161. package/bundle/chunk-gzz78dnm.js +2 -0
  162. package/bundle/{chunk-840mmmzz.js → chunk-h3yazfmh.js} +4 -4
  163. package/bundle/{chunk-d4faz5xa.js → chunk-h429rzqp.js} +1 -1
  164. package/bundle/{chunk-f0dp1tf9.js → chunk-h5y0pwwc.js} +1 -1
  165. package/bundle/{chunk-62gefpwn.js → chunk-h6b6acrv.js} +2 -2
  166. package/bundle/{chunk-19rs84t8.js → chunk-h8bq75er.js} +1 -1
  167. package/bundle/{chunk-99df6wvm.js → chunk-ha147mdc.js} +1 -1
  168. package/bundle/{chunk-xdcwx384.js → chunk-ha1w0xzh.js} +1 -1
  169. package/bundle/{chunk-5341jv20.js → chunk-ha294vpj.js} +1 -1
  170. package/bundle/chunk-hfrjkgyk.js +2 -0
  171. package/bundle/chunk-hjpt1n6g.js +2 -0
  172. package/bundle/{chunk-bzh71a92.js → chunk-hvdre0mb.js} +1 -1
  173. package/bundle/{chunk-86sfzgnf.js → chunk-hxf2a10r.js} +1 -1
  174. package/bundle/{chunk-4ppw719f.js → chunk-j09qf4zh.js} +1 -1
  175. package/bundle/chunk-j0jayfyn.js +35 -0
  176. package/bundle/{chunk-c1wc4b5q.js → chunk-j5b0yc0f.js} +1 -1
  177. package/bundle/{chunk-k8dbc1p5.js → chunk-j767byd1.js} +1 -1
  178. package/bundle/chunk-j794z99k.js +2 -0
  179. package/bundle/{chunk-5asf8f41.js → chunk-j95mkzwg.js} +114 -114
  180. package/bundle/{chunk-rn3je2hv.js → chunk-jcznttek.js} +1 -1
  181. package/bundle/{chunk-4v29ayke.js → chunk-jgw20mxx.js} +1 -1
  182. package/bundle/{chunk-175720ws.js → chunk-jhdpwndc.js} +2 -2
  183. package/bundle/{chunk-f0x3q5dj.js → chunk-jkqa49xc.js} +2 -2
  184. package/bundle/{chunk-sb3cgb4v.js → chunk-jmg64erz.js} +1 -1
  185. package/bundle/chunk-jpw7z507.js +2 -0
  186. package/bundle/{chunk-3cs1qf8x.js → chunk-jr622341.js} +1 -1
  187. package/bundle/{chunk-fswt9qc0.js → chunk-jv69hdp0.js} +2 -2
  188. package/bundle/chunk-jx9c90ft.js +2 -0
  189. package/bundle/{chunk-4jfnhghx.js → chunk-kevhkmn2.js} +2 -2
  190. package/bundle/{chunk-bxnsrggq.js → chunk-khpjjjsb.js} +1 -1
  191. package/bundle/chunk-kkfrys0w.js +2 -0
  192. package/bundle/chunk-kkq2vwm6.js +2 -0
  193. package/bundle/{chunk-h6b5966p.js → chunk-km1tyeyy.js} +1 -1
  194. package/bundle/chunk-kp0w1p79.js +2 -0
  195. package/bundle/chunk-kr7t73tg.js +3 -0
  196. package/bundle/chunk-kt7q9620.js +2 -0
  197. package/bundle/{chunk-8a9sj8gp.js → chunk-kzcb1pt4.js} +1 -1
  198. package/bundle/{chunk-ywj77e0m.js → chunk-m0f6cf9n.js} +2 -2
  199. package/bundle/chunk-m30bgt2t.js +2 -0
  200. package/bundle/chunk-m318f9es.js +2 -0
  201. package/bundle/{chunk-4yd2vvh6.js → chunk-m5r6zq6v.js} +1 -1
  202. package/bundle/chunk-m6g6za7b.js +2 -0
  203. package/bundle/chunk-m8djypsy.js +11 -0
  204. package/bundle/chunk-ma0vvbvy.js +2 -0
  205. package/bundle/chunk-mha4n5md.js +2 -0
  206. package/bundle/{chunk-s9epttpy.js → chunk-mhq2a5ms.js} +1 -1
  207. package/bundle/chunk-mp9qhnxg.js +2 -0
  208. package/bundle/{chunk-gd0j16gn.js → chunk-mqdvthkm.js} +1 -1
  209. package/bundle/{chunk-69k7cdtv.js → chunk-mqe1qa6t.js} +2 -2
  210. package/bundle/{chunk-j45p2v4a.js → chunk-mz6swd88.js} +3 -3
  211. package/bundle/{chunk-0m4gvjcv.js → chunk-n25t4j9w.js} +2 -2
  212. package/bundle/{chunk-83n11xym.js → chunk-n7ewvphw.js} +3 -3
  213. package/bundle/chunk-n9wre9wx.js +2 -0
  214. package/bundle/chunk-ncbj74tk.js +3 -0
  215. package/bundle/{chunk-06tgmvh6.js → chunk-ne3z7yye.js} +2 -2
  216. package/bundle/chunk-nnyvn2pm.js +2 -0
  217. package/bundle/chunk-nyhx3822.js +2 -0
  218. package/bundle/{chunk-zjyaze0d.js → chunk-p54bzjtv.js} +1 -1
  219. package/bundle/{chunk-dvp0r93q.js → chunk-p5d5qyzq.js} +1 -1
  220. package/bundle/{chunk-m8kjtp60.js → chunk-p6mxxem5.js} +1 -1
  221. package/bundle/{chunk-6zdzbmzs.js → chunk-p76c9s6g.js} +264 -264
  222. package/bundle/chunk-p8etcskm.js +2 -0
  223. package/bundle/{chunk-b350g18y.js → chunk-pf4gwr34.js} +2 -2
  224. package/bundle/{chunk-wf0n1cs9.js → chunk-pf61zhms.js} +1 -1
  225. package/bundle/{chunk-sh03ka27.js → chunk-pfx8ts02.js} +1 -1
  226. package/bundle/{chunk-e611m0p4.js → chunk-phvp9h7w.js} +1 -1
  227. package/bundle/chunk-pv71d7f3.js +2 -0
  228. package/bundle/{chunk-2fged9vy.js → chunk-pwcmc8j7.js} +1 -1
  229. package/bundle/{chunk-g77kddrs.js → chunk-pyt4xpze.js} +2 -2
  230. package/bundle/{chunk-1bq15kf0.js → chunk-q0pd8bac.js} +2 -2
  231. package/bundle/{chunk-yg9n2a2d.js → chunk-q12dtxep.js} +1 -1
  232. package/bundle/{chunk-v1axkp21.js → chunk-q2j2dm96.js} +2 -2
  233. package/bundle/{chunk-rx9eh3db.js → chunk-qf1hh45g.js} +3 -3
  234. package/bundle/{chunk-p4xqfkbh.js → chunk-qqjspfqw.js} +1 -1
  235. package/bundle/{chunk-9kc2th5c.js → chunk-qvnsgyfk.js} +2 -2
  236. package/bundle/{chunk-rqap90xh.js → chunk-qz35c4xy.js} +2 -2
  237. package/bundle/{chunk-bemyyen3.js → chunk-r3z77rjn.js} +1 -1
  238. package/bundle/{chunk-vsv4p060.js → chunk-r7mcn9ey.js} +1 -1
  239. package/bundle/{chunk-nzz7gzg2.js → chunk-rmpgmjtd.js} +1 -1
  240. package/bundle/{chunk-k0chq88p.js → chunk-rpt3rm31.js} +1 -1
  241. package/bundle/chunk-rteaec1s.js +2 -0
  242. package/bundle/chunk-rxwcah73.js +2 -0
  243. package/bundle/{chunk-s0gmxpxm.js → chunk-s1gy4hnw.js} +2 -2
  244. package/bundle/{chunk-4s1n38ds.js → chunk-s2ma1nz3.js} +2 -2
  245. package/bundle/chunk-s3gjc4m0.js +2 -0
  246. package/bundle/{chunk-6yshpz0z.js → chunk-s5taq9jy.js} +2 -2
  247. package/bundle/{chunk-5mf4qrye.js → chunk-s7017cak.js} +2 -2
  248. package/bundle/{chunk-6pt6nqwk.js → chunk-s9bn800b.js} +1 -1
  249. package/bundle/{chunk-73a7ts8r.js → chunk-sa3rjs2s.js} +1 -1
  250. package/bundle/{chunk-wfpnv00c.js → chunk-sprbs7aj.js} +2 -2
  251. package/bundle/{chunk-10q04xh5.js → chunk-sq2z7keb.js} +1 -1
  252. package/bundle/{chunk-w8nj5ph5.js → chunk-sqrx9csx.js} +1 -1
  253. package/bundle/{chunk-art8gejd.js → chunk-srf4jqcj.js} +1 -1
  254. package/bundle/{chunk-ffyj5nsg.js → chunk-ssp3nw24.js} +2 -2
  255. package/bundle/{chunk-2tkgtasa.js → chunk-svnhycdw.js} +2 -2
  256. package/bundle/chunk-swm990q6.js +2 -0
  257. package/bundle/chunk-sy42ayp2.js +2 -0
  258. package/bundle/{chunk-5rvvfgfy.js → chunk-t3kxce69.js} +2 -2
  259. package/bundle/chunk-t7mvej98.js +2 -0
  260. package/bundle/{chunk-6j53vtzd.js → chunk-t8pmy758.js} +1 -1
  261. package/bundle/{chunk-v7v0krrj.js → chunk-t9srpmte.js} +1 -1
  262. package/bundle/{chunk-2pw56zpj.js → chunk-tatecas7.js} +2 -2
  263. package/bundle/chunk-teagh4hx.js +2 -0
  264. package/bundle/{chunk-avksqxan.js → chunk-tf40p520.js} +1 -1
  265. package/bundle/{chunk-yms3bsm7.js → chunk-tpgksx59.js} +1 -1
  266. package/bundle/{chunk-02tmc2st.js → chunk-tr4cze2c.js} +1 -1
  267. package/bundle/chunk-tv4cp6f9.js +2 -0
  268. package/bundle/chunk-tw618904.js +2 -0
  269. package/bundle/{chunk-mq3w4z8k.js → chunk-v1bqh3m6.js} +176 -176
  270. package/bundle/{chunk-j46bxb1b.js → chunk-v3bfzxxg.js} +1 -1
  271. package/bundle/{chunk-vr13f6b5.js → chunk-v5gf0wx6.js} +2 -2
  272. package/bundle/{chunk-d385e2qt.js → chunk-v6mnbwtz.js} +1 -1
  273. package/bundle/{chunk-bq6cvf16.js → chunk-v93gr6n9.js} +2 -2
  274. package/bundle/chunk-vdpffam0.js +2 -0
  275. package/bundle/chunk-ve5w7nkb.js +2 -0
  276. package/bundle/chunk-vey57h4x.js +30 -0
  277. package/bundle/{chunk-pwq2f75j.js → chunk-vf492zs6.js} +1 -1
  278. package/bundle/{chunk-fkq0v5qv.js → chunk-vg9ec44m.js} +2 -2
  279. package/bundle/{chunk-61b81z2h.js → chunk-vh3n53qq.js} +1 -1
  280. package/bundle/{chunk-bmdqb48f.js → chunk-vk8gxf4y.js} +1 -1
  281. package/bundle/{chunk-rd08wx37.js → chunk-vr222v2n.js} +2 -2
  282. package/bundle/chunk-vrpca62q.js +2 -0
  283. package/bundle/{chunk-x3dzzq0t.js → chunk-w5fx69cw.js} +1 -1
  284. package/bundle/{chunk-k4wfq9cn.js → chunk-w9w59zjv.js} +2 -2
  285. package/bundle/{chunk-xmf59618.js → chunk-wbz79hns.js} +1 -1
  286. package/bundle/{chunk-gfvq78gy.js → chunk-wdrfzx4m.js} +1 -1
  287. package/bundle/{chunk-j3agzs13.js → chunk-wf18y499.js} +2 -2
  288. package/bundle/chunk-wvvygzz2.js +2 -0
  289. package/bundle/{chunk-wne3v1fk.js → chunk-wyxc99aa.js} +2 -2
  290. package/bundle/{chunk-5q98z8ck.js → chunk-x2mbre12.js} +2 -2
  291. package/bundle/{chunk-2d61z24r.js → chunk-x8rr2f15.js} +1 -1
  292. package/bundle/{chunk-vgmgg994.js → chunk-xpmgqa5n.js} +1 -1
  293. package/bundle/{chunk-rws2tsdv.js → chunk-xrwsttb7.js} +1 -1
  294. package/bundle/{chunk-ytfq6rn9.js → chunk-xz6psr05.js} +1 -1
  295. package/bundle/{chunk-4xqwt6dr.js → chunk-xzshjp04.js} +2 -2
  296. package/bundle/chunk-y27gwnx9.js +2 -0
  297. package/bundle/chunk-y2ms7q84.js +2 -0
  298. package/bundle/{chunk-1pft3sar.js → chunk-y8bjb32m.js} +1 -1
  299. package/bundle/{chunk-h036zy9e.js → chunk-ya7wrt5f.js} +2 -2
  300. package/bundle/{chunk-ahgb3r1c.js → chunk-ycjz7y1x.js} +2 -2
  301. package/bundle/{chunk-10kj86va.js → chunk-ykqx1z0b.js} +1 -1
  302. package/bundle/chunk-yq4vck53.js +2 -0
  303. package/bundle/{chunk-j2snkw45.js → chunk-yxsc90ba.js} +2 -2
  304. package/bundle/{chunk-5cwy8y78.js → chunk-yy5qqab3.js} +2 -2
  305. package/bundle/{chunk-86reb44c.js → chunk-z38am71w.js} +1 -1
  306. package/bundle/{chunk-pwrwb7mn.js → chunk-z6mqdbj1.js} +1 -1
  307. package/bundle/{chunk-nyxn7npc.js → chunk-z87ew6d3.js} +1 -1
  308. package/bundle/{chunk-m6967jtv.js → chunk-z9k4506p.js} +2 -2
  309. package/bundle/{chunk-hf39qx6t.js → chunk-zezz8xfw.js} +2 -2
  310. package/bundle/{chunk-ffx0cr44.js → chunk-zg72kz2k.js} +2 -2
  311. package/bundle/chunk-zkxc41ek.js +2 -0
  312. package/bundle/{chunk-tz1bzrnh.js → chunk-zssy3srh.js} +1 -1
  313. package/bundle/{chunk-xxck1man.js → chunk-zyz4na64.js} +1 -1
  314. package/bundle/{chunk-e18hshcg.js → chunk-zzsetq5f.js} +1 -1
  315. package/bundle/index.js +3 -3
  316. package/bundle/parser.worker.js +2 -2
  317. package/bundle/worker.js +1 -1
  318. package/package.json +1 -1
  319. package/bundle/chunk-1r7anzk5.js +0 -2
  320. package/bundle/chunk-2jzay8a9.js +0 -2
  321. package/bundle/chunk-30rghawe.js +0 -2
  322. package/bundle/chunk-31a47ptm.js +0 -10
  323. package/bundle/chunk-33mzqyyb.js +0 -3
  324. package/bundle/chunk-3dajnr1w.js +0 -2
  325. package/bundle/chunk-3ege6krg.js +0 -2
  326. package/bundle/chunk-43vpxggb.js +0 -2
  327. package/bundle/chunk-49y7zg15.js +0 -2
  328. package/bundle/chunk-5qhsfjzq.js +0 -3
  329. package/bundle/chunk-5re7995e.js +0 -2
  330. package/bundle/chunk-5xxn06g0.js +0 -2
  331. package/bundle/chunk-6k0y2332.js +0 -2
  332. package/bundle/chunk-6qwnty59.js +0 -8
  333. package/bundle/chunk-7cp30q0t.js +0 -2
  334. package/bundle/chunk-7t63wz2f.js +0 -2
  335. package/bundle/chunk-8gz8fk6r.js +0 -2
  336. package/bundle/chunk-8ht7cq3h.js +0 -2
  337. package/bundle/chunk-8qv0119d.js +0 -2
  338. package/bundle/chunk-9m0eawt5.js +0 -2
  339. package/bundle/chunk-a32y70fe.js +0 -2
  340. package/bundle/chunk-ae1b15bd.js +0 -31
  341. package/bundle/chunk-apneazwv.js +0 -2
  342. package/bundle/chunk-aw5yv01t.js +0 -2
  343. package/bundle/chunk-az12tp53.js +0 -2
  344. package/bundle/chunk-b5dpzcc7.js +0 -2
  345. package/bundle/chunk-baq0wk3q.js +0 -2
  346. package/bundle/chunk-bcgtqx3g.js +0 -2
  347. package/bundle/chunk-bde5d507.js +0 -2
  348. package/bundle/chunk-bzzggc3s.js +0 -2
  349. package/bundle/chunk-c8qx439t.js +0 -2
  350. package/bundle/chunk-ckw51fn6.js +0 -2
  351. package/bundle/chunk-denp0wrq.js +0 -2
  352. package/bundle/chunk-depxzjer.js +0 -2
  353. package/bundle/chunk-dhvqpcf3.js +0 -2
  354. package/bundle/chunk-dkqqswbv.js +0 -2
  355. package/bundle/chunk-e5t7jsxa.js +0 -2
  356. package/bundle/chunk-eb811dt2.js +0 -2
  357. package/bundle/chunk-fbz2xv2w.js +0 -2
  358. package/bundle/chunk-ffynh19k.js +0 -2
  359. package/bundle/chunk-fgr9xshx.js +0 -2
  360. package/bundle/chunk-gbvcb4k1.js +0 -2
  361. package/bundle/chunk-gdtnqzbp.js +0 -2
  362. package/bundle/chunk-gkfvhh28.js +0 -2
  363. package/bundle/chunk-gvx5hmhk.js +0 -2
  364. package/bundle/chunk-gww6abk3.js +0 -2
  365. package/bundle/chunk-hham7r33.js +0 -2
  366. package/bundle/chunk-hmm0gj34.js +0 -3
  367. package/bundle/chunk-hsjbe5zy.js +0 -2
  368. package/bundle/chunk-j89sv999.js +0 -2
  369. package/bundle/chunk-k9b4005p.js +0 -2
  370. package/bundle/chunk-kht2kwam.js +0 -2
  371. package/bundle/chunk-kzkb4648.js +0 -2
  372. package/bundle/chunk-m2540waa.js +0 -2
  373. package/bundle/chunk-mreacz8r.js +0 -2
  374. package/bundle/chunk-mscvm1rm.js +0 -2
  375. package/bundle/chunk-mw3hh526.js +0 -2
  376. package/bundle/chunk-n3nsrk5n.js +0 -2
  377. package/bundle/chunk-n4qbnecw.js +0 -35
  378. package/bundle/chunk-n9nmc4q4.js +0 -2
  379. package/bundle/chunk-nj4as8vy.js +0 -2
  380. package/bundle/chunk-nxm6gpyv.js +0 -2
  381. package/bundle/chunk-pqzx9ha6.js +0 -2
  382. package/bundle/chunk-qbjqkezn.js +0 -2
  383. package/bundle/chunk-qhtp1xvx.js +0 -2
  384. package/bundle/chunk-qkztgpay.js +0 -2
  385. package/bundle/chunk-rnf3dy0y.js +0 -2
  386. package/bundle/chunk-rry4kq85.js +0 -2
  387. package/bundle/chunk-rt49c6js.js +0 -5
  388. package/bundle/chunk-ryfj80q6.js +0 -2
  389. package/bundle/chunk-snx49w8h.js +0 -2
  390. package/bundle/chunk-t21mdqbb.js +0 -2
  391. package/bundle/chunk-tkbjcznz.js +0 -2
  392. package/bundle/chunk-tn2yyqeb.js +0 -2
  393. package/bundle/chunk-ttebf3nt.js +0 -2
  394. package/bundle/chunk-twpfh0mx.js +0 -2
  395. package/bundle/chunk-tzf6d5qy.js +0 -2
  396. package/bundle/chunk-v2mq09wx.js +0 -2
  397. package/bundle/chunk-v59a02aj.js +0 -2
  398. package/bundle/chunk-vxr4rzt0.js +0 -2
  399. package/bundle/chunk-w0h9rczg.js +0 -2
  400. package/bundle/chunk-w8344et5.js +0 -2
  401. package/bundle/chunk-weyg78et.js +0 -2
  402. package/bundle/chunk-wyavgt96.js +0 -2
  403. package/bundle/chunk-xchj8gna.js +0 -2
  404. package/bundle/chunk-yvjecrjy.js +0 -2
  405. package/bundle/chunk-yw2x6by6.js +0 -2
  406. package/bundle/chunk-z0r4syk8.js +0 -2
  407. package/bundle/chunk-z7c00g63.js +0 -2
  408. package/bundle/chunk-z93n3cbm.js +0 -2
  409. package/bundle/chunk-znr0saas.js +0 -2
  410. package/bundle/chunk-zqqt7v17.js +0 -2
  411. package/bundle/chunk-zwrgh1hc.js +0 -2
  412. package/bundle/chunk-zwxp07yc.js +0 -2
@@ -0,0 +1,5 @@
1
+ // @bun
2
+ import{Tl as no,Ul as Vt,Vl as oo,Wl as qt,Yl as Qt,Zl as Dt}from"./chunk-ft4msj4z.js";import{$l as pr,$m as gi,$n as Yi,Am as Pr,An as Ti,Bm as Ur,Bn as Oi,Cm as Zr,Cn as $i,Co as Zt,Dm as Xr,Dn as Bi,Em as Yr,En as Lo,Fm as vr,Fn as Go,Gm as x,Gn as Qi,Hm as zr,Hn as Di,Im as kr,In as Ii,Jm as Vr,Jn as li,Km as qr,Kn as Li,Lm as wr,Ln as di,Mm as Fr,Mn as Gi,Nm as cr,Nn as Ji,Om as jr,On as Ci,Pm as br,Pn as Hi,Qm as hr,Qn as Mi,Rm as ar,Rn as xi,Sm as ni,Sn as Ki,Tm as oi,Tn as Ri,Um as ri,Un as Ei,Vm as ii,Vn as Si,Wm as ti,Wn as Wi,Xm as ei,Xn as Pi,Ym as mi,Yn as Ui,Zm as yi,Zn as Zi,_l as Nr,_m as fi,_n as Xi,am as Sn,an as j,ao as vi,bm as Wn,bn as D,bo as zi,cm as sr,cn as fn,co as ki,dm as Ar,dn as yn,do as Vi,em as Tr,en as vo,eo as qi,fn as ui,fo as wi,gm as Or,gn as Y,go as Fi,hm as $r,hn as _o,ho as ci,im as Br,in as Pn,io as ji,jm as Qr,jn as No,jo as bi,km as Dr,kn as po,ko as hi,lm as Ir,ln as so,lo as ai,mm as lr,mn as Ao,mo as nt,nm as Lr,nn as To,no as ot,om as dr,on as Oo,oo as rt,pm as Gr,pn as $o,po as it,qm as Jr,qn as _i,qo as tt,rm as Cr,rn as Bo,ro as et,sm as Hr,sn as Qo,so as mt,tm as Mr,tn as Do,to as yt,um as xr,un as Ni,uo as jo,vm as Kr,vn as Io,vo as ft,wm as Rr,wn as pi,wo as gt,xm as Er,xn as lo,xo as ut,ym as Sr,yn as si,zm as Wr,zn as Ai}from"./chunk-m8djypsy.js";import{hp as hn,lp as an}from"./chunk-wf18y499.js";import{mp as vt}from"./chunk-4bp91rza.js";import{np as Mo}from"./chunk-6vxddv5w.js";import{bt as Yn,ct as ro,dt as sn,et as xt,ft as Wt,ht as Kt}from"./chunk-52f62kr0.js";import{it as Et}from"./chunk-svnhycdw.js";import{ju as un}from"./chunk-m5r6zq6v.js";import{Iu as eo}from"./chunk-76jbys6j.js";import{Mu as Wo}from"./chunk-dm7hfb7f.js";import{Cv as V,tv as nn}from"./chunk-62mb6wxm.js";import{Fv as Bt,Iv as wo,Jv as q,Nv as go,Sv as Bn}from"./chunk-zg72kz2k.js";import{Tv as b}from"./chunk-kr7t73tg.js";import{IB as An,QB as Hn,cC as Kn}from"./chunk-sprbs7aj.js";import{FG as _n,MJ as r,PM as $t,QL as Xo,TD as wn,UK as dn,VG as Ot,fE as Dn,jH as a,rG as So,yG as kn,zQ as s}from"./chunk-qvnsgyfk.js";import{aR as $n}from"./chunk-pfx8ts02.js";var Fo={};$n(Fo,{run:()=>bt});var mn={time_created:j().notNull().$default(()=>Date.now()),time_updated:j().notNull().$onUpdate(()=>Date.now())};var C=yn("project",{id:D().$type().primaryKey(),worktree:D().notNull(),vcs:D(),name:D(),icon_url:D(),icon_color:D(),...mn,time_initialized:j(),sandboxes:D({mode:"json"}).notNull().$type(),commands:D({mode:"json"}).$type()});var gn=yn("session",{id:D().$type().primaryKey(),project_id:D().$type().notNull().references(()=>C.id,{onDelete:"cascade"}),workspace_id:D().$type(),parent_id:D().$type(),context_from:D().$type(),context_watermark:D().$type(),slug:D().notNull(),directory:D().notNull(),title:D().notNull(),version:D().notNull(),share_url:D(),summary_additions:j(),summary_deletions:j(),summary_files:j(),summary_diffs:D({mode:"json"}).$type(),revert:D({mode:"json"}).$type(),permission:D({mode:"json"}).$type(),...mn,time_compacting:j(),time_archived:j(),last_checkpoint_message_id:D().$type()},(n)=>[fn("session_project_idx").on(n.project_id),fn("session_workspace_idx").on(n.workspace_id),fn("session_parent_idx").on(n.parent_id),fn("session_context_from_idx").on(n.context_from)]),fo=yn("message",{id:D().$type().primaryKey(),session_id:D().$type().notNull().references(()=>gn.id,{onDelete:"cascade"}),agent_id:D().notNull().default("main"),...mn,data:D({mode:"json"}).notNull().$type()},(n)=>[fn("message_session_time_created_id_idx").on(n.session_id,n.time_created,n.id),fn("message_session_agent_idx").on(n.session_id,n.agent_id,n.id)]),zo=yn("part",{id:D().$type().primaryKey(),message_id:D().$type().notNull().references(()=>fo.id,{onDelete:"cascade"}),session_id:D().$type().notNull(),...mn,data:D({mode:"json"}).notNull().$type()},(n)=>[fn("part_message_id_id_idx").on(n.message_id,n.id),fn("part_session_idx").on(n.session_id)]),ko=yn("todo",{session_id:D().$type().notNull().references(()=>gn.id,{onDelete:"cascade"}),content:D().notNull(),status:D().notNull(),position:j().notNull(),...mn},(n)=>[vo({columns:[n.session_id,n.position]}),fn("todo_session_idx").on(n.session_id)]),Vo=yn("permission",{project_id:D().primaryKey().references(()=>C.id,{onDelete:"cascade"}),...mn,data:D({mode:"json"}).notNull().$type()});var qo=yn("session_share",{session_id:D().primaryKey().references(()=>gn.id,{onDelete:"cascade"}),id:D().notNull(),secret:D().notNull(),url:D().notNull(),...mn});import k from"path";var X=V.create({service:"json-migration"});async function bt(n,o){let i=k.join(Bn.Path.data,"storage");if(!await go.exists(i))return X.info("storage directory does not exist, skipping migration"),{projects:0,sessions:0,messages:0,parts:0,todos:0,permissions:0,shares:0,errors:[]};X.info("starting json to sqlite migration",{storageDir:i});let _=performance.now();n.run("PRAGMA journal_mode = WAL"),n.run("PRAGMA synchronous = OFF"),n.run("PRAGMA cache_size = 10000"),n.run("PRAGMA temp_store = MEMORY");let e={projects:0,sessions:0,messages:0,parts:0,todos:0,permissions:0,shares:0,errors:[]},T={sessions:0,todos:0,permissions:0,shares:0},p=e.errors,O=1000,H=Date.now();async function E(g){return wo.scan(g,{cwd:i,absolute:!0})}async function K(g,G,M){let I=M-G,A=Array(I);for(let P=0;P<I;P++)A[P]=go.readJson(g[G+P]);let J=await Promise.allSettled(A),Z=Array(I);for(let P=0;P<J.length;P++){let w=J[P];if(w.status==="fulfilled"){Z[P]=w.value;continue}p.push(`failed to read ${g[G+P]}: ${w.reason}`)}return Z}function R(g,G,M){if(g.length===0)return 0;try{return n.insert(G).values(g).onConflictDoNothing().run(),g.length}catch(I){return p.push(`failed to migrate ${M} batch: ${I}`),0}}X.info("scanning files...");let[S,B,l,d,u,N,m]=await Promise.all([E("project/*.json"),E("session/*/*.json"),E("message/*/*.json"),E("part/*/*.json"),E("todo/*.json"),E("permission/*.json"),E("session_share/*.json")]);X.info("file scan complete",{projects:S.length,sessions:B.length,messages:l.length,parts:d.length,todos:u.length,permissions:N.length,shares:m.length});let f=Math.max(1,S.length+B.length+l.length+d.length+u.length+N.length+m.length),t=o?.progress,y=0,Q=(g,G)=>{y=Math.min(f,y+G),t?.({current:y,total:f,label:g})};t?.({current:y,total:f,label:"starting"}),n.run("BEGIN TRANSACTION");let L=new Set,$=[];for(let g=0;g<S.length;g+=O){let G=Math.min(g+O,S.length),M=await K(S,g,G);$.length=0;for(let I=0;I<M.length;I++){let A=M[I];if(!A)continue;let J=k.basename(S[g+I],".json");L.add(J),$.push({id:J,worktree:A.worktree??"/",vcs:A.vcs,name:A.name??void 0,icon_url:A.icon?.url,icon_color:A.icon?.color,time_created:A.time?.created??H,time_updated:A.time?.updated??H,time_initialized:A.time?.initialized,sandboxes:A.sandboxes??[],commands:A.commands})}e.projects+=R($,C,"project"),Q("projects",G-g)}X.info("migrated projects",{count:e.projects,duration:Math.round(performance.now()-_)});let U=B.map((g)=>k.basename(k.dirname(g))),z=new Set,en=[];for(let g=0;g<B.length;g+=O){let G=Math.min(g+O,B.length),M=await K(B,g,G);en.length=0;for(let I=0;I<M.length;I++){let A=M[I];if(!A)continue;let J=k.basename(B[g+I],".json"),Z=U[g+I];if(!L.has(Z)){T.sessions++;continue}z.add(J),en.push({id:J,project_id:Z,parent_id:A.parentID??null,slug:A.slug??"",directory:A.directory??"",title:A.title??"",version:A.version??"",share_url:A.share?.url??null,summary_additions:A.summary?.additions??null,summary_deletions:A.summary?.deletions??null,summary_files:A.summary?.files??null,summary_diffs:A.summary?.diffs??null,revert:A.revert??null,permission:A.permission??null,time_created:A.time?.created??H,time_updated:A.time?.updated??H,time_compacting:A.time?.compacting??null,time_archived:A.time?.archived??null})}e.sessions+=R(en,gn,"session"),Q("sessions",G-g)}if(X.info("migrated sessions",{count:e.sessions}),T.sessions>0)X.warn("skipped orphaned sessions",{count:T.sessions});let Nn=[],W=[],Fn=new Map;for(let g of l){let G=k.basename(k.dirname(g));if(!z.has(G))continue;Nn.push(g),W.push(G)}for(let g=0;g<Nn.length;g+=O){let G=Math.min(g+O,Nn.length),M=await K(Nn,g,G),I=Array(M.length),A=0;for(let J=0;J<M.length;J++){let Z=M[J];if(!Z)continue;let P=Nn[g+J],w=k.basename(P,".json"),En=W[g+J];Fn.set(w,En);let In=Z;delete In.id,delete In.sessionID,I[A++]={id:w,session_id:En,time_created:Z.time?.created??H,time_updated:Z.time?.updated??H,data:In}}I.length=A,e.messages+=R(I,fo,"message"),Q("messages",G-g)}X.info("migrated messages",{count:e.messages});for(let g=0;g<d.length;g+=O){let G=Math.min(g+O,d.length),M=await K(d,g,G),I=Array(M.length),A=0;for(let J=0;J<M.length;J++){let Z=M[J];if(!Z)continue;let P=d[g+J],w=k.basename(P,".json"),En=k.basename(k.dirname(P)),In=Fn.get(En);if(!In){p.push(`part missing message session: ${P}`);continue}if(!z.has(In))continue;let bn=Z;delete bn.id,delete bn.messageID,delete bn.sessionID,I[A++]={id:w,message_id:En,session_id:In,time_created:Z.time?.created??H,time_updated:Z.time?.updated??H,data:bn}}I.length=A,e.parts+=R(I,zo,"part"),Q("parts",G-g)}X.info("migrated parts",{count:e.parts});let On=u.map((g)=>k.basename(g,".json"));for(let g=0;g<u.length;g+=O){let G=Math.min(g+O,u.length),M=await K(u,g,G),I=[];for(let A=0;A<M.length;A++){let J=M[A];if(!J)continue;let Z=On[g+A];if(!z.has(Z)){T.todos++;continue}if(!Array.isArray(J)){p.push(`todo not an array: ${u[g+A]}`);continue}for(let P=0;P<J.length;P++){let w=J[P];if(!w?.content||!w?.status)continue;I.push({session_id:Z,content:w.content,status:w.status,position:P,time_created:H,time_updated:H})}}e.todos+=R(I,ko,"todo"),Q("todos",G-g)}if(X.info("migrated todos",{count:e.todos}),T.todos>0)X.warn("skipped orphaned todos",{count:T.todos});let cn=N.map((g)=>k.basename(g,".json")),Rn=[];for(let g=0;g<N.length;g+=O){let G=Math.min(g+O,N.length),M=await K(N,g,G);Rn.length=0;for(let I=0;I<M.length;I++){let A=M[I];if(!A)continue;let J=cn[g+I];if(!L.has(J)){T.permissions++;continue}Rn.push({project_id:J,data:A})}e.permissions+=R(Rn,Vo,"permission"),Q("permissions",G-g)}if(X.info("migrated permissions",{count:e.permissions}),T.permissions>0)X.warn("skipped orphaned permissions",{count:T.permissions});let jn=m.map((g)=>k.basename(g,".json")),Gn=[];for(let g=0;g<m.length;g+=O){let G=Math.min(g+O,m.length),M=await K(m,g,G);Gn.length=0;for(let I=0;I<M.length;I++){let A=M[I];if(!A)continue;let J=jn[g+I];if(!z.has(J)){T.shares++;continue}if(!A?.id||!A?.secret||!A?.url){p.push(`session_share missing id/secret/url: ${m[g+I]}`);continue}Gn.push({session_id:J,id:A.id,secret:A.secret,url:A.url})}e.shares+=R(Gn,qo,"session_share"),Q("shares",G-g)}if(X.info("migrated session shares",{count:e.shares}),T.shares>0)X.warn("skipped orphaned session shares",{count:T.shares});if(n.run("COMMIT"),X.info("json migration complete",{projects:e.projects,sessions:e.sessions,messages:e.messages,parts:e.parts,todos:e.todos,permissions:e.permissions,shares:e.shares,errorCount:e.errors.length,duration:Math.round(performance.now()-_)}),e.errors.length>0)X.warn("migration errors",{errors:e.errors.slice(0,20)});return t?.({current:f,total:f,label:"complete"}),e}var Ln={};$n(Ln,{use:()=>Me,transaction:()=>Ke,textDecoder:()=>mi,sumDistinct:()=>ir,sum:()=>rr,sql:()=>x,relationsOrderToSQL:()=>tt,relationsFilterToSQL:()=>it,relationToSQL:()=>mt,relationExtrasToSQL:()=>et,processRelations:()=>Wi,placeholder:()=>kr,param:()=>vr,orderSelectedFields:()=>jr,orderByOperators:()=>Vi,or:()=>No,operators:()=>ki,notLike:()=>si,notInArray:()=>_i,notIlike:()=>Ti,notExists:()=>Ni,notBetween:()=>pi,not:()=>po,noopMapper:()=>Xr,noopEncoder:()=>Zr,noopDecoder:()=>Ur,ne:()=>_o,name:()=>Wr,min:()=>er,max:()=>tr,mapUpdateSet:()=>hr,mapResultRow:()=>cr,mapRelationalRow:()=>wi,mapColumnsInSQLToAlias:()=>xi,mapColumnsInAliasedSQLToAlias:()=>Mi,lte:()=>Oo,lt:()=>To,like:()=>lo,l2Distance:()=>mr,l1Distance:()=>yr,jaccardDistance:()=>_r,isWithEnum:()=>fi,isView:()=>wr,isTable:()=>dr,isSQLWrapper:()=>Kr,isNull:()=>Bo,isNotNull:()=>Qo,isDriverValueEncoder:()=>Pr,isConfig:()=>ei,is:()=>Sn,innerProduct:()=>fr,inArray:()=>$o,ilike:()=>Ai,haveSameKeys:()=>br,hasOwnEntityKind:()=>pr,hammingDistance:()=>ur,gte:()=>Ao,gt:()=>so,getViewSelectedFields:()=>oi,getViewName:()=>Fr,getTableUniqueName:()=>Jr,getTableName:()=>Gr,getTableLikeName:()=>ii,getTableColumns:()=>ni,getTableAsAliasSQL:()=>yt,getOriginalColumnFromAlias:()=>Ki,getOrderByOperators:()=>qi,getColumns:()=>ri,getColumnTable:()=>sr,getColumnNameAndConfig:()=>ti,getChannelPath:()=>zt,fillPlaceholders:()=>Vr,fieldSelectionToSQL:()=>rt,extractTablesFromSchema:()=>ai,extractExtendedColumnType:()=>Ar,exists:()=>Do,eq:()=>Y,entityKind:()=>Nr,effect:()=>xe,desc:()=>Go,defineRelationsPart:()=>ot,defineRelations:()=>nt,createRelationsHelper:()=>hi,countDistinct:()=>ao,count:()=>uo,cosineDistance:()=>gr,close:()=>He,buildRelationsParts:()=>Ui,buildRelations:()=>Pi,bindIfParam:()=>ui,between:()=>Io,avgDistinct:()=>or,avg:()=>nr,assertUnreachable:()=>yi,asc:()=>Lo,arrayOverlaps:()=>Bi,arrayContains:()=>Oi,arrayContained:()=>$i,applyMixins:()=>ar,and:()=>Pn,aliasedTableColumn:()=>Hi,aliasedTable:()=>Gi,aliasedRelation:()=>Ci,aliasedColumn:()=>Ji,WithSubquery:()=>Hr,ViewSelectionAliasProxyHandler:()=>Ii,ViewBaseConfig:()=>Mr,View:()=>qr,TransactionRollbackError:()=>Si,TableSchema:()=>Or,TableColumns:()=>$r,TableAliasProxyHandler:()=>li,Table:()=>Lr,Subquery:()=>Cr,StringChunk:()=>Rr,SQL:()=>Er,RelationsHelperStatic:()=>bi,RelationsBuilderTable:()=>Fi,RelationsBuilderJunctionColumn:()=>ji,RelationsBuilderColumn:()=>ci,RelationTableAliasProxyHandler:()=>di,Relation:()=>Zi,QueryPromise:()=>Qi,Placeholder:()=>zr,Path:()=>Po,Param:()=>Yr,OriginalName:()=>Qr,One:()=>Xi,NotFoundError:()=>Ce,NoopLogger:()=>ut,Name:()=>Sr,Many:()=>Yi,IsAlias:()=>Ir,FakePrimitiveParam:()=>xr,ExtraConfigColumns:()=>Br,ExtraConfigBuilder:()=>lr,DrizzleQueryError:()=>Ei,DrizzleError:()=>Ri,DefaultLogger:()=>gt,Count:()=>zi,ConsoleLogWriter:()=>ft,ColumnTableAliasProxyHandler:()=>Di,ColumnBuilder:()=>Tr,ColumnAliasProxyHandler:()=>Li,Column:()=>Wn,Client:()=>Mn,CONSTANTS:()=>gi,BaseName:()=>Dr,AggregatedField:()=>vi});import ht from"crypto";import co,{existsSync as at,readdirSync as ne}from"fs";import{join as oe}from"path";function bo(n){if(co.existsSync(`${n.migrationsFolder}/meta/_journal.json`))throw Error('We detected that you have old drizzle-kit migration folders. You must upgrade drizzle-kit and run "drizzle-kit up"');let o=n.migrationsFolder,i=[],_=ne(o).map((e)=>({path:oe(o,e,"migration.sql"),name:e})).filter((e)=>at(e.path));_.sort((e,T)=>e.name.localeCompare(T.name));for(let e of _){let T=e.path,p=e.name.slice(0,14),O=co.readFileSync(T).toString(),H=O.split("--> statement-breakpoint").map((K)=>{return K}),E=jo(p);i.push({sql:H,bps:!0,folderMillis:E,hash:ht.createHash("sha256").update(O).digest("hex"),name:e.name})}return i}function ho(n,o){if(Array.isArray(o)||"migrationsJournal"in o){let _=Array.isArray(o)?o:o.migrationsJournal,e=Array.isArray(o)?void 0:o.migrationsTable,T=_.map((p)=>({sql:p.sql.split("--> statement-breakpoint"),folderMillis:p.timestamp,hash:"",bps:!0,name:p.name}));return n.dialect.migrate(T,n.session,{migrationsTable:e})}let i=bo(o);return n.dialect.migrate(i,n.session,o)}function uo(n){return x`count(${n||x.raw("*")})`.mapWith(Number)}function ao(n){return x`count(distinct ${n})`.mapWith(Number)}function nr(n){return x`avg(${n})`.mapWith(String)}function or(n){return x`avg(distinct ${n})`.mapWith(String)}function rr(n){return x`sum(${n})`.mapWith(String)}function ir(n){return x`sum(distinct ${n})`.mapWith(String)}function tr(n){return x`max(${n})`.mapWith(Sn(n,Wn)?n:String)}function er(n){return x`min(${n})`.mapWith(Sn(n,Wn)?n:String)}function Jn(n){return JSON.stringify(n)}function mr(n,o){if(Array.isArray(o))return x`${n} <-> ${Jn(o)}`;return x`${n} <-> ${o}`}function yr(n,o){if(Array.isArray(o))return x`${n} <+> ${Jn(o)}`;return x`${n} <+> ${o}`}function fr(n,o){if(Array.isArray(o))return x`${n} <#> ${Jn(o)}`;return x`${n} <#> ${o}`}function gr(n,o){if(Array.isArray(o))return x`${n} <=> ${Jn(o)}`;return x`${n} <=> ${o}`}function ur(n,o){if(Array.isArray(o))return x`${n} <~> ${Jn(o)}`;return x`${n} <~> ${o}`}function _r(n,o){if(Array.isArray(o))return x`${n} <%> ${Jn(o)}`;return x`${n} <%> ${o}`}import to from"path";var vn={};$n(vn,{workspaceID:()=>Be,useEffect:()=>Ie,use:()=>De,make:()=>Qe,invalidate:()=>Le,has:()=>le,get:()=>Eo,directory:()=>io,context:()=>Ro,bind:()=>$e});import{EventEmitter as re}from"events";var Un=new re;var Jo=new Set;function _t(n){return Jo.add(n),()=>{Jo.delete(n)}}async function Co(n){await Promise.allSettled([...Jo].map((o)=>o(n)))}function Zn(n){return n()}var Ct={};$n(Ct,{setInitialized:()=>_e,list:()=>ge,layer:()=>Jt,get:()=>ue,fromRow:()=>pn,defaultLayer:()=>Ko,UpdateInput:()=>fe,Service:()=>Cn,Info:()=>dt,Event:()=>Gt});import*as c from"fs/promises";import*as It from"os";import*as Qn from"path";var ie=s.String.pipe(s.brand("ProjectID")),F=ie.pipe(hn((n)=>({global:n.make("global"),zod:b.string().pipe(b.custom())})));import*as ln from"fs/promises";import*as h from"path";import*as st from"crypto";async function Ho(n){let o=h.resolve(n);while(!0){let i=h.join(o,".git"),_=await ln.stat(i).catch(()=>null);if(_){if(_.isDirectory())return i;let p=(await ln.readFile(i,"utf-8")).trim().match(/^gitdir:\s*(.+)$/);if(!p)return null;let O=h.isAbsolute(p[1])?p[1]:h.resolve(o,p[1]);return h.resolve(O,"../..")}let e=h.dirname(o);if(e===o)return null;o=e}}async function Nt(n){let o=await ln.readFile(n,"utf-8").catch(()=>null);if(o===null)return null;return o.trim()||null}async function pt(n){let o=await Nt(n);if(o)return o;let i=st.randomUUID();try{return await ln.writeFile(n,i,{flag:"wx"}),i}catch(_){if(_.code!=="EEXIST")throw _;let e=await Nt(n);if(e)return e;throw Error(`Project ID file was concurrently created but is empty: ${n}`)}}async function At(n){let o=await Ho(n);if(o){let _=h.join(o,"qitqode-project-id");return F.make(await pt(_))}let i=h.join(n,".qitqode-project-id");return F.make(await pt(i))}async function ee(n){let o=await Ho(n);if(!o)return;let i=Qn.join(n,".qitqode-project-id"),_=Qn.join(o,"qitqode-project-id"),e=(O)=>c.access(O).then(()=>!0).catch(()=>!1);if(await e(i)){if(!await e(_)){let O=await c.readFile(i,"utf-8");await c.writeFile(_,O)}await c.unlink(i).catch(()=>{})}let T=Qn.join(o,"info","exclude");if(await c.mkdir(Qn.dirname(T),{recursive:!0}),!(await c.readFile(T,"utf-8").catch(()=>"")).includes(".qitqode-project-id"))await c.appendFile(T,`
3
+ .qitqode-project-id
4
+ `)}var Tt=V.create({service:"project"}),me=262144,xo=s.Literal("git"),lt=s.Struct({url:s.optional(s.String),override:s.optional(s.String),color:s.optional(s.String)}),Lt=s.Struct({start:s.optional(s.String.annotate({description:"Startup script to run when creating a new workspace (worktree)"}))}),ye=s.Struct({created:s.Number,updated:s.Number,initialized:s.optional(s.Number)}),dt=s.Struct({id:F,worktree:s.String,vcs:s.optional(xo),name:s.optional(s.String),icon:s.optional(lt),commands:s.optional(Lt),time:ye,sandboxes:s.Array(s.String)}).annotate({identifier:"Project"}).pipe(hn((n)=>({zod:an(n)}))),Gt={Updated:Dt.define("project.updated",dt.zod)};function pn(n){let o=n.icon_url||n.icon_color?{url:n.icon_url??void 0,color:n.icon_color??void 0}:void 0;return{id:n.id,worktree:n.worktree,vcs:n.vcs?s.decodeUnknownSync(xo)(n.vcs):void 0,name:n.name??void 0,icon:o,time:{created:n.time_created,updated:n.time_updated,initialized:n.time_initialized??void 0},sandboxes:n.sandboxes,commands:n.commands??void 0}}var fe=b.object({projectID:F.zod,name:b.string().optional(),icon:an(lt).optional(),commands:an(Lt).optional()});class Cn extends Dn.Service()("@qitqode/Project"){}var Jt=a.effect(Cn,r.gen(function*(){let n=yield*q.Service,o=yield*$t.Path,i=yield*no.ChildProcessSpawner,_=r.fnUntraced(function*(t,y){return yield*Qt(i,t,y)},r.catch(()=>r.succeed({code:1,text:"",stderr:""}))),e=(t)=>r.sync(()=>Ln.use(t)),T=(t)=>r.sync(()=>Un.emit("event",{directory:"global",project:t.id,payload:{type:Gt.Updated.type,properties:t}})),p=s.decodeUnknownSync(s.optional(xo))(nn.QITQODE_FAKE_VCS),O=(t,y)=>{if(!y)return t;if(y=y.replace(/[\r\n]+$/,""),!y)return t;if(y=q.windowsPath(y),o.isAbsolute(y))return o.normalize(y);return o.resolve(t,y)},H=yield*Ot.Scope,E=r.fn("Project.fromDirectory")(function*(t){Tt.info("fromDirectory",{directory:t});let y=yield*r.gen(function*(){if(nn.QITQODE_DISABLE_GIT)return{id:F.global,worktree:t,sandbox:t,vcs:p};let z=(yield*n.up({targets:[".git"],start:t}).pipe(r.orDie))[0];if(!z)return{id:F.global,worktree:"/",sandbox:"/",vcs:p};let en=o.dirname(z),Nn=process.env.HOME??process.env.USERPROFILE??It.homedir();if(en===Nn||Qn.parse(en).root===en)return Tt.warn("ignoring .git at home or filesystem root, snapshots disabled",{dotgit:z}),{id:F.global,worktree:t,sandbox:t,vcs:p};let W=en,Fn=yield*r.sync(()=>Mo("git")),On;if(!Fn)return{id:On??F.global,worktree:W,sandbox:W,vcs:p};let cn=yield*_(["rev-parse","--git-common-dir"],{cwd:W});if(cn.code!==0)return{id:On??F.global,worktree:W,sandbox:W,vcs:p};let Rn=(()=>{let Gn=O(W,cn.text.trim());return Gn===W?W:o.dirname(Gn)})();if(On==null)yield*r.promise(()=>ee(W)),On=yield*r.promise(()=>At(W));let jn=yield*_(["rev-parse","--show-toplevel"],{cwd:W});if(jn.code!==0)return{id:On,worktree:W,sandbox:W,vcs:p};return W=O(W,jn.text.trim()),{id:On,sandbox:W,worktree:Rn,vcs:"git"}}),Q=yield*e((U)=>U.select().from(C).where(Y(C.id,y.id)).get()),L=Q?pn(Q):{id:y.id,worktree:y.worktree,vcs:y.vcs,sandboxes:[],time:{created:Date.now(),updated:Date.now()}};if(nn.QITQODE_EXPERIMENTAL_ICON_DISCOVERY)yield*K(L).pipe(r.ignore,r.forkIn(H));let $={...L,worktree:y.worktree,vcs:y.vcs,time:{...L.time,updated:Date.now()}};if(y.sandbox!==$.worktree&&!$.sandboxes.includes(y.sandbox))$.sandboxes.push(y.sandbox);if($.sandboxes=yield*r.forEach($.sandboxes,(U)=>n.exists(U).pipe(r.orDie,r.map((z)=>z?U:void 0)),{concurrency:16}).pipe(r.map((U)=>U.filter((z)=>z!==void 0))),yield*e((U)=>U.insert(C).values({id:$.id,worktree:$.worktree,vcs:$.vcs??null,name:$.name,icon_url:$.icon?.url,icon_color:$.icon?.color,time_created:$.time.created,time_updated:$.time.updated,time_initialized:$.time.initialized,sandboxes:$.sandboxes,commands:$.commands}).onConflictDoUpdate({target:C.id,set:{worktree:$.worktree,vcs:$.vcs??null,name:$.name,icon_url:$.icon?.url,icon_color:$.icon?.color,time_updated:$.time.updated,time_initialized:$.time.initialized,sandboxes:$.sandboxes,commands:$.commands}}).run()),y.id!==F.global)yield*e((U)=>U.update(gn).set({project_id:y.id}).where(Pn(Y(gn.project_id,F.global),Y(gn.directory,y.worktree))).run());return yield*T($),{project:$,sandbox:y.sandbox}}),K=r.fn("Project.discover")(function*(t){if(t.vcs!=="git")return;if(t.icon?.override)return;if(t.icon?.url)return;let Q=(yield*n.glob("**/favicon.{ico,png,svg,jpg,jpeg,webp}",{cwd:t.worktree,absolute:!0,include:"file"}).pipe(r.orDie)).sort((Nn,W)=>Nn.length-W.length)[0];if(!Q)return;let L=yield*n.stat(Q).pipe(r.orDie);if(Number(L.size)>me)return;let $=yield*n.readFile(Q).pipe(r.orDie),U=Buffer.from($).toString("base64"),en=`data:${q.mimeType(Q)};base64,${U}`;yield*B({projectID:t.id,icon:{url:en}})}),R=r.fn("Project.list")(function*(){return yield*e((t)=>t.select().from(C).all().map(pn))}),S=r.fn("Project.get")(function*(t){let y=yield*e((Q)=>Q.select().from(C).where(Y(C.id,t)).get());return y?pn(y):void 0}),B=r.fn("Project.update")(function*(t){let y=yield*e((L)=>L.update(C).set({name:t.name,icon_url:t.icon?.url,icon_color:t.icon?.color,commands:t.commands,time_updated:Date.now()}).where(Y(C.id,t.projectID)).returning().get());if(!y)throw Error(`Project not found: ${t.projectID}`);let Q=pn(y);return yield*T(Q),Q}),l=r.fn("Project.initGit")(function*(t){if(t.project.vcs==="git")return t.project;if(!(yield*r.sync(()=>Mo("git"))))throw Error("Git is not installed");let y=yield*_(["init","--quiet"],{cwd:t.directory});if(y.code!==0)throw Error(y.stderr.trim()||y.text.trim()||"Failed to initialize git repository");let{project:Q}=yield*E(t.directory);return Q}),d=r.fn("Project.setInitialized")(function*(t){yield*e((y)=>y.update(C).set({time_initialized:Date.now()}).where(Y(C.id,t)).run())}),u=r.fn("Project.sandboxes")(function*(t){let y=yield*e((L)=>L.select().from(C).where(Y(C.id,t)).get());if(!y)return[];let Q=pn(y);return yield*r.forEach(Q.sandboxes,(L)=>n.isDir(L).pipe(r.orDie,r.map(($)=>$?L:void 0)),{concurrency:16}).pipe(r.map((L)=>L.filter(($)=>$!==void 0)))}),N=r.fnUntraced(function*(t,y){let Q=yield*e((L)=>L.update(C).set({sandboxes:y,time_updated:Date.now()}).where(Y(C.id,t)).returning().get());if(!Q)throw Error(`Project not found: ${t}`);yield*T(pn(Q))}),m=r.fn("Project.addSandbox")(function*(t,y){let Q=yield*e(($)=>$.select().from(C).where(Y(C.id,t)).get());if(!Q)throw Error(`Project not found: ${t}`);let L=[...Q.sandboxes];if(!L.includes(y))L.push(y);yield*N(t,L)}),f=r.fn("Project.removeSandbox")(function*(t,y){let Q=yield*e(($)=>$.select().from(C).where(Y(C.id,t)).get());if(!Q)throw Error(`Project not found: ${t}`);let L=Q.sandboxes.filter(($)=>$!==y);yield*N(t,L)});return Cn.of({fromDirectory:E,discover:K,list:R,get:S,update:B,initGit:l,setInitialized:d,sandboxes:u,addSandbox:m,removeSandbox:f})})),Ko=Jt.pipe(a.provide(oo),a.provide(q.defaultLayer),a.provide(Bt.layer));function ge(){return Ln.use((n)=>n.select().from(C).all().map((o)=>pn(o)))}function ue(n){let o=Ln.use((i)=>i.select().from(C).where(Y(C.id,n)).get());if(!o)return;return pn(o)}function _e(n){Ln.use((o)=>o.update(C).set({time_initialized:Date.now()}).where(Y(C.id,n)).run())}import{parse as Ne}from"path";var rn=un.create("instance");xt(()=>rn.use());var tn=new Map,pe=Kt(Cn,Ko),se=new Set(["/etc","/proc","/sys","/dev","/boot","/root","/var","/private/etc","/private/var"]);function Ae(n){if(n===Ne(n).root)return"filesystem root is not a valid project directory";for(let o of se)if(n===o||q.contains(o,n))return"target is a protected system directory";return null}function Te(n){let o=Ae(n);if(o)throw Error("Access denied: "+o)}var Xn={all:void 0};function Ht(n){return Zn(async()=>{let o=n.project&&n.worktree?{directory:n.directory,worktree:n.worktree,project:n.project}:await pe.runPromise((i)=>i.fromDirectory(n.directory)).then(({project:i,sandbox:_})=>({directory:n.directory,worktree:_,project:i}));return await rn.provide(o,async()=>{await n.init?.()}),o})}function Mt(n,o){let i=o.catch((_)=>{if(tn.get(n)===i)tn.delete(n);throw _});return tn.set(n,i),i}var on={async provide(n){let o=q.resolve(n.directory);Te(o);let i=tn.get(o);if(!i)V.Default.info("creating instance",{directory:o}),i=Mt(o,Ht({directory:o,init:n.init}));let _=await i;return rn.provide(_,async()=>{return n.fn()})},get current(){return rn.use()},get directory(){return rn.use().directory},get worktree(){return rn.use().worktree},get project(){return rn.use().project},containsPath(n,o){let i=o??on;if(q.contains(i.directory,n))return!0;if(i.worktree==="/")return!1;return q.contains(i.worktree,n)},bind(n){let o=rn.use();return(...i)=>rn.provide(o,()=>n(...i))},restore(n,o){return rn.provide(n,o)},async reload(n){let o=q.resolve(n.directory);V.Default.info("reloading instance",{directory:o}),await Co(o),tn.delete(o);let i=Mt(o,Ht({...n,directory:o}));return Un.emit("event",{directory:o,project:n.project?.id,workspace:sn.workspaceID,payload:{type:"server.instance.disposed",properties:{directory:o}}}),await i},async dispose(){let{directory:n,project:o}=on;V.Default.info("disposing instance",{directory:n}),await Co(n),tn.delete(n),Un.emit("event",{directory:n,project:o.id,workspace:sn.workspaceID,payload:{type:"server.instance.disposed",properties:{directory:n}}})},async disposeAll(){if(Xn.all)return Xn.all;return Xn.all=Zn(async()=>{V.Default.info("disposing all instances");let n=[...tn.entries()];for(let[o,i]of n){if(tn.get(o)!==i)continue;let _=await i.catch((e)=>{V.Default.warn("instance dispose failed",{key:o,error:e});return});if(!_){if(tn.get(o)===i)tn.delete(o);continue}if(tn.get(o)!==i)continue;await rn.provide(_,async()=>{await on.dispose()})}}).finally(()=>{Xn.all=void 0}),Xn.all}};var Rt="~qitqode/InstanceState",$e=(n)=>{try{return on.bind(n)}catch(_){if(!(_ instanceof un.NotFound))throw _}let o=dn.getCurrent(),i=o?Dn.getReferenceUnsafe(o.context,Yn):void 0;if(!i)return n;return(..._)=>on.restore(i,()=>n(..._))},Ro=r.gen(function*(){return(yield*Yn)??on.current}),Be=r.gen(function*(){return(yield*ro)??sn.workspaceID}),io=r.map(Ro,(n)=>n.directory),Qe=(n)=>r.gen(function*(){let o=yield*Hn.make({capacity:Number.POSITIVE_INFINITY,lookup:()=>r.gen(function*(){return yield*n(yield*Ro)})}),i=_t((_)=>r.runPromise(Hn.invalidate(o,_).pipe(r.provide(Et))));return yield*r.addFinalizer(()=>r.sync(i)),{[Rt]:Rt,cache:o}}),Eo=(n)=>r.gen(function*(){return yield*Hn.get(n.cache,yield*io)}),De=(n,o)=>r.map(Eo(n),o),Ie=(n,o)=>r.flatMap(Eo(n),o),le=(n)=>r.gen(function*(){return yield*Hn.has(n.cache,yield*io)}),Le=(n)=>r.gen(function*(){return yield*Hn.invalidate(n.cache,yield*io)});var Pt={};$n(Pt,{make:()=>de});function St(n,o,i){if(n&&o!==void 0)return sn.restore(o,()=>on.restore(n,i));if(n)return on.restore(n,i);if(o!==void 0)return sn.restore(o,i);return i()}function de(){return r.gen(function*(){let n=yield*r.context(),i=(yield*Yn)??(()=>{try{return on.current}catch(p){if(!(p instanceof un.NotFound))throw p}})(),_=(yield*ro)??sn.workspaceID,e=(p)=>Wt(p,{instance:i,workspace:_}),T=(p)=>e(p).pipe(r.provide(n));return{promise:(p)=>St(i,_,()=>r.runPromise(T(p))),fork:(p)=>St(i,_,()=>r.runFork(T(p)))}})}var Ut={};$n(Ut,{make:()=>Ge,Cancelled:()=>zn});class zn extends s.TaggedErrorClass()("RunnerCancelled",{}){}var Ge=(n,o)=>{let i=An.makeUnsafe({_tag:"Idle"}),_=o?.onIdle??r.void,e=o?.onBusy??r.void,T=o?.onInterrupt,p=0,O=()=>An.getUnsafe(i),H=()=>{return p+=1,p},E=(m,f)=>kn.isFailure(f)&&So.hasInterruptsOnly(f.cause)?_n.fail(m,new zn).pipe(r.asVoid):_n.done(m,f).pipe(r.asVoid),K=()=>An.modify(i,(m)=>[m._tag==="Idle"?_:r.void,m]).pipe(r.flatten),R=(m,f,t)=>An.modify(i,(y)=>[r.gen(function*(){if(y._tag==="Running"&&y.run.id===m)yield*_;yield*E(f,t)}),y._tag==="Running"&&y.run.id===m?{_tag:"Idle"}:y]).pipe(r.flatten),S=(m,f)=>r.gen(function*(){let t=H(),y=yield*m.pipe(r.onExit((Q)=>R(t,f,Q)),r.forkIn(n));return{id:t,done:f,fiber:y}}),B=(m)=>An.modifyEffect(i,r.fnUntraced(function*(f){if(f._tag==="Shell"&&f.shell.id===m)return[_,{_tag:"Idle"}];if(f._tag==="ShellThenRun"&&f.shell.id===m){let t=yield*S(f.run.work,f.run.done);return[r.void,{_tag:"Running",run:t}]}return[r.void,f]})).pipe(r.flatten),l=(m)=>dn.interrupt(m.fiber),d=(m)=>An.modifyEffect(i,r.fnUntraced(function*(f){switch(f._tag){case"Running":case"ShellThenRun":if(o?.onReentryWarn)yield*o.onReentryWarn({label:o.label??"(unlabeled)",existingRunId:f.run.id});return[_n.await(f.run.done),f];case"Shell":{let t={id:H(),done:yield*_n.make(),work:m};return[_n.await(t.done),{_tag:"ShellThenRun",shell:f.shell,run:t}]}case"Idle":{let t=yield*_n.make(),y=yield*S(m,t);return[_n.await(t),{_tag:"Running",run:y}]}}})).pipe(r.flatten,r.catch((f)=>f instanceof zn?T??r.die(f):r.fail(f))),u=(m)=>An.modifyEffect(i,r.fnUntraced(function*(f){if(f._tag!=="Idle")return[r.sync(()=>{if(o?.busy)o.busy();throw Error("Runner is busy")}),f];yield*e;let t=H(),y=yield*m.pipe(r.ensuring(B(t)),r.forkChild),Q={id:t,fiber:y};return[r.gen(function*(){let L=yield*dn.await(y);if(kn.isSuccess(L))return L.value;if(So.hasInterruptsOnly(L.cause)&&T)return yield*T;return yield*r.failCause(L.cause)}),{_tag:"Shell",shell:Q}]})).pipe(r.flatten),N=An.modify(i,(m)=>{switch(m._tag){case"Idle":return[r.void,m];case"Running":return[r.gen(function*(){yield*dn.interrupt(m.run.fiber);let f=yield*dn.await(m.run.fiber);yield*E(m.run.done,f),yield*_n.await(m.run.done).pipe(r.exit,r.asVoid),yield*K()}),{_tag:"Idle"}];case"Shell":return[r.gen(function*(){yield*l(m.shell),yield*K()}),{_tag:"Idle"}];case"ShellThenRun":return[r.gen(function*(){yield*_n.fail(m.run.done,new zn).pipe(r.asVoid),yield*l(m.shell),yield*K()}),{_tag:"Idle"}]}}).pipe(r.flatten);return{get state(){return O()},get busy(){return O()._tag!=="Idle"},ensureRunning:d,startShell:u,cancel:N}};import{Database as Je}from"bun:sqlite";function Xt(n){let o=new Je(n,{create:!0});return Zt({client:o})}var Ce=eo.create("NotFoundError",b.object({message:b.string()})),Yt=V.create({service:"db"});function zt(){if(["latest","beta","prod"].includes(Wo)||nn.QITQODE_DISABLE_CHANNEL_DB)return to.join(Bn.Path.data,"qitqode.db");let n=Wo.replace(/[^a-zA-Z0-9._-]/g,"-");return to.join(Bn.Path.data,`qitqode-${n}.db`)}var Po=Zn(()=>{if(nn.QITQODE_DB){if(nn.QITQODE_DB===":memory:"||to.isAbsolute(nn.QITQODE_DB))return nn.QITQODE_DB;return to.join(Bn.Path.data,nn.QITQODE_DB)}return zt()}),Mn=vt(()=>{Yt.info("opening database",{path:Po});let n=Xt(Po);n.run("PRAGMA journal_mode = WAL"),n.run("PRAGMA synchronous = NORMAL"),n.run("PRAGMA busy_timeout = 5000"),n.run("PRAGMA cache_size = -64000"),n.run("PRAGMA foreign_keys = ON"),n.run("PRAGMA wal_checkpoint(PASSIVE)");let o=[{sql:"CREATE TABLE `project` (\n\t`id` text PRIMARY KEY,\n\t`worktree` text NOT NULL,\n\t`vcs` text,\n\t`name` text,\n\t`icon_url` text,\n\t`icon_color` text,\n\t`time_created` integer NOT NULL,\n\t`time_updated` integer NOT NULL,\n\t`time_initialized` integer,\n\t`sandboxes` text NOT NULL\n);\n--> statement-breakpoint\nCREATE TABLE `message` (\n\t`id` text PRIMARY KEY,\n\t`session_id` text NOT NULL,\n\t`time_created` integer NOT NULL,\n\t`time_updated` integer NOT NULL,\n\t`data` text NOT NULL,\n\tCONSTRAINT `fk_message_session_id_session_id_fk` FOREIGN KEY (`session_id`) REFERENCES `session`(`id`) ON DELETE CASCADE\n);\n--> statement-breakpoint\nCREATE TABLE `part` (\n\t`id` text PRIMARY KEY,\n\t`message_id` text NOT NULL,\n\t`session_id` text NOT NULL,\n\t`time_created` integer NOT NULL,\n\t`time_updated` integer NOT NULL,\n\t`data` text NOT NULL,\n\tCONSTRAINT `fk_part_message_id_message_id_fk` FOREIGN KEY (`message_id`) REFERENCES `message`(`id`) ON DELETE CASCADE\n);\n--> statement-breakpoint\nCREATE TABLE `permission` (\n\t`project_id` text PRIMARY KEY,\n\t`time_created` integer NOT NULL,\n\t`time_updated` integer NOT NULL,\n\t`data` text NOT NULL,\n\tCONSTRAINT `fk_permission_project_id_project_id_fk` FOREIGN KEY (`project_id`) REFERENCES `project`(`id`) ON DELETE CASCADE\n);\n--> statement-breakpoint\nCREATE TABLE `session` (\n\t`id` text PRIMARY KEY,\n\t`project_id` text NOT NULL,\n\t`parent_id` text,\n\t`slug` text NOT NULL,\n\t`directory` text NOT NULL,\n\t`title` text NOT NULL,\n\t`version` text NOT NULL,\n\t`share_url` text,\n\t`summary_additions` integer,\n\t`summary_deletions` integer,\n\t`summary_files` integer,\n\t`summary_diffs` text,\n\t`revert` text,\n\t`permission` text,\n\t`time_created` integer NOT NULL,\n\t`time_updated` integer NOT NULL,\n\t`time_compacting` integer,\n\t`time_archived` integer,\n\tCONSTRAINT `fk_session_project_id_project_id_fk` FOREIGN KEY (`project_id`) REFERENCES `project`(`id`) ON DELETE CASCADE\n);\n--> statement-breakpoint\nCREATE TABLE `todo` (\n\t`session_id` text NOT NULL,\n\t`content` text NOT NULL,\n\t`status` text NOT NULL,\n\t`priority` text NOT NULL,\n\t`position` integer NOT NULL,\n\t`time_created` integer NOT NULL,\n\t`time_updated` integer NOT NULL,\n\tCONSTRAINT `todo_pk` PRIMARY KEY(`session_id`, `position`),\n\tCONSTRAINT `fk_todo_session_id_session_id_fk` FOREIGN KEY (`session_id`) REFERENCES `session`(`id`) ON DELETE CASCADE\n);\n--> statement-breakpoint\nCREATE TABLE `session_share` (\n\t`session_id` text PRIMARY KEY,\n\t`id` text NOT NULL,\n\t`secret` text NOT NULL,\n\t`url` text NOT NULL,\n\t`time_created` integer NOT NULL,\n\t`time_updated` integer NOT NULL,\n\tCONSTRAINT `fk_session_share_session_id_session_id_fk` FOREIGN KEY (`session_id`) REFERENCES `session`(`id`) ON DELETE CASCADE\n);\n--> statement-breakpoint\nCREATE INDEX `message_session_idx` ON `message` (`session_id`);--> statement-breakpoint\nCREATE INDEX `part_message_idx` ON `part` (`message_id`);--> statement-breakpoint\nCREATE INDEX `part_session_idx` ON `part` (`session_id`);--> statement-breakpoint\nCREATE INDEX `session_project_idx` ON `session` (`project_id`);--> statement-breakpoint\nCREATE INDEX `session_parent_idx` ON `session` (`parent_id`);--> statement-breakpoint\nCREATE INDEX `todo_session_idx` ON `todo` (`session_id`);",timestamp:1769552633000,name:"20260127222353_familiar_lady_ursula"},{sql:"ALTER TABLE `project` ADD `commands` text;",timestamp:1770830228000,name:"20260211171708_add_project_commands"},{sql:"CREATE TABLE `control_account` (\n\t`email` text NOT NULL,\n\t`url` text NOT NULL,\n\t`access_token` text NOT NULL,\n\t`refresh_token` text NOT NULL,\n\t`token_expiry` integer,\n\t`active` integer NOT NULL,\n\t`time_created` integer NOT NULL,\n\t`time_updated` integer NOT NULL,\n\tCONSTRAINT `control_account_pk` PRIMARY KEY(`email`, `url`)\n);\n",timestamp:1770993676000,name:"20260213144116_wakeful_the_professor"},{sql:"CREATE TABLE `workspace` (\n\t`id` text PRIMARY KEY,\n\t`branch` text,\n\t`project_id` text NOT NULL,\n\t`config` text NOT NULL,\n\tCONSTRAINT `fk_workspace_project_id_project_id_fk` FOREIGN KEY (`project_id`) REFERENCES `project`(`id`) ON DELETE CASCADE\n);\n",timestamp:1772056728000,name:"20260225215848_workspace"},{sql:"ALTER TABLE `session` ADD `workspace_id` text;--> statement-breakpoint\nCREATE INDEX `session_workspace_idx` ON `session` (`workspace_id`);",timestamp:1772228279000,name:"20260227213759_add_session_workspace_id"},{sql:"CREATE TABLE `account` (\n\t`id` text PRIMARY KEY,\n\t`email` text NOT NULL,\n\t`url` text NOT NULL,\n\t`access_token` text NOT NULL,\n\t`refresh_token` text NOT NULL,\n\t`token_expiry` integer,\n\t`selected_org_id` text,\n\t`time_created` integer NOT NULL,\n\t`time_updated` integer NOT NULL\n);\n--> statement-breakpoint\nCREATE TABLE `account_state` (\n\t`id` integer PRIMARY KEY NOT NULL,\n\t`active_account_id` text,\n\tFOREIGN KEY (`active_account_id`) REFERENCES `account`(`id`) ON UPDATE no action ON DELETE set null\n);\n",timestamp:1772310750000,name:"20260228203230_blue_harpoon"},{sql:"ALTER TABLE `workspace` ADD `type` text NOT NULL;--> statement-breakpoint\nALTER TABLE `workspace` ADD `name` text;--> statement-breakpoint\nALTER TABLE `workspace` ADD `directory` text;--> statement-breakpoint\nALTER TABLE `workspace` ADD `extra` text;--> statement-breakpoint\nALTER TABLE `workspace` DROP COLUMN `config`;",timestamp:1772579546000,name:"20260303231226_add_workspace_fields"},{sql:"ALTER TABLE `account_state` ADD `active_org_id` text;--> statement-breakpoint\nUPDATE `account_state` SET `active_org_id` = (SELECT `selected_org_id` FROM `account` WHERE `account`.`id` = `account_state`.`active_account_id`);--> statement-breakpoint\nALTER TABLE `account` DROP COLUMN `selected_org_id`;\n",timestamp:1773097200000,name:"20260309230000_move_org_to_state"},{sql:"DROP INDEX IF EXISTS `message_session_idx`;--> statement-breakpoint\nDROP INDEX IF EXISTS `part_message_idx`;--> statement-breakpoint\nCREATE INDEX `message_session_time_created_id_idx` ON `message` (`session_id`,`time_created`,`id`);--> statement-breakpoint\nCREATE INDEX `part_message_id_id_idx` ON `part` (`message_id`,`id`);",timestamp:1773290071000,name:"20260312043431_session_message_cursor"},{sql:"CREATE TABLE `event_sequence` (\n\t`aggregate_id` text PRIMARY KEY,\n\t`seq` integer NOT NULL\n);\n--> statement-breakpoint\nCREATE TABLE `event` (\n\t`id` text PRIMARY KEY,\n\t`aggregate_id` text NOT NULL,\n\t`seq` integer NOT NULL,\n\t`type` text NOT NULL,\n\t`data` text NOT NULL,\n\tCONSTRAINT `fk_event_aggregate_id_event_sequence_aggregate_id_fk` FOREIGN KEY (`aggregate_id`) REFERENCES `event_sequence`(`aggregate_id`) ON DELETE CASCADE\n);\n",timestamp:1774309702000,name:"20260323234822_events"},{sql:"PRAGMA foreign_keys=OFF;--> statement-breakpoint\nCREATE TABLE `__new_workspace` (\n\t`id` text PRIMARY KEY,\n\t`type` text NOT NULL,\n\t`name` text DEFAULT '' NOT NULL,\n\t`branch` text,\n\t`directory` text,\n\t`extra` text,\n\t`project_id` text NOT NULL,\n\tCONSTRAINT `fk_workspace_project_id_project_id_fk` FOREIGN KEY (`project_id`) REFERENCES `project`(`id`) ON DELETE CASCADE\n);\n--> statement-breakpoint\nINSERT INTO `__new_workspace`(`id`, `type`, `branch`, `name`, `directory`, `extra`, `project_id`) SELECT `id`, `type`, `branch`, `name`, `directory`, `extra`, `project_id` FROM `workspace`;--> statement-breakpoint\nDROP TABLE `workspace`;--> statement-breakpoint\nALTER TABLE `__new_workspace` RENAME TO `workspace`;--> statement-breakpoint\nPRAGMA foreign_keys=ON;",timestamp:1775843113000,name:"20260410174513_workspace-name"},{sql:"CREATE TABLE `session_entry` (\n\t`id` text PRIMARY KEY,\n\t`session_id` text NOT NULL,\n\t`type` text NOT NULL,\n\t`time_created` integer NOT NULL,\n\t`time_updated` integer NOT NULL,\n\t`data` text NOT NULL,\n\tCONSTRAINT `fk_session_entry_session_id_session_id_fk` FOREIGN KEY (`session_id`) REFERENCES `session`(`id`) ON DELETE CASCADE\n);\n--> statement-breakpoint\nCREATE INDEX `session_entry_session_idx` ON `session_entry` (`session_id`);--> statement-breakpoint\nCREATE INDEX `session_entry_session_type_idx` ON `session_entry` (`session_id`,`type`);--> statement-breakpoint\nCREATE INDEX `session_entry_time_created_idx` ON `session_entry` (`time_created`);",timestamp:1776103196000,name:"20260413175956_chief_energizer"},{sql:"ALTER TABLE `session` ADD `context_from` text;--> statement-breakpoint\nALTER TABLE `session` ADD `context_watermark` text;--> statement-breakpoint\nCREATE INDEX `session_context_from_idx` ON `session` (`context_from`);\n",timestamp:1776873600000,name:"20260422160000_context_inheritance"},{sql:"CREATE TABLE `task_registry` (\n `id` text PRIMARY KEY,\n `parent_session_id` text NOT NULL REFERENCES `session`(`id`) ON DELETE CASCADE,\n `status` text NOT NULL,\n `agent` text NOT NULL,\n `description` text NOT NULL,\n `context_mode` text NOT NULL,\n `background` integer NOT NULL,\n `last_turn_time` integer NOT NULL,\n `turn_count` integer NOT NULL DEFAULT 0,\n `error` text,\n `time_completed` integer,\n `time_created` integer NOT NULL,\n `time_updated` integer NOT NULL\n);--> statement-breakpoint\nCREATE INDEX `task_registry_parent_idx` ON `task_registry` (`parent_session_id`);--> statement-breakpoint\nCREATE INDEX `task_registry_status_idx` ON `task_registry` (`status`);--> statement-breakpoint\nCREATE INDEX `task_registry_status_last_turn_idx` ON `task_registry` (`status`, `last_turn_time`);\n",timestamp:1776877200000,name:"20260422170000_task_registry"},{sql:"DROP INDEX IF EXISTS `session_entry_session_idx`;--> statement-breakpoint\nDROP INDEX IF EXISTS `session_entry_session_type_idx`;--> statement-breakpoint\nDROP INDEX IF EXISTS `session_entry_time_created_idx`;--> statement-breakpoint\nDROP TABLE IF EXISTS `session_entry`;\n",timestamp:1776956061000,name:"20260423145421_remove_session_entry"},{sql:"DROP INDEX IF EXISTS `task_registry_parent_idx`;--> statement-breakpoint\nDROP INDEX IF EXISTS `task_registry_status_idx`;--> statement-breakpoint\nDROP INDEX IF EXISTS `task_registry_status_last_turn_idx`;--> statement-breakpoint\nALTER TABLE `task_registry` RENAME TO `actor_registry`;--> statement-breakpoint\nCREATE INDEX `actor_registry_parent_idx` ON `actor_registry` (`parent_session_id`);--> statement-breakpoint\nCREATE INDEX `actor_registry_status_idx` ON `actor_registry` (`status`);--> statement-breakpoint\nCREATE INDEX `actor_registry_status_last_turn_idx` ON `actor_registry` (`status`, `last_turn_time`);\n",timestamp:1778803200000,name:"20260515000000_actor_rename"},{sql:"CREATE TABLE `memory_fts` (\n `path` text PRIMARY KEY NOT NULL,\n `scope` text NOT NULL,\n `scope_id` text DEFAULT '' NOT NULL,\n `type` text NOT NULL,\n `body` text NOT NULL,\n `fingerprint` text NOT NULL,\n `last_indexed_at` integer NOT NULL\n);\n--> statement-breakpoint\nCREATE INDEX `memory_fts_scope_idx` ON `memory_fts` (`scope`, `scope_id`);\n--> statement-breakpoint\nCREATE INDEX `memory_fts_type_idx` ON `memory_fts` (`type`);\n--> statement-breakpoint\nCREATE VIRTUAL TABLE `memory_fts_idx` USING fts5(\n body,\n content='memory_fts',\n content_rowid='rowid',\n tokenize='unicode61 remove_diacritics 1'\n);\n--> statement-breakpoint\nCREATE TRIGGER `memory_fts_ai` AFTER INSERT ON `memory_fts` BEGIN\n INSERT INTO `memory_fts_idx`(rowid, body) VALUES (NEW.rowid, NEW.body);\nEND;\n--> statement-breakpoint\nCREATE TRIGGER `memory_fts_ad` AFTER DELETE ON `memory_fts` BEGIN\n DELETE FROM `memory_fts_idx` WHERE rowid = OLD.rowid;\nEND;\n--> statement-breakpoint\nCREATE TRIGGER `memory_fts_au` AFTER UPDATE ON `memory_fts` BEGIN\n DELETE FROM `memory_fts_idx` WHERE rowid = OLD.rowid;\n INSERT INTO `memory_fts_idx`(rowid, body) VALUES (NEW.rowid, NEW.body);\nEND;\n",timestamp:1778806800000,name:"20260515010000_memory_fts"},{sql:"CREATE TABLE `task` (\n `id` text NOT NULL,\n `session_id` text NOT NULL REFERENCES `session`(`id`) ON DELETE CASCADE,\n `parent_task_id` text,\n `kind` text NOT NULL DEFAULT 'user',\n `status` text NOT NULL,\n `focus` integer NOT NULL DEFAULT 0,\n `summary` text NOT NULL,\n `created_at` integer NOT NULL,\n `last_event_at` integer NOT NULL,\n `ended_at` integer,\n `cleanup_after` integer,\n PRIMARY KEY (`session_id`, `id`)\n);--> statement-breakpoint\nCREATE INDEX `task_session_idx` ON `task` (`session_id`);--> statement-breakpoint\nCREATE INDEX `task_parent_idx` ON `task` (`session_id`, `parent_task_id`);--> statement-breakpoint\nCREATE INDEX `task_status_idx` ON `task` (`status`);--> statement-breakpoint\nCREATE INDEX `task_kind_idx` ON `task` (`kind`);--> statement-breakpoint\nCREATE UNIQUE INDEX `task_focus_per_session_idx` ON `task` (`session_id`) WHERE focus = 1;--> statement-breakpoint\nCREATE TABLE `task_event` (\n `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,\n `session_id` text NOT NULL REFERENCES `session`(`id`) ON DELETE CASCADE,\n `task_id` text NOT NULL,\n `at` integer NOT NULL,\n `kind` text NOT NULL,\n `summary` text,\n FOREIGN KEY (`session_id`, `task_id`) REFERENCES `task`(`session_id`, `id`) ON DELETE CASCADE\n);--> statement-breakpoint\nCREATE INDEX `task_event_task_idx` ON `task_event` (`session_id`, `task_id`, `at`);\n",timestamp:1778810400000,name:"20260515020000_user_task"},{sql:"ALTER TABLE `session` ADD `last_checkpoint_message_id` text;\n",timestamp:1779148800000,name:"20260519000000_last_checkpoint_message_id"},{sql:"ALTER TABLE `message` ADD `agent_id` text;--> statement-breakpoint\nCREATE INDEX `message_session_agent_idx` ON `message` (`session_id`,`agent_id`,`id`);\n",timestamp:1779321600000,name:"20260521000000_message_agent_id"},{sql:"DROP TABLE `actor_registry`;--> statement-breakpoint\nCREATE TABLE `actor_registry` (\n `session_id` text NOT NULL REFERENCES `session`(`id`) ON DELETE CASCADE,\n `actor_id` text NOT NULL,\n `mode` text NOT NULL,\n `parent_actor_id` text,\n `status` text NOT NULL,\n `agent` text NOT NULL,\n `description` text NOT NULL,\n `context_mode` text NOT NULL,\n `context_watermark` text,\n `background` integer NOT NULL,\n `tools` text,\n `last_turn_time` integer NOT NULL,\n `turn_count` integer NOT NULL DEFAULT 0,\n `error` text,\n `time_completed` integer,\n `time_created` integer NOT NULL,\n `time_updated` integer NOT NULL,\n PRIMARY KEY (`session_id`, `actor_id`)\n);--> statement-breakpoint\nCREATE INDEX `actor_registry_session_agent_idx` ON `actor_registry` (`session_id`, `agent`);--> statement-breakpoint\nCREATE INDEX `actor_registry_session_parent_idx` ON `actor_registry` (`session_id`, `parent_actor_id`);--> statement-breakpoint\nCREATE INDEX `actor_registry_status_idx` ON `actor_registry` (`status`);--> statement-breakpoint\nCREATE INDEX `actor_registry_status_last_turn_idx` ON `actor_registry` (`status`, `last_turn_time`);\n",timestamp:1779321660000,name:"20260521000100_actor_registry_v6"},{sql:"DROP TRIGGER IF EXISTS `memory_fts_ai`;--> statement-breakpoint\nDROP TRIGGER IF EXISTS `memory_fts_ad`;--> statement-breakpoint\nDROP TRIGGER IF EXISTS `memory_fts_au`;--> statement-breakpoint\nDROP TABLE IF EXISTS `memory_fts_idx`;--> statement-breakpoint\nDROP TABLE IF EXISTS `memory_fts`;--> statement-breakpoint\nCREATE TABLE `memory_fts` (\n `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,\n `path` text NOT NULL UNIQUE,\n `scope` text NOT NULL,\n `scope_id` text DEFAULT '' NOT NULL,\n `type` text NOT NULL,\n `body` text NOT NULL,\n `fingerprint` text NOT NULL,\n `last_indexed_at` integer NOT NULL\n);--> statement-breakpoint\nCREATE INDEX `memory_fts_scope_idx` ON `memory_fts` (`scope`, `scope_id`);--> statement-breakpoint\nCREATE INDEX `memory_fts_type_idx` ON `memory_fts` (`type`);--> statement-breakpoint\nCREATE VIRTUAL TABLE `memory_fts_idx` USING fts5(\n body,\n content='memory_fts',\n content_rowid='id',\n tokenize='unicode61 remove_diacritics 1'\n);--> statement-breakpoint\nCREATE TRIGGER `memory_fts_ai` AFTER INSERT ON `memory_fts` BEGIN\n INSERT INTO `memory_fts_idx`(rowid, body) VALUES (NEW.id, NEW.body);\nEND;--> statement-breakpoint\nCREATE TRIGGER `memory_fts_ad` AFTER DELETE ON `memory_fts` BEGIN\n DELETE FROM `memory_fts_idx` WHERE rowid = OLD.id;\nEND;--> statement-breakpoint\nCREATE TRIGGER `memory_fts_au` AFTER UPDATE ON `memory_fts` BEGIN\n DELETE FROM `memory_fts_idx` WHERE rowid = OLD.id;\n INSERT INTO `memory_fts_idx`(rowid, body) VALUES (NEW.id, NEW.body);\nEND;\n",timestamp:1779325200000,name:"20260521010000_memory_fts_v6"},{sql:"-- Fix v6.1 trigger pattern: external content FTS5 vtab requires the 'delete'\n-- magic command to remove OLD body's tokens, NOT a plain DELETE FROM the vtab.\n-- The previous DELETE FROM pattern was contentless-mode syntax misapplied to\n-- external-content mode, leaving stale tokens accumulating until vtab corrupts.\nDROP TRIGGER IF EXISTS `memory_fts_ai`;--> statement-breakpoint\nDROP TRIGGER IF EXISTS `memory_fts_ad`;--> statement-breakpoint\nDROP TRIGGER IF EXISTS `memory_fts_au`;--> statement-breakpoint\nCREATE TRIGGER `memory_fts_ai` AFTER INSERT ON `memory_fts` BEGIN\n INSERT INTO `memory_fts_idx`(rowid, body) VALUES (NEW.id, NEW.body);\nEND;--> statement-breakpoint\nCREATE TRIGGER `memory_fts_ad` AFTER DELETE ON `memory_fts` BEGIN\n INSERT INTO `memory_fts_idx`(`memory_fts_idx`, rowid, body) VALUES('delete', OLD.id, OLD.body);\nEND;--> statement-breakpoint\nCREATE TRIGGER `memory_fts_au` AFTER UPDATE ON `memory_fts` BEGIN\n INSERT INTO `memory_fts_idx`(`memory_fts_idx`, rowid, body) VALUES('delete', OLD.id, OLD.body);\n INSERT INTO `memory_fts_idx`(rowid, body) VALUES (NEW.id, NEW.body);\nEND;\n",timestamp:1779328800000,name:"20260521020000_memory_fts_triggers"},{sql:"UPDATE `message` SET `agent_id` = 'main' WHERE `agent_id` IS NULL;--> statement-breakpoint\nCREATE TABLE `message_new` (\n `id` text PRIMARY KEY NOT NULL,\n `session_id` text NOT NULL REFERENCES `session`(`id`) ON DELETE CASCADE,\n `agent_id` text NOT NULL DEFAULT 'main',\n `time_created` integer NOT NULL,\n `time_updated` integer NOT NULL,\n `data` text NOT NULL\n);--> statement-breakpoint\nINSERT INTO `message_new` SELECT `id`, `session_id`, COALESCE(`agent_id`, 'main'), `time_created`, `time_updated`, `data` FROM `message`;--> statement-breakpoint\nDROP TABLE `message`;--> statement-breakpoint\nALTER TABLE `message_new` RENAME TO `message`;--> statement-breakpoint\nCREATE INDEX `message_session_time_created_id_idx` ON `message` (`session_id`,`time_created`,`id`);--> statement-breakpoint\nCREATE INDEX `message_session_agent_idx` ON `message` (`session_id`,`agent_id`,`id`);\n",timestamp:1779753600000,name:"20260526000000_agent_id_main"},{sql:"ALTER TABLE `actor_registry` ADD COLUMN `last_outcome` text;--> statement-breakpoint\nALTER TABLE `actor_registry` ADD COLUMN `lifecycle` text NOT NULL DEFAULT 'ephemeral';--> statement-breakpoint\nALTER TABLE `actor_registry` RENAME COLUMN `error` TO `last_error`;--> statement-breakpoint\nUPDATE `actor_registry` SET `last_outcome` = 'success' WHERE `status` = 'completed';--> statement-breakpoint\nUPDATE `actor_registry` SET `last_outcome` = 'failure' WHERE `status` = 'failed';--> statement-breakpoint\nUPDATE `actor_registry` SET `last_outcome` = 'cancelled' WHERE `status` = 'cancelled';--> statement-breakpoint\nUPDATE `actor_registry` SET `status` = 'idle' WHERE `status` IN ('completed','failed','cancelled');--> statement-breakpoint\nUPDATE `actor_registry` SET `lifecycle` = CASE `mode` WHEN 'peer' THEN 'persistent' WHEN 'main' THEN 'persistent' ELSE 'ephemeral' END;\n",timestamp:1779840000000,name:"20260527000000_actor_lifecycle"},{sql:"CREATE TABLE `inbox` (\n `id` text PRIMARY KEY NOT NULL,\n `receiver_session_id` text NOT NULL REFERENCES `session`(`id`) ON DELETE CASCADE,\n `receiver_actor_id` text NOT NULL,\n `sender_session_id` text,\n `sender_actor_id` text,\n `type` text NOT NULL DEFAULT 'text',\n `content` text NOT NULL,\n `created_at` integer NOT NULL\n);--> statement-breakpoint\nCREATE INDEX `inbox_receiver_idx` ON `inbox` (`receiver_session_id`,`receiver_actor_id`,`id`);--> statement-breakpoint\nCREATE INDEX `inbox_created_idx` ON `inbox` (`created_at`);\n",timestamp:1779840060000,name:"20260527000100_inbox"},{sql:"-- todo: drop priority column\nALTER TABLE `todo` DROP COLUMN `priority`;\n--> statement-breakpoint\n\n-- task: drop focus-dependent index before dropping its column\nDROP INDEX `task_focus_per_session_idx`;\n--> statement-breakpoint\nDROP INDEX `task_kind_idx`;\n--> statement-breakpoint\nALTER TABLE `task` DROP COLUMN `focus`;\n--> statement-breakpoint\nALTER TABLE `task` DROP COLUMN `kind`;\n--> statement-breakpoint\n\n-- migrate status values: proposed/active -> open\nUPDATE `task` SET `status` = 'open' WHERE `status` IN ('proposed', 'active');\n",timestamp:1780012800000,name:"20260529000000_task_todo_redesign"},{sql:"ALTER TABLE `task` ADD COLUMN `owner` text;\n",timestamp:1780444800000,name:"20260603000000_task_in_progress_owner"},{sql:"CREATE TABLE `workflow_run` (\n `id` text PRIMARY KEY NOT NULL,\n `session_id` text NOT NULL REFERENCES `session`(`id`) ON DELETE CASCADE,\n `name` text NOT NULL,\n `status` text NOT NULL,\n `running` integer NOT NULL DEFAULT 0,\n `succeeded` integer NOT NULL DEFAULT 0,\n `failed` integer NOT NULL DEFAULT 0,\n `current_phase` text,\n `parent_actor_id` text,\n `args` text,\n `error` text,\n `time_created` integer NOT NULL,\n `time_updated` integer NOT NULL\n);--> statement-breakpoint\nCREATE INDEX `workflow_run_session_idx` ON `workflow_run` (`session_id`);--> statement-breakpoint\nCREATE INDEX `workflow_run_status_idx` ON `workflow_run` (`status`);\n",timestamp:1780444800000,name:"20260603000000_workflow_run"},{sql:"ALTER TABLE `workflow_run` ADD COLUMN `script_sha` text;\n",timestamp:1780531200000,name:"20260604000000_workflow_script_sha"},{sql:"CREATE TABLE `claude_import` (\n `source_uuid` text PRIMARY KEY NOT NULL,\n `session_id` text NOT NULL,\n `source_path` text NOT NULL,\n `source_mtime` integer NOT NULL,\n `time_imported` integer NOT NULL\n);\n",timestamp:1780876800000,name:"20260608000000_claude_import"},{sql:"ALTER TABLE `claude_import` ADD `message_ids` text;\n",timestamp:1780880400000,name:"20260608010000_claude_import_message_ids"},{sql:"CREATE TABLE `history_fts` (\n `part_id` text PRIMARY KEY NOT NULL,\n `session_id` text NOT NULL,\n `message_id` text NOT NULL,\n `project_id` text NOT NULL,\n `kind` text NOT NULL,\n `tool_name` text,\n `body` text NOT NULL,\n `time_created` integer NOT NULL\n);--> statement-breakpoint\nCREATE INDEX `history_fts_session_idx` ON `history_fts` (`session_id`, `time_created`);--> statement-breakpoint\nCREATE INDEX `history_fts_project_idx` ON `history_fts` (`project_id`, `time_created`);--> statement-breakpoint\nCREATE INDEX `history_fts_message_idx` ON `history_fts` (`message_id`);--> statement-breakpoint\nCREATE VIRTUAL TABLE `history_fts_idx` USING fts5(\n body,\n content='history_fts',\n content_rowid='rowid',\n tokenize='unicode61 remove_diacritics 1'\n);--> statement-breakpoint\nCREATE TRIGGER `history_fts_ai` AFTER INSERT ON `history_fts` BEGIN\n INSERT INTO `history_fts_idx`(rowid, body) VALUES (NEW.rowid, NEW.body);\nEND;--> statement-breakpoint\nCREATE TRIGGER `history_fts_ad` AFTER DELETE ON `history_fts` BEGIN\n INSERT INTO `history_fts_idx`(`history_fts_idx`, rowid, body) VALUES('delete', OLD.rowid, OLD.body);\nEND;--> statement-breakpoint\nCREATE TRIGGER `history_fts_au` AFTER UPDATE ON `history_fts` BEGIN\n INSERT INTO `history_fts_idx`(`history_fts_idx`, rowid, body) VALUES('delete', OLD.rowid, OLD.body);\n INSERT INTO `history_fts_idx`(rowid, body) VALUES (NEW.rowid, NEW.body);\nEND;\n",timestamp:1780963200000,name:"20260609000000_history_fts"},{sql:"ALTER TABLE `workflow_run` ADD COLUMN `agent_timeout_ms` integer;\n",timestamp:1781046000000,name:"20260609230000_workflow_agent_timeout"},{sql:"CREATE TABLE `external_import` (\n `source` text NOT NULL,\n `source_key` text NOT NULL,\n `session_id` text NOT NULL,\n `source_path` text NOT NULL,\n `source_mtime` integer NOT NULL,\n `time_imported` integer NOT NULL,\n `message_ids` text,\n PRIMARY KEY (`source`, `source_key`)\n);\n\nINSERT INTO `external_import` (`source`, `source_key`, `session_id`, `source_path`, `source_mtime`, `time_imported`, `message_ids`)\nSELECT 'cc', `source_uuid`, `session_id`, `source_path`, `source_mtime`, `time_imported`, `message_ids`\nFROM `claude_import`;\n\nDROP TABLE `claude_import`;\n",timestamp:1781222400000,name:"20260612000000_external_import"}];if(o.length>0){if(Yt.info("applying migrations",{count:o.length,mode:"bundled"}),nn.QITQODE_SKIP_MIGRATIONS)for(let i of o)i.sql="select 1;";ho(n,o)}return n});function He(){Mn().$client.close(),Mn.reset()}var Vn=un.create("database");function Me(n){try{return n(Vn.use().tx)}catch(o){if(o instanceof un.NotFound){let i=[],_=Vn.provide({effects:i,tx:Mn()},()=>n(Mn()));for(let e of i)e();return _}throw o}}function xe(n){let o=vn.bind(n);try{Vn.use().effects.push(o)}catch{o()}}function Ke(n,o){try{return n(Vn.use().tx)}catch(i){if(i instanceof un.NotFound){let _=[],e=vn.bind((p)=>Vn.provide({tx:p,effects:_},()=>n(p))),T=Mn().transaction(e,{behavior:o?.behavior});for(let p of _)p();return T}throw i}}var jt={};$n(jt,{layer:()=>ct,defaultLayer:()=>we,Service:()=>yo,NotFoundError:()=>Yo});import v from"path";var xn={};$n(xn,{layer:()=>wt,defaultLayer:()=>Se,Service:()=>mo,Git:()=>xn});var Re=["--no-optional-locks","-c","core.autocrlf=false","-c","core.fsmonitor=false","-c","core.longpaths=true","-c","core.symlinks=true","-c","core.quotepath=false"],qn=(n)=>n.text().trim(),Uo=(n)=>n.split("\x00").filter(Boolean),Ee=(n)=>({exitCode:1,text:()=>"",stdout:Buffer.alloc(0),stderr:Buffer.from(n instanceof Error?n.message:String(n))}),kt=(n)=>{if(n==="??")return"added";if(n.includes("U"))return"modified";if(n.includes("A")&&!n.includes("D"))return"added";if(n.includes("D")&&!n.includes("A"))return"deleted";return"modified"};class mo extends Dn.Service()("@qitqode/Git"){}var wt=a.effect(mo,r.gen(function*(){let n=yield*no.ChildProcessSpawner,o=r.fn("Git.run")(function*(u,N){let m=Vt.make("git",[...Re,...u],{cwd:N.cwd,env:N.env,extendEnv:!0,stdin:"ignore",stdout:"pipe",stderr:"pipe"}),f=yield*qt(n,m);return{exitCode:f.code,text:()=>f.text,stdout:Buffer.from(f.text),stderr:Buffer.from(f.stderr)}},r.scoped,r.catch((u)=>r.succeed(Ee(u)))),i=r.fn("Git.text")(function*(u,N){return(yield*o(u,N)).text()}),_=r.fn("Git.lines")(function*(u,N){return(yield*i(u,N)).split(/\r?\n/).map((m)=>m.trim()).filter(Boolean)}),e=r.fnUntraced(function*(u){return yield*_(["for-each-ref","--format=%(refname:short)","refs/heads"],{cwd:u})}),T=r.fnUntraced(function*(u,N){let m=yield*o(["config","init.defaultBranch"],{cwd:u}),f=qn(m);if(!f||!N.includes(f))return;return{name:f,ref:f}}),p=r.fnUntraced(function*(u){let N=yield*_(["remote"],{cwd:u});if(N.includes("origin"))return"origin";if(N.length===1)return N[0];if(N.includes("upstream"))return"upstream";return N[0]}),O=r.fn("Git.branch")(function*(u){let N=yield*o(["symbolic-ref","--quiet","--short","HEAD"],{cwd:u});if(N.exitCode!==0)return;return qn(N)||void 0}),H=r.fn("Git.prefix")(function*(u){let N=yield*o(["rev-parse","--show-prefix"],{cwd:u});if(N.exitCode!==0)return"";return qn(N)}),E=r.fn("Git.defaultBranch")(function*(u){let N=yield*p(u);if(N){let t=yield*o(["symbolic-ref",`refs/remotes/${N}/HEAD`],{cwd:u});if(t.exitCode===0){let y=qn(t).replace(/^refs\/remotes\//,""),Q=y.startsWith(`${N}/`)?y.slice(`${N}/`.length):"";if(Q)return{name:Q,ref:y}}}let m=yield*e(u),f=yield*T(u,m);if(f)return f;if(m.includes("main"))return{name:"main",ref:"main"};if(m.includes("master"))return{name:"master",ref:"master"}}),K=r.fn("Git.hasHead")(function*(u){return(yield*o(["rev-parse","--verify","HEAD"],{cwd:u})).exitCode===0}),R=r.fn("Git.mergeBase")(function*(u,N,m="HEAD"){let f=yield*o(["merge-base",N,m],{cwd:u});if(f.exitCode!==0)return;return qn(f)||void 0}),S=r.fn("Git.show")(function*(u,N,m,f=""){let t=f?`${f}${m}`:m,y=yield*o(["show",`${N}:${t}`],{cwd:u});if(y.exitCode!==0)return"";if(y.stdout.includes(0))return"";return y.text()}),B=r.fn("Git.status")(function*(u){return Uo(yield*i(["status","--porcelain=v1","--untracked-files=all","--no-renames","-z","--","."],{cwd:u})).flatMap((N)=>{let m=N.slice(3);if(!m)return[];let f=N.slice(0,2);return[{file:m,code:f,status:kt(f)}]})}),l=r.fn("Git.diff")(function*(u,N){let m=Uo(yield*i(["diff","--no-ext-diff","--no-renames","--name-status","-z",N,"--","."],{cwd:u}));return m.flatMap((f,t)=>{if(t%2!==0)return[];let y=m[t+1];if(!f||!y)return[];return[{file:y,code:f,status:kt(f)}]})}),d=r.fn("Git.stats")(function*(u,N){return Uo(yield*i(["diff","--no-ext-diff","--no-renames","--numstat","-z",N,"--","."],{cwd:u})).flatMap((m)=>{let f=m.indexOf("\t"),t=m.indexOf("\t",f+1);if(f===-1||t===-1)return[];let y=m.slice(t+1);if(!y)return[];let Q=m.slice(0,f),L=m.slice(f+1,t),$=Q==="-"?0:Number.parseInt(Q||"0",10),U=L==="-"?0:Number.parseInt(L||"0",10);return[{file:y,additions:Number.isFinite($)?$:0,deletions:Number.isFinite(U)?U:0}]})});return mo.of({run:o,branch:O,prefix:H,defaultBranch:E,hasHead:K,mergeBase:R,show:S,status:B,diff:l,stats:d})})),Se=wt.pipe(a.provide(oo));var Tn=V.create({service:"storage"}),Yo=eo.create("NotFoundError",b.object({message:b.string()})),We=s.Struct({path:s.optional(s.Struct({root:s.optional(s.String)}))}),Pe=s.Struct({id:s.String}),Ue=s.Struct({id:s.String}),Ze=s.Struct({additions:s.Number,deletions:s.Number}),Xe=s.Struct({id:s.String,projectID:s.String,summary:s.Struct({diffs:s.Array(Ze)})}),Ye=s.decodeUnknownOption(We),ve=s.decodeUnknownOption(Pe),ze=s.decodeUnknownOption(Ue),ke=s.decodeUnknownOption(Xe);class yo extends Dn.Service()("@qitqode/Storage"){}function Ve(n,o){return v.join(n,...o)+".json"}function Zo(n){if(!n||typeof n!=="object")return!1;if("code"in n&&n.code==="ENOENT")return!0;if("reason"in n&&n.reason&&typeof n.reason==="object"&&"_tag"in n.reason)return n.reason._tag==="NotFound";return!1}function qe(n){let o=Number.parseInt(n,10);return Number.isNaN(o)?0:o}var Ft=[r.fn("Storage.migration.1")(function*(n,o,i){let _=v.resolve(n,"../project");if(!(yield*o.isDir(_)))return;let e=yield*o.glob("*",{cwd:_,include:"all"});for(let T of e){let p=v.join(_,T);if(!(yield*o.isDir(p)))continue;Tn.info(`migrating project ${T}`);let O=T,H="/";if(O!=="global"){for(let R of yield*o.glob("storage/session/message/*/*.json",{cwd:p,absolute:!0})){let S=Ye(yield*o.readJson(R),{onExcessProperty:"preserve"}),B=wn.isSome(S)?S.value.path?.root:void 0;if(!B)continue;H=B;break}if(!H)continue;if(!(yield*o.isDir(H)))continue;let E=yield*i.run(["rev-list","--max-parents=0","--all"],{cwd:H}),[K]=E.text().split(`
5
+ `).filter(Boolean).map((R)=>R.trim()).toSorted();if(!K)continue;O=K,yield*o.writeWithDirs(v.join(n,"project",O+".json"),JSON.stringify({id:K,vcs:"git",worktree:H,time:{created:Date.now(),initialized:Date.now()}},null,2)),Tn.info(`migrating sessions for project ${O}`);for(let R of yield*o.glob("storage/session/info/*.json",{cwd:p,absolute:!0})){let S=v.join(n,"session",O,v.basename(R));Tn.info("copying",{sessionFile:R,dest:S});let B=yield*o.readJson(R),l=ve(B,{onExcessProperty:"preserve"});if(yield*o.writeWithDirs(S,JSON.stringify(B,null,2)),wn.isNone(l))continue;Tn.info(`migrating messages for session ${l.value.id}`);for(let d of yield*o.glob(`storage/session/message/${l.value.id}/*.json`,{cwd:p,absolute:!0})){let u=v.join(n,"message",l.value.id,v.basename(d));Tn.info("copying",{msgFile:d,dest:u});let N=yield*o.readJson(d),m=ze(N,{onExcessProperty:"preserve"});if(yield*o.writeWithDirs(u,JSON.stringify(N,null,2)),wn.isNone(m))continue;Tn.info(`migrating parts for message ${m.value.id}`);for(let f of yield*o.glob(`storage/session/part/${l.value.id}/${m.value.id}/*.json`,{cwd:p,absolute:!0})){let t=v.join(n,"part",m.value.id,v.basename(f)),y=yield*o.readJson(f);Tn.info("copying",{partFile:f,dest:t}),yield*o.writeWithDirs(t,JSON.stringify(y,null,2))}}}}}}),r.fn("Storage.migration.2")(function*(n,o){for(let i of yield*o.glob("session/*/*.json",{cwd:n,absolute:!0})){let _=yield*o.readJson(i),e=ke(_,{onExcessProperty:"preserve"});if(wn.isNone(e))continue;let T=e.value.summary.diffs;yield*o.writeWithDirs(v.join(n,"session_diff",e.value.id+".json"),JSON.stringify(T,null,2)),yield*o.writeWithDirs(v.join(n,"session",e.value.projectID,e.value.id+".json"),JSON.stringify({..._,summary:{additions:T.reduce((p,O)=>p+O.additions,0),deletions:T.reduce((p,O)=>p+O.deletions,0)}},null,2))}})],ct=a.effect(yo,r.gen(function*(){let n=yield*q.Service,o=yield*xn.Service,i=yield*Xo.make({lookup:()=>Kn.make(),idleTimeToLive:0}),_=yield*r.cached(r.gen(function*(){let B=v.join(Bn.Path.data,"storage"),l=v.join(B,"migration"),d=yield*n.readFileString(l).pipe(r.map(qe),r.catchIf(Zo,()=>r.succeed(0)),r.orElseSucceed(()=>0));for(let u=d;u<Ft.length;u++){Tn.info("running migration",{index:u});let N=Ft[u],m=yield*r.exit(N(B,n,o));if(kn.isFailure(m)){Tn.error("failed to run migration",{index:u,cause:m.cause});break}yield*n.writeWithDirs(l,String(u+1))}return{dir:B}})),e=(B)=>r.fail(new Yo({message:`Resource not found: ${B}`})),T=(B,l)=>l.pipe(r.catchIf(Zo,()=>e(B))),p=r.fnUntraced(function*(B,l){yield*n.writeWithDirs(B,JSON.stringify(l,null,2))}),O=(B,l)=>r.scoped(r.gen(function*(){let d=Ve((yield*_).dir,B);return yield*l(d,yield*Xo.get(i,d))})),H=r.fn("Storage.remove")(function*(B){yield*O(B,(l,d)=>Kn.withWriteLock(d,n.remove(l).pipe(r.catchIf(Zo,()=>r.void))))}),E=(B)=>r.gen(function*(){return yield*O(B,(d,u)=>Kn.withReadLock(u,T(d,n.readJson(d))))}),K=(B,l)=>r.gen(function*(){return yield*O(B,(u,N)=>Kn.withWriteLock(N,r.gen(function*(){let m=yield*T(u,n.readJson(u));return l(m),yield*p(u,m),m})))}),R=(B,l)=>r.gen(function*(){yield*O(B,(d,u)=>Kn.withWriteLock(u,p(d,l)))}),S=r.fn("Storage.list")(function*(B){let l=(yield*_).dir,d=v.join(l,...B);return(yield*n.glob("**/*",{cwd:d,include:"file"}).pipe(r.catch(()=>r.succeed([])))).map((N)=>[...B,...N.slice(0,-5).split(v.sep)]).toSorted((N,m)=>N.join("/").localeCompare(m.join("/")))});return yo.of({remove:H,read:E,update:K,write:R,list:S})})),we=ct.pipe(a.provide(q.defaultLayer),a.provide(xn.defaultLayer));export{Un as ql,_t as rl,Zn as sl,mn as tl,C as ul,gn as vl,fo as wl,zo as xl,ko as yl,Vo as zl,qo as Al,Fo as Bl,uo as Cl,Ln as Dl,xn as El,Yo as Fl,jt as Gl,F as Hl,Ho as Il,At as Jl,_e as Kl,Ct as Ll,Ae as Ml,on as Nl,vn as Ol,de as Pl,Pt as Ql,Ut as Rl};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{xP as w}from"./chunk-sh03ka27.js";async function M(z,Z,{concurrency:q=Number.POSITIVE_INFINITY,stopOnError:A=!0,signal:J}={}){return new Promise((B,Q)=>{if(z[Symbol.iterator]===void 0&&z[Symbol.asyncIterator]===void 0)throw TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof z})`);if(typeof Z!=="function")throw TypeError("Mapper function is required");if(!(Number.isSafeInteger(q)&&q>=1||q===Number.POSITIVE_INFINITY))throw TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${q}\` (${typeof q})`);let X=[],$=[],K=new Map,N=!1,F=!1,T=!1,G=0,f=0,_=z[Symbol.iterator]===void 0?z[Symbol.asyncIterator]():z[Symbol.iterator](),D=()=>{Y(J.reason)},E=()=>{J?.removeEventListener("abort",D)},O=(H)=>{B(H),E()},Y=(H)=>{N=!0,F=!0,Q(H),E()};if(J){if(J.aborted)Y(J.reason);J.addEventListener("abort",D,{once:!0})}let V=async()=>{if(F)return;let H=await _.next(),h=f;if(f++,H.done){if(T=!0,G===0&&!F){if(!A&&$.length>0){Y(AggregateError($));return}if(F=!0,K.size===0){O(X);return}let U=[];for(let[W,P]of X.entries()){if(K.get(W)===L)continue;U.push(P)}O(U)}return}G++,(async()=>{try{let U=await H.value;if(F)return;let W=await Z(U,h);if(W===L)K.set(h,W);X[h]=W,G--,await V()}catch(U){if(A)Y(U);else{$.push(U),G--;try{await V()}catch(W){Y(W)}}}})()};(async()=>{for(let H=0;H<q;H++){try{await V()}catch(h){Y(h);break}if(T||N)break}})()})}function I(z,Z,{concurrency:q=Number.POSITIVE_INFINITY,backpressure:A=q}={}){if(z[Symbol.iterator]===void 0&&z[Symbol.asyncIterator]===void 0)throw TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof z})`);if(typeof Z!=="function")throw TypeError("Mapper function is required");if(!(Number.isSafeInteger(q)&&q>=1||q===Number.POSITIVE_INFINITY))throw TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${q}\` (${typeof q})`);if(!(Number.isSafeInteger(A)&&A>=q||A===Number.POSITIVE_INFINITY))throw TypeError(`Expected \`backpressure\` to be an integer from \`concurrency\` (${q}) and up or \`Infinity\`, got \`${A}\` (${typeof A})`);return{async*[Symbol.asyncIterator](){let J=z[Symbol.asyncIterator]===void 0?z[Symbol.iterator]():z[Symbol.asyncIterator](),B=[],Q=0,X=!1,$=0;function K(){if(X||!(Q<q&&B.length<A))return;Q++;let N=(async()=>{let{done:F,value:T}=await J.next();if(F)return Q--,{done:!0};K();try{let G=await Z(await T,$++);if(Q--,G===L){let f=B.indexOf(N);if(f>0)B.splice(f,1)}return K(),{done:!1,value:G}}catch(G){return Q--,X=!0,{error:G}}})();B.push(N)}K();while(B.length>0){let{error:N,done:F,value:T}=await B[0];if(B.shift(),N)throw N;if(F)return;if(K(),T===L)continue;yield T}}}}var L;var C=w(()=>{L=Symbol("skip")});C();export{L as pMapSkip,I as pMapIterable,M as default};
2
+ import{bR as w}from"./chunk-pfx8ts02.js";async function M(z,Z,{concurrency:q=Number.POSITIVE_INFINITY,stopOnError:A=!0,signal:J}={}){return new Promise((B,Q)=>{if(z[Symbol.iterator]===void 0&&z[Symbol.asyncIterator]===void 0)throw TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof z})`);if(typeof Z!=="function")throw TypeError("Mapper function is required");if(!(Number.isSafeInteger(q)&&q>=1||q===Number.POSITIVE_INFINITY))throw TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${q}\` (${typeof q})`);let X=[],$=[],K=new Map,N=!1,F=!1,T=!1,G=0,f=0,_=z[Symbol.iterator]===void 0?z[Symbol.asyncIterator]():z[Symbol.iterator](),D=()=>{Y(J.reason)},E=()=>{J?.removeEventListener("abort",D)},O=(H)=>{B(H),E()},Y=(H)=>{N=!0,F=!0,Q(H),E()};if(J){if(J.aborted)Y(J.reason);J.addEventListener("abort",D,{once:!0})}let V=async()=>{if(F)return;let H=await _.next(),h=f;if(f++,H.done){if(T=!0,G===0&&!F){if(!A&&$.length>0){Y(AggregateError($));return}if(F=!0,K.size===0){O(X);return}let U=[];for(let[W,P]of X.entries()){if(K.get(W)===L)continue;U.push(P)}O(U)}return}G++,(async()=>{try{let U=await H.value;if(F)return;let W=await Z(U,h);if(W===L)K.set(h,W);X[h]=W,G--,await V()}catch(U){if(A)Y(U);else{$.push(U),G--;try{await V()}catch(W){Y(W)}}}})()};(async()=>{for(let H=0;H<q;H++){try{await V()}catch(h){Y(h);break}if(T||N)break}})()})}function I(z,Z,{concurrency:q=Number.POSITIVE_INFINITY,backpressure:A=q}={}){if(z[Symbol.iterator]===void 0&&z[Symbol.asyncIterator]===void 0)throw TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof z})`);if(typeof Z!=="function")throw TypeError("Mapper function is required");if(!(Number.isSafeInteger(q)&&q>=1||q===Number.POSITIVE_INFINITY))throw TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${q}\` (${typeof q})`);if(!(Number.isSafeInteger(A)&&A>=q||A===Number.POSITIVE_INFINITY))throw TypeError(`Expected \`backpressure\` to be an integer from \`concurrency\` (${q}) and up or \`Infinity\`, got \`${A}\` (${typeof A})`);return{async*[Symbol.asyncIterator](){let J=z[Symbol.asyncIterator]===void 0?z[Symbol.iterator]():z[Symbol.asyncIterator](),B=[],Q=0,X=!1,$=0;function K(){if(X||!(Q<q&&B.length<A))return;Q++;let N=(async()=>{let{done:F,value:T}=await J.next();if(F)return Q--,{done:!0};K();try{let G=await Z(await T,$++);if(Q--,G===L){let f=B.indexOf(N);if(f>0)B.splice(f,1)}return K(),{done:!1,value:G}}catch(G){return Q--,X=!0,{error:G}}})();B.push(N)}K();while(B.length>0){let{error:N,done:F,value:T}=await B[0];if(B.shift(),N)throw N;if(F)return;if(K(),T===L)continue;yield T}}}}var L;var C=w(()=>{L=Symbol("skip")});C();export{L as pMapSkip,I as pMapIterable,M as default};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import"./chunk-pfx8ts02.js";var F="./tree-sitter-markdown-411r6y9b.wasm";export{F as default};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import"./chunk-sh03ka27.js";var e={"ui.sessionReview.title":"\uC138\uC158 \uBCC0\uACBD \uC0AC\uD56D","ui.sessionReview.title.lastTurn":"\uB9C8\uC9C0\uB9C9 \uD134 \uBCC0\uACBD \uC0AC\uD56D","ui.sessionReview.diffStyle.unified":"\uD1B5\uD569 \uBCF4\uAE30","ui.sessionReview.diffStyle.split":"\uBD84\uD560 \uBCF4\uAE30","ui.sessionReview.openFile":"\uD30C\uC77C \uC5F4\uAE30","ui.sessionReview.selection.line":"{{line}}\uBC88 \uC904","ui.sessionReview.selection.lines":"{{start}}-{{end}}\uBC88 \uC904","ui.sessionReview.expandAll":"\uBAA8\uB450 \uD3BC\uCE58\uAE30","ui.sessionReview.collapseAll":"\uBAA8\uB450 \uC811\uAE30","ui.sessionReview.change.added":"\uCD94\uAC00\uB428","ui.sessionReview.change.removed":"\uC0AD\uC81C\uB428","ui.sessionReview.change.modified":"\uC218\uC815\uB428","ui.sessionReview.image.loading":"\uB85C\uB529 \uC911...","ui.sessionReview.image.placeholder":"\uC774\uBBF8\uC9C0","ui.sessionReview.largeDiff.title":"\uCC28\uC774\uAC00 \uB108\uBB34 \uCEE4\uC11C \uB80C\uB354\uB9C1\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","ui.sessionReview.largeDiff.meta":"\uC81C\uD55C: {{limit}} \uBCC0\uACBD \uC904. \uD604\uC7AC: {{current}} \uBCC0\uACBD \uC904.","ui.sessionReview.largeDiff.renderAnyway":"\uADF8\uB798\uB3C4 \uB80C\uB354\uB9C1","ui.fileMedia.kind.image":"\uC774\uBBF8\uC9C0","ui.fileMedia.kind.audio":"\uC624\uB514\uC624","ui.fileMedia.state.removed":"{{kind}} \uC81C\uAC70\uB428","ui.fileMedia.state.loading":"{{kind}} \uB85C\uB4DC \uC911...","ui.fileMedia.state.error":"{{kind}} \uB85C\uB4DC \uC624\uB958","ui.fileMedia.state.unavailable":"{{kind}} \uC0AC\uC6A9 \uBD88\uAC00","ui.fileMedia.binary.title":"\uBC14\uC774\uB108\uB9AC \uD30C\uC77C","ui.fileMedia.binary.description.path":"{{path}}\uC740(\uB294) \uBC14\uC774\uB108\uB9AC \uD30C\uC77C\uC774\uBBC0\uB85C \uD45C\uC2DC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.","ui.fileMedia.binary.description.default":"\uBC14\uC774\uB108\uB9AC \uD30C\uC77C\uC774\uBBC0\uB85C \uD45C\uC2DC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.","ui.lineComment.label.prefix":"","ui.lineComment.label.suffix":"\uC5D0 \uB313\uAE00 \uB2EC\uAE30","ui.lineComment.editorLabel.prefix":"","ui.lineComment.editorLabel.suffix":"\uC5D0 \uB313\uAE00 \uC791\uC131 \uC911","ui.lineComment.placeholder":"\uB313\uAE00 \uCD94\uAC00","ui.lineComment.submit":"\uB313\uAE00","ui.sessionTurn.steps.show":"\uB2E8\uACC4 \uD45C\uC2DC","ui.sessionTurn.steps.hide":"\uB2E8\uACC4 \uC228\uAE30\uAE30","ui.sessionTurn.summary.response":"\uC751\uB2F5","ui.sessionTurn.diff.showMore":"\uBCC0\uACBD \uC0AC\uD56D \uB354 \uBCF4\uAE30 ({{count}})","ui.sessionTurn.retry.retrying":"\uC7AC\uC2DC\uB3C4 \uC911","ui.sessionTurn.retry.inSeconds":"{{seconds}}\uCD08 \uD6C4","ui.sessionTurn.retry.attempt":"{{attempt}}\uBC88\uC9F8","ui.sessionTurn.retry.attemptLine":"{{line}} - {{attempt}}\uBC88\uC9F8","ui.sessionTurn.retry.geminiHot":"gemini\uAC00 \uD604\uC7AC \uACFC\uBD80\uD558 \uC0C1\uD0DC\uC785\uB2C8\uB2E4","ui.sessionTurn.error.freeUsageExceeded":"\uBB34\uB8CC \uC0AC\uC6A9\uB7C9 \uCD08\uACFC","ui.sessionTurn.error.addQredits":"\uD06C\uB808\uB527 \uCD94\uAC00","ui.sessionTurn.status.delegating":"\uC791\uC5C5 \uC704\uC784 \uC911","ui.sessionTurn.status.planning":"\uB2E4\uC74C \uB2E8\uACC4 \uACC4\uD68D \uC911","ui.sessionTurn.status.gatheringContext":"\uD0D0\uC0C9 \uC911","ui.sessionTurn.status.gatheredContext":"\uD0D0\uC0C9\uB428","ui.sessionTurn.status.searchingCodebase":"\uCF54\uB4DC\uBCA0\uC774\uC2A4 \uAC80\uC0C9 \uC911","ui.sessionTurn.status.searchingWeb":"\uC6F9 \uAC80\uC0C9 \uC911","ui.sessionTurn.status.makingEdits":"\uD3B8\uC9D1 \uC218\uD589 \uC911","ui.sessionTurn.status.runningCommands":"\uBA85\uB839\uC5B4 \uC2E4\uD589 \uC911","ui.sessionTurn.status.thinking":"\uC0DD\uAC01 \uC911","ui.sessionTurn.status.thinkingWithTopic":"\uC0DD\uAC01 \uC911 - {{topic}}","ui.sessionTurn.status.gatheringThoughts":"\uC0DD\uAC01 \uC815\uB9AC \uC911","ui.sessionTurn.status.consideringNextSteps":"\uB2E4\uC74C \uB2E8\uACC4 \uACE0\uB824 \uC911","ui.messagePart.questions.dismissed":"\uC9C8\uBB38 \uBB34\uC2DC\uB428","ui.messagePart.compaction":"\uC138\uC158 \uC555\uCD95\uB428","ui.messagePart.context.read.one":"{{count}}\uAC1C \uC77D\uC74C","ui.messagePart.context.read.other":"{{count}}\uAC1C \uC77D\uC74C","ui.messagePart.context.search.one":"{{count}}\uAC1C \uAC80\uC0C9","ui.messagePart.context.search.other":"{{count}}\uAC1C \uAC80\uC0C9","ui.messagePart.context.list.one":"{{count}}\uAC1C \uBAA9\uB85D","ui.messagePart.context.list.other":"{{count}}\uAC1C \uBAA9\uB85D","ui.messagePart.diagnostic.error":"\uC624\uB958","ui.messagePart.title.edit":"\uD3B8\uC9D1","ui.messagePart.title.write":"\uC791\uC131","ui.messagePart.option.typeOwnAnswer":"\uC9C1\uC811 \uB2F5\uBCC0 \uC785\uB825","ui.messagePart.review.title":"\uB2F5\uBCC0 \uAC80\uD1A0","ui.list.loading":"\uB85C\uB529 \uC911","ui.list.empty":"\uACB0\uACFC \uC5C6\uC74C","ui.list.clearFilter":"\uD544\uD130 \uC9C0\uC6B0\uAE30","ui.list.emptyWithFilter.prefix":"\uB2E4\uC74C\uC5D0 \uB300\uD55C \uACB0\uACFC \uC5C6\uC74C: ","ui.list.emptyWithFilter.suffix":"","ui.messageNav.newMessage":"\uC0C8 \uBA54\uC2DC\uC9C0","ui.textField.copyToClipboard":"\uD074\uB9BD\uBCF4\uB4DC\uC5D0 \uBCF5\uC0AC","ui.textField.copyLink":"\uB9C1\uD06C \uBCF5\uC0AC","ui.textField.copied":"\uBCF5\uC0AC\uB428","ui.imagePreview.alt":"\uC774\uBBF8\uC9C0 \uBBF8\uB9AC\uBCF4\uAE30","ui.scrollView.ariaLabel":"\uC2A4\uD06C\uB864 \uAC00\uB2A5\uD55C \uCF58\uD150\uCE20","ui.tool.read":"\uC77D\uAE30","ui.tool.loaded":"\uB85C\uB4DC\uB428","ui.tool.list":"\uBAA9\uB85D","ui.tool.glob":"Glob","ui.tool.grep":"Grep","ui.tool.webfetch":"\uC6F9 \uAC00\uC838\uC624\uAE30","ui.tool.websearch":"\uC6F9 \uAC80\uC0C9","ui.tool.codesearch":"\uCF54\uB4DC \uAC80\uC0C9","ui.tool.shell":"\uC178","ui.tool.patch":"\uD328\uCE58","ui.tool.todos":"\uD560 \uC77C","ui.tool.todos.read":"\uD560 \uC77C \uC77D\uAE30","ui.tool.questions":"\uC9C8\uBB38","ui.tool.agent":"{{type}} \uC5D0\uC774\uC804\uD2B8","ui.tool.agent.default":"\uC5D0\uC774\uC804\uD2B8","ui.common.file.one":"\uD30C\uC77C","ui.common.file.other":"\uD30C\uC77C","ui.common.question.one":"\uC9C8\uBB38","ui.common.question.other":"\uC9C8\uBB38","ui.common.add":"\uCD94\uAC00","ui.common.back":"\uB4A4\uB85C","ui.common.cancel":"\uCDE8\uC18C","ui.common.confirm":"\uD655\uC778","ui.common.dismiss":"\uB2EB\uAE30","ui.common.close":"\uB2EB\uAE30","ui.common.next":"\uB2E4\uC74C","ui.common.submit":"\uC81C\uCD9C","ui.permission.deny":"\uAC70\uBD80","ui.permission.allowAlways":"\uD56D\uC0C1 \uD5C8\uC6A9","ui.permission.allowOnce":"\uD55C \uBC88\uB9CC \uD5C8\uC6A9","ui.message.expand":"\uBA54\uC2DC\uC9C0 \uD3BC\uCE58\uAE30","ui.message.collapse":"\uBA54\uC2DC\uC9C0 \uC811\uAE30","ui.message.copy":"\uBCF5\uC0AC","ui.message.copyMessage":"\uBA54\uC2DC\uC9C0 \uBCF5\uC0AC","ui.message.forkMessage":"\uC0C8 \uC138\uC158\uC73C\uB85C \uBD84\uAE30","ui.message.revertMessage":"\uC774 \uC2DC\uC810\uC73C\uB85C \uCD08\uAE30\uD654","ui.message.copyResponse":"\uC751\uB2F5 \uBCF5\uC0AC","ui.message.copied":"\uBCF5\uC0AC\uB428!","ui.message.interrupted":"\uC911\uB2E8\uB428","ui.message.queued":"\uB300\uAE30 \uC911","ui.message.attachment.alt":"\uCCA8\uBD80 \uD30C\uC77C","ui.patch.action.deleted":"\uC0AD\uC81C\uB428","ui.patch.action.created":"\uC0DD\uC131\uB428","ui.patch.action.moved":"\uC774\uB3D9\uB428","ui.patch.action.patched":"\uD328\uCE58\uB428","ui.question.subtitle.answered":"{{count}}\uAC1C \uB2F5\uBCC0\uB428","ui.question.answer.none":"(\uB2F5\uBCC0 \uC5C6\uC74C)","ui.question.review.notAnswered":"(\uB2F5\uBCC0\uB418\uC9C0 \uC54A\uC74C)","ui.question.multiHint":"\uD574\uB2F9\uD558\uB294 \uD56D\uBAA9 \uBAA8\uB450 \uC120\uD0DD","ui.question.singleHint":"\uD558\uB098\uC758 \uB2F5\uBCC0\uC744 \uC120\uD0DD","ui.question.custom.placeholder":"\uB2F5\uBCC0 \uC785\uB825...","ui.fileSearch.placeholder":"\uCC3E\uAE30","ui.fileSearch.previousMatch":"\uC774\uC804 \uD56D\uBAA9","ui.fileSearch.nextMatch":"\uB2E4\uC74C \uD56D\uBAA9","ui.fileSearch.close":"\uAC80\uC0C9 \uB2EB\uAE30","ui.tool.task":"\uC791\uC5C5","ui.tool.skill":"\uC2A4\uD0AC","ui.basicTool.called":"`{{tool}}` \uD638\uCD9C\uB428","ui.toolErrorCard.failed":"\uC2E4\uD328","ui.toolErrorCard.copyError":"\uC624\uB958 \uBCF5\uC0AC","ui.message.duration.seconds":"{{count}}\uCD08","ui.message.duration.minutesSeconds":"{{minutes}}\uBD84 {{seconds}}\uCD08"};export{e as dict};
2
+ import"./chunk-pfx8ts02.js";var e={"ui.sessionReview.title":"\uC138\uC158 \uBCC0\uACBD \uC0AC\uD56D","ui.sessionReview.title.lastTurn":"\uB9C8\uC9C0\uB9C9 \uD134 \uBCC0\uACBD \uC0AC\uD56D","ui.sessionReview.diffStyle.unified":"\uD1B5\uD569 \uBCF4\uAE30","ui.sessionReview.diffStyle.split":"\uBD84\uD560 \uBCF4\uAE30","ui.sessionReview.openFile":"\uD30C\uC77C \uC5F4\uAE30","ui.sessionReview.selection.line":"{{line}}\uBC88 \uC904","ui.sessionReview.selection.lines":"{{start}}-{{end}}\uBC88 \uC904","ui.sessionReview.expandAll":"\uBAA8\uB450 \uD3BC\uCE58\uAE30","ui.sessionReview.collapseAll":"\uBAA8\uB450 \uC811\uAE30","ui.sessionReview.change.added":"\uCD94\uAC00\uB428","ui.sessionReview.change.removed":"\uC0AD\uC81C\uB428","ui.sessionReview.change.modified":"\uC218\uC815\uB428","ui.sessionReview.image.loading":"\uB85C\uB529 \uC911...","ui.sessionReview.image.placeholder":"\uC774\uBBF8\uC9C0","ui.sessionReview.largeDiff.title":"\uCC28\uC774\uAC00 \uB108\uBB34 \uCEE4\uC11C \uB80C\uB354\uB9C1\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4","ui.sessionReview.largeDiff.meta":"\uC81C\uD55C: {{limit}} \uBCC0\uACBD \uC904. \uD604\uC7AC: {{current}} \uBCC0\uACBD \uC904.","ui.sessionReview.largeDiff.renderAnyway":"\uADF8\uB798\uB3C4 \uB80C\uB354\uB9C1","ui.fileMedia.kind.image":"\uC774\uBBF8\uC9C0","ui.fileMedia.kind.audio":"\uC624\uB514\uC624","ui.fileMedia.state.removed":"{{kind}} \uC81C\uAC70\uB428","ui.fileMedia.state.loading":"{{kind}} \uB85C\uB4DC \uC911...","ui.fileMedia.state.error":"{{kind}} \uB85C\uB4DC \uC624\uB958","ui.fileMedia.state.unavailable":"{{kind}} \uC0AC\uC6A9 \uBD88\uAC00","ui.fileMedia.binary.title":"\uBC14\uC774\uB108\uB9AC \uD30C\uC77C","ui.fileMedia.binary.description.path":"{{path}}\uC740(\uB294) \uBC14\uC774\uB108\uB9AC \uD30C\uC77C\uC774\uBBC0\uB85C \uD45C\uC2DC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.","ui.fileMedia.binary.description.default":"\uBC14\uC774\uB108\uB9AC \uD30C\uC77C\uC774\uBBC0\uB85C \uD45C\uC2DC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.","ui.lineComment.label.prefix":"","ui.lineComment.label.suffix":"\uC5D0 \uB313\uAE00 \uB2EC\uAE30","ui.lineComment.editorLabel.prefix":"","ui.lineComment.editorLabel.suffix":"\uC5D0 \uB313\uAE00 \uC791\uC131 \uC911","ui.lineComment.placeholder":"\uB313\uAE00 \uCD94\uAC00","ui.lineComment.submit":"\uB313\uAE00","ui.sessionTurn.steps.show":"\uB2E8\uACC4 \uD45C\uC2DC","ui.sessionTurn.steps.hide":"\uB2E8\uACC4 \uC228\uAE30\uAE30","ui.sessionTurn.summary.response":"\uC751\uB2F5","ui.sessionTurn.diff.showMore":"\uBCC0\uACBD \uC0AC\uD56D \uB354 \uBCF4\uAE30 ({{count}})","ui.sessionTurn.retry.retrying":"\uC7AC\uC2DC\uB3C4 \uC911","ui.sessionTurn.retry.inSeconds":"{{seconds}}\uCD08 \uD6C4","ui.sessionTurn.retry.attempt":"{{attempt}}\uBC88\uC9F8","ui.sessionTurn.retry.attemptLine":"{{line}} - {{attempt}}\uBC88\uC9F8","ui.sessionTurn.retry.geminiHot":"gemini\uAC00 \uD604\uC7AC \uACFC\uBD80\uD558 \uC0C1\uD0DC\uC785\uB2C8\uB2E4","ui.sessionTurn.error.freeUsageExceeded":"\uBB34\uB8CC \uC0AC\uC6A9\uB7C9 \uCD08\uACFC","ui.sessionTurn.error.addQredits":"\uD06C\uB808\uB527 \uCD94\uAC00","ui.sessionTurn.status.delegating":"\uC791\uC5C5 \uC704\uC784 \uC911","ui.sessionTurn.status.planning":"\uB2E4\uC74C \uB2E8\uACC4 \uACC4\uD68D \uC911","ui.sessionTurn.status.gatheringContext":"\uD0D0\uC0C9 \uC911","ui.sessionTurn.status.gatheredContext":"\uD0D0\uC0C9\uB428","ui.sessionTurn.status.searchingCodebase":"\uCF54\uB4DC\uBCA0\uC774\uC2A4 \uAC80\uC0C9 \uC911","ui.sessionTurn.status.searchingWeb":"\uC6F9 \uAC80\uC0C9 \uC911","ui.sessionTurn.status.makingEdits":"\uD3B8\uC9D1 \uC218\uD589 \uC911","ui.sessionTurn.status.runningCommands":"\uBA85\uB839\uC5B4 \uC2E4\uD589 \uC911","ui.sessionTurn.status.thinking":"\uC0DD\uAC01 \uC911","ui.sessionTurn.status.thinkingWithTopic":"\uC0DD\uAC01 \uC911 - {{topic}}","ui.sessionTurn.status.gatheringThoughts":"\uC0DD\uAC01 \uC815\uB9AC \uC911","ui.sessionTurn.status.consideringNextSteps":"\uB2E4\uC74C \uB2E8\uACC4 \uACE0\uB824 \uC911","ui.messagePart.questions.dismissed":"\uC9C8\uBB38 \uBB34\uC2DC\uB428","ui.messagePart.compaction":"\uC138\uC158 \uC555\uCD95\uB428","ui.messagePart.context.read.one":"{{count}}\uAC1C \uC77D\uC74C","ui.messagePart.context.read.other":"{{count}}\uAC1C \uC77D\uC74C","ui.messagePart.context.search.one":"{{count}}\uAC1C \uAC80\uC0C9","ui.messagePart.context.search.other":"{{count}}\uAC1C \uAC80\uC0C9","ui.messagePart.context.list.one":"{{count}}\uAC1C \uBAA9\uB85D","ui.messagePart.context.list.other":"{{count}}\uAC1C \uBAA9\uB85D","ui.messagePart.diagnostic.error":"\uC624\uB958","ui.messagePart.title.edit":"\uD3B8\uC9D1","ui.messagePart.title.write":"\uC791\uC131","ui.messagePart.option.typeOwnAnswer":"\uC9C1\uC811 \uB2F5\uBCC0 \uC785\uB825","ui.messagePart.review.title":"\uB2F5\uBCC0 \uAC80\uD1A0","ui.list.loading":"\uB85C\uB529 \uC911","ui.list.empty":"\uACB0\uACFC \uC5C6\uC74C","ui.list.clearFilter":"\uD544\uD130 \uC9C0\uC6B0\uAE30","ui.list.emptyWithFilter.prefix":"\uB2E4\uC74C\uC5D0 \uB300\uD55C \uACB0\uACFC \uC5C6\uC74C: ","ui.list.emptyWithFilter.suffix":"","ui.messageNav.newMessage":"\uC0C8 \uBA54\uC2DC\uC9C0","ui.textField.copyToClipboard":"\uD074\uB9BD\uBCF4\uB4DC\uC5D0 \uBCF5\uC0AC","ui.textField.copyLink":"\uB9C1\uD06C \uBCF5\uC0AC","ui.textField.copied":"\uBCF5\uC0AC\uB428","ui.imagePreview.alt":"\uC774\uBBF8\uC9C0 \uBBF8\uB9AC\uBCF4\uAE30","ui.scrollView.ariaLabel":"\uC2A4\uD06C\uB864 \uAC00\uB2A5\uD55C \uCF58\uD150\uCE20","ui.tool.read":"\uC77D\uAE30","ui.tool.loaded":"\uB85C\uB4DC\uB428","ui.tool.list":"\uBAA9\uB85D","ui.tool.glob":"Glob","ui.tool.grep":"Grep","ui.tool.webfetch":"\uC6F9 \uAC00\uC838\uC624\uAE30","ui.tool.websearch":"\uC6F9 \uAC80\uC0C9","ui.tool.codesearch":"\uCF54\uB4DC \uAC80\uC0C9","ui.tool.shell":"\uC178","ui.tool.patch":"\uD328\uCE58","ui.tool.todos":"\uD560 \uC77C","ui.tool.todos.read":"\uD560 \uC77C \uC77D\uAE30","ui.tool.questions":"\uC9C8\uBB38","ui.tool.agent":"{{type}} \uC5D0\uC774\uC804\uD2B8","ui.tool.agent.default":"\uC5D0\uC774\uC804\uD2B8","ui.common.file.one":"\uD30C\uC77C","ui.common.file.other":"\uD30C\uC77C","ui.common.question.one":"\uC9C8\uBB38","ui.common.question.other":"\uC9C8\uBB38","ui.common.add":"\uCD94\uAC00","ui.common.back":"\uB4A4\uB85C","ui.common.cancel":"\uCDE8\uC18C","ui.common.confirm":"\uD655\uC778","ui.common.dismiss":"\uB2EB\uAE30","ui.common.close":"\uB2EB\uAE30","ui.common.next":"\uB2E4\uC74C","ui.common.submit":"\uC81C\uCD9C","ui.permission.deny":"\uAC70\uBD80","ui.permission.allowAlways":"\uD56D\uC0C1 \uD5C8\uC6A9","ui.permission.allowOnce":"\uD55C \uBC88\uB9CC \uD5C8\uC6A9","ui.message.expand":"\uBA54\uC2DC\uC9C0 \uD3BC\uCE58\uAE30","ui.message.collapse":"\uBA54\uC2DC\uC9C0 \uC811\uAE30","ui.message.copy":"\uBCF5\uC0AC","ui.message.copyMessage":"\uBA54\uC2DC\uC9C0 \uBCF5\uC0AC","ui.message.forkMessage":"\uC0C8 \uC138\uC158\uC73C\uB85C \uBD84\uAE30","ui.message.revertMessage":"\uC774 \uC2DC\uC810\uC73C\uB85C \uCD08\uAE30\uD654","ui.message.copyResponse":"\uC751\uB2F5 \uBCF5\uC0AC","ui.message.copied":"\uBCF5\uC0AC\uB428!","ui.message.interrupted":"\uC911\uB2E8\uB428","ui.message.queued":"\uB300\uAE30 \uC911","ui.message.attachment.alt":"\uCCA8\uBD80 \uD30C\uC77C","ui.patch.action.deleted":"\uC0AD\uC81C\uB428","ui.patch.action.created":"\uC0DD\uC131\uB428","ui.patch.action.moved":"\uC774\uB3D9\uB428","ui.patch.action.patched":"\uD328\uCE58\uB428","ui.question.subtitle.answered":"{{count}}\uAC1C \uB2F5\uBCC0\uB428","ui.question.answer.none":"(\uB2F5\uBCC0 \uC5C6\uC74C)","ui.question.review.notAnswered":"(\uB2F5\uBCC0\uB418\uC9C0 \uC54A\uC74C)","ui.question.multiHint":"\uD574\uB2F9\uD558\uB294 \uD56D\uBAA9 \uBAA8\uB450 \uC120\uD0DD","ui.question.singleHint":"\uD558\uB098\uC758 \uB2F5\uBCC0\uC744 \uC120\uD0DD","ui.question.custom.placeholder":"\uB2F5\uBCC0 \uC785\uB825...","ui.fileSearch.placeholder":"\uCC3E\uAE30","ui.fileSearch.previousMatch":"\uC774\uC804 \uD56D\uBAA9","ui.fileSearch.nextMatch":"\uB2E4\uC74C \uD56D\uBAA9","ui.fileSearch.close":"\uAC80\uC0C9 \uB2EB\uAE30","ui.tool.task":"\uC791\uC5C5","ui.tool.skill":"\uC2A4\uD0AC","ui.basicTool.called":"`{{tool}}` \uD638\uCD9C\uB428","ui.toolErrorCard.failed":"\uC2E4\uD328","ui.toolErrorCard.copyError":"\uC624\uB958 \uBCF5\uC0AC","ui.message.duration.seconds":"{{count}}\uCD08","ui.message.duration.minutesSeconds":"{{minutes}}\uBD84 {{seconds}}\uCD08"};export{e as dict};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{zf as Lh}from"./chunk-175720ws.js";import{Af as Mt}from"./chunk-q1dmxn63.js";import"./chunk-b350g18y.js";import{If as eh}from"./chunk-48rg4yhk.js";import{Jf as hh,Lf as gt}from"./chunk-vr13f6b5.js";import{Bq as E,Cq as k,Eq as _,Hq as th,Iq as Ct,Jp as Y,Np as vt,Pp as lt,Qp as bt,Zp as _t,aq as Lt,bq as ft,cq as wt,hq as jt,iq as o,kq as St,mq as dt,nq as et,pq as pt,rq as ot,uq as v,vq as r}from"./chunk-1bq15kf0.js";import{Mq as rt,Vq as kt,Xq as I}from"./chunk-pdcxmr6x.js";import"./chunk-cqtkxwd8.js";import"./chunk-a1mbach4.js";import{Lu as h}from"./chunk-sg9enzsp.js";import"./chunk-5q98z8ck.js";import{uP as ut}from"./chunk-sh03ka27.js";var Ft=ut(Mt(),1);var J=ut(eh(),1);class ht{bytes;constructor(t){if(this.bytes=t,t.byteLength!==8)throw Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(t){if(t>9223372036854776000||t<-9223372036854776000)throw Error(`${t} is too large (or, if negative, too small) to represent as an Int64`);let s=new Uint8Array(8);for(let a=7,y=Math.abs(Math.round(t));a>-1&&y>0;a--,y/=256)s[a]=y;if(t<0)Qt(s);return new ht(s)}valueOf(){let t=this.bytes.slice(0),s=t[0]&128;if(s)Qt(t);return parseInt(J.toHex(t),16)*(s?-1:1)}toString(){return String(this.valueOf())}}function Qt(t){for(let s=0;s<8;s++)t[s]^=255;for(let s=7;s>-1;s--)if(t[s]++,t[s]!==0)break}class Ut{toUtf8;fromUtf8;constructor(t,s){this.toUtf8=t,this.fromUtf8=s}format(t){let s=[];for(let w of Object.keys(t)){let f=this.fromUtf8(w);s.push(Uint8Array.from([f.byteLength]),f,this.formatHeaderValue(t[w]))}let a=new Uint8Array(s.reduce((w,f)=>w+f.byteLength,0)),y=0;for(let w of s)a.set(w,y),y+=w.byteLength;return a}formatHeaderValue(t){switch(t.type){case"boolean":return Uint8Array.from([t.value?0:1]);case"byte":return Uint8Array.from([2,t.value]);case"short":let s=new DataView(new ArrayBuffer(3));return s.setUint8(0,3),s.setInt16(1,t.value,!1),new Uint8Array(s.buffer);case"integer":let a=new DataView(new ArrayBuffer(5));return a.setUint8(0,4),a.setInt32(1,t.value,!1),new Uint8Array(a.buffer);case"long":let y=new Uint8Array(9);return y[0]=5,y.set(t.value.bytes,1),y;case"binary":let w=new DataView(new ArrayBuffer(3+t.value.byteLength));w.setUint8(0,6),w.setUint16(1,t.value.byteLength,!1);let f=new Uint8Array(w.buffer);return f.set(t.value,3),f;case"string":let S=this.fromUtf8(t.value),g=new DataView(new ArrayBuffer(3+S.byteLength));g.setUint8(0,7),g.setUint16(1,S.byteLength,!1);let c=new Uint8Array(g.buffer);return c.set(S,3),c;case"timestamp":let T=new Uint8Array(9);return T[0]=8,T.set(ht.fromNumber(t.value.valueOf()).bytes,1),T;case"uuid":if(!Gh.test(t.value))throw Error(`Invalid UUID received: ${t.value}`);let N=new Uint8Array(17);return N[0]=9,N.set(J.fromHex(t.value.replace(/\-/g,"")),1),N}}parse(t){let s={},a=0;while(a<t.byteLength){let y=t.getUint8(a++),w=this.toUtf8(new Uint8Array(t.buffer,t.byteOffset+a,y));switch(a+=y,t.getUint8(a++)){case 0:s[w]={type:Zt,value:!0};break;case 1:s[w]={type:Zt,value:!1};break;case 2:s[w]={type:gh,value:t.getInt8(a++)};break;case 3:s[w]={type:Ah,value:t.getInt16(a,!1)},a+=2;break;case 4:s[w]={type:mh,value:t.getInt32(a,!1)},a+=4;break;case 5:s[w]={type:Uh,value:new ht(new Uint8Array(t.buffer,t.byteOffset+a,8))},a+=8;break;case 6:let f=t.getUint16(a,!1);a+=2,s[w]={type:zh,value:new Uint8Array(t.buffer,t.byteOffset+a,f)},a+=f;break;case 7:let S=t.getUint16(a,!1);a+=2,s[w]={type:Nh,value:this.toUtf8(new Uint8Array(t.buffer,t.byteOffset+a,S))},a+=S;break;case 8:s[w]={type:Th,value:new Date(new ht(new Uint8Array(t.buffer,t.byteOffset+a,8)).valueOf())},a+=8;break;case 9:let g=new Uint8Array(t.buffer,t.byteOffset+a,16);a+=16,s[w]={type:$h,value:`${J.toHex(g.subarray(0,4))}-${J.toHex(g.subarray(4,6))}-${J.toHex(g.subarray(6,8))}-${J.toHex(g.subarray(8,10))}-${J.toHex(g.subarray(10))}`};break;default:throw Error("Unrecognized header type tag")}}return s}}var xt;(function(t){t[t.boolTrue=0]="boolTrue",t[t.boolFalse=1]="boolFalse",t[t.byte=2]="byte",t[t.short=3]="short",t[t.integer=4]="integer",t[t.long=5]="long",t[t.byteArray=6]="byteArray",t[t.string=7]="string",t[t.timestamp=8]="timestamp",t[t.uuid=9]="uuid"})(xt||(xt={}));var Zt="boolean",gh="byte",Ah="short",mh="integer",Uh="long",zh="binary",Nh="string",Th="timestamp",$h="uuid",Gh=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;var Dt=ut(Mt(),1),Vt=4,l=Vt*2,p=4,Xh=l+p*2;function qt({byteLength:t,byteOffset:s,buffer:a}){if(t<Xh)throw Error("Provided message too short to accommodate event stream message overhead");let y=new DataView(a,s,t),w=y.getUint32(0,!1);if(t!==w)throw Error("Reported message length does not match received message length");let f=y.getUint32(Vt,!1),S=y.getUint32(l,!1),g=y.getUint32(t-p,!1),c=new Dt.Crc32().update(new Uint8Array(a,s,l));if(S!==c.digest())throw Error(`The prelude checksum specified in the message (${S}) does not match the calculated CRC32 checksum (${c.digest()})`);if(c.update(new Uint8Array(a,s+l,t-(l+p))),g!==c.digest())throw Error(`The message checksum (${c.digest()}) did not match the expected value of ${g}`);return{headers:new DataView(a,s+l+p,f),body:new Uint8Array(a,s+l+p+f,w-f-(l+p+p))}}class zt{headerMarshaller;messageBuffer;isEndOfStream;constructor(t,s){this.headerMarshaller=new Ut(t,s),this.messageBuffer=[],this.isEndOfStream=!1}feed(t){this.messageBuffer.push(this.decode(t))}endOfStream(){this.isEndOfStream=!0}getMessage(){let t=this.messageBuffer.pop(),s=this.isEndOfStream;return{getMessage(){return t},isEndOfStream(){return s}}}getAvailableMessages(){let t=this.messageBuffer;this.messageBuffer=[];let s=this.isEndOfStream;return{getMessages(){return t},isEndOfStream(){return s}}}encode({headers:t,body:s}){let a=this.headerMarshaller.format(t),y=a.byteLength+s.byteLength+16,w=new Uint8Array(y),f=new DataView(w.buffer,w.byteOffset,w.byteLength),S=new Ft.Crc32;return f.setUint32(0,y,!1),f.setUint32(4,a.byteLength,!1),f.setUint32(8,S.update(w.subarray(0,8)).digest(),!1),w.set(a,12),w.set(s,a.byteLength+12),f.setUint32(y-4,S.update(w.subarray(8,y-4)).digest(),!1),w}decode(t){let{headers:s,body:a}=qt(t);return{headers:this.headerMarshaller.parse(s),body:a}}formatHeaders(t){return this.headerMarshaller.format(t)}}var At=ut(Lh(),1);var Tt=new TextEncoder,bh={appstream2:"appstream",cloudhsmv2:"cloudhsm",email:"ses",marketplace:"aws-marketplace",mobile:"AWSMobileHubService",pinpoint:"mobiletargeting",queue:"sqs","git-codecommit":"codecommit","mturk-requester-sandbox":"mturk-requester","personalize-runtime":"personalize"},jh=new Set(["authorization","content-type","content-length","user-agent","presigned-expires","expect","x-amzn-trace-id","range","connection"]);class $t{constructor({method:t,url:s,headers:a,body:y,accessKeyId:w,secretAccessKey:f,sessionToken:S,service:g,region:c,cache:T,datetime:N,signQuery:j,appendSessionToken:e,allHeaders:A,singleEncode:m}){if(s==null)throw TypeError("url is a required option");if(w==null)throw TypeError("accessKeyId is a required option");if(f==null)throw TypeError("secretAccessKey is a required option");this.method=t||(y?"POST":"GET"),this.url=new URL(s),this.headers=new Headers(a||{}),this.body=y,this.accessKeyId=w,this.secretAccessKey=f,this.sessionToken=S;let $,i;if(!g||!c)[$,i]=Ch(this.url,this.headers);if(this.service=g||$||"",this.region=c||i||"us-east-1",this.cache=T||new Map,this.datetime=N||new Date().toISOString().replace(/[:-]|\.\d{3}/g,""),this.signQuery=j,this.appendSessionToken=e||this.service==="iotdevicegateway",this.headers.delete("Host"),this.service==="s3"&&!this.signQuery&&!this.headers.has("X-Amz-Content-Sha256"))this.headers.set("X-Amz-Content-Sha256","UNSIGNED-PAYLOAD");let H=this.signQuery?this.url.searchParams:this.headers;if(H.set("X-Amz-Date",this.datetime),this.sessionToken&&!this.appendSessionToken)H.set("X-Amz-Security-Token",this.sessionToken);if(this.signableHeaders=["host",...this.headers.keys()].filter((u)=>A||!jh.has(u)).sort(),this.signedHeaders=this.signableHeaders.join(";"),this.canonicalHeaders=this.signableHeaders.map((u)=>u+":"+(u==="host"?this.url.host:(this.headers.get(u)||"").replace(/\s+/g," "))).join(`
2
+ import{Af as Lh}from"./chunk-jhdpwndc.js";import{Bf as Mt}from"./chunk-dptvy1zn.js";import"./chunk-pf4gwr34.js";import{Jf as eh}from"./chunk-b2zfr7jz.js";import{Kf as hh,Mf as gt}from"./chunk-v5gf0wx6.js";import{$r as r,Dr as _t,Gr as Lt,Hr as ft,Ir as wt,Nr as jt,Or as o,Qr as St,Sr as dt,Tr as et,Vr as pt,Xr as ot,_r as v,fs as E,gs as k,is as _,ls as th,ms as Ct,nr as Y,rr as vt,tr as lt,ur as bt}from"./chunk-q0pd8bac.js";import{Bs as I,qs as rt,zs as kt}from"./chunk-4dy64hgp.js";import"./chunk-cqtkxwd8.js";import"./chunk-gt10s0ks.js";import{pw as h}from"./chunk-9tfm1dk2.js";import"./chunk-x2mbre12.js";import{_Q as ut}from"./chunk-pfx8ts02.js";var Ft=ut(Mt(),1);var J=ut(eh(),1);class ht{bytes;constructor(t){if(this.bytes=t,t.byteLength!==8)throw Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(t){if(t>9223372036854776000||t<-9223372036854776000)throw Error(`${t} is too large (or, if negative, too small) to represent as an Int64`);let s=new Uint8Array(8);for(let a=7,y=Math.abs(Math.round(t));a>-1&&y>0;a--,y/=256)s[a]=y;if(t<0)Qt(s);return new ht(s)}valueOf(){let t=this.bytes.slice(0),s=t[0]&128;if(s)Qt(t);return parseInt(J.toHex(t),16)*(s?-1:1)}toString(){return String(this.valueOf())}}function Qt(t){for(let s=0;s<8;s++)t[s]^=255;for(let s=7;s>-1;s--)if(t[s]++,t[s]!==0)break}class Ut{toUtf8;fromUtf8;constructor(t,s){this.toUtf8=t,this.fromUtf8=s}format(t){let s=[];for(let w of Object.keys(t)){let f=this.fromUtf8(w);s.push(Uint8Array.from([f.byteLength]),f,this.formatHeaderValue(t[w]))}let a=new Uint8Array(s.reduce((w,f)=>w+f.byteLength,0)),y=0;for(let w of s)a.set(w,y),y+=w.byteLength;return a}formatHeaderValue(t){switch(t.type){case"boolean":return Uint8Array.from([t.value?0:1]);case"byte":return Uint8Array.from([2,t.value]);case"short":let s=new DataView(new ArrayBuffer(3));return s.setUint8(0,3),s.setInt16(1,t.value,!1),new Uint8Array(s.buffer);case"integer":let a=new DataView(new ArrayBuffer(5));return a.setUint8(0,4),a.setInt32(1,t.value,!1),new Uint8Array(a.buffer);case"long":let y=new Uint8Array(9);return y[0]=5,y.set(t.value.bytes,1),y;case"binary":let w=new DataView(new ArrayBuffer(3+t.value.byteLength));w.setUint8(0,6),w.setUint16(1,t.value.byteLength,!1);let f=new Uint8Array(w.buffer);return f.set(t.value,3),f;case"string":let S=this.fromUtf8(t.value),g=new DataView(new ArrayBuffer(3+S.byteLength));g.setUint8(0,7),g.setUint16(1,S.byteLength,!1);let c=new Uint8Array(g.buffer);return c.set(S,3),c;case"timestamp":let T=new Uint8Array(9);return T[0]=8,T.set(ht.fromNumber(t.value.valueOf()).bytes,1),T;case"uuid":if(!Gh.test(t.value))throw Error(`Invalid UUID received: ${t.value}`);let N=new Uint8Array(17);return N[0]=9,N.set(J.fromHex(t.value.replace(/\-/g,"")),1),N}}parse(t){let s={},a=0;while(a<t.byteLength){let y=t.getUint8(a++),w=this.toUtf8(new Uint8Array(t.buffer,t.byteOffset+a,y));switch(a+=y,t.getUint8(a++)){case 0:s[w]={type:Zt,value:!0};break;case 1:s[w]={type:Zt,value:!1};break;case 2:s[w]={type:gh,value:t.getInt8(a++)};break;case 3:s[w]={type:Ah,value:t.getInt16(a,!1)},a+=2;break;case 4:s[w]={type:mh,value:t.getInt32(a,!1)},a+=4;break;case 5:s[w]={type:Uh,value:new ht(new Uint8Array(t.buffer,t.byteOffset+a,8))},a+=8;break;case 6:let f=t.getUint16(a,!1);a+=2,s[w]={type:zh,value:new Uint8Array(t.buffer,t.byteOffset+a,f)},a+=f;break;case 7:let S=t.getUint16(a,!1);a+=2,s[w]={type:Nh,value:this.toUtf8(new Uint8Array(t.buffer,t.byteOffset+a,S))},a+=S;break;case 8:s[w]={type:Th,value:new Date(new ht(new Uint8Array(t.buffer,t.byteOffset+a,8)).valueOf())},a+=8;break;case 9:let g=new Uint8Array(t.buffer,t.byteOffset+a,16);a+=16,s[w]={type:$h,value:`${J.toHex(g.subarray(0,4))}-${J.toHex(g.subarray(4,6))}-${J.toHex(g.subarray(6,8))}-${J.toHex(g.subarray(8,10))}-${J.toHex(g.subarray(10))}`};break;default:throw Error("Unrecognized header type tag")}}return s}}var xt;(function(t){t[t.boolTrue=0]="boolTrue",t[t.boolFalse=1]="boolFalse",t[t.byte=2]="byte",t[t.short=3]="short",t[t.integer=4]="integer",t[t.long=5]="long",t[t.byteArray=6]="byteArray",t[t.string=7]="string",t[t.timestamp=8]="timestamp",t[t.uuid=9]="uuid"})(xt||(xt={}));var Zt="boolean",gh="byte",Ah="short",mh="integer",Uh="long",zh="binary",Nh="string",Th="timestamp",$h="uuid",Gh=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;var Dt=ut(Mt(),1),Vt=4,l=Vt*2,p=4,Xh=l+p*2;function qt({byteLength:t,byteOffset:s,buffer:a}){if(t<Xh)throw Error("Provided message too short to accommodate event stream message overhead");let y=new DataView(a,s,t),w=y.getUint32(0,!1);if(t!==w)throw Error("Reported message length does not match received message length");let f=y.getUint32(Vt,!1),S=y.getUint32(l,!1),g=y.getUint32(t-p,!1),c=new Dt.Crc32().update(new Uint8Array(a,s,l));if(S!==c.digest())throw Error(`The prelude checksum specified in the message (${S}) does not match the calculated CRC32 checksum (${c.digest()})`);if(c.update(new Uint8Array(a,s+l,t-(l+p))),g!==c.digest())throw Error(`The message checksum (${c.digest()}) did not match the expected value of ${g}`);return{headers:new DataView(a,s+l+p,f),body:new Uint8Array(a,s+l+p+f,w-f-(l+p+p))}}class zt{headerMarshaller;messageBuffer;isEndOfStream;constructor(t,s){this.headerMarshaller=new Ut(t,s),this.messageBuffer=[],this.isEndOfStream=!1}feed(t){this.messageBuffer.push(this.decode(t))}endOfStream(){this.isEndOfStream=!0}getMessage(){let t=this.messageBuffer.pop(),s=this.isEndOfStream;return{getMessage(){return t},isEndOfStream(){return s}}}getAvailableMessages(){let t=this.messageBuffer;this.messageBuffer=[];let s=this.isEndOfStream;return{getMessages(){return t},isEndOfStream(){return s}}}encode({headers:t,body:s}){let a=this.headerMarshaller.format(t),y=a.byteLength+s.byteLength+16,w=new Uint8Array(y),f=new DataView(w.buffer,w.byteOffset,w.byteLength),S=new Ft.Crc32;return f.setUint32(0,y,!1),f.setUint32(4,a.byteLength,!1),f.setUint32(8,S.update(w.subarray(0,8)).digest(),!1),w.set(a,12),w.set(s,a.byteLength+12),f.setUint32(y-4,S.update(w.subarray(8,y-4)).digest(),!1),w}decode(t){let{headers:s,body:a}=qt(t);return{headers:this.headerMarshaller.parse(s),body:a}}formatHeaders(t){return this.headerMarshaller.format(t)}}var At=ut(Lh(),1);var Tt=new TextEncoder,bh={appstream2:"appstream",cloudhsmv2:"cloudhsm",email:"ses",marketplace:"aws-marketplace",mobile:"AWSMobileHubService",pinpoint:"mobiletargeting",queue:"sqs","git-codecommit":"codecommit","mturk-requester-sandbox":"mturk-requester","personalize-runtime":"personalize"},jh=new Set(["authorization","content-type","content-length","user-agent","presigned-expires","expect","x-amzn-trace-id","range","connection"]);class $t{constructor({method:t,url:s,headers:a,body:y,accessKeyId:w,secretAccessKey:f,sessionToken:S,service:g,region:c,cache:T,datetime:N,signQuery:j,appendSessionToken:e,allHeaders:A,singleEncode:m}){if(s==null)throw TypeError("url is a required option");if(w==null)throw TypeError("accessKeyId is a required option");if(f==null)throw TypeError("secretAccessKey is a required option");this.method=t||(y?"POST":"GET"),this.url=new URL(s),this.headers=new Headers(a||{}),this.body=y,this.accessKeyId=w,this.secretAccessKey=f,this.sessionToken=S;let $,i;if(!g||!c)[$,i]=Ch(this.url,this.headers);if(this.service=g||$||"",this.region=c||i||"us-east-1",this.cache=T||new Map,this.datetime=N||new Date().toISOString().replace(/[:-]|\.\d{3}/g,""),this.signQuery=j,this.appendSessionToken=e||this.service==="iotdevicegateway",this.headers.delete("Host"),this.service==="s3"&&!this.signQuery&&!this.headers.has("X-Amz-Content-Sha256"))this.headers.set("X-Amz-Content-Sha256","UNSIGNED-PAYLOAD");let H=this.signQuery?this.url.searchParams:this.headers;if(H.set("X-Amz-Date",this.datetime),this.sessionToken&&!this.appendSessionToken)H.set("X-Amz-Security-Token",this.sessionToken);if(this.signableHeaders=["host",...this.headers.keys()].filter((u)=>A||!jh.has(u)).sort(),this.signedHeaders=this.signableHeaders.join(";"),this.canonicalHeaders=this.signableHeaders.map((u)=>u+":"+(u==="host"?this.url.host:(this.headers.get(u)||"").replace(/\s+/g," "))).join(`
3
3
  `),this.credentialString=[this.datetime.slice(0,8),this.region,this.service,"aws4_request"].join("/"),this.signQuery){if(this.service==="s3"&&!H.has("X-Amz-Expires"))H.set("X-Amz-Expires","86400");H.set("X-Amz-Algorithm","AWS4-HMAC-SHA256"),H.set("X-Amz-Credential",this.accessKeyId+"/"+this.credentialString),H.set("X-Amz-SignedHeaders",this.signedHeaders)}if(this.service==="s3")try{this.encodedPath=decodeURIComponent(this.url.pathname.replace(/\+/g," "))}catch(u){this.encodedPath=this.url.pathname}else this.encodedPath=this.url.pathname.replace(/\/+/g,"/");if(!m)this.encodedPath=encodeURIComponent(this.encodedPath).replace(/%2F/g,"/");this.encodedPath=Yt(this.encodedPath);let C=new Set;this.encodedSearch=[...this.url.searchParams].filter(([u])=>{if(!u)return!1;if(this.service==="s3"){if(C.has(u))return!1;C.add(u)}return!0}).map((u)=>u.map((X)=>Yt(encodeURIComponent(X)))).sort(([u,X],[L,W])=>u<L?-1:u>L?1:X<W?-1:X>W?1:0).map((u)=>u.join("=")).join("&")}async sign(){if(this.signQuery){if(this.url.searchParams.set("X-Amz-Signature",await this.signature()),this.sessionToken&&this.appendSessionToken)this.url.searchParams.set("X-Amz-Security-Token",this.sessionToken)}else this.headers.set("Authorization",await this.authHeader());return{method:this.method,url:this.url,headers:this.headers,body:this.body}}async authHeader(){return["AWS4-HMAC-SHA256 Credential="+this.accessKeyId+"/"+this.credentialString,"SignedHeaders="+this.signedHeaders,"Signature="+await this.signature()].join(", ")}async signature(){let t=this.datetime.slice(0,8),s=[this.secretAccessKey,t,this.region,this.service].join(),a=this.cache.get(s);if(!a){let y=await at("AWS4"+this.secretAccessKey,t),w=await at(y,this.region),f=await at(w,this.service);a=await at(f,"aws4_request"),this.cache.set(s,a)}return Nt(await at(a,await this.stringToSign()))}async stringToSign(){return["AWS4-HMAC-SHA256",this.datetime,this.credentialString,Nt(await Pt(await this.canonicalString()))].join(`
4
4
  `)}async canonicalString(){return[this.method.toUpperCase(),this.encodedPath,this.encodedSearch,this.canonicalHeaders+`
5
5
  `,this.signedHeaders,await this.hexBodyHash()].join(`
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{We as P,_e as C,cf as h,df as g,ef as u,gf as m,of as d,pf as S,tf as c,uf as i,vf as M,xf as p}from"./chunk-4ycg2c6f.js";import{Uq as T,Vq as v,Xq as w}from"./chunk-pdcxmr6x.js";import"./chunk-cqtkxwd8.js";import"./chunk-a1mbach4.js";import{Lu as j}from"./chunk-sg9enzsp.js";import"./chunk-5q98z8ck.js";import"./chunk-sh03ka27.js";function y(B){if(B==null)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};let{prompt_tokens:Q,completion_tokens:X}=B;return{inputTokens:{total:Q,noCache:Q,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:X,text:X,reasoning:void 0},raw:B}}function R({data:B,mediaType:Q}){return B instanceof URL?B.toString():`data:${Q};base64,${C(B)}`}function n(B){var Q;let X=[];for(let D=0;D<B.length;D++){let{role:K,content:$}=B[D],N=D===B.length-1;switch(K){case"system":{X.push({role:"system",content:$});break}case"user":{X.push({role:"user",content:$.map((G)=>{switch(G.type){case"text":return{type:"text",text:G.text};case"file":if(G.mediaType.startsWith("image/")){let Z=G.mediaType==="image/*"?"image/jpeg":G.mediaType;return{type:"image_url",image_url:R({data:G.data,mediaType:Z})}}else if(G.mediaType==="application/pdf")return{type:"document_url",document_url:R({data:G.data,mediaType:"application/pdf"})};else throw new w({functionality:"Only images and PDF file parts are supported"})}})});break}case"assistant":{let G="",Z=[];for(let Y of $)switch(Y.type){case"text":{G+=Y.text;break}case"tool-call":{Z.push({id:Y.toolCallId,type:"function",function:{name:Y.toolName,arguments:JSON.stringify(Y.input)}});break}case"reasoning":{G+=Y.text;break}default:throw Error(`Unsupported content type in assistant message: ${Y.type}`)}X.push({role:"assistant",content:G,prefix:N?!0:void 0,tool_calls:Z.length>0?Z:void 0});break}case"tool":{for(let G of $){if(G.type==="tool-approval-response")continue;let Z=G.output,Y;switch(Z.type){case"text":case"error-text":Y=Z.value;break;case"execution-denied":Y=(Q=Z.reason)!=null?Q:"Tool execution denied.";break;case"content":case"json":case"error-json":Y=JSON.stringify(Z.value);break}X.push({role:"tool",name:G.toolName,tool_call_id:G.toolCallId,content:Y})}break}default:throw Error(`Unsupported role: ${K}`)}}return X}function k({id:B,model:Q,created:X}){return{id:B!=null?B:void 0,modelId:Q!=null?Q:void 0,timestamp:X!=null?new Date(X*1000):void 0}}function x(B){switch(B){case"stop":return"stop";case"length":case"model_length":return"length";case"tool_calls":return"tool-calls";default:return"other"}}var t=j.object({safePrompt:j.boolean().optional(),documentImageLimit:j.number().optional(),documentPageLimit:j.number().optional(),structuredOutputs:j.boolean().optional(),strictJsonSchema:j.boolean().optional(),parallelToolCalls:j.boolean().optional(),reasoningEffort:j.enum(["high","none"]).optional()}),e=j.object({object:j.literal("error"),message:j.string(),type:j.string(),param:j.string().nullable(),code:j.string().nullable()}),b=c({errorSchema:e,errorToMessage:(B)=>B.message});function o({tools:B,toolChoice:Q}){B=(B==null?void 0:B.length)?B:void 0;let X=[];if(B==null)return{tools:void 0,toolChoice:void 0,toolWarnings:X};let D=[];for(let $ of B)if($.type==="provider")X.push({type:"unsupported",feature:`provider-defined tool ${$.id}`});else D.push({type:"function",function:{name:$.name,description:$.description,parameters:$.inputSchema,...$.strict!=null?{strict:$.strict}:{}}});if(Q==null)return{tools:D,toolChoice:void 0,toolWarnings:X};let K=Q.type;switch(K){case"auto":case"none":return{tools:D,toolChoice:K,toolWarnings:X};case"required":return{tools:D,toolChoice:"any",toolWarnings:X};case"tool":return{tools:D.filter(($)=>$.function.name===Q.toolName),toolChoice:"any",toolWarnings:X};default:throw new w({functionality:`tool choice type: ${K}`})}}var jj=class{constructor(B,Q){this.specificationVersion="v3",this.supportedUrls={"application/pdf":[/^https:\/\/.*$/]};var X;this.modelId=B,this.config=Q,this.generateId=(X=Q.generateId)!=null?X:h}get provider(){return this.config.provider}async getArgs({prompt:B,maxOutputTokens:Q,temperature:X,topP:D,topK:K,frequencyPenalty:$,presencePenalty:N,stopSequences:G,responseFormat:Z,seed:Y,providerOptions:J,tools:f,toolChoice:L}){var U,O,V,q;let E=[],A=(U=await d({provider:"mistral",providerOptions:J,schema:t}))!=null?U:{};if(K!=null)E.push({type:"unsupported",feature:"topK"});if($!=null)E.push({type:"unsupported",feature:"frequencyPenalty"});if(N!=null)E.push({type:"unsupported",feature:"presencePenalty"});if(G!=null)E.push({type:"unsupported",feature:"stopSequences"});let H=(O=A.structuredOutputs)!=null?O:!0,z=(V=A.strictJsonSchema)!=null?V:!1;if((Z==null?void 0:Z.type)==="json"&&!(Z==null?void 0:Z.schema))B=u({messages:B,schema:Z.schema});let W={model:this.modelId,safe_prompt:A.safePrompt,max_tokens:Q,temperature:X,top_p:D,random_seed:Y,reasoning_effort:A.reasoningEffort,response_format:(Z==null?void 0:Z.type)==="json"?H&&(Z==null?void 0:Z.schema)!=null?{type:"json_schema",json_schema:{schema:Z.schema,strict:z,name:(q=Z.name)!=null?q:"response",description:Z.description}}:{type:"json_object"}:void 0,document_image_limit:A.documentImageLimit,document_page_limit:A.documentPageLimit,messages:n(B)},{tools:_,toolChoice:s,toolWarnings:r}=o({tools:f,toolChoice:L});return{args:{...W,tools:_,tool_choice:s,..._!=null&&A.parallelToolCalls!==void 0?{parallel_tool_calls:A.parallelToolCalls}:{}},warnings:[...E,...r]}}async doGenerate(B){var Q;let{args:X,warnings:D}=await this.getArgs(B),{responseHeaders:K,value:$,rawValue:N}=await S({url:`${this.config.baseURL}/chat/completions`,headers:P(this.config.headers(),B.headers),body:X,failedResponseHandler:b,successfulResponseHandler:M(Bj),abortSignal:B.abortSignal,fetch:this.config.fetch}),G=$.choices[0],Z=[];if(G.message.content!=null&&Array.isArray(G.message.content)){for(let Y of G.message.content)if(Y.type==="thinking"){let J=F(Y.thinking);if(J.length>0)Z.push({type:"reasoning",text:J})}else if(Y.type==="text"){if(Y.text.length>0)Z.push({type:"text",text:Y.text})}}else{let Y=I(G.message.content);if(Y!=null&&Y.length>0)Z.push({type:"text",text:Y})}if(G.message.tool_calls!=null)for(let Y of G.message.tool_calls)Z.push({type:"tool-call",toolCallId:Y.id,toolName:Y.function.name,input:Y.function.arguments});return{content:Z,finishReason:{unified:x(G.finish_reason),raw:(Q=G.finish_reason)!=null?Q:void 0},usage:y($.usage),request:{body:X},response:{...k($),headers:K,body:N},warnings:D}}async doStream(B){let{args:Q,warnings:X}=await this.getArgs(B),D={...Q,stream:!0},{responseHeaders:K,value:$}=await S({url:`${this.config.baseURL}/chat/completions`,headers:P(this.config.headers(),B.headers),body:D,failedResponseHandler:b,successfulResponseHandler:i(Gj),abortSignal:B.abortSignal,fetch:this.config.fetch}),N={unified:"other",raw:void 0},G=void 0,Z=!0,Y=!1,J=null,f=this.generateId;return{stream:$.pipeThrough(new TransformStream({start(L){L.enqueue({type:"stream-start",warnings:X})},transform(L,U){if(B.includeRawChunks)U.enqueue({type:"raw",rawValue:L.rawValue});if(!L.success){U.enqueue({type:"error",error:L.error});return}let O=L.value;if(Z)Z=!1,U.enqueue({type:"response-metadata",...k(O)});if(O.usage!=null)G=O.usage;let V=O.choices[0],q=V.delta,E=I(q.content);if(q.content!=null&&Array.isArray(q.content)){for(let A of q.content)if(A.type==="thinking"){let H=F(A.thinking);if(H.length>0){if(J==null){if(Y)U.enqueue({type:"text-end",id:"0"}),Y=!1;J=f(),U.enqueue({type:"reasoning-start",id:J})}U.enqueue({type:"reasoning-delta",id:J,delta:H})}}}if(E!=null&&E.length>0){if(!Y){if(J!=null)U.enqueue({type:"reasoning-end",id:J}),J=null;U.enqueue({type:"text-start",id:"0"}),Y=!0}U.enqueue({type:"text-delta",id:"0",delta:E})}if((q==null?void 0:q.tool_calls)!=null)for(let A of q.tool_calls){let H=A.id,z=A.function.name,W=A.function.arguments;U.enqueue({type:"tool-input-start",id:H,toolName:z}),U.enqueue({type:"tool-input-delta",id:H,delta:W}),U.enqueue({type:"tool-input-end",id:H}),U.enqueue({type:"tool-call",toolCallId:H,toolName:z,input:W})}if(V.finish_reason!=null)N={unified:x(V.finish_reason),raw:V.finish_reason}},flush(L){if(J!=null)L.enqueue({type:"reasoning-end",id:J});if(Y)L.enqueue({type:"text-end",id:"0"});L.enqueue({type:"finish",finishReason:N,usage:y(G)})}})),request:{body:D},response:{headers:K}}}};function F(B){return B.filter((Q)=>Q.type==="text").map((Q)=>Q.text).join("")}function I(B){if(typeof B==="string")return B;if(B==null)return;let Q=[];for(let X of B){let{type:D}=X;switch(D){case"text":Q.push(X.text);break;case"thinking":case"image_url":case"reference":break;default:throw Error(`Unsupported type: ${D}`)}}return Q.length?Q.join(""):void 0}var l=j.union([j.string(),j.array(j.discriminatedUnion("type",[j.object({type:j.literal("text"),text:j.string()}),j.object({type:j.literal("image_url"),image_url:j.union([j.string(),j.object({url:j.string(),detail:j.string().nullable()})])}),j.object({type:j.literal("reference"),reference_ids:j.array(j.union([j.string(),j.number()]))}),j.object({type:j.literal("thinking"),thinking:j.array(j.object({type:j.literal("text"),text:j.string()}))})]))]).nullish(),a=j.object({prompt_tokens:j.number(),completion_tokens:j.number(),total_tokens:j.number()}),Bj=j.object({id:j.string().nullish(),created:j.number().nullish(),model:j.string().nullish(),choices:j.array(j.object({message:j.object({role:j.literal("assistant"),content:l,tool_calls:j.array(j.object({id:j.string(),function:j.object({name:j.string(),arguments:j.string()})})).nullish()}),index:j.number(),finish_reason:j.string().nullish()})),object:j.literal("chat.completion"),usage:a}),Gj=j.object({id:j.string().nullish(),created:j.number().nullish(),model:j.string().nullish(),choices:j.array(j.object({delta:j.object({role:j.enum(["assistant"]).optional(),content:l,tool_calls:j.array(j.object({id:j.string(),function:j.object({name:j.string(),arguments:j.string()})})).nullish()}),finish_reason:j.string().nullish(),index:j.number()})),usage:a.nullish()}),Qj=class{constructor(B,Q){this.specificationVersion="v3",this.maxEmbeddingsPerCall=32,this.supportsParallelCalls=!1,this.modelId=B,this.config=Q}get provider(){return this.config.provider}async doEmbed({values:B,abortSignal:Q,headers:X}){if(B.length>this.maxEmbeddingsPerCall)throw new v({provider:this.provider,modelId:this.modelId,maxEmbeddingsPerCall:this.maxEmbeddingsPerCall,values:B});let{responseHeaders:D,value:K,rawValue:$}=await S({url:`${this.config.baseURL}/embeddings`,headers:P(this.config.headers(),X),body:{model:this.modelId,input:B,encoding_format:"float"},failedResponseHandler:b,successfulResponseHandler:M(Xj),abortSignal:Q,fetch:this.config.fetch});return{warnings:[],embeddings:K.data.map((N)=>N.embedding),usage:K.usage?{tokens:K.usage.prompt_tokens}:void 0,response:{headers:D,body:$}}}},Xj=j.object({data:j.array(j.object({embedding:j.array(j.number())})),usage:j.object({prompt_tokens:j.number()}).nullish()}),Yj="3.0.27";function Zj(B={}){var Q;let X=(Q=p(B.baseURL))!=null?Q:"https://api.mistral.ai/v1",D=()=>g({Authorization:`Bearer ${m({apiKey:B.apiKey,environmentVariableName:"MISTRAL_API_KEY",description:"Mistral"})}`,...B.headers},`ai-sdk/mistral/${Yj}`),K=(G)=>new jj(G,{provider:"mistral.chat",baseURL:X,headers:D,fetch:B.fetch,generateId:B.generateId}),$=(G)=>new Qj(G,{provider:"mistral.embedding",baseURL:X,headers:D,fetch:B.fetch}),N=function(G){if(new.target)throw Error("The Mistral model function cannot be called with the new keyword.");return K(G)};return N.specificationVersion="v3",N.languageModel=K,N.chat=K,N.embedding=$,N.embeddingModel=$,N.textEmbedding=$,N.textEmbeddingModel=$,N.imageModel=(G)=>{throw new T({modelId:G,modelType:"imageModel"})},N}var Pj=Zj();export{Pj as mistral,Zj as createMistral,Yj as VERSION};
2
+ import{$e as C,Xe as P,df as h,ef as g,ff as u,hf as m,pf as d,qf as S,uf as c,vf as i,wf as M,yf as p}from"./chunk-fg5f3a8a.js";import{Bs as w,ys as T,zs as v}from"./chunk-4dy64hgp.js";import"./chunk-cqtkxwd8.js";import"./chunk-gt10s0ks.js";import{pw as j}from"./chunk-9tfm1dk2.js";import"./chunk-x2mbre12.js";import"./chunk-pfx8ts02.js";function y(B){if(B==null)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};let{prompt_tokens:Q,completion_tokens:X}=B;return{inputTokens:{total:Q,noCache:Q,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:X,text:X,reasoning:void 0},raw:B}}function R({data:B,mediaType:Q}){return B instanceof URL?B.toString():`data:${Q};base64,${C(B)}`}function n(B){var Q;let X=[];for(let D=0;D<B.length;D++){let{role:K,content:$}=B[D],N=D===B.length-1;switch(K){case"system":{X.push({role:"system",content:$});break}case"user":{X.push({role:"user",content:$.map((G)=>{switch(G.type){case"text":return{type:"text",text:G.text};case"file":if(G.mediaType.startsWith("image/")){let Z=G.mediaType==="image/*"?"image/jpeg":G.mediaType;return{type:"image_url",image_url:R({data:G.data,mediaType:Z})}}else if(G.mediaType==="application/pdf")return{type:"document_url",document_url:R({data:G.data,mediaType:"application/pdf"})};else throw new w({functionality:"Only images and PDF file parts are supported"})}})});break}case"assistant":{let G="",Z=[];for(let Y of $)switch(Y.type){case"text":{G+=Y.text;break}case"tool-call":{Z.push({id:Y.toolCallId,type:"function",function:{name:Y.toolName,arguments:JSON.stringify(Y.input)}});break}case"reasoning":{G+=Y.text;break}default:throw Error(`Unsupported content type in assistant message: ${Y.type}`)}X.push({role:"assistant",content:G,prefix:N?!0:void 0,tool_calls:Z.length>0?Z:void 0});break}case"tool":{for(let G of $){if(G.type==="tool-approval-response")continue;let Z=G.output,Y;switch(Z.type){case"text":case"error-text":Y=Z.value;break;case"execution-denied":Y=(Q=Z.reason)!=null?Q:"Tool execution denied.";break;case"content":case"json":case"error-json":Y=JSON.stringify(Z.value);break}X.push({role:"tool",name:G.toolName,tool_call_id:G.toolCallId,content:Y})}break}default:throw Error(`Unsupported role: ${K}`)}}return X}function k({id:B,model:Q,created:X}){return{id:B!=null?B:void 0,modelId:Q!=null?Q:void 0,timestamp:X!=null?new Date(X*1000):void 0}}function x(B){switch(B){case"stop":return"stop";case"length":case"model_length":return"length";case"tool_calls":return"tool-calls";default:return"other"}}var t=j.object({safePrompt:j.boolean().optional(),documentImageLimit:j.number().optional(),documentPageLimit:j.number().optional(),structuredOutputs:j.boolean().optional(),strictJsonSchema:j.boolean().optional(),parallelToolCalls:j.boolean().optional(),reasoningEffort:j.enum(["high","none"]).optional()}),e=j.object({object:j.literal("error"),message:j.string(),type:j.string(),param:j.string().nullable(),code:j.string().nullable()}),b=c({errorSchema:e,errorToMessage:(B)=>B.message});function o({tools:B,toolChoice:Q}){B=(B==null?void 0:B.length)?B:void 0;let X=[];if(B==null)return{tools:void 0,toolChoice:void 0,toolWarnings:X};let D=[];for(let $ of B)if($.type==="provider")X.push({type:"unsupported",feature:`provider-defined tool ${$.id}`});else D.push({type:"function",function:{name:$.name,description:$.description,parameters:$.inputSchema,...$.strict!=null?{strict:$.strict}:{}}});if(Q==null)return{tools:D,toolChoice:void 0,toolWarnings:X};let K=Q.type;switch(K){case"auto":case"none":return{tools:D,toolChoice:K,toolWarnings:X};case"required":return{tools:D,toolChoice:"any",toolWarnings:X};case"tool":return{tools:D.filter(($)=>$.function.name===Q.toolName),toolChoice:"any",toolWarnings:X};default:throw new w({functionality:`tool choice type: ${K}`})}}var jj=class{constructor(B,Q){this.specificationVersion="v3",this.supportedUrls={"application/pdf":[/^https:\/\/.*$/]};var X;this.modelId=B,this.config=Q,this.generateId=(X=Q.generateId)!=null?X:h}get provider(){return this.config.provider}async getArgs({prompt:B,maxOutputTokens:Q,temperature:X,topP:D,topK:K,frequencyPenalty:$,presencePenalty:N,stopSequences:G,responseFormat:Z,seed:Y,providerOptions:J,tools:f,toolChoice:L}){var U,O,V,q;let E=[],A=(U=await d({provider:"mistral",providerOptions:J,schema:t}))!=null?U:{};if(K!=null)E.push({type:"unsupported",feature:"topK"});if($!=null)E.push({type:"unsupported",feature:"frequencyPenalty"});if(N!=null)E.push({type:"unsupported",feature:"presencePenalty"});if(G!=null)E.push({type:"unsupported",feature:"stopSequences"});let H=(O=A.structuredOutputs)!=null?O:!0,z=(V=A.strictJsonSchema)!=null?V:!1;if((Z==null?void 0:Z.type)==="json"&&!(Z==null?void 0:Z.schema))B=u({messages:B,schema:Z.schema});let W={model:this.modelId,safe_prompt:A.safePrompt,max_tokens:Q,temperature:X,top_p:D,random_seed:Y,reasoning_effort:A.reasoningEffort,response_format:(Z==null?void 0:Z.type)==="json"?H&&(Z==null?void 0:Z.schema)!=null?{type:"json_schema",json_schema:{schema:Z.schema,strict:z,name:(q=Z.name)!=null?q:"response",description:Z.description}}:{type:"json_object"}:void 0,document_image_limit:A.documentImageLimit,document_page_limit:A.documentPageLimit,messages:n(B)},{tools:_,toolChoice:s,toolWarnings:r}=o({tools:f,toolChoice:L});return{args:{...W,tools:_,tool_choice:s,..._!=null&&A.parallelToolCalls!==void 0?{parallel_tool_calls:A.parallelToolCalls}:{}},warnings:[...E,...r]}}async doGenerate(B){var Q;let{args:X,warnings:D}=await this.getArgs(B),{responseHeaders:K,value:$,rawValue:N}=await S({url:`${this.config.baseURL}/chat/completions`,headers:P(this.config.headers(),B.headers),body:X,failedResponseHandler:b,successfulResponseHandler:M(Bj),abortSignal:B.abortSignal,fetch:this.config.fetch}),G=$.choices[0],Z=[];if(G.message.content!=null&&Array.isArray(G.message.content)){for(let Y of G.message.content)if(Y.type==="thinking"){let J=F(Y.thinking);if(J.length>0)Z.push({type:"reasoning",text:J})}else if(Y.type==="text"){if(Y.text.length>0)Z.push({type:"text",text:Y.text})}}else{let Y=I(G.message.content);if(Y!=null&&Y.length>0)Z.push({type:"text",text:Y})}if(G.message.tool_calls!=null)for(let Y of G.message.tool_calls)Z.push({type:"tool-call",toolCallId:Y.id,toolName:Y.function.name,input:Y.function.arguments});return{content:Z,finishReason:{unified:x(G.finish_reason),raw:(Q=G.finish_reason)!=null?Q:void 0},usage:y($.usage),request:{body:X},response:{...k($),headers:K,body:N},warnings:D}}async doStream(B){let{args:Q,warnings:X}=await this.getArgs(B),D={...Q,stream:!0},{responseHeaders:K,value:$}=await S({url:`${this.config.baseURL}/chat/completions`,headers:P(this.config.headers(),B.headers),body:D,failedResponseHandler:b,successfulResponseHandler:i(Gj),abortSignal:B.abortSignal,fetch:this.config.fetch}),N={unified:"other",raw:void 0},G=void 0,Z=!0,Y=!1,J=null,f=this.generateId;return{stream:$.pipeThrough(new TransformStream({start(L){L.enqueue({type:"stream-start",warnings:X})},transform(L,U){if(B.includeRawChunks)U.enqueue({type:"raw",rawValue:L.rawValue});if(!L.success){U.enqueue({type:"error",error:L.error});return}let O=L.value;if(Z)Z=!1,U.enqueue({type:"response-metadata",...k(O)});if(O.usage!=null)G=O.usage;let V=O.choices[0],q=V.delta,E=I(q.content);if(q.content!=null&&Array.isArray(q.content)){for(let A of q.content)if(A.type==="thinking"){let H=F(A.thinking);if(H.length>0){if(J==null){if(Y)U.enqueue({type:"text-end",id:"0"}),Y=!1;J=f(),U.enqueue({type:"reasoning-start",id:J})}U.enqueue({type:"reasoning-delta",id:J,delta:H})}}}if(E!=null&&E.length>0){if(!Y){if(J!=null)U.enqueue({type:"reasoning-end",id:J}),J=null;U.enqueue({type:"text-start",id:"0"}),Y=!0}U.enqueue({type:"text-delta",id:"0",delta:E})}if((q==null?void 0:q.tool_calls)!=null)for(let A of q.tool_calls){let H=A.id,z=A.function.name,W=A.function.arguments;U.enqueue({type:"tool-input-start",id:H,toolName:z}),U.enqueue({type:"tool-input-delta",id:H,delta:W}),U.enqueue({type:"tool-input-end",id:H}),U.enqueue({type:"tool-call",toolCallId:H,toolName:z,input:W})}if(V.finish_reason!=null)N={unified:x(V.finish_reason),raw:V.finish_reason}},flush(L){if(J!=null)L.enqueue({type:"reasoning-end",id:J});if(Y)L.enqueue({type:"text-end",id:"0"});L.enqueue({type:"finish",finishReason:N,usage:y(G)})}})),request:{body:D},response:{headers:K}}}};function F(B){return B.filter((Q)=>Q.type==="text").map((Q)=>Q.text).join("")}function I(B){if(typeof B==="string")return B;if(B==null)return;let Q=[];for(let X of B){let{type:D}=X;switch(D){case"text":Q.push(X.text);break;case"thinking":case"image_url":case"reference":break;default:throw Error(`Unsupported type: ${D}`)}}return Q.length?Q.join(""):void 0}var l=j.union([j.string(),j.array(j.discriminatedUnion("type",[j.object({type:j.literal("text"),text:j.string()}),j.object({type:j.literal("image_url"),image_url:j.union([j.string(),j.object({url:j.string(),detail:j.string().nullable()})])}),j.object({type:j.literal("reference"),reference_ids:j.array(j.union([j.string(),j.number()]))}),j.object({type:j.literal("thinking"),thinking:j.array(j.object({type:j.literal("text"),text:j.string()}))})]))]).nullish(),a=j.object({prompt_tokens:j.number(),completion_tokens:j.number(),total_tokens:j.number()}),Bj=j.object({id:j.string().nullish(),created:j.number().nullish(),model:j.string().nullish(),choices:j.array(j.object({message:j.object({role:j.literal("assistant"),content:l,tool_calls:j.array(j.object({id:j.string(),function:j.object({name:j.string(),arguments:j.string()})})).nullish()}),index:j.number(),finish_reason:j.string().nullish()})),object:j.literal("chat.completion"),usage:a}),Gj=j.object({id:j.string().nullish(),created:j.number().nullish(),model:j.string().nullish(),choices:j.array(j.object({delta:j.object({role:j.enum(["assistant"]).optional(),content:l,tool_calls:j.array(j.object({id:j.string(),function:j.object({name:j.string(),arguments:j.string()})})).nullish()}),finish_reason:j.string().nullish(),index:j.number()})),usage:a.nullish()}),Qj=class{constructor(B,Q){this.specificationVersion="v3",this.maxEmbeddingsPerCall=32,this.supportsParallelCalls=!1,this.modelId=B,this.config=Q}get provider(){return this.config.provider}async doEmbed({values:B,abortSignal:Q,headers:X}){if(B.length>this.maxEmbeddingsPerCall)throw new v({provider:this.provider,modelId:this.modelId,maxEmbeddingsPerCall:this.maxEmbeddingsPerCall,values:B});let{responseHeaders:D,value:K,rawValue:$}=await S({url:`${this.config.baseURL}/embeddings`,headers:P(this.config.headers(),X),body:{model:this.modelId,input:B,encoding_format:"float"},failedResponseHandler:b,successfulResponseHandler:M(Xj),abortSignal:Q,fetch:this.config.fetch});return{warnings:[],embeddings:K.data.map((N)=>N.embedding),usage:K.usage?{tokens:K.usage.prompt_tokens}:void 0,response:{headers:D,body:$}}}},Xj=j.object({data:j.array(j.object({embedding:j.array(j.number())})),usage:j.object({prompt_tokens:j.number()}).nullish()}),Yj="3.0.27";function Zj(B={}){var Q;let X=(Q=p(B.baseURL))!=null?Q:"https://api.mistral.ai/v1",D=()=>g({Authorization:`Bearer ${m({apiKey:B.apiKey,environmentVariableName:"MISTRAL_API_KEY",description:"Mistral"})}`,...B.headers},`ai-sdk/mistral/${Yj}`),K=(G)=>new jj(G,{provider:"mistral.chat",baseURL:X,headers:D,fetch:B.fetch,generateId:B.generateId}),$=(G)=>new Qj(G,{provider:"mistral.embedding",baseURL:X,headers:D,fetch:B.fetch}),N=function(G){if(new.target)throw Error("The Mistral model function cannot be called with the new keyword.");return K(G)};return N.specificationVersion="v3",N.languageModel=K,N.chat=K,N.embedding=$,N.embeddingModel=$,N.textEmbedding=$,N.textEmbeddingModel=$,N.imageModel=(G)=>{throw new T({modelId:G,modelType:"imageModel"})},N}var Pj=Zj();export{Pj as mistral,Zj as createMistral,Yj as VERSION};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{gg as a,hg as b,ig as c,jg as d,kg as e}from"./chunk-5xmtzs15.js";import"./chunk-0gqwvt8w.js";import"./chunk-fcbmedh3.js";import"./chunk-jkqa49xc.js";import"./chunk-a4y0wjtq.js";import"./chunk-nfg7nt13.js";import"./chunk-s2ma1nz3.js";import"./chunk-96281xfb.js";import"./chunk-p76c9s6g.js";import"./chunk-az2pxgx6.js";import"./chunk-bd21p9zz.js";import"./chunk-p54bzjtv.js";import"./chunk-ha1w0xzh.js";import"./chunk-vr222v2n.js";import"./chunk-6vpc1y3w.js";import"./chunk-j95mkzwg.js";import"./chunk-tatecas7.js";import"./chunk-52n4tdeh.js";import"./chunk-ft4msj4z.js";import"./chunk-m8djypsy.js";import"./chunk-m0f6cf9n.js";import"./chunk-n7ewvphw.js";import"./chunk-ya7wrt5f.js";import"./chunk-wf18y499.js";import"./chunk-4bp91rza.js";import"./chunk-6vxddv5w.js";import"./chunk-dwza14dk.js";import"./chunk-vey57h4x.js";import"./chunk-40pe0tde.js";import"./chunk-d4y5hyjg.js";import"./chunk-q0pd8bac.js";import"./chunk-4dy64hgp.js";import"./chunk-cqtkxwd8.js";import"./chunk-gt10s0ks.js";import"./chunk-z9k4506p.js";import"./chunk-yxsc90ba.js";import"./chunk-vk8gxf4y.js";import"./chunk-jr622341.js";import"./chunk-xzshjp04.js";import"./chunk-pyt4xpze.js";import"./chunk-52f62kr0.js";import"./chunk-svnhycdw.js";import"./chunk-9skj2w9e.js";import"./chunk-m5r6zq6v.js";import"./chunk-vg9ec44m.js";import"./chunk-e826jvr2.js";import"./chunk-4gv7nsdd.js";import"./chunk-afagt413.js";import"./chunk-76jbys6j.js";import"./chunk-9exxjnxc.js";import"./chunk-dm7hfb7f.js";import"./chunk-s5taq9jy.js";import"./chunk-62mb6wxm.js";import"./chunk-zg72kz2k.js";import"./chunk-kr7t73tg.js";import"./chunk-9tfm1dk2.js";import"./chunk-x2mbre12.js";import"./chunk-sprbs7aj.js";import"./chunk-qvnsgyfk.js";import"./chunk-zezz8xfw.js";import"./chunk-bkqemdv8.js";import"./chunk-pfx8ts02.js";export{c as url,b as openapi,d as listen,e as Server,a as Default};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{ct as _}from"./chunk-fdmz0502.js";import{nu as h}from"./chunk-33mzqyyb.js";import{wP as X,yP as L}from"./chunk-sh03ka27.js";var E={};X(E,{println:()=>g,print:()=>a,markdown:()=>G,logo:()=>I,input:()=>w,error:()=>A,empty:()=>D,UI:()=>E,Style:()=>m,CancelledError:()=>N});import{EOL as x}from"os";var T={left:[" "," "," \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557","\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2551 \u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D","\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 ","\u2588\u2588\u2551\u2584\u2584 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 ","\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u2588\u2588\u2551 \u2588\u2588\u2551 "," \u255A\u2550\u2550\u2580\u2580\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D "],right:[" "," "," \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557","\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D","\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2557 ","\u2588\u2588\u2551\u2584\u2584 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2554\u2550\u2550\u255D ","\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557"," \u255A\u2550\u2550\u2580\u2580\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D"]},R={left:[" "," ","\u2588\u2580\u2580\u2588 \u2588 \u2580\u2580\u2580","\u2588 \u2584\u2588 \u2588 \u2588 ","\u2580\u2580\u2580\u2580 \u2580 \u2580 "],right:[" "," ","\u2588\u2580\u2580\u2588 \u2588\u2580\u2580\u2588 \u2588\u2580\u2580\u2584 \u2588\u2580\u2580\u2580","\u2588 \u2584\u2588 \u2588 \u2588 \u2588 \u2588 \u2588\u2580\u2580 ","\u2580\u2580\u2580\u2580 \u2580\u2580\u2580\u2580 \u2580\u2580\u2580 \u2580\u2580\u2580\u2580"]};var O=["\u2800 ","\u2588\u2580\u2580\u2588 \u2588 \u2580\u2580\u2580 \u2588\u2580\u2580\u2588 \u2588\u2580\u2580\u2588 \u2588\u2580\u2580\u2584 \u2588\u2580\u2580\u2580","\u2588 \u2584\u2588 \u2588 \u2588 \u2588 \u2584\u2588 \u2588 \u2588 \u2588 \u2588 \u2588\u2580\u2580 ","\u2580\u2580\u2580\u2580 \u2580 \u2580 \u2580\u2580\u2580\u2580 \u2580\u2580\u2580\u2580 \u2580\u2580\u2580 \u2580\u2580\u2580\u2580"],N=_.create("UICancelledError",h.void()),m={TEXT_HIGHLIGHT:"\x1B[96m",TEXT_HIGHLIGHT_BOLD:"\x1B[96m\x1B[1m",TEXT_DIM:"\x1B[90m",TEXT_DIM_BOLD:"\x1B[90m\x1B[1m",TEXT_NORMAL:"\x1B[0m",TEXT_NORMAL_BOLD:"\x1B[1m",TEXT_WARNING:"\x1B[93m",TEXT_WARNING_BOLD:"\x1B[93m\x1B[1m",TEXT_DANGER:"\x1B[91m",TEXT_DANGER_BOLD:"\x1B[91m\x1B[1m",TEXT_SUCCESS:"\x1B[92m",TEXT_SUCCESS_BOLD:"\x1B[92m\x1B[1m",TEXT_INFO:"\x1B[94m",TEXT_INFO_BOLD:"\x1B[94m\x1B[1m"};function g(...r){a(...r),process.stderr.write(x)}function a(...r){f=!1,process.stderr.write(r.join(" "))}var f=!1;function D(){if(f)return;g(""+m.TEXT_NORMAL),f=!0}function I(r){if(!process.stdout.isTTY&&!process.stderr.isTTY){let o=[];for(let s of O){if(r)o.push(r);o.push(s),o.push(x)}return o.join("").trimEnd()}let n=[],t="\x1B[0m",i={fg:"\x1B[90m",shadow:"\x1B[38;5;235m",bg:"\x1B[48;5;235m"},c={fg:t,shadow:"\x1B[38;5;238m",bg:"\x1B[48;5;238m"},d=" ",b=(o,s,u,l)=>{let e=[];for(let p of o){if(p==="_"){e.push(l," ",t);continue}if(p==="^"){e.push(s,l,"\u2580",t);continue}if(p==="~"){e.push(u,"\u2580",t);continue}if(p===" "){e.push(" ");continue}e.push(s,p,t)}return e.join("")};return T.left.forEach((o,s)=>{if(r)n.push(r);n.push(b(o,i.fg,i.shadow,i.bg)),n.push(d);let u=T.right[s]??"";n.push(b(u,c.fg,c.shadow,c.bg)),n.push(x)}),n.join("").trimEnd()}async function w(r){let t=L("readline").createInterface({input:process.stdin,output:process.stdout});return new Promise((i)=>{t.question(r,(c)=>{t.close(),i(c.trim())})})}function A(r){if(r.startsWith("Error: "))r=r.slice(7);g(m.TEXT_DANGER_BOLD+"Error: "+m.TEXT_NORMAL+r)}function G(r){return r}
3
- export{T as ag,R as bg,E as cg};
2
+ import{Iu as _}from"./chunk-76jbys6j.js";import{Tv as h}from"./chunk-kr7t73tg.js";import{aR as X,cR as L}from"./chunk-pfx8ts02.js";var E={};X(E,{println:()=>g,print:()=>a,markdown:()=>G,logo:()=>I,input:()=>w,error:()=>A,empty:()=>D,UI:()=>E,Style:()=>m,CancelledError:()=>N});import{EOL as x}from"os";var T={left:[" "," "," \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557","\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2551 \u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D","\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 ","\u2588\u2588\u2551\u2584\u2584 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 ","\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u2588\u2588\u2551 \u2588\u2588\u2551 "," \u255A\u2550\u2550\u2580\u2580\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D "],right:[" "," "," \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557","\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D","\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2557 ","\u2588\u2588\u2551\u2584\u2584 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2554\u2550\u2550\u255D ","\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557"," \u255A\u2550\u2550\u2580\u2580\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D"]},R={left:[" "," ","\u2588\u2580\u2580\u2588 \u2588 \u2580\u2580\u2580","\u2588 \u2584\u2588 \u2588 \u2588 ","\u2580\u2580\u2580\u2580 \u2580 \u2580 "],right:[" "," ","\u2588\u2580\u2580\u2588 \u2588\u2580\u2580\u2588 \u2588\u2580\u2580\u2584 \u2588\u2580\u2580\u2580","\u2588 \u2584\u2588 \u2588 \u2588 \u2588 \u2588 \u2588\u2580\u2580 ","\u2580\u2580\u2580\u2580 \u2580\u2580\u2580\u2580 \u2580\u2580\u2580 \u2580\u2580\u2580\u2580"]};var O=["\u2800 ","\u2588\u2580\u2580\u2588 \u2588 \u2580\u2580\u2580 \u2588\u2580\u2580\u2588 \u2588\u2580\u2580\u2588 \u2588\u2580\u2580\u2584 \u2588\u2580\u2580\u2580","\u2588 \u2584\u2588 \u2588 \u2588 \u2588 \u2584\u2588 \u2588 \u2588 \u2588 \u2588 \u2588\u2580\u2580 ","\u2580\u2580\u2580\u2580 \u2580 \u2580 \u2580\u2580\u2580\u2580 \u2580\u2580\u2580\u2580 \u2580\u2580\u2580 \u2580\u2580\u2580\u2580"],N=_.create("UICancelledError",h.void()),m={TEXT_HIGHLIGHT:"\x1B[96m",TEXT_HIGHLIGHT_BOLD:"\x1B[96m\x1B[1m",TEXT_DIM:"\x1B[90m",TEXT_DIM_BOLD:"\x1B[90m\x1B[1m",TEXT_NORMAL:"\x1B[0m",TEXT_NORMAL_BOLD:"\x1B[1m",TEXT_WARNING:"\x1B[93m",TEXT_WARNING_BOLD:"\x1B[93m\x1B[1m",TEXT_DANGER:"\x1B[91m",TEXT_DANGER_BOLD:"\x1B[91m\x1B[1m",TEXT_SUCCESS:"\x1B[92m",TEXT_SUCCESS_BOLD:"\x1B[92m\x1B[1m",TEXT_INFO:"\x1B[94m",TEXT_INFO_BOLD:"\x1B[94m\x1B[1m"};function g(...r){a(...r),process.stderr.write(x)}function a(...r){f=!1,process.stderr.write(r.join(" "))}var f=!1;function D(){if(f)return;g(""+m.TEXT_NORMAL),f=!0}function I(r){if(!process.stdout.isTTY&&!process.stderr.isTTY){let o=[];for(let s of O){if(r)o.push(r);o.push(s),o.push(x)}return o.join("").trimEnd()}let n=[],t="\x1B[0m",i={fg:"\x1B[90m",shadow:"\x1B[38;5;235m",bg:"\x1B[48;5;235m"},c={fg:t,shadow:"\x1B[38;5;238m",bg:"\x1B[48;5;238m"},d=" ",b=(o,s,u,l)=>{let e=[];for(let p of o){if(p==="_"){e.push(l," ",t);continue}if(p==="^"){e.push(s,l,"\u2580",t);continue}if(p==="~"){e.push(u,"\u2580",t);continue}if(p===" "){e.push(" ");continue}e.push(s,p,t)}return e.join("")};return T.left.forEach((o,s)=>{if(r)n.push(r);n.push(b(o,i.fg,i.shadow,i.bg)),n.push(d);let u=T.right[s]??"";n.push(b(u,c.fg,c.shadow,c.bg)),n.push(x)}),n.join("").trimEnd()}async function w(r){let t=L("readline").createInterface({input:process.stdin,output:process.stdout});return new Promise((i)=>{t.question(r,(c)=>{t.close(),i(c.trim())})})}function A(r){if(r.startsWith("Error: "))r=r.slice(7);g(m.TEXT_DANGER_BOLD+"Error: "+m.TEXT_NORMAL+r)}function G(r){return r}
3
+ export{T as bg,R as cg,E as dg};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Aq as yQ,Bq as c,Cq as PQ,Dq as MQ,Eq as i,Iq as kQ,Jp as g,Lp as jQ,Pp as RQ,Qp as ZQ,Zp as o,cq as xQ,dq as NQ,gq as bQ,kq as f,nq as C,uq as l,vq as p,zq as h}from"./chunk-1bq15kf0.js";import{Kq as e,Vq as wQ,Xq as YQ}from"./chunk-pdcxmr6x.js";import"./chunk-cqtkxwd8.js";import"./chunk-a1mbach4.js";import{Lu as Q}from"./chunk-sg9enzsp.js";import"./chunk-5q98z8ck.js";import"./chunk-sh03ka27.js";var _Q="3.0.63",vQ=f(()=>C(Q.object({error:Q.object({code:Q.number().nullable(),message:Q.string(),status:Q.string()})}))),QQ=PQ({errorSchema:vQ,errorToMessage:(X)=>X.error.message}),hQ=Q.union([Q.object({text:Q.string()}),Q.object({inlineData:Q.object({mimeType:Q.string(),data:Q.string()})})]),mQ=f(()=>C(Q.object({outputDimensionality:Q.number().optional(),taskType:Q.enum(["SEMANTIC_SIMILARITY","CLASSIFICATION","CLUSTERING","RETRIEVAL_DOCUMENT","RETRIEVAL_QUERY","QUESTION_ANSWERING","FACT_VERIFICATION","CODE_RETRIEVAL_QUERY"]).optional(),content:Q.array(Q.array(hQ).min(1).nullable()).optional()}))),uQ=class{constructor(X,Y){this.specificationVersion="v3",this.maxEmbeddingsPerCall=2048,this.supportsParallelCalls=!0,this.modelId=X,this.config=Y}get provider(){return this.config.provider}async doEmbed({values:X,headers:Y,abortSignal:Z,providerOptions:$}){let J=await l({provider:"google",providerOptions:$,schema:mQ});if(X.length>this.maxEmbeddingsPerCall)throw new wQ({provider:this.provider,modelId:this.modelId,maxEmbeddingsPerCall:this.maxEmbeddingsPerCall,values:X});let L=g(await c(this.config.headers),Y),H=J==null?void 0:J.content;if(H!=null&&H.length!==X.length)throw Error(`The number of multimodal content entries (${H.length}) must match the number of values (${X.length}).`);if(X.length===1){let U=H==null?void 0:H[0],G=X[0]?[{text:X[0]}]:[],D=U!=null?[...G,...U]:[{text:X[0]}],{responseHeaders:N,value:E,rawValue:q}=await p({url:`${this.config.baseURL}/models/${this.modelId}:embedContent`,headers:L,body:{model:`models/${this.modelId}`,content:{parts:D},outputDimensionality:J==null?void 0:J.outputDimensionality,taskType:J==null?void 0:J.taskType},failedResponseHandler:QQ,successfulResponseHandler:i(dQ),abortSignal:Z,fetch:this.config.fetch});return{warnings:[],embeddings:[E.embedding.values],usage:void 0,response:{headers:N,body:q}}}let{responseHeaders:w,value:V,rawValue:x}=await p({url:`${this.config.baseURL}/models/${this.modelId}:batchEmbedContents`,headers:L,body:{requests:X.map((U,G)=>{let D=H==null?void 0:H[G],N=U?[{text:U}]:[];return{model:`models/${this.modelId}`,content:{role:"user",parts:D!=null?[...N,...D]:[{text:U}]},outputDimensionality:J==null?void 0:J.outputDimensionality,taskType:J==null?void 0:J.taskType}})},failedResponseHandler:QQ,successfulResponseHandler:i(cQ),abortSignal:Z,fetch:this.config.fetch});return{warnings:[],embeddings:V.embeddings.map((U)=>U.values),usage:void 0,response:{headers:w,body:x}}}},cQ=f(()=>C(Q.object({embeddings:Q.array(Q.object({values:Q.array(Q.number())}))}))),dQ=f(()=>C(Q.object({embedding:Q.object({values:Q.array(Q.number())})})));function AQ(X){var Y,Z,$,J;if(X==null)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};let L=(Y=X.promptTokenCount)!=null?Y:0,H=(Z=X.candidatesTokenCount)!=null?Z:0,w=($=X.cachedContentTokenCount)!=null?$:0,V=(J=X.thoughtsTokenCount)!=null?J:0;return{inputTokens:{total:L,noCache:L-w,cacheRead:w,cacheWrite:void 0},outputTokens:{total:H+V,text:H,reasoning:V},raw:X}}function u(X,Y=!0){if(X==null)return;if(gQ(X)){if(Y)return;if(typeof X==="object"&&X.description)return{type:"object",description:X.description};return{type:"object"}}if(typeof X==="boolean")return{type:"boolean",properties:{}};let{type:Z,description:$,required:J,properties:L,items:H,allOf:w,anyOf:V,oneOf:x,format:U,const:G,minLength:D,enum:N}=X,E={};if($)E.description=$;if(J)E.required=J;if(U)E.format=U;if(G!==void 0)E.enum=[G];if(Z)if(Array.isArray(Z)){let q=Z.includes("null"),j=Z.filter((B)=>B!=="null");if(j.length===0)E.type="null";else if(E.anyOf=j.map((B)=>({type:B})),q)E.nullable=!0}else E.type=Z;if(N!==void 0)E.enum=N;if(L!=null)E.properties=Object.entries(L).reduce((q,[j,B])=>{return q[j]=u(B,!1),q},{});if(H)E.items=Array.isArray(H)?H.map((q)=>u(q,!1)):u(H,!1);if(w)E.allOf=w.map((q)=>u(q,!1));if(V)if(V.some((q)=>typeof q==="object"&&(q==null?void 0:q.type)==="null")){let q=V.filter((j)=>!(typeof j==="object"&&(j==null?void 0:j.type)==="null"));if(q.length===1){let j=u(q[0],!1);if(typeof j==="object")E.nullable=!0,Object.assign(E,j)}else E.anyOf=q.map((j)=>u(j,!1)),E.nullable=!0}else E.anyOf=V.map((q)=>u(q,!1));if(x)E.oneOf=x.map((q)=>u(q,!1));if(D!==void 0)E.minLength=D;return E}function gQ(X){return X!=null&&typeof X==="object"&&X.type==="object"&&(X.properties==null||Object.keys(X.properties).length===0)&&!X.additionalProperties}var pQ=/^data:([^;,]+);base64,(.+)$/s;function iQ(X){let Y=pQ.exec(X);if(Y==null)return;return{mediaType:Y[1],data:Y[2]}}function lQ(X){let Y=iQ(X);if(Y==null)return;return{inlineData:{mimeType:Y.mediaType,data:Y.data}}}function sQ(X,Y,Z){let $=[],J=[];for(let L of Z)switch(L.type){case"text":{J.push(L.text);break}case"image-data":case"file-data":{$.push({inlineData:{mimeType:L.mediaType,data:L.data}});break}case"image-url":case"file-url":{let H=lQ(L.url);if(H!=null)$.push(H);else J.push(JSON.stringify(L));break}default:{J.push(JSON.stringify(L));break}}X.push({functionResponse:{name:Y,response:{name:Y,content:J.length>0?J.join(`
2
+ import{$r as p,Dr as o,Ir as xQ,Jr as NQ,Mr as bQ,Qr as f,Tr as C,_r as l,ds as h,es as yQ,fs as c,gs as PQ,hs as MQ,is as i,ms as kQ,nr as g,pr as jQ,tr as RQ,ur as ZQ}from"./chunk-q0pd8bac.js";import{Bs as YQ,os as e,zs as wQ}from"./chunk-4dy64hgp.js";import"./chunk-cqtkxwd8.js";import"./chunk-gt10s0ks.js";import{pw as Q}from"./chunk-9tfm1dk2.js";import"./chunk-x2mbre12.js";import"./chunk-pfx8ts02.js";var _Q="3.0.63",vQ=f(()=>C(Q.object({error:Q.object({code:Q.number().nullable(),message:Q.string(),status:Q.string()})}))),QQ=PQ({errorSchema:vQ,errorToMessage:(X)=>X.error.message}),hQ=Q.union([Q.object({text:Q.string()}),Q.object({inlineData:Q.object({mimeType:Q.string(),data:Q.string()})})]),mQ=f(()=>C(Q.object({outputDimensionality:Q.number().optional(),taskType:Q.enum(["SEMANTIC_SIMILARITY","CLASSIFICATION","CLUSTERING","RETRIEVAL_DOCUMENT","RETRIEVAL_QUERY","QUESTION_ANSWERING","FACT_VERIFICATION","CODE_RETRIEVAL_QUERY"]).optional(),content:Q.array(Q.array(hQ).min(1).nullable()).optional()}))),uQ=class{constructor(X,Y){this.specificationVersion="v3",this.maxEmbeddingsPerCall=2048,this.supportsParallelCalls=!0,this.modelId=X,this.config=Y}get provider(){return this.config.provider}async doEmbed({values:X,headers:Y,abortSignal:Z,providerOptions:$}){let J=await l({provider:"google",providerOptions:$,schema:mQ});if(X.length>this.maxEmbeddingsPerCall)throw new wQ({provider:this.provider,modelId:this.modelId,maxEmbeddingsPerCall:this.maxEmbeddingsPerCall,values:X});let L=g(await c(this.config.headers),Y),H=J==null?void 0:J.content;if(H!=null&&H.length!==X.length)throw Error(`The number of multimodal content entries (${H.length}) must match the number of values (${X.length}).`);if(X.length===1){let U=H==null?void 0:H[0],G=X[0]?[{text:X[0]}]:[],D=U!=null?[...G,...U]:[{text:X[0]}],{responseHeaders:N,value:E,rawValue:q}=await p({url:`${this.config.baseURL}/models/${this.modelId}:embedContent`,headers:L,body:{model:`models/${this.modelId}`,content:{parts:D},outputDimensionality:J==null?void 0:J.outputDimensionality,taskType:J==null?void 0:J.taskType},failedResponseHandler:QQ,successfulResponseHandler:i(dQ),abortSignal:Z,fetch:this.config.fetch});return{warnings:[],embeddings:[E.embedding.values],usage:void 0,response:{headers:N,body:q}}}let{responseHeaders:w,value:V,rawValue:x}=await p({url:`${this.config.baseURL}/models/${this.modelId}:batchEmbedContents`,headers:L,body:{requests:X.map((U,G)=>{let D=H==null?void 0:H[G],N=U?[{text:U}]:[];return{model:`models/${this.modelId}`,content:{role:"user",parts:D!=null?[...N,...D]:[{text:U}]},outputDimensionality:J==null?void 0:J.outputDimensionality,taskType:J==null?void 0:J.taskType}})},failedResponseHandler:QQ,successfulResponseHandler:i(cQ),abortSignal:Z,fetch:this.config.fetch});return{warnings:[],embeddings:V.embeddings.map((U)=>U.values),usage:void 0,response:{headers:w,body:x}}}},cQ=f(()=>C(Q.object({embeddings:Q.array(Q.object({values:Q.array(Q.number())}))}))),dQ=f(()=>C(Q.object({embedding:Q.object({values:Q.array(Q.number())})})));function AQ(X){var Y,Z,$,J;if(X==null)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};let L=(Y=X.promptTokenCount)!=null?Y:0,H=(Z=X.candidatesTokenCount)!=null?Z:0,w=($=X.cachedContentTokenCount)!=null?$:0,V=(J=X.thoughtsTokenCount)!=null?J:0;return{inputTokens:{total:L,noCache:L-w,cacheRead:w,cacheWrite:void 0},outputTokens:{total:H+V,text:H,reasoning:V},raw:X}}function u(X,Y=!0){if(X==null)return;if(gQ(X)){if(Y)return;if(typeof X==="object"&&X.description)return{type:"object",description:X.description};return{type:"object"}}if(typeof X==="boolean")return{type:"boolean",properties:{}};let{type:Z,description:$,required:J,properties:L,items:H,allOf:w,anyOf:V,oneOf:x,format:U,const:G,minLength:D,enum:N}=X,E={};if($)E.description=$;if(J)E.required=J;if(U)E.format=U;if(G!==void 0)E.enum=[G];if(Z)if(Array.isArray(Z)){let q=Z.includes("null"),j=Z.filter((B)=>B!=="null");if(j.length===0)E.type="null";else if(E.anyOf=j.map((B)=>({type:B})),q)E.nullable=!0}else E.type=Z;if(N!==void 0)E.enum=N;if(L!=null)E.properties=Object.entries(L).reduce((q,[j,B])=>{return q[j]=u(B,!1),q},{});if(H)E.items=Array.isArray(H)?H.map((q)=>u(q,!1)):u(H,!1);if(w)E.allOf=w.map((q)=>u(q,!1));if(V)if(V.some((q)=>typeof q==="object"&&(q==null?void 0:q.type)==="null")){let q=V.filter((j)=>!(typeof j==="object"&&(j==null?void 0:j.type)==="null"));if(q.length===1){let j=u(q[0],!1);if(typeof j==="object")E.nullable=!0,Object.assign(E,j)}else E.anyOf=q.map((j)=>u(j,!1)),E.nullable=!0}else E.anyOf=V.map((q)=>u(q,!1));if(x)E.oneOf=x.map((q)=>u(q,!1));if(D!==void 0)E.minLength=D;return E}function gQ(X){return X!=null&&typeof X==="object"&&X.type==="object"&&(X.properties==null||Object.keys(X.properties).length===0)&&!X.additionalProperties}var pQ=/^data:([^;,]+);base64,(.+)$/s;function iQ(X){let Y=pQ.exec(X);if(Y==null)return;return{mediaType:Y[1],data:Y[2]}}function lQ(X){let Y=iQ(X);if(Y==null)return;return{inlineData:{mimeType:Y.mediaType,data:Y.data}}}function sQ(X,Y,Z){let $=[],J=[];for(let L of Z)switch(L.type){case"text":{J.push(L.text);break}case"image-data":case"file-data":{$.push({inlineData:{mimeType:L.mediaType,data:L.data}});break}case"image-url":case"file-url":{let H=lQ(L.url);if(H!=null)$.push(H);else J.push(JSON.stringify(L));break}default:{J.push(JSON.stringify(L));break}}X.push({functionResponse:{name:Y,response:{name:Y,content:J.length>0?J.join(`
3
3
  `):"Tool executed successfully."},...$.length>0?{parts:$}:{}}})}function nQ(X,Y,Z){for(let $ of Z)switch($.type){case"text":X.push({functionResponse:{name:Y,response:{name:Y,content:$.text}}});break;case"image-data":X.push({inlineData:{mimeType:String($.mediaType),data:String($.data)}},{text:"Tool executed successfully and returned this image as a response"});break;default:X.push({text:JSON.stringify($)});break}}function aQ(X,Y){var Z,$,J,L,H,w,V,x;let U=[],G=[],D=!0,N=(Z=Y==null?void 0:Y.isGemmaModel)!=null?Z:!1,E=($=Y==null?void 0:Y.providerOptionsName)!=null?$:"google",q=(J=Y==null?void 0:Y.supportsFunctionResponseParts)!=null?J:!0;for(let{role:j,content:B}of X)switch(j){case"system":{if(!D)throw new YQ({functionality:"system messages are only supported at the beginning of the conversation"});U.push({text:B});break}case"user":{D=!1;let K=[];for(let F of B)switch(F.type){case"text":{K.push({text:F.text});break}case"file":{let b=F.mediaType==="image/*"?"image/jpeg":F.mediaType;K.push(F.data instanceof URL?{fileData:{mimeType:b,fileUri:F.data.toString()}}:{inlineData:{mimeType:b,data:ZQ(F.data)}});break}}G.push({role:"user",parts:K});break}case"assistant":{D=!1,G.push({role:"model",parts:B.map((K)=>{var F,b,S,k;let z=(k=(F=K.providerOptions)==null?void 0:F[E])!=null?k:E!=="google"?(b=K.providerOptions)==null?void 0:b.google:(S=K.providerOptions)==null?void 0:S.vertex,y=(z==null?void 0:z.thoughtSignature)!=null?String(z.thoughtSignature):void 0;switch(K.type){case"text":return K.text.length===0?void 0:{text:K.text,thoughtSignature:y};case"reasoning":return K.text.length===0?void 0:{text:K.text,thought:!0,thoughtSignature:y};case"file":{if(K.data instanceof URL)throw new YQ({functionality:"File data URLs in assistant messages are not supported"});return{inlineData:{mimeType:K.mediaType,data:ZQ(K.data)},...(z==null?void 0:z.thought)===!0?{thought:!0}:{},thoughtSignature:y}}case"tool-call":{let P=(z==null?void 0:z.serverToolCallId)!=null?String(z.serverToolCallId):void 0,O=(z==null?void 0:z.serverToolType)!=null?String(z.serverToolType):void 0;if(P&&O)return{toolCall:{toolType:O,args:typeof K.input==="string"?JSON.parse(K.input):K.input,id:P},thoughtSignature:y};return{functionCall:{name:K.toolName,args:K.input},thoughtSignature:y}}case"tool-result":{let P=(z==null?void 0:z.serverToolCallId)!=null?String(z.serverToolCallId):void 0,O=(z==null?void 0:z.serverToolType)!=null?String(z.serverToolType):void 0;if(P&&O)return{toolResponse:{toolType:O,response:K.output.type==="json"?K.output.value:{},id:P},thoughtSignature:y};return}}}).filter((K)=>K!==void 0)});break}case"tool":{D=!1;let K=[];for(let F of B){if(F.type==="tool-approval-response")continue;let b=(V=(L=F.providerOptions)==null?void 0:L[E])!=null?V:E!=="google"?(H=F.providerOptions)==null?void 0:H.google:(w=F.providerOptions)==null?void 0:w.vertex,S=(b==null?void 0:b.serverToolCallId)!=null?String(b.serverToolCallId):void 0,k=(b==null?void 0:b.serverToolType)!=null?String(b.serverToolType):void 0;if(S&&k){let y=(b==null?void 0:b.thoughtSignature)!=null?String(b.thoughtSignature):void 0;if(G.length>0){let P=G[G.length-1];if(P.role==="model"){P.parts.push({toolResponse:{toolType:k,response:F.output.type==="json"?F.output.value:{},id:S},thoughtSignature:y});continue}}}let z=F.output;if(z.type==="content")if(q)sQ(K,F.toolName,z.value);else nQ(K,F.toolName,z.value);else K.push({functionResponse:{name:F.toolName,response:{name:F.toolName,content:z.type==="execution-denied"?(x=z.reason)!=null?x:"Tool execution denied.":z.value}}})}G.push({role:"user",parts:K});break}}if(N&&U.length>0&&G.length>0&&G[0].role==="user"){let j=U.map((B)=>B.text).join(`
4
4
 
5
5
  `);G[0].parts.unshift({text:j+`