@qitqode/qitqode-android-arm64 0.1.22 → 0.1.24

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 (426) hide show
  1. package/bundle/{chunk-18xhxdsh.js → chunk-02txthqv.js} +2 -2
  2. package/bundle/{chunk-t4c0zy2s.js → chunk-0ae5q6ck.js} +2 -2
  3. package/bundle/chunk-0bvde0cx.js +2 -0
  4. package/bundle/chunk-0kbxnazj.js +2 -0
  5. package/bundle/{chunk-n68xjm4p.js → chunk-0pbt75ev.js} +1 -1
  6. package/bundle/{chunk-hmm1m733.js → chunk-0pvbk8ks.js} +2 -2
  7. package/bundle/{chunk-j6cpsxva.js → chunk-0rtshz2r.js} +1 -1
  8. package/bundle/{chunk-mbkw9s6e.js → chunk-0w0jfzb4.js} +1 -1
  9. package/bundle/{chunk-qq9pvscd.js → chunk-0w4v0fbs.js} +2 -2
  10. package/bundle/{chunk-jee9y4t0.js → chunk-0z3z0gk1.js} +2 -2
  11. package/bundle/{chunk-mr7ya5kc.js → chunk-17ggas8k.js} +1 -1
  12. package/bundle/chunk-19z5q33z.js +2 -0
  13. package/bundle/chunk-1a0wnwna.js +2 -0
  14. package/bundle/{chunk-y2tnzn1y.js → chunk-1d64dywx.js} +2 -2
  15. package/bundle/chunk-1ddm2wxv.js +2 -0
  16. package/bundle/chunk-1fk4vsmc.js +2 -0
  17. package/bundle/{chunk-x4c8drpe.js → chunk-1fnmkm0z.js} +2 -2
  18. package/bundle/chunk-1j2f9nd5.js +2 -0
  19. package/bundle/{chunk-b5x3zghc.js → chunk-1jh5p5qw.js} +2 -2
  20. package/bundle/{chunk-mbmc1mg0.js → chunk-1jsywey3.js} +1 -1
  21. package/bundle/{chunk-t2n6fmpy.js → chunk-1p34bx7c.js} +2 -2
  22. package/bundle/{chunk-7yw60h8j.js → chunk-1xyn0sp2.js} +2 -2
  23. package/bundle/{chunk-yy91rm3y.js → chunk-1y9t7nxn.js} +1 -1
  24. package/bundle/{chunk-h99n5rv7.js → chunk-21ejqv4v.js} +1 -1
  25. package/bundle/chunk-23geekk5.js +3 -0
  26. package/bundle/chunk-27s736an.js +2 -0
  27. package/bundle/{chunk-4qegdkss.js → chunk-2eardzxs.js} +1 -1
  28. package/bundle/{chunk-6emme4kp.js → chunk-2gxjjqfx.js} +1 -1
  29. package/bundle/chunk-2j17xrzj.js +2 -0
  30. package/bundle/{chunk-s4epqtge.js → chunk-2mmspnr3.js} +1 -1
  31. package/bundle/{chunk-30233h8f.js → chunk-2qcndbxv.js} +1 -1
  32. package/bundle/{chunk-8rcpj28e.js → chunk-2wp1w8cy.js} +1 -1
  33. package/bundle/{chunk-6r4gn18m.js → chunk-2y8qz8te.js} +1 -1
  34. package/bundle/{chunk-8r4xs1q9.js → chunk-2z6fzwyc.js} +2 -2
  35. package/bundle/chunk-2zca3nak.js +2 -0
  36. package/bundle/chunk-2zcvcfq4.js +2 -0
  37. package/bundle/chunk-38hwkfj5.js +2 -0
  38. package/bundle/chunk-3afqxvsn.js +2 -0
  39. package/bundle/chunk-3avc1ppg.js +7 -0
  40. package/bundle/{chunk-a2ty2e0g.js → chunk-3nhqd8wg.js} +3 -3
  41. package/bundle/{chunk-jfy6bfvv.js → chunk-3tdqsm5c.js} +1 -1
  42. package/bundle/{chunk-c88rh38d.js → chunk-3tkp27x7.js} +2 -2
  43. package/bundle/chunk-3v4vtah1.js +2 -0
  44. package/bundle/{chunk-x8w2xgx6.js → chunk-3vbtra1j.js} +1 -1
  45. package/bundle/{chunk-b54t7ycj.js → chunk-3wzqs241.js} +1 -1
  46. package/bundle/chunk-3ypk0j2f.js +2 -0
  47. package/bundle/{chunk-tq258v8s.js → chunk-3z1y040p.js} +2 -2
  48. package/bundle/{chunk-3w60y2x5.js → chunk-453wpzg6.js} +1 -1
  49. package/bundle/chunk-4aykrj51.js +9 -0
  50. package/bundle/{chunk-qryeqw9s.js → chunk-4d1a547n.js} +1 -1
  51. package/bundle/chunk-4dtbmqmq.js +2 -0
  52. package/bundle/{chunk-s1mx3bkw.js → chunk-4k149ews.js} +1 -1
  53. package/bundle/{chunk-hyr049cr.js → chunk-4kse3awh.js} +1 -1
  54. package/bundle/chunk-4q9w2yve.js +5 -0
  55. package/bundle/{chunk-cx0z3mm3.js → chunk-4tn69nqs.js} +1 -1
  56. package/bundle/chunk-4zjb6rps.js +2 -0
  57. package/bundle/{chunk-cpkega70.js → chunk-58enbars.js} +2 -2
  58. package/bundle/{chunk-p64fb4rm.js → chunk-5h2hcp46.js} +1 -1
  59. package/bundle/chunk-5hkcjgwh.js +2 -0
  60. package/bundle/{chunk-7b69jj5g.js → chunk-5kmfnkzv.js} +1 -1
  61. package/bundle/{chunk-k19zvbzh.js → chunk-5rkmhzq0.js} +2 -2
  62. package/bundle/chunk-5snrz263.js +2 -0
  63. package/bundle/{chunk-ht1hqsaa.js → chunk-5y8efy5b.js} +1 -1
  64. package/bundle/chunk-653c0mxr.js +11 -0
  65. package/bundle/chunk-6av7hrrk.js +7 -0
  66. package/bundle/chunk-6bswn7w5.js +2 -0
  67. package/bundle/{chunk-fgtyrvan.js → chunk-6dxaty1v.js} +1 -1
  68. package/bundle/chunk-6epghftw.js +2 -0
  69. package/bundle/{chunk-bbznk59q.js → chunk-6g3m7yxf.js} +2 -2
  70. package/bundle/{chunk-xjdxyeja.js → chunk-6j0365q3.js} +2 -2
  71. package/bundle/chunk-6jjhxh8p.js +2 -0
  72. package/bundle/{chunk-y0fxwgrv.js → chunk-6mscvf6y.js} +1 -1
  73. package/bundle/{chunk-30p5pm3w.js → chunk-6nhje520.js} +1 -1
  74. package/bundle/{chunk-bjw39da9.js → chunk-6sdh1q7g.js} +1 -1
  75. package/bundle/{chunk-1eqcgkyq.js → chunk-6szvs3k9.js} +1 -1
  76. package/bundle/chunk-6ws7xyc5.js +2 -0
  77. package/bundle/{chunk-1d6ret10.js → chunk-78bajmqm.js} +1 -1
  78. package/bundle/{chunk-xtjsfqam.js → chunk-7a6p7dfx.js} +1 -1
  79. package/bundle/{chunk-ng85b73s.js → chunk-7dckfame.js} +1 -1
  80. package/bundle/chunk-7g28zhar.js +2 -0
  81. package/bundle/{chunk-8t1whx0k.js → chunk-7gczzccz.js} +1 -1
  82. package/bundle/chunk-7mhffm9f.js +800 -0
  83. package/bundle/{chunk-68jsyydc.js → chunk-7tgm8wp5.js} +1 -1
  84. package/bundle/chunk-7v02b2ms.js +2 -0
  85. package/bundle/chunk-7vmp2034.js +2 -0
  86. package/bundle/chunk-7wxrypkr.js +2 -0
  87. package/bundle/{chunk-1zb95qfx.js → chunk-7y3y3j51.js} +2 -2
  88. package/bundle/{chunk-mgp034y0.js → chunk-7yf15a3a.js} +1 -1
  89. package/bundle/{chunk-bwyf1bvf.js → chunk-82gs5cmn.js} +1 -1
  90. package/bundle/{chunk-hkmx6w54.js → chunk-84gnbzky.js} +1 -1
  91. package/bundle/{chunk-fyd31m33.js → chunk-8651hq0k.js} +1 -1
  92. package/bundle/{chunk-ymv05pbt.js → chunk-8717htya.js} +1 -1
  93. package/bundle/{chunk-fjtq8164.js → chunk-8ace31r2.js} +1 -1
  94. package/bundle/{chunk-7276th89.js → chunk-8cr7ks31.js} +1 -1
  95. package/bundle/{chunk-9g05wsae.js → chunk-8h9r6c8g.js} +2 -2
  96. package/bundle/chunk-8kk9gvdy.js +2 -0
  97. package/bundle/{chunk-haw1jzwb.js → chunk-8pe047p0.js} +1 -1
  98. package/bundle/{chunk-j2k4wxsk.js → chunk-8r79zf3y.js} +2 -2
  99. package/bundle/chunk-8ygpp4y3.js +2 -0
  100. package/bundle/chunk-95q60g1p.js +2 -0
  101. package/bundle/{chunk-rvz05kxy.js → chunk-9798jffg.js} +1 -1
  102. package/bundle/{chunk-7hx0pza2.js → chunk-99n6czag.js} +2 -2
  103. package/bundle/{chunk-m79gd4yt.js → chunk-9easaxy7.js} +1 -1
  104. package/bundle/{chunk-jyh2g13j.js → chunk-9f7y0dj0.js} +1 -1
  105. package/bundle/{chunk-x1dfc7qd.js → chunk-9jf67xb0.js} +2 -2
  106. package/bundle/chunk-9mjbenja.js +2 -0
  107. package/bundle/{chunk-9fdv5d8a.js → chunk-9nx8hm57.js} +1 -1
  108. package/bundle/{chunk-0ddhkapd.js → chunk-9pe4agdz.js} +2 -2
  109. package/bundle/{chunk-f72j5yx8.js → chunk-9rqrm9y8.js} +1 -1
  110. package/bundle/{chunk-mqt5qh3t.js → chunk-9sy9ws1w.js} +1 -1
  111. package/bundle/{chunk-zfw873yt.js → chunk-9vcw33dv.js} +1 -1
  112. package/bundle/chunk-9vn1gy8h.js +2 -0
  113. package/bundle/{chunk-wmmck56g.js → chunk-9xvctnjr.js} +1 -1
  114. package/bundle/{chunk-2p6w3w8f.js → chunk-a5zjrwqy.js} +2 -2
  115. package/bundle/{chunk-jj7wrfty.js → chunk-a9y27zd2.js} +1 -1
  116. package/bundle/{chunk-pcctf3gs.js → chunk-ac202abt.js} +1 -1
  117. package/bundle/{chunk-tcp31yv0.js → chunk-agdfqncf.js} +2 -2
  118. package/bundle/chunk-ajp3f08k.js +2 -0
  119. package/bundle/{chunk-7w01dxp9.js → chunk-am73j1bt.js} +1 -1
  120. package/bundle/{chunk-ne8ftsv3.js → chunk-apq38bt4.js} +3 -3
  121. package/bundle/chunk-aptkpdkc.js +2 -0
  122. package/bundle/{chunk-vpp88hhd.js → chunk-b643cra9.js} +229 -229
  123. package/bundle/{chunk-6hkv9411.js → chunk-b6m4yyww.js} +1 -1
  124. package/bundle/{chunk-rry321tn.js → chunk-b8ag61vj.js} +1 -1
  125. package/bundle/{chunk-hzexvrnj.js → chunk-bas6x25m.js} +2 -2
  126. package/bundle/{chunk-q6x5bmc3.js → chunk-bd21p9zz.js} +2 -2
  127. package/bundle/{chunk-t7v8wzr9.js → chunk-bf146hz2.js} +2 -2
  128. package/bundle/{chunk-pkdk0ppc.js → chunk-bky5a42k.js} +2 -2
  129. package/bundle/chunk-bry94ar5.js +2 -0
  130. package/bundle/chunk-btzyvqkf.js +2 -0
  131. package/bundle/{chunk-xce77xex.js → chunk-c31k8yh0.js} +1 -1
  132. package/bundle/chunk-c94pjdfh.js +2 -0
  133. package/bundle/chunk-cct9ds5c.js +2 -0
  134. package/bundle/chunk-cesrhm09.js +4 -0
  135. package/bundle/{chunk-pqyds00j.js → chunk-cvchztkc.js} +1 -1
  136. package/bundle/{chunk-x6gzygc3.js → chunk-cy2586rv.js} +1 -1
  137. package/bundle/chunk-czn535v0.js +2 -0
  138. package/bundle/chunk-d56zc21w.js +3 -0
  139. package/bundle/chunk-d7wd5hz1.js +2 -0
  140. package/bundle/chunk-d86cmjrp.js +2 -0
  141. package/bundle/{chunk-1kje2a6g.js → chunk-dann9gfq.js} +1 -1
  142. package/bundle/{chunk-fssgbz70.js → chunk-dcx8hjbs.js} +1 -1
  143. package/bundle/{chunk-x4b0ywbs.js → chunk-dgzyn27r.js} +1 -1
  144. package/bundle/{chunk-meaa7wrs.js → chunk-dkm7x8rj.js} +2 -2
  145. package/bundle/chunk-dkv2mg97.js +3 -0
  146. package/bundle/chunk-dnq65xvn.js +2 -0
  147. package/bundle/chunk-dpqv8rtn.js +2 -0
  148. package/bundle/chunk-e346x00p.js +10 -0
  149. package/bundle/chunk-e9mh7s3z.js +2 -0
  150. package/bundle/{chunk-kywg73qz.js → chunk-ebjhggdw.js} +1 -1
  151. package/bundle/{chunk-prrrw8t8.js → chunk-ecwz9nhs.js} +2 -2
  152. package/bundle/{chunk-m9bc5csy.js → chunk-edvcz2gd.js} +1 -1
  153. package/bundle/chunk-ek2y5f6g.js +2 -0
  154. package/bundle/{chunk-dhvwrrqx.js → chunk-ep8zn49w.js} +2 -2
  155. package/bundle/chunk-epdsay73.js +2 -0
  156. package/bundle/{chunk-adgrn60n.js → chunk-evqxvhdb.js} +1 -1
  157. package/bundle/{chunk-n1wawwry.js → chunk-ewyk4py6.js} +1 -1
  158. package/bundle/{chunk-56cty7nr.js → chunk-f3kjp838.js} +2 -2
  159. package/bundle/{chunk-c9afcdba.js → chunk-f819a7ec.js} +1 -1
  160. package/bundle/chunk-f89gntcy.js +3 -0
  161. package/bundle/{chunk-qwf258sw.js → chunk-fdezde1z.js} +1 -1
  162. package/bundle/chunk-ffnsn7tv.js +2 -0
  163. package/bundle/{chunk-98nh88th.js → chunk-fhng5her.js} +2 -2
  164. package/bundle/chunk-fkezc7ew.js +2 -0
  165. package/bundle/{chunk-78wt9ad8.js → chunk-fkvccmgk.js} +2 -2
  166. package/bundle/{chunk-1123xk5a.js → chunk-fm4xa6yx.js} +2 -2
  167. package/bundle/{chunk-j1kqhxnq.js → chunk-frdc3ysq.js} +1 -1
  168. package/bundle/chunk-fsxddgj0.js +2 -0
  169. package/bundle/{chunk-ah9cm91p.js → chunk-ftk58wxe.js} +1 -1
  170. package/bundle/{chunk-zz192a31.js → chunk-g0v9g37f.js} +1 -1
  171. package/bundle/{chunk-50aznc8e.js → chunk-g7vkkmsk.js} +3 -3
  172. package/bundle/chunk-gbcsfg6v.js +2 -0
  173. package/bundle/{chunk-s6qdtfty.js → chunk-gc9q0x8z.js} +3 -3
  174. package/bundle/{chunk-ntmn6epc.js → chunk-gen6f3dn.js} +2 -2
  175. package/bundle/{chunk-fkdbba26.js → chunk-gf4ek7rv.js} +1 -1
  176. package/bundle/{chunk-ee5r4h0v.js → chunk-gff87y4n.js} +1 -1
  177. package/bundle/chunk-gfmz85hp.js +2 -0
  178. package/bundle/chunk-gk63k4t6.js +2 -0
  179. package/bundle/{chunk-b3x13ndd.js → chunk-gn7xgd4c.js} +1 -1
  180. package/bundle/{chunk-4gfryje2.js → chunk-gn9p1d50.js} +1 -1
  181. package/bundle/{chunk-b1t8d1s8.js → chunk-gvzfffr4.js} +1 -1
  182. package/bundle/{chunk-zeh3mjgp.js → chunk-ha1w0xzh.js} +1 -1
  183. package/bundle/{chunk-r8ddb02d.js → chunk-hbnr0j7h.js} +2 -2
  184. package/bundle/chunk-hg563h5r.js +3 -0
  185. package/bundle/{chunk-y3x5m3e8.js → chunk-hg9nk090.js} +1 -1
  186. package/bundle/{chunk-67wvdfs5.js → chunk-hh3w51wp.js} +2 -2
  187. package/bundle/{chunk-fa03gsff.js → chunk-hh4c02fh.js} +1 -1
  188. package/bundle/{chunk-5z8gpy3x.js → chunk-hh9a709t.js} +1 -1
  189. package/bundle/{chunk-dgsg31vm.js → chunk-hjbks7r9.js} +1 -1
  190. package/bundle/{chunk-qafcfb4x.js → chunk-hqg5qbxk.js} +1 -1
  191. package/bundle/{chunk-jtbf88gw.js → chunk-hv4nhx6q.js} +2 -2
  192. package/bundle/{chunk-n4spe0sv.js → chunk-hxgb0y1w.js} +1 -1
  193. package/bundle/chunk-j0vf8s12.js +2 -0
  194. package/bundle/chunk-j1a64ade.js +3 -0
  195. package/bundle/chunk-j1bxt69x.js +2 -0
  196. package/bundle/{chunk-351wfvhp.js → chunk-j1veq3zr.js} +2 -2
  197. package/bundle/{chunk-60dxyp37.js → chunk-jbd9k041.js} +2 -2
  198. package/bundle/chunk-jcem8s30.js +2 -0
  199. package/bundle/{chunk-v9sfzkg5.js → chunk-jegn6jc3.js} +2 -2
  200. package/bundle/chunk-jjwjb9w0.js +3 -0
  201. package/bundle/{chunk-3degq6rv.js → chunk-jmjg8d8a.js} +4 -4
  202. package/bundle/chunk-jpham2a3.js +2 -0
  203. package/bundle/{chunk-rpy4rgmm.js → chunk-jpygkh1c.js} +1 -1
  204. package/bundle/{chunk-n39gqxkz.js → chunk-jr8qcf99.js} +2 -2
  205. package/bundle/{chunk-9hrpcnt8.js → chunk-jr9xnvjq.js} +1 -1
  206. package/bundle/{chunk-07b36w5g.js → chunk-jz3aav8a.js} +2 -2
  207. package/bundle/chunk-jzkymnr5.js +2 -0
  208. package/bundle/chunk-k0qtwnhb.js +2 -0
  209. package/bundle/{chunk-6w15nfph.js → chunk-k16hzy2q.js} +1 -1
  210. package/bundle/chunk-k2rsky7z.js +2 -0
  211. package/bundle/{chunk-61ndvjmm.js → chunk-k9d927xe.js} +1 -1
  212. package/bundle/{chunk-jrwfx6d8.js → chunk-k9g77a02.js} +1 -1
  213. package/bundle/{chunk-t1f7jeat.js → chunk-kaeyhw2n.js} +2 -2
  214. package/bundle/{chunk-gvj8qg7x.js → chunk-kc3hpmr2.js} +2 -2
  215. package/bundle/chunk-kcetcysa.js +2 -0
  216. package/bundle/chunk-kjfc5v3s.js +2 -0
  217. package/bundle/chunk-kkvb2c2z.js +8 -0
  218. package/bundle/chunk-km2ayfyf.js +2 -0
  219. package/bundle/chunk-knrh89eb.js +2 -0
  220. package/bundle/{chunk-8wzc27e3.js → chunk-kr0fsqas.js} +1 -1
  221. package/bundle/chunk-ksqfjawv.js +2 -0
  222. package/bundle/{chunk-awdpkgxf.js → chunk-ktmazmas.js} +2 -2
  223. package/bundle/{chunk-c4x99ayd.js → chunk-m8djypsy.js} +1 -1
  224. package/bundle/{chunk-10qkxzhh.js → chunk-mj24ntn9.js} +1 -1
  225. package/bundle/chunk-mjhb1q0n.js +3 -0
  226. package/bundle/{chunk-4xpfmpjf.js → chunk-ms1fd6h4.js} +1 -1
  227. package/bundle/chunk-mxcger73.js +2 -0
  228. package/bundle/{chunk-fzhgxcej.js → chunk-n1chdwrs.js} +1 -1
  229. package/bundle/{chunk-jatba8z8.js → chunk-najzfhb2.js} +1 -1
  230. package/bundle/chunk-nazkrkeb.js +2 -0
  231. package/bundle/chunk-nk01s49e.js +2 -0
  232. package/bundle/{chunk-pp44xnd7.js → chunk-ns0pswww.js} +1 -1
  233. package/bundle/chunk-ns8b7rx1.js +2 -0
  234. package/bundle/chunk-ny6vpkx2.js +2 -0
  235. package/bundle/{chunk-0vw5a7m9.js → chunk-p4hpr8d7.js} +1 -1
  236. package/bundle/{chunk-n1m5qdf5.js → chunk-p54bzjtv.js} +1 -1
  237. package/bundle/{chunk-f8xnn26j.js → chunk-pb7rnkke.js} +1 -1
  238. package/bundle/{chunk-4se8cbmb.js → chunk-pfhp78cr.js} +1 -1
  239. package/bundle/{chunk-y2r3zker.js → chunk-ps543k72.js} +1 -1
  240. package/bundle/chunk-pv8jcpnf.js +2 -0
  241. package/bundle/{chunk-vqxyph4q.js → chunk-pyq01301.js} +1 -1
  242. package/bundle/chunk-q0dd3ak6.js +3 -0
  243. package/bundle/chunk-q2s057bm.js +2 -0
  244. package/bundle/{chunk-x1naayst.js → chunk-q3x4x2tq.js} +1 -1
  245. package/bundle/chunk-q5cqg2c0.js +28 -0
  246. package/bundle/{chunk-msqx5bb0.js → chunk-q6fbyvpq.js} +1 -1
  247. package/bundle/chunk-qk2wnp2x.js +2 -0
  248. package/bundle/{chunk-wm3b050v.js → chunk-qw2hgs5b.js} +2 -2
  249. package/bundle/{chunk-8x6x3g16.js → chunk-qywwj58s.js} +2 -2
  250. package/bundle/chunk-r012q335.js +3 -0
  251. package/bundle/{chunk-gzwcj7c9.js → chunk-r3yqe7x0.js} +1 -1
  252. package/bundle/{chunk-2epf5806.js → chunk-r48g0kaq.js} +2 -2
  253. package/bundle/{chunk-hrnx60em.js → chunk-r7xp0xcn.js} +2 -2
  254. package/bundle/chunk-rbdjbgkb.js +2 -0
  255. package/bundle/{chunk-a3a9bbk7.js → chunk-rvvfs9ps.js} +2 -2
  256. package/bundle/chunk-rxjprhgh.js +2 -0
  257. package/bundle/chunk-s3w9bmze.js +2 -0
  258. package/bundle/chunk-s3zste1a.js +2 -0
  259. package/bundle/{chunk-bdzgtazc.js → chunk-s9amvacw.js} +2 -2
  260. package/bundle/chunk-sbt7qmwm.js +3 -0
  261. package/bundle/chunk-sf6h44pb.js +2 -0
  262. package/bundle/{chunk-aznbvrbm.js → chunk-sgtgvzv6.js} +1 -1
  263. package/bundle/chunk-sgvzxs7m.js +2 -0
  264. package/bundle/{chunk-h7rxnbf0.js → chunk-sjrmhd3e.js} +1 -1
  265. package/bundle/chunk-sp9bndyh.js +2 -0
  266. package/bundle/{chunk-ck65rcxb.js → chunk-spm1yy6w.js} +1 -1
  267. package/bundle/{chunk-h6htvj2y.js → chunk-srf73nm4.js} +1 -1
  268. package/bundle/{chunk-c2w3bqsa.js → chunk-sswbfqcq.js} +1 -1
  269. package/bundle/{chunk-er5q8nhp.js → chunk-t488d66k.js} +1 -1
  270. package/bundle/{chunk-aftpj9fe.js → chunk-t6w96xq2.js} +1 -1
  271. package/bundle/{chunk-t8365msg.js → chunk-te1zfpzv.js} +1 -1
  272. package/bundle/{chunk-2bxy8zm1.js → chunk-tk3bve0x.js} +2 -2
  273. package/bundle/chunk-tsn1jkr7.js +2 -0
  274. package/bundle/{chunk-z9b0ydw1.js → chunk-tzc4jkzg.js} +1 -1
  275. package/bundle/{chunk-01gtn79f.js → chunk-v2kyarwz.js} +2 -2
  276. package/bundle/{chunk-0qmaxpkv.js → chunk-v7r9np94.js} +1 -1
  277. package/bundle/{chunk-0jv8r99k.js → chunk-va4davgy.js} +317 -297
  278. package/bundle/{chunk-2bbvvh0d.js → chunk-vavrczqm.js} +1 -1
  279. package/bundle/{chunk-43xq4p51.js → chunk-ve5gb789.js} +2 -2
  280. package/bundle/{chunk-n9gzj085.js → chunk-vf1r5ckp.js} +1 -1
  281. package/bundle/{chunk-hnzs3ywg.js → chunk-vftqwdpg.js} +1 -1
  282. package/bundle/chunk-vg4styg5.js +2 -0
  283. package/bundle/chunk-vh09hhcs.js +2 -0
  284. package/bundle/chunk-vhktpm0n.js +2 -0
  285. package/bundle/{chunk-5a80qybt.js → chunk-vvypb02q.js} +1 -1
  286. package/bundle/{chunk-h5wh2d49.js → chunk-vzjcmwry.js} +2 -2
  287. package/bundle/{chunk-6nhgkw5r.js → chunk-w1atxyz0.js} +1 -1
  288. package/bundle/{chunk-73d0dy03.js → chunk-w7p2x973.js} +2 -2
  289. package/bundle/{chunk-db7hykjs.js → chunk-wa2ce2sg.js} +2 -2
  290. package/bundle/{chunk-3nc9wy1m.js → chunk-wf09j72q.js} +2 -2
  291. package/bundle/{chunk-wfb9dwmc.js → chunk-wfnk2vsd.js} +1 -1
  292. package/bundle/{chunk-zt8kghd2.js → chunk-wj6aq50n.js} +1 -1
  293. package/bundle/{chunk-39h565hz.js → chunk-wmrq9qqf.js} +1 -1
  294. package/bundle/{chunk-ha5qct06.js → chunk-wmw2gne9.js} +2 -2
  295. package/bundle/chunk-wtp0yvqw.js +2 -0
  296. package/bundle/{chunk-btjcs9ee.js → chunk-x6z2b63w.js} +1 -1
  297. package/bundle/{chunk-3xbtg0hn.js → chunk-xccs5c50.js} +1 -1
  298. package/bundle/{chunk-abc7ccfd.js → chunk-xj73j10a.js} +1 -1
  299. package/bundle/chunk-xmzs7q66.js +2 -0
  300. package/bundle/chunk-xv80476w.js +2 -0
  301. package/bundle/{chunk-tepesp0b.js → chunk-xv8gnkh5.js} +1 -1
  302. package/bundle/{chunk-hf0gny5t.js → chunk-y1srca0c.js} +2 -2
  303. package/bundle/{chunk-zy0zn8yx.js → chunk-y2jmtfdh.js} +2 -2
  304. package/bundle/{chunk-w8xaw2dv.js → chunk-y3n31nnx.js} +2 -2
  305. package/bundle/{chunk-6v4mhtha.js → chunk-ygj1cy0n.js} +1 -1
  306. package/bundle/{chunk-496rb1e4.js → chunk-yh174jhg.js} +2 -2
  307. package/bundle/chunk-yjvr0et1.js +2 -0
  308. package/bundle/{chunk-h9ftcgs2.js → chunk-yz7rqzby.js} +3 -3
  309. package/bundle/{chunk-2qy62cv4.js → chunk-yzdty5t9.js} +2 -2
  310. package/bundle/{chunk-5mrjxapq.js → chunk-zavtsfxz.js} +1 -1
  311. package/bundle/{chunk-h725tttx.js → chunk-zeh481tm.js} +2 -2
  312. package/bundle/{chunk-cn7nnjsf.js → chunk-zfnbk5gy.js} +1 -1
  313. package/bundle/{chunk-p20ft5mj.js → chunk-zk8n8hnh.js} +2 -2
  314. package/bundle/{chunk-en7nxqvn.js → chunk-zp2ffbc2.js} +2 -2
  315. package/bundle/chunk-zx3kcfkj.js +2 -0
  316. package/bundle/index.js +4 -4
  317. package/bundle/parser.worker.js +2 -2
  318. package/bundle/worker.js +1 -1
  319. package/package.json +1 -1
  320. package/bundle/chunk-04ezvjjf.js +0 -2
  321. package/bundle/chunk-0msr85tj.js +0 -2
  322. package/bundle/chunk-0qrpg3n8.js +0 -2
  323. package/bundle/chunk-0w8ztgmg.js +0 -2
  324. package/bundle/chunk-0y2nwncb.js +0 -2
  325. package/bundle/chunk-0zh8tykf.js +0 -2
  326. package/bundle/chunk-21z1vfgm.js +0 -2
  327. package/bundle/chunk-2ec8msmq.js +0 -2
  328. package/bundle/chunk-2n5m61m9.js +0 -2
  329. package/bundle/chunk-362z696e.js +0 -2
  330. package/bundle/chunk-367rm03h.js +0 -2
  331. package/bundle/chunk-3f6t3wde.js +0 -799
  332. package/bundle/chunk-40vz0fhv.js +0 -3
  333. package/bundle/chunk-43k17qzb.js +0 -2
  334. package/bundle/chunk-4r574drd.js +0 -2
  335. package/bundle/chunk-6c2xn1ab.js +0 -2
  336. package/bundle/chunk-6pe3xzkk.js +0 -11
  337. package/bundle/chunk-6rak9ez9.js +0 -2
  338. package/bundle/chunk-71dbq1d0.js +0 -2
  339. package/bundle/chunk-73r1zvgw.js +0 -2
  340. package/bundle/chunk-7az1bpy8.js +0 -2
  341. package/bundle/chunk-7bm1t462.js +0 -2
  342. package/bundle/chunk-7nq8126b.js +0 -2
  343. package/bundle/chunk-80a0d0js.js +0 -2
  344. package/bundle/chunk-9ac4h2d9.js +0 -2
  345. package/bundle/chunk-9zp746aj.js +0 -2
  346. package/bundle/chunk-a0vpemkf.js +0 -2
  347. package/bundle/chunk-anqjy235.js +0 -7
  348. package/bundle/chunk-atjzxp7b.js +0 -2
  349. package/bundle/chunk-ax4f4fbm.js +0 -2
  350. package/bundle/chunk-aybmm0jf.js +0 -2
  351. package/bundle/chunk-b2scgkye.js +0 -2
  352. package/bundle/chunk-b5h8vd5n.js +0 -3
  353. package/bundle/chunk-bbpze4hq.js +0 -2
  354. package/bundle/chunk-bn6mg34g.js +0 -7
  355. package/bundle/chunk-c6wrjyep.js +0 -2
  356. package/bundle/chunk-cckshvkb.js +0 -9
  357. package/bundle/chunk-ce3c03mh.js +0 -2
  358. package/bundle/chunk-cm31dbwq.js +0 -2
  359. package/bundle/chunk-cqaw6hka.js +0 -2
  360. package/bundle/chunk-cxbkhs5y.js +0 -2
  361. package/bundle/chunk-d9vs6zd0.js +0 -2
  362. package/bundle/chunk-dcyzpkww.js +0 -2
  363. package/bundle/chunk-dj3rct8v.js +0 -2
  364. package/bundle/chunk-djcsvcby.js +0 -5
  365. package/bundle/chunk-ds162xgb.js +0 -3
  366. package/bundle/chunk-e1zv873k.js +0 -2
  367. package/bundle/chunk-eb0ksh4x.js +0 -2
  368. package/bundle/chunk-efxshjyz.js +0 -2
  369. package/bundle/chunk-enry018j.js +0 -2
  370. package/bundle/chunk-f03yje8k.js +0 -3
  371. package/bundle/chunk-fd1vbz1f.js +0 -3
  372. package/bundle/chunk-fydd2nmw.js +0 -2
  373. package/bundle/chunk-g2bw2qf5.js +0 -2
  374. package/bundle/chunk-h9a4zzr4.js +0 -2
  375. package/bundle/chunk-hkqcpdmt.js +0 -3
  376. package/bundle/chunk-jx3kvzka.js +0 -2
  377. package/bundle/chunk-k6eyc1wv.js +0 -8
  378. package/bundle/chunk-k9m536te.js +0 -2
  379. package/bundle/chunk-khkv9s5c.js +0 -2
  380. package/bundle/chunk-kv58j3yk.js +0 -2
  381. package/bundle/chunk-m3sr6xdg.js +0 -2
  382. package/bundle/chunk-mmyhzhzt.js +0 -2
  383. package/bundle/chunk-mt8zem33.js +0 -24
  384. package/bundle/chunk-mw60bmaf.js +0 -2
  385. package/bundle/chunk-nk42gy65.js +0 -2
  386. package/bundle/chunk-ps8xnz0h.js +0 -2
  387. package/bundle/chunk-pvn4dz8e.js +0 -2
  388. package/bundle/chunk-pw3tnt2j.js +0 -2
  389. package/bundle/chunk-pzajshbc.js +0 -2
  390. package/bundle/chunk-q2weasmk.js +0 -2
  391. package/bundle/chunk-qe8zp79w.js +0 -2
  392. package/bundle/chunk-qvcnvqvf.js +0 -2
  393. package/bundle/chunk-qxrjbw22.js +0 -2
  394. package/bundle/chunk-qy9s3nmy.js +0 -2
  395. package/bundle/chunk-r0zsgad8.js +0 -4
  396. package/bundle/chunk-r4hkkcj4.js +0 -2
  397. package/bundle/chunk-r50kjthp.js +0 -2
  398. package/bundle/chunk-rbrkvj3x.js +0 -2
  399. package/bundle/chunk-rhgfyvth.js +0 -2
  400. package/bundle/chunk-rjdpw6at.js +0 -2
  401. package/bundle/chunk-s6c5c940.js +0 -2
  402. package/bundle/chunk-s79zd152.js +0 -2
  403. package/bundle/chunk-skjx57kv.js +0 -2
  404. package/bundle/chunk-ssfgge5z.js +0 -2
  405. package/bundle/chunk-t813v629.js +0 -2
  406. package/bundle/chunk-tdqbsbyb.js +0 -2
  407. package/bundle/chunk-th189x63.js +0 -3
  408. package/bundle/chunk-thbjhgw0.js +0 -2
  409. package/bundle/chunk-tk6gjy9d.js +0 -3
  410. package/bundle/chunk-tsfpkwvr.js +0 -2
  411. package/bundle/chunk-tz8qhbk9.js +0 -3
  412. package/bundle/chunk-v07wtbmt.js +0 -2
  413. package/bundle/chunk-v6kenrks.js +0 -2
  414. package/bundle/chunk-v7dfqwxx.js +0 -2
  415. package/bundle/chunk-vf7hhxsa.js +0 -2
  416. package/bundle/chunk-vmhq6cyz.js +0 -2
  417. package/bundle/chunk-vvs87e61.js +0 -2
  418. package/bundle/chunk-w6z123g2.js +0 -2
  419. package/bundle/chunk-wg0849tq.js +0 -2
  420. package/bundle/chunk-xa0f5g9z.js +0 -2
  421. package/bundle/chunk-xj0ba60b.js +0 -2
  422. package/bundle/chunk-xtfcdgwe.js +0 -2
  423. package/bundle/chunk-xz7dccwp.js +0 -2
  424. package/bundle/chunk-ye6j8k26.js +0 -2
  425. package/bundle/chunk-zbvf09bm.js +0 -3
  426. package/bundle/chunk-zmqmccbc.js +0 -2
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{$p as fG,Bq as xG,Cp as g,Ep as FG,Gp as NG,Ip as wG,Jp as QG,Kp as SG,Sp as $G,Xp as OG,Yp as XG,dq as v,gq as k,hq as s,kq as CG,nq as p,oq as u,tq as _,vq as yG,wq as YG,xq as d,yq as IG,zq as RG}from"./chunk-t7v8wzr9.js";import{Dq as l,Eq as GG,Nq as BG,Qq as c}from"./chunk-er5q8nhp.js";import"./chunk-cqtkxwd8.js";import"./chunk-h6htvj2y.js";import{Cu as G}from"./chunk-hrnx60em.js";import"./chunk-bbznk59q.js";import"./chunk-fa03gsff.js";function vG(J){var D;let L=[],q=[];for(let{role:K,content:z}of J)switch(K){case"system":{L.push({role:"system",content:z});break}case"user":{if(z.length===1&&z[0].type==="text"){L.push({role:"user",content:z[0].text});break}L.push({role:"user",content:z.map((A)=>{switch(A.type){case"text":return{type:"text",text:A.text};case"file":if(A.mediaType.startsWith("image/")){let Y=A.mediaType==="image/*"?"image/jpeg":A.mediaType;return{type:"image_url",image_url:{url:A.data instanceof URL?A.data.toString():`data:${Y};base64,${QG(A.data)}`}}}else throw new c({functionality:`file part media type ${A.mediaType}`})}})});break}case"assistant":{let A="",Y=[];for(let X of z)switch(X.type){case"text":{A+=X.text;break}case"tool-call":{Y.push({id:X.toolCallId,type:"function",function:{name:X.toolName,arguments:JSON.stringify(X.input)}});break}}L.push({role:"assistant",content:A,tool_calls:Y.length>0?Y:void 0});break}case"tool":{for(let A of z){if(A.type==="tool-approval-response")continue;let Y=A.output,X;switch(Y.type){case"text":case"error-text":X=Y.value;break;case"execution-denied":X=(D=Y.reason)!=null?D:"Tool execution denied.";break;case"content":case"json":case"error-json":X=JSON.stringify(Y.value);break}L.push({role:"tool",tool_call_id:A.toolCallId,content:X})}break}default:throw Error(`Unsupported role: ${K}`)}return{messages:L,warnings:q}}function EG(J){var D,L,q,K;let z=(L=(D=J.prompt_tokens_details)==null?void 0:D.cached_tokens)!=null?L:0,A=(K=(q=J.completion_tokens_details)==null?void 0:q.reasoning_tokens)!=null?K:0,Y=z<=J.prompt_tokens;return{inputTokens:{total:Y?J.prompt_tokens:J.prompt_tokens+z,noCache:Y?J.prompt_tokens-z:J.prompt_tokens,cacheRead:z,cacheWrite:void 0},outputTokens:{total:J.completion_tokens+A,text:J.completion_tokens,reasoning:A},raw:J}}function JG({id:J,model:D,created:L,created_at:q}){let K=L!=null?L:q;return{id:J!=null?J:void 0,modelId:D!=null?D:void 0,timestamp:K!=null?new Date(K*1000):void 0}}function WG(J){switch(J){case"stop":return"stop";case"length":return"length";case"tool_calls":case"function_call":return"tool-calls";case"content_filter":return"content-filter";default:return"other"}}var kG=G.object({type:G.literal("web"),country:G.string().length(2).optional(),excludedWebsites:G.array(G.string()).max(5).optional(),allowedWebsites:G.array(G.string()).max(5).optional(),safeSearch:G.boolean().optional()}),bG=G.object({type:G.literal("x"),excludedXHandles:G.array(G.string()).optional(),includedXHandles:G.array(G.string()).optional(),postFavoriteCount:G.number().int().optional(),postViewCount:G.number().int().optional(),xHandles:G.array(G.string()).optional()}),hG=G.object({type:G.literal("news"),country:G.string().length(2).optional(),excludedWebsites:G.array(G.string()).max(5).optional(),safeSearch:G.boolean().optional()}),_G=G.object({type:G.literal("rss"),links:G.array(G.string().url()).max(1)}),mG=G.discriminatedUnion("type",[kG,bG,hG,_G]),gG=G.object({reasoningEffort:G.enum(["low","high"]).optional(),logprobs:G.boolean().optional(),topLogprobs:G.number().int().min(0).max(8).optional(),parallel_function_calling:G.boolean().optional(),searchParameters:G.object({mode:G.enum(["off","auto","on"]),returnCitations:G.boolean().optional(),fromDate:G.string().optional(),toDate:G.string().optional(),maxSearchResults:G.number().min(1).max(50).optional(),sources:G.array(mG).optional()}).optional()}),uG=G.object({error:G.object({message:G.string(),type:G.string().nullish(),param:G.any().nullish(),code:G.union([G.string(),G.number()]).nullish()})}),r=yG({errorSchema:uG,errorToMessage:(J)=>J.error.message});function dG({tools:J,toolChoice:D}){J=(J==null?void 0:J.length)?J:void 0;let L=[];if(J==null)return{tools:void 0,toolChoice:void 0,toolWarnings:L};let q=[];for(let z of J)if(z.type==="provider")L.push({type:"unsupported",feature:`provider-defined tool ${z.name}`});else q.push({type:"function",function:{name:z.name,description:z.description,parameters:z.inputSchema,...z.strict!=null?{strict:z.strict}:{}}});if(D==null)return{tools:q,toolChoice:void 0,toolWarnings:L};let K=D.type;switch(K){case"auto":case"none":return{tools:q,toolChoice:K,toolWarnings:L};case"required":return{tools:q,toolChoice:"required",toolWarnings:L};case"tool":return{tools:q,toolChoice:{type:"function",function:{name:D.toolName}},toolWarnings:L};default:throw new c({functionality:`tool choice type: ${K}`})}}var cG=class{constructor(J,D){this.specificationVersion="v3",this.supportedUrls={"image/*":[/^https?:\/\/.*$/]},this.modelId=J,this.config=D}get provider(){return this.config.provider}async getArgs({prompt:J,maxOutputTokens:D,temperature:L,topP:q,topK:K,frequencyPenalty:z,presencePenalty:A,stopSequences:Y,seed:X,responseFormat:Z,providerOptions:M,tools:E,toolChoice:F}){var B,R,N;let $=[],W=(B=await p({provider:"xai",providerOptions:M,schema:gG}))!=null?B:{};if(K!=null)$.push({type:"unsupported",feature:"topK"});if(z!=null)$.push({type:"unsupported",feature:"frequencyPenalty"});if(A!=null)$.push({type:"unsupported",feature:"presencePenalty"});if(Y!=null)$.push({type:"unsupported",feature:"stopSequences"});let{messages:H,warnings:O}=vG(J);$.push(...O);let{tools:C,toolChoice:w,toolWarnings:j}=dG({tools:E,toolChoice:F});return $.push(...j),{args:{model:this.modelId,logprobs:W.logprobs===!0||W.topLogprobs!=null?!0:void 0,top_logprobs:W.topLogprobs,max_completion_tokens:D,temperature:L,top_p:q,seed:X,reasoning_effort:W.reasoningEffort,parallel_function_calling:W.parallel_function_calling,response_format:(Z==null?void 0:Z.type)==="json"?Z.schema!=null?{type:"json_schema",json_schema:{name:(R=Z.name)!=null?R:"response",schema:Z.schema,strict:!0}}:{type:"json_object"}:void 0,search_parameters:W.searchParameters?{mode:W.searchParameters.mode,return_citations:W.searchParameters.returnCitations,from_date:W.searchParameters.fromDate,to_date:W.searchParameters.toDate,max_search_results:W.searchParameters.maxSearchResults,sources:(N=W.searchParameters.sources)==null?void 0:N.map((S)=>{var h;return{type:S.type,...S.type==="web"&&{country:S.country,excluded_websites:S.excludedWebsites,allowed_websites:S.allowedWebsites,safe_search:S.safeSearch},...S.type==="x"&&{excluded_x_handles:S.excludedXHandles,included_x_handles:(h=S.includedXHandles)!=null?h:S.xHandles,post_favorite_count:S.postFavoriteCount,post_view_count:S.postViewCount},...S.type==="news"&&{country:S.country,excluded_websites:S.excludedWebsites,safe_search:S.safeSearch},...S.type==="rss"&&{links:S.links}}})}:void 0,messages:H,tools:C,tool_choice:w},warnings:$}}async doGenerate(J){var D,L;let{args:q,warnings:K}=await this.getArgs(J),z=`${(D=this.config.baseURL)!=null?D:"https://api.x.ai/v1"}/chat/completions`,{responseHeaders:A,value:Y,rawValue:X}=await u({url:z,headers:g(this.config.headers(),J.headers),body:q,failedResponseHandler:r,successfulResponseHandler:d(pG),abortSignal:J.abortSignal,fetch:this.config.fetch});if(Y.error!=null)throw new GG({message:Y.error,url:z,requestBodyValues:q,statusCode:200,responseHeaders:A,responseBody:JSON.stringify(X),isRetryable:Y.code==="The service is currently unavailable"});let Z=Y.choices[0],M=[];if(Z.message.content!=null&&Z.message.content.length>0){let E=Z.message.content,F=q.messages[q.messages.length-1];if((F==null?void 0:F.role)==="assistant"&&E===F.content)E="";if(E.length>0)M.push({type:"text",text:E})}if(Z.message.reasoning_content!=null&&Z.message.reasoning_content.length>0)M.push({type:"reasoning",text:Z.message.reasoning_content});if(Z.message.tool_calls!=null)for(let E of Z.message.tool_calls)M.push({type:"tool-call",toolCallId:E.id,toolName:E.function.name,input:E.function.arguments});if(Y.citations!=null)for(let E of Y.citations)M.push({type:"source",sourceType:"url",id:this.config.generateId(),url:E});return{content:M,finishReason:{unified:WG(Z.finish_reason),raw:(L=Z.finish_reason)!=null?L:void 0},usage:Y.usage?EG(Y.usage):{inputTokens:{total:0,noCache:0,cacheRead:0,cacheWrite:0},outputTokens:{total:0,text:0,reasoning:0}},request:{body:q},response:{...JG(Y),headers:A,body:X},warnings:K}}async doStream(J){var D;let{args:L,warnings:q}=await this.getArgs(J),K={...L,stream:!0,stream_options:{include_usage:!0}},z=`${(D=this.config.baseURL)!=null?D:"https://api.x.ai/v1"}/chat/completions`,{responseHeaders:A,value:Y}=await u({url:z,headers:g(this.config.headers(),J.headers),body:K,failedResponseHandler:r,successfulResponseHandler:async({response:N})=>{let $=NG(N),W=N.headers.get("content-type");if(W==null?void 0:W.includes("application/json")){let H=await N.text(),O=await CG({text:H,schema:lG});if(O.success)throw new GG({message:O.value.error,url:z,requestBodyValues:K,statusCode:200,responseHeaders:$,responseBody:H,isRetryable:O.value.code==="The service is currently unavailable"});throw new GG({message:"Invalid JSON response",url:z,requestBodyValues:K,statusCode:200,responseHeaders:$,responseBody:H})}return YG(iG)({response:N,url:z,requestBodyValues:K})},abortSignal:J.abortSignal,fetch:this.config.fetch}),X={unified:"other",raw:void 0},Z=void 0,M=!0,E={},F={},B=void 0,R=this;return{stream:Y.pipeThrough(new TransformStream({start(N){N.enqueue({type:"stream-start",warnings:q})},transform(N,$){if(J.includeRawChunks)$.enqueue({type:"raw",rawValue:N.rawValue});if(!N.success){$.enqueue({type:"error",error:N.error});return}let W=N.value;if(M)$.enqueue({type:"response-metadata",...JG(W)}),M=!1;if(W.citations!=null)for(let w of W.citations)$.enqueue({type:"source",sourceType:"url",id:R.config.generateId(),url:w});if(W.usage!=null)Z=EG(W.usage);let H=W.choices[0];if((H==null?void 0:H.finish_reason)!=null)X={unified:WG(H.finish_reason),raw:H.finish_reason};if((H==null?void 0:H.delta)==null)return;let{delta:O,index:C}=H;if(O.content!=null&&O.content.length>0){let w=O.content;if(B!=null&&!E[B].ended)$.enqueue({type:"reasoning-end",id:B}),E[B].ended=!0,B=void 0;let j=K.messages[K.messages.length-1];if((j==null?void 0:j.role)==="assistant"&&w===j.content)return;let y=`text-${W.id||C}`;if(E[y]==null)E[y]={type:"text",ended:!1},$.enqueue({type:"text-start",id:y});$.enqueue({type:"text-delta",id:y,delta:w})}if(O.reasoning_content!=null&&O.reasoning_content.length>0){let w=`reasoning-${W.id||C}`;if(F[w]===O.reasoning_content)return;if(F[w]=O.reasoning_content,E[w]==null)E[w]={type:"reasoning",ended:!1},B=w,$.enqueue({type:"reasoning-start",id:w});$.enqueue({type:"reasoning-delta",id:w,delta:O.reasoning_content})}if(O.tool_calls!=null){if(B!=null&&!E[B].ended)$.enqueue({type:"reasoning-end",id:B}),E[B].ended=!0,B=void 0;for(let w of O.tool_calls){let j=w.id;$.enqueue({type:"tool-input-start",id:j,toolName:w.function.name}),$.enqueue({type:"tool-input-delta",id:j,delta:w.function.arguments}),$.enqueue({type:"tool-input-end",id:j}),$.enqueue({type:"tool-call",toolCallId:j,toolName:w.function.name,input:w.function.arguments})}}},flush(N){for(let[$,W]of Object.entries(E))if(!W.ended)N.enqueue({type:W.type==="text"?"text-end":"reasoning-end",id:$});N.enqueue({type:"finish",finishReason:X,usage:Z!=null?Z:{inputTokens:{total:0,noCache:0,cacheRead:0,cacheWrite:0},outputTokens:{total:0,text:0,reasoning:0}}})}})),request:{body:K},response:{headers:A}}}},TG=G.object({prompt_tokens:G.number(),completion_tokens:G.number(),total_tokens:G.number(),prompt_tokens_details:G.object({text_tokens:G.number().nullish(),audio_tokens:G.number().nullish(),image_tokens:G.number().nullish(),cached_tokens:G.number().nullish()}).nullish(),completion_tokens_details:G.object({reasoning_tokens:G.number().nullish(),audio_tokens:G.number().nullish(),accepted_prediction_tokens:G.number().nullish(),rejected_prediction_tokens:G.number().nullish()}).nullish()}),pG=G.object({id:G.string().nullish(),created:G.number().nullish(),model:G.string().nullish(),choices:G.array(G.object({message:G.object({role:G.literal("assistant"),content:G.string().nullish(),reasoning_content:G.string().nullish(),tool_calls:G.array(G.object({id:G.string(),type:G.literal("function"),function:G.object({name:G.string(),arguments:G.string()})})).nullish()}),index:G.number(),finish_reason:G.string().nullish()})).nullish(),object:G.literal("chat.completion").nullish(),usage:TG.nullish(),citations:G.array(G.string().url()).nullish(),code:G.string().nullish(),error:G.string().nullish()}),iG=G.object({id:G.string().nullish(),created:G.number().nullish(),model:G.string().nullish(),choices:G.array(G.object({delta:G.object({role:G.enum(["assistant"]).optional(),content:G.string().nullish(),reasoning_content:G.string().nullish(),tool_calls:G.array(G.object({id:G.string(),type:G.literal("function"),function:G.object({name:G.string(),arguments:G.string()})})).nullish()}),finish_reason:G.string().nullish(),index:G.number()})),usage:TG.nullish(),citations:G.array(G.string().url()).nullish()}),lG=G.object({code:G.string(),error:G.string()}),rG=G.object({aspect_ratio:G.string().optional(),output_format:G.string().optional(),sync_mode:G.boolean().optional(),resolution:G.enum(["1k","2k"]).optional(),quality:G.enum(["low","medium","high"]).optional(),user:G.string().optional()}),aG=class{constructor(J,D){this.modelId=J,this.config=D,this.specificationVersion="v3",this.maxImagesPerCall=3}get provider(){return this.config.provider}async doGenerate({prompt:J,n:D,size:L,aspectRatio:q,seed:K,providerOptions:z,headers:A,abortSignal:Y,files:X,mask:Z}){var M,E,F,B,R;let N=[];if(L!=null)N.push({type:"unsupported",feature:"size",details:"This model does not support the `size` option. Use `aspectRatio` instead."});if(K!=null)N.push({type:"unsupported",feature:"seed"});if(Z!=null)N.push({type:"unsupported",feature:"mask"});let $=await p({provider:"xai",providerOptions:z,schema:rG}),W=X!=null&&X.length>0,H=W?X.map((I)=>SG(I)):[],O=W?"/images/edits":"/images/generations",C={model:this.modelId,prompt:J,n:D,response_format:"b64_json"};if(q!=null)C.aspect_ratio=q;if(($==null?void 0:$.output_format)!=null)C.output_format=$.output_format;if(($==null?void 0:$.sync_mode)!=null)C.sync_mode=$.sync_mode;if(($==null?void 0:$.aspect_ratio)!=null&&q==null)C.aspect_ratio=$.aspect_ratio;if(($==null?void 0:$.resolution)!=null)C.resolution=$.resolution;if(($==null?void 0:$.quality)!=null)C.quality=$.quality;if(($==null?void 0:$.user)!=null)C.user=$.user;if(H.length===1)C.image={url:H[0],type:"image_url"};else if(H.length>1)C.images=H.map((I)=>({url:I,type:"image_url"}));let w=(M=this.config.baseURL)!=null?M:"https://api.x.ai/v1",j=(B=(F=(E=this.config._internal)==null?void 0:E.currentDate)==null?void 0:F.call(E))!=null?B:new Date,{value:y,responseHeaders:S}=await u({url:`${w}${O}`,headers:g(this.config.headers(),A),body:C,failedResponseHandler:r,successfulResponseHandler:d(nG),abortSignal:Y,fetch:this.config.fetch});return{images:y.data.every((I)=>I.b64_json!=null)?y.data.map((I)=>I.b64_json):await Promise.all(y.data.map((I)=>this.downloadImage(I.url,Y))),warnings:N,response:{timestamp:j,modelId:this.modelId,headers:S},providerMetadata:{xai:{images:y.data.map((I)=>({...I.revised_prompt?{revisedPrompt:I.revised_prompt}:{}})),...((R=y.usage)==null?void 0:R.cost_in_usd_ticks)!=null?{costInUsdTicks:y.usage.cost_in_usd_ticks}:{}}}}}async downloadImage(J,D){let{value:L}=await XG({url:J,abortSignal:D,failedResponseHandler:RG(),successfulResponseHandler:IG(),fetch:this.config.fetch});return L}},nG=G.object({data:G.array(G.object({url:G.string().nullish(),b64_json:G.string().nullish(),revised_prompt:G.string().nullish()})),usage:G.object({cost_in_usd_ticks:G.number().nullish()}).nullish()});async function sG({prompt:J}){var D,L,q,K,z;let A=[],Y=[];for(let X of J)switch(X.role){case"system":{A.push({role:"system",content:X.content});break}case"user":{let Z=[];for(let M of X.content)switch(M.type){case"text":{Z.push({type:"input_text",text:M.text});break}case"file":{if(M.mediaType.startsWith("image/")){let E=M.mediaType==="image/*"?"image/jpeg":M.mediaType,F=M.data instanceof URL?M.data.toString():`data:${E};base64,${QG(M.data)}`;Z.push({type:"input_image",image_url:F})}else throw new c({functionality:`file part media type ${M.mediaType}`});break}default:{let E=M;Y.push({type:"other",message:"xAI Responses API does not support this content type in user messages"})}}A.push({role:"user",content:Z});break}case"assistant":{for(let Z of X.content)switch(Z.type){case"text":{let M=typeof((L=(D=Z.providerOptions)==null?void 0:D.xai)==null?void 0:L.itemId)==="string"?Z.providerOptions.xai.itemId:void 0;A.push({role:"assistant",content:Z.text,id:M});break}case"tool-call":{if(Z.providerExecuted)break;let M=typeof((K=(q=Z.providerOptions)==null?void 0:q.xai)==null?void 0:K.itemId)==="string"?Z.providerOptions.xai.itemId:void 0;A.push({type:"function_call",id:M!=null?M:Z.toolCallId,call_id:Z.toolCallId,name:Z.toolName,arguments:JSON.stringify(Z.input),status:"completed"});break}case"tool-result":break;case"reasoning":case"file":{Y.push({type:"other",message:`xAI Responses API does not support ${Z.type} in assistant messages`});break}default:{let M=Z;Y.push({type:"other",message:"xAI Responses API does not support this content type in assistant messages"})}}break}case"tool":{for(let Z of X.content){if(Z.type==="tool-approval-response")continue;let M=Z.output,E;switch(M.type){case"text":case"error-text":E=M.value;break;case"execution-denied":E=(z=M.reason)!=null?z:"tool execution denied";break;case"json":case"error-json":E=JSON.stringify(M.value);break;case"content":E=M.value.map((F)=>{if(F.type==="text")return F.text;return""}).join("");break;default:{let F=M;E=""}}A.push({type:"function_call_output",call_id:Z.toolCallId,output:E})}break}default:{let Z=X;Y.push({type:"other",message:"unsupported message role"})}}return{input:A,inputWarnings:Y}}function ZG(J){var D,L,q,K;let z=(L=(D=J.input_tokens_details)==null?void 0:D.cached_tokens)!=null?L:0,A=(K=(q=J.output_tokens_details)==null?void 0:q.reasoning_tokens)!=null?K:0,Y=z<=J.input_tokens;return{inputTokens:{total:Y?J.input_tokens:J.input_tokens+z,noCache:Y?J.input_tokens-z:J.input_tokens,cacheRead:z,cacheWrite:void 0},outputTokens:{total:J.output_tokens,text:J.output_tokens-A,reasoning:A},raw:J}}function o(J){switch(J){case"stop":case"completed":return"stop";case"length":case"max_output_tokens":return"length";case"tool_calls":case"function_call":return"tool-calls";case"content_filter":return"content-filter";default:return"other"}}var KG=G.union([G.object({type:G.literal("url_citation"),url:G.string(),title:G.string().optional()}),G.object({type:G.string()})]),AG=G.object({type:G.string(),text:G.string().optional(),logprobs:G.array(G.any()).optional(),annotations:G.array(KG).optional()}),jG=G.object({type:G.string(),text:G.string()}),i=G.object({name:G.string().optional(),arguments:G.string().optional(),input:G.string().optional(),call_id:G.string().optional(),id:G.string(),status:G.string(),action:G.any().optional()}),tG=G.object({name:G.string().optional(),arguments:G.string().optional(),output:G.string().optional(),error:G.string().optional(),id:G.string(),status:G.string(),server_label:G.string().optional()}),DG=G.discriminatedUnion("type",[G.object({type:G.literal("web_search_call"),...i.shape}),G.object({type:G.literal("x_search_call"),...i.shape}),G.object({type:G.literal("code_interpreter_call"),...i.shape}),G.object({type:G.literal("code_execution_call"),...i.shape}),G.object({type:G.literal("view_image_call"),...i.shape}),G.object({type:G.literal("view_x_video_call"),...i.shape}),G.object({type:G.literal("file_search_call"),id:G.string(),status:G.string(),queries:G.array(G.string()).optional(),results:G.array(G.object({file_id:G.string(),filename:G.string(),score:G.number(),text:G.string()})).nullish()}),G.object({type:G.literal("custom_tool_call"),...i.shape}),G.object({type:G.literal("mcp_call"),...tG.shape}),G.object({type:G.literal("message"),role:G.string(),content:G.array(AG),id:G.string(),status:G.string()}),G.object({type:G.literal("function_call"),name:G.string(),arguments:G.string(),call_id:G.string(),id:G.string()}),G.object({type:G.literal("reasoning"),id:G.string(),summary:G.array(jG),status:G.string(),encrypted_content:G.string().nullish()})]),qG=G.object({input_tokens:G.number(),output_tokens:G.number(),total_tokens:G.number().optional(),input_tokens_details:G.object({cached_tokens:G.number().optional()}).optional(),output_tokens_details:G.object({reasoning_tokens:G.number().optional()}).optional(),num_sources_used:G.number().optional(),num_server_side_tools_used:G.number().optional()}),t=G.object({id:G.string().nullish(),created_at:G.number().nullish(),model:G.string().nullish(),object:G.literal("response"),output:G.array(DG),usage:qG.nullish(),status:G.string()}),eG=G.union([G.object({type:G.literal("response.created"),response:t.partial({usage:!0,status:!0})}),G.object({type:G.literal("response.in_progress"),response:t.partial({usage:!0,status:!0})}),G.object({type:G.literal("response.output_item.added"),item:DG,output_index:G.number()}),G.object({type:G.literal("response.output_item.done"),item:DG,output_index:G.number()}),G.object({type:G.literal("response.content_part.added"),item_id:G.string(),output_index:G.number(),content_index:G.number(),part:AG}),G.object({type:G.literal("response.content_part.done"),item_id:G.string(),output_index:G.number(),content_index:G.number(),part:AG}),G.object({type:G.literal("response.output_text.delta"),item_id:G.string(),output_index:G.number(),content_index:G.number(),delta:G.string(),logprobs:G.array(G.any()).optional()}),G.object({type:G.literal("response.output_text.done"),item_id:G.string(),output_index:G.number(),content_index:G.number(),text:G.string(),logprobs:G.array(G.any()).optional(),annotations:G.array(KG).optional()}),G.object({type:G.literal("response.output_text.annotation.added"),item_id:G.string(),output_index:G.number(),content_index:G.number(),annotation_index:G.number(),annotation:KG}),G.object({type:G.literal("response.reasoning_summary_part.added"),item_id:G.string(),output_index:G.number(),summary_index:G.number(),part:jG}),G.object({type:G.literal("response.reasoning_summary_part.done"),item_id:G.string(),output_index:G.number(),summary_index:G.number(),part:jG}),G.object({type:G.literal("response.reasoning_summary_text.delta"),item_id:G.string(),output_index:G.number(),summary_index:G.number(),delta:G.string()}),G.object({type:G.literal("response.reasoning_summary_text.done"),item_id:G.string(),output_index:G.number(),summary_index:G.number(),text:G.string()}),G.object({type:G.literal("response.reasoning_text.delta"),item_id:G.string(),output_index:G.number(),content_index:G.number(),delta:G.string()}),G.object({type:G.literal("response.reasoning_text.done"),item_id:G.string(),output_index:G.number(),content_index:G.number(),text:G.string()}),G.object({type:G.literal("response.web_search_call.in_progress"),item_id:G.string(),output_index:G.number()}),G.object({type:G.literal("response.web_search_call.searching"),item_id:G.string(),output_index:G.number()}),G.object({type:G.literal("response.web_search_call.completed"),item_id:G.string(),output_index:G.number()}),G.object({type:G.literal("response.x_search_call.in_progress"),item_id:G.string(),output_index:G.number()}),G.object({type:G.literal("response.x_search_call.searching"),item_id:G.string(),output_index:G.number()}),G.object({type:G.literal("response.x_search_call.completed"),item_id:G.string(),output_index:G.number()}),G.object({type:G.literal("response.file_search_call.in_progress"),item_id:G.string(),output_index:G.number()}),G.object({type:G.literal("response.file_search_call.searching"),item_id:G.string(),output_index:G.number()}),G.object({type:G.literal("response.file_search_call.completed"),item_id:G.string(),output_index:G.number()}),G.object({type:G.literal("response.code_execution_call.in_progress"),item_id:G.string(),output_index:G.number()}),G.object({type:G.literal("response.code_execution_call.executing"),item_id:G.string(),output_index:G.number()}),G.object({type:G.literal("response.code_execution_call.completed"),item_id:G.string(),output_index:G.number()}),G.object({type:G.literal("response.code_interpreter_call.in_progress"),item_id:G.string(),output_index:G.number()}),G.object({type:G.literal("response.code_interpreter_call.executing"),item_id:G.string(),output_index:G.number()}),G.object({type:G.literal("response.code_interpreter_call.interpreting"),item_id:G.string(),output_index:G.number()}),G.object({type:G.literal("response.code_interpreter_call.completed"),item_id:G.string(),output_index:G.number()}),G.object({type:G.literal("response.code_interpreter_call_code.delta"),item_id:G.string(),output_index:G.number(),delta:G.string()}),G.object({type:G.literal("response.code_interpreter_call_code.done"),item_id:G.string(),output_index:G.number(),code:G.string()}),G.object({type:G.literal("response.custom_tool_call_input.delta"),item_id:G.string(),output_index:G.number(),delta:G.string()}),G.object({type:G.literal("response.custom_tool_call_input.done"),item_id:G.string(),output_index:G.number(),input:G.string()}),G.object({type:G.literal("response.function_call_arguments.delta"),item_id:G.string(),output_index:G.number(),delta:G.string()}),G.object({type:G.literal("response.function_call_arguments.done"),item_id:G.string(),output_index:G.number(),arguments:G.string()}),G.object({type:G.literal("response.mcp_call.in_progress"),item_id:G.string(),output_index:G.number()}),G.object({type:G.literal("response.mcp_call.executing"),item_id:G.string(),output_index:G.number()}),G.object({type:G.literal("response.mcp_call.completed"),item_id:G.string(),output_index:G.number()}),G.object({type:G.literal("response.mcp_call.failed"),item_id:G.string(),output_index:G.number()}),G.object({type:G.literal("response.mcp_call_arguments.delta"),item_id:G.string(),output_index:G.number(),delta:G.string()}),G.object({type:G.literal("response.mcp_call_arguments.done"),item_id:G.string(),output_index:G.number(),arguments:G.string().optional()}),G.object({type:G.literal("response.mcp_call_output.delta"),item_id:G.string(),output_index:G.number(),delta:G.string()}),G.object({type:G.literal("response.mcp_call_output.done"),item_id:G.string(),output_index:G.number(),output:G.string().optional()}),G.object({type:G.literal("response.incomplete"),response:G.object({incomplete_details:G.object({reason:G.string()}).nullish(),usage:qG.nullish()})}),G.object({type:G.literal("response.failed"),response:G.object({error:G.object({code:G.string().nullish(),message:G.string()}).nullish(),incomplete_details:G.object({reason:G.string()}).nullish(),usage:qG.nullish()})}),G.object({type:G.literal("error"),code:G.string().nullish(),message:G.string(),param:G.string().nullish()}),G.object({type:G.literal("response.done"),response:t}),G.object({type:G.literal("response.completed"),response:t})]),oG=G.object({reasoningEffort:G.enum(["low","medium","high"]).optional(),logprobs:G.boolean().optional(),topLogprobs:G.number().int().min(0).max(8).optional(),store:G.boolean().optional(),previousResponseId:G.string().optional(),include:G.array(G.enum(["file_search_call.results"])).nullish()}),GJ=v(()=>k(G.object({vectorStoreIds:G.array(G.string()),maxNumResults:G.number().optional()}))),JJ=v(()=>k(G.object({queries:G.array(G.string()),results:G.array(G.object({fileId:G.string(),filename:G.string(),score:G.number().min(0).max(1),text:G.string()})).nullable()}))),QJ=_({id:"xai.file_search",inputSchema:v(()=>k(G.object({}))),outputSchema:JJ}),XJ=(J)=>QJ(J),YJ=v(()=>k(G.object({serverUrl:G.string().describe("The URL of the MCP server"),serverLabel:G.string().optional().describe("A label for the MCP server"),serverDescription:G.string().optional().describe("Description of the MCP server"),allowedTools:G.array(G.string()).optional().describe("List of allowed tool names"),headers:G.record(G.string(),G.string()).optional().describe("Custom headers to send"),authorization:G.string().optional().describe("Authorization header value")}))),ZJ=v(()=>k(G.object({name:G.string(),arguments:G.string(),result:G.unknown()}))),$J=_({id:"xai.mcp",inputSchema:v(()=>k(G.object({}))),outputSchema:ZJ}),KJ=(J)=>$J(J),AJ=v(()=>k(G.object({allowedDomains:G.array(G.string()).max(5).optional(),excludedDomains:G.array(G.string()).max(5).optional(),enableImageUnderstanding:G.boolean().optional()}))),jJ=v(()=>k(G.object({query:G.string(),sources:G.array(G.object({title:G.string(),url:G.string(),snippet:G.string()}))}))),DJ=_({id:"xai.web_search",inputSchema:v(()=>k(G.object({}))),outputSchema:jJ}),qJ=(J={})=>DJ(J),zJ=v(()=>k(G.object({allowedXHandles:G.array(G.string()).max(10).optional(),excludedXHandles:G.array(G.string()).max(10).optional(),fromDate:G.string().optional(),toDate:G.string().optional(),enableImageUnderstanding:G.boolean().optional(),enableVideoUnderstanding:G.boolean().optional()}))),VJ=v(()=>k(G.object({query:G.string(),posts:G.array(G.object({author:G.string(),text:G.string(),url:G.string(),likes:G.number()}))}))),LJ=_({id:"xai.x_search",inputSchema:v(()=>k(G.object({}))),outputSchema:VJ}),UJ=(J={})=>LJ(J);async function HJ({tools:J,toolChoice:D}){let L=(J==null?void 0:J.length)?J:void 0,q=[];if(L==null)return{tools:void 0,toolChoice:void 0,toolWarnings:q};let K=[],z=new Map;for(let Y of L)if(z.set(Y.name,Y),Y.type==="provider")switch(Y.id){case"xai.web_search":{let X=await s({value:Y.args,schema:AJ});K.push({type:"web_search",allowed_domains:X.allowedDomains,excluded_domains:X.excludedDomains,enable_image_understanding:X.enableImageUnderstanding});break}case"xai.x_search":{let X=await s({value:Y.args,schema:zJ});K.push({type:"x_search",allowed_x_handles:X.allowedXHandles,excluded_x_handles:X.excludedXHandles,from_date:X.fromDate,to_date:X.toDate,enable_image_understanding:X.enableImageUnderstanding,enable_video_understanding:X.enableVideoUnderstanding});break}case"xai.code_execution":{K.push({type:"code_interpreter"});break}case"xai.view_image":{K.push({type:"view_image"});break}case"xai.view_x_video":{K.push({type:"view_x_video"});break}case"xai.file_search":{let X=await s({value:Y.args,schema:GJ});K.push({type:"file_search",vector_store_ids:X.vectorStoreIds,max_num_results:X.maxNumResults});break}case"xai.mcp":{let X=await s({value:Y.args,schema:YJ});K.push({type:"mcp",server_url:X.serverUrl,server_label:X.serverLabel,server_description:X.serverDescription,allowed_tools:X.allowedTools,headers:X.headers,authorization:X.authorization});break}default:{q.push({type:"unsupported",feature:`provider-defined tool ${Y.name}`});break}}else K.push({type:"function",name:Y.name,description:Y.description,parameters:Y.inputSchema,...Y.strict!=null?{strict:Y.strict}:{}});if(D==null)return{tools:K,toolChoice:void 0,toolWarnings:q};let A=D.type;switch(A){case"auto":case"none":return{tools:K,toolChoice:A,toolWarnings:q};case"required":return{tools:K,toolChoice:"required",toolWarnings:q};case"tool":{let Y=z.get(D.toolName);if(Y==null)return{tools:K,toolChoice:void 0,toolWarnings:q};if(Y.type==="provider")return q.push({type:"unsupported",feature:`toolChoice for server-side tool "${Y.name}"`}),{tools:K,toolChoice:void 0,toolWarnings:q};return{tools:K,toolChoice:{type:"function",name:Y.name},toolWarnings:q}}default:throw new c({functionality:`tool choice type: ${A}`})}}var MJ=class{constructor(J,D){this.specificationVersion="v3",this.supportedUrls={"image/*":[/^https?:\/\/.*$/]},this.modelId=J,this.config=D}get provider(){return this.config.provider}async getArgs({prompt:J,maxOutputTokens:D,temperature:L,topP:q,stopSequences:K,seed:z,responseFormat:A,providerOptions:Y,tools:X,toolChoice:Z}){var M,E,F,B,R,N,$;let W=[],H=(M=await p({provider:"xai",providerOptions:Y,schema:oG}))!=null?M:{};if(K!=null)W.push({type:"unsupported",feature:"stopSequences"});let O=(E=X==null?void 0:X.find((x)=>x.type==="provider"&&x.id==="xai.web_search"))==null?void 0:E.name,C=(F=X==null?void 0:X.find((x)=>x.type==="provider"&&x.id==="xai.x_search"))==null?void 0:F.name,w=(B=X==null?void 0:X.find((x)=>x.type==="provider"&&x.id==="xai.code_execution"))==null?void 0:B.name,j=(R=X==null?void 0:X.find((x)=>x.type==="provider"&&x.id==="xai.mcp"))==null?void 0:R.name,y=(N=X==null?void 0:X.find((x)=>x.type==="provider"&&x.id==="xai.file_search"))==null?void 0:N.name,{input:S,inputWarnings:h}=await sG({prompt:J,store:!0});W.push(...h);let{tools:m,toolChoice:I,toolWarnings:P}=await HJ({tools:X,toolChoice:Z});W.push(...P);let f=H.include?[...H.include]:void 0;if(H.store===!1)if(f==null)f=["reasoning.encrypted_content"];else f=[...f,"reasoning.encrypted_content"];let U={model:this.modelId,input:S,logprobs:H.logprobs===!0||H.topLogprobs!=null?!0:void 0,top_logprobs:H.topLogprobs,max_output_tokens:D,temperature:L,top_p:q,seed:z,...(A==null?void 0:A.type)==="json"&&{text:{format:A.schema!=null?{type:"json_schema",strict:!0,name:($=A.name)!=null?$:"response",description:A.description,schema:A.schema}:{type:"json_object"}}},...H.reasoningEffort!=null&&{reasoning:{effort:H.reasoningEffort}},...H.store===!1&&{store:H.store},...f!=null&&{include:f},...H.previousResponseId!=null&&{previous_response_id:H.previousResponseId}};if(m&&m.length>0)U.tools=m;if(I!=null)U.tool_choice=I;return{args:U,warnings:W,webSearchToolName:O,xSearchToolName:C,codeExecutionToolName:w,mcpToolName:j,fileSearchToolName:y}}async doGenerate(J){var D,L,q,K,z,A,Y,X,Z,M,E,F,B;let{args:R,warnings:N,webSearchToolName:$,xSearchToolName:W,codeExecutionToolName:H,mcpToolName:O,fileSearchToolName:C}=await this.getArgs(J),{responseHeaders:w,value:j,rawValue:y}=await u({url:`${(D=this.config.baseURL)!=null?D:"https://api.x.ai/v1"}/responses`,headers:g(this.config.headers(),J.headers),body:R,failedResponseHandler:r,successfulResponseHandler:d(t),abortSignal:J.abortSignal,fetch:this.config.fetch}),S=[],h=!1,m=["web_search","web_search_with_snippets","browse_page"],I=["x_user_search","x_keyword_search","x_semantic_search","x_thread_fetch"];for(let P of j.output){if(P.type==="file_search_call"){let f=C!=null?C:"file_search";S.push({type:"tool-call",toolCallId:P.id,toolName:f,input:"",providerExecuted:!0}),S.push({type:"tool-result",toolCallId:P.id,toolName:f,result:{queries:(L=P.queries)!=null?L:[],results:(K=(q=P.results)==null?void 0:q.map((U)=>({fileId:U.file_id,filename:U.filename,score:U.score,text:U.text})))!=null?K:null}});continue}if(P.type==="web_search_call"||P.type==="x_search_call"||P.type==="code_interpreter_call"||P.type==="code_execution_call"||P.type==="view_image_call"||P.type==="view_x_video_call"||P.type==="custom_tool_call"||P.type==="mcp_call"){let f=(z=P.name)!=null?z:"";if(m.includes((A=P.name)!=null?A:"")||P.type==="web_search_call")f=$!=null?$:"web_search";else if(I.includes((Y=P.name)!=null?Y:"")||P.type==="x_search_call")f=W!=null?W:"x_search";else if(P.name==="code_execution"||P.type==="code_interpreter_call"||P.type==="code_execution_call")f=H!=null?H:"code_execution";else if(P.type==="mcp_call")f=(X=O!=null?O:P.name)!=null?X:"mcp";let U=P.type==="custom_tool_call"?(Z=P.input)!=null?Z:"":P.type==="mcp_call"?(M=P.arguments)!=null?M:"":(E=P.arguments)!=null?E:"";S.push({type:"tool-call",toolCallId:P.id,toolName:f,input:U,providerExecuted:!0});continue}switch(P.type){case"message":{for(let f of P.content){if(f.text)S.push({type:"text",text:f.text});if(f.annotations){for(let U of f.annotations)if(U.type==="url_citation"&&"url"in U)S.push({type:"source",sourceType:"url",id:this.config.generateId(),url:U.url,title:(F=U.title)!=null?F:U.url})}}break}case"function_call":{h=!0,S.push({type:"tool-call",toolCallId:P.call_id,toolName:P.name,input:P.arguments});break}case"reasoning":{let f=P.summary.map((U)=>U.text).filter((U)=>U&&U.length>0);if(f.length>0){let U=f.join("");if(P.encrypted_content||P.id)S.push({type:"reasoning",text:U,providerMetadata:{xai:{...P.encrypted_content&&{reasoningEncryptedContent:P.encrypted_content},...P.id&&{itemId:P.id}}}});else S.push({type:"reasoning",text:U})}break}default:break}}return{content:S,finishReason:{unified:h?"tool-calls":o(j.status),raw:(B=j.status)!=null?B:void 0},usage:j.usage?ZG(j.usage):{inputTokens:{total:0,noCache:0,cacheRead:0,cacheWrite:0},outputTokens:{total:0,text:0,reasoning:0}},request:{body:R},response:{...JG(j),headers:w,body:y},warnings:N}}async doStream(J){var D;let{args:L,warnings:q,webSearchToolName:K,xSearchToolName:z,codeExecutionToolName:A,mcpToolName:Y,fileSearchToolName:X}=await this.getArgs(J),Z={...L,stream:!0},{responseHeaders:M,value:E}=await u({url:`${(D=this.config.baseURL)!=null?D:"https://api.x.ai/v1"}/responses`,headers:g(this.config.headers(),J.headers),body:Z,failedResponseHandler:r,successfulResponseHandler:YG(eG),abortSignal:J.abortSignal,fetch:this.config.fetch}),F={unified:"other",raw:void 0},B=!1,R=void 0,N=!0,$={},W=new Set,H={},O={},C=this;return{stream:E.pipeThrough(new TransformStream({start(w){w.enqueue({type:"stream-start",warnings:q})},transform(w,j){var y,S,h,m,I,P,f,U,x,zG,VG,LG,UG,HG,MG;if(J.includeRawChunks)j.enqueue({type:"raw",rawValue:w.rawValue});if(!w.success){j.enqueue({type:"error",error:w.error});return}let V=w.value;if(V.type==="response.created"||V.type==="response.in_progress"){if(N)j.enqueue({type:"response-metadata",...JG(V.response)}),N=!1;return}if(V.type==="response.reasoning_summary_part.added"){let Q=`reasoning-${V.item_id}`;O[V.item_id]={},j.enqueue({type:"reasoning-start",id:Q,providerMetadata:{xai:{itemId:V.item_id}}})}if(V.type==="response.reasoning_summary_text.delta"){let Q=`reasoning-${V.item_id}`;j.enqueue({type:"reasoning-delta",id:Q,delta:V.delta,providerMetadata:{xai:{itemId:V.item_id}}});return}if(V.type==="response.reasoning_summary_text.done")return;if(V.type==="response.reasoning_text.delta"){let Q=`reasoning-${V.item_id}`;if(O[V.item_id]==null)O[V.item_id]={},j.enqueue({type:"reasoning-start",id:Q,providerMetadata:{xai:{itemId:V.item_id}}});j.enqueue({type:"reasoning-delta",id:Q,delta:V.delta,providerMetadata:{xai:{itemId:V.item_id}}});return}if(V.type==="response.reasoning_text.done")return;if(V.type==="response.output_text.delta"){let Q=`text-${V.item_id}`;if($[Q]==null)$[Q]={type:"text"},j.enqueue({type:"text-start",id:Q});j.enqueue({type:"text-delta",id:Q,delta:V.delta});return}if(V.type==="response.output_text.done"){if(V.annotations){for(let Q of V.annotations)if(Q.type==="url_citation"&&"url"in Q)j.enqueue({type:"source",sourceType:"url",id:C.config.generateId(),url:Q.url,title:(y=Q.title)!=null?y:Q.url})}return}if(V.type==="response.output_text.annotation.added"){let Q=V.annotation;if(Q.type==="url_citation"&&"url"in Q)j.enqueue({type:"source",sourceType:"url",id:C.config.generateId(),url:Q.url,title:(S=Q.title)!=null?S:Q.url});return}if(V.type==="response.done"||V.type==="response.completed"||V.type==="response.incomplete"){let Q=V.response;if(Q.usage)R=ZG(Q.usage);if(V.type==="response.incomplete"){let T="incomplete_details"in Q?(h=Q.incomplete_details)==null?void 0:h.reason:void 0;F={unified:T?o(T):"other",raw:T!=null?T:"incomplete"}}else if("status"in Q&&Q.status)F={unified:B?"tool-calls":o(Q.status),raw:Q.status};return}if(V.type==="response.failed"){let Q=(m=V.response.incomplete_details)==null?void 0:m.reason;if(F={unified:Q?o(Q):"error",raw:Q!=null?Q:"error"},V.response.usage)R=ZG(V.response.usage);return}if(V.type==="error"){j.enqueue({type:"error",error:V});return}if(V.type==="response.custom_tool_call_input.delta"||V.type==="response.custom_tool_call_input.done")return;if(V.type==="response.function_call_arguments.delta"){let Q=H[V.output_index];if(Q!=null)j.enqueue({type:"tool-input-delta",id:Q.toolCallId,delta:V.delta});return}if(V.type==="response.function_call_arguments.done")return;if(V.type==="response.output_item.added"||V.type==="response.output_item.done"){let Q=V.item;if(Q.type==="reasoning"){if(V.type==="response.output_item.done"){let T=`reasoning-${Q.id}`;if(!(Q.id in O))O[Q.id]={},j.enqueue({type:"reasoning-start",id:T,providerMetadata:{xai:{...Q.id&&{itemId:Q.id}}}});j.enqueue({type:"reasoning-end",id:T,providerMetadata:{xai:{...Q.encrypted_content&&{reasoningEncryptedContent:Q.encrypted_content},...Q.id&&{itemId:Q.id}}}}),delete O[Q.id]}return}if(Q.type==="file_search_call"){let T=X!=null?X:"file_search";if(!W.has(Q.id))W.add(Q.id),j.enqueue({type:"tool-input-start",id:Q.id,toolName:T}),j.enqueue({type:"tool-input-delta",id:Q.id,delta:""}),j.enqueue({type:"tool-input-end",id:Q.id}),j.enqueue({type:"tool-call",toolCallId:Q.id,toolName:T,input:"",providerExecuted:!0});if(V.type==="response.output_item.done")j.enqueue({type:"tool-result",toolCallId:Q.id,toolName:T,result:{queries:(I=Q.queries)!=null?I:[],results:(f=(P=Q.results)==null?void 0:P.map((b)=>({fileId:b.file_id,filename:b.filename,score:b.score,text:b.text})))!=null?f:null}});return}if(Q.type==="web_search_call"||Q.type==="x_search_call"||Q.type==="code_interpreter_call"||Q.type==="code_execution_call"||Q.type==="view_image_call"||Q.type==="view_x_video_call"||Q.type==="custom_tool_call"||Q.type==="mcp_call"){let T=["web_search","web_search_with_snippets","browse_page"],b=["x_user_search","x_keyword_search","x_semantic_search","x_thread_fetch"],n=(U=Q.name)!=null?U:"";if(T.includes((x=Q.name)!=null?x:"")||Q.type==="web_search_call")n=K!=null?K:"web_search";else if(b.includes((zG=Q.name)!=null?zG:"")||Q.type==="x_search_call")n=z!=null?z:"x_search";else if(Q.name==="code_execution"||Q.type==="code_interpreter_call"||Q.type==="code_execution_call")n=A!=null?A:"code_execution";else if(Q.type==="mcp_call")n=(VG=Y!=null?Y:Q.name)!=null?VG:"mcp";let PG=Q.type==="custom_tool_call"?(LG=Q.input)!=null?LG:"":Q.type==="mcp_call"?(UG=Q.arguments)!=null?UG:"":(HG=Q.arguments)!=null?HG:"";if((Q.type==="custom_tool_call"?V.type==="response.output_item.done":!W.has(Q.id))&&!W.has(Q.id))W.add(Q.id),j.enqueue({type:"tool-input-start",id:Q.id,toolName:n}),j.enqueue({type:"tool-input-delta",id:Q.id,delta:PG}),j.enqueue({type:"tool-input-end",id:Q.id}),j.enqueue({type:"tool-call",toolCallId:Q.id,toolName:n,input:PG,providerExecuted:!0});return}if(Q.type==="message")for(let T of Q.content){if(T.text&&T.text.length>0){let b=`text-${Q.id}`;if($[b]==null)$[b]={type:"text"},j.enqueue({type:"text-start",id:b}),j.enqueue({type:"text-delta",id:b,delta:T.text})}if(T.annotations){for(let b of T.annotations)if(b.type==="url_citation"&&"url"in b)j.enqueue({type:"source",sourceType:"url",id:C.config.generateId(),url:b.url,title:(MG=b.title)!=null?MG:b.url})}}else if(Q.type==="function_call"){if(V.type==="response.output_item.added")H[V.output_index]={toolName:Q.name,toolCallId:Q.call_id},j.enqueue({type:"tool-input-start",id:Q.call_id,toolName:Q.name});else if(V.type==="response.output_item.done")B=!0,H[V.output_index]=void 0,j.enqueue({type:"tool-input-end",id:Q.call_id}),j.enqueue({type:"tool-call",toolCallId:Q.call_id,toolName:Q.name,input:Q.arguments})}}},flush(w){for(let[j,y]of Object.entries($))if(y.type==="text")w.enqueue({type:"text-end",id:j});w.enqueue({type:"finish",finishReason:F,usage:R!=null?R:{inputTokens:{total:0,noCache:0,cacheRead:0,cacheWrite:0},outputTokens:{total:0,text:0,reasoning:0}}})}})),request:{body:Z},response:{headers:M}}}},PJ=G.object({output:G.string().describe("the output of the code execution"),error:G.string().optional().describe("any error that occurred")}),EJ=_({id:"xai.code_execution",inputSchema:G.object({}).describe("no input parameters"),outputSchema:PJ}),WJ=(J={})=>EJ(J),BJ=G.object({description:G.string().describe("description of the image"),objects:G.array(G.string()).optional().describe("objects detected in the image")}),FJ=_({id:"xai.view_image",inputSchema:G.object({}).describe("no input parameters"),outputSchema:BJ}),NJ=(J={})=>FJ(J),wJ=G.object({transcript:G.string().optional().describe("transcript of the video"),description:G.string().describe("description of the video content"),duration:G.number().optional().describe("duration in seconds")}),SJ=_({id:"xai.view_x_video",inputSchema:G.object({}).describe("no input parameters"),outputSchema:wJ}),OJ=(J={})=>SJ(J),fJ={codeExecution:WJ,fileSearch:XJ,mcpServer:KJ,viewImage:NJ,viewXVideo:OJ,webSearch:qJ,xSearch:UJ},CJ="3.0.82",a=G.string().min(1),yJ=G.enum(["480p","720p"]),IJ=G.enum(["edit-video","extend-video","reference-to-video"]),e={pollIntervalMs:G.number().positive().nullish(),pollTimeoutMs:G.number().positive().nullish(),resolution:yJ.nullish()},RJ=G.object({...e,mode:G.literal("edit-video"),videoUrl:a,referenceImageUrls:G.undefined().optional()}),xJ=G.object({...e,mode:G.literal("extend-video"),videoUrl:a,referenceImageUrls:G.undefined().optional()}),TJ=G.object({...e,mode:G.literal("reference-to-video"),referenceImageUrls:G.array(a).min(1).max(7),videoUrl:G.undefined().optional()}),vJ=G.object({...e,mode:G.undefined().optional(),videoUrl:a.optional(),referenceImageUrls:G.array(a).min(1).max(7).optional()}),IQ=G.union([RJ,xJ,TJ,vJ]),kJ=G.object({mode:IJ.optional(),videoUrl:a.optional(),referenceImageUrls:G.array(a).min(1).max(7).optional(),...e}).passthrough(),bJ=v(()=>k(kJ)),hJ={"1280x720":"720p","854x480":"480p","640x480":"480p"};function _J(J){if((J==null?void 0:J.mode)!=null)return J.mode;if((J==null?void 0:J.videoUrl)!=null)return"edit-video";if((J==null?void 0:J.referenceImageUrls)!=null&&J.referenceImageUrls.length>0)return"reference-to-video";return}var mJ=class{constructor(J,D){this.modelId=J,this.config=D,this.specificationVersion="v3",this.maxVideosPerCall=1}get provider(){return this.config.provider}async doGenerate(J){var D,L,q,K,z,A,Y,X,Z,M;let E=(q=(L=(D=this.config._internal)==null?void 0:D.currentDate)==null?void 0:L.call(D))!=null?q:new Date,F=[],B=await p({provider:"xai",providerOptions:J.providerOptions,schema:bJ}),R=_J(B),N=R==="edit-video",$=R==="extend-video",W=R==="reference-to-video";if(J.fps!=null)F.push({type:"unsupported",feature:"fps",details:"xAI video models do not support custom FPS."});if(J.seed!=null)F.push({type:"unsupported",feature:"seed",details:"xAI video models do not support seed."});if(J.n!=null&&J.n>1)F.push({type:"unsupported",feature:"n",details:"xAI video models do not support generating multiple videos per call. Only 1 video will be generated."});if(N&&J.duration!=null)F.push({type:"unsupported",feature:"duration",details:"xAI video editing does not support custom duration."});if(N&&J.aspectRatio!=null)F.push({type:"unsupported",feature:"aspectRatio",details:"xAI video editing does not support custom aspect ratio."});if(N&&((B==null?void 0:B.resolution)!=null||J.resolution!=null))F.push({type:"unsupported",feature:"resolution",details:"xAI video editing does not support custom resolution."});if($&&J.aspectRatio!=null)F.push({type:"unsupported",feature:"aspectRatio",details:"xAI video extension does not support custom aspect ratio."});if($&&((B==null?void 0:B.resolution)!=null||J.resolution!=null))F.push({type:"unsupported",feature:"resolution",details:"xAI video extension does not support custom resolution."});let H={model:this.modelId,prompt:J.prompt},O=!N,C=!N&&!$,w=!N&&!$;if(O&&J.duration!=null)H.duration=J.duration;if(C&&J.aspectRatio!=null)H.aspect_ratio=J.aspectRatio;if(w&&(B==null?void 0:B.resolution)!=null)H.resolution=B.resolution;else if(w&&J.resolution!=null){let U=hJ[J.resolution];if(U!=null)H.resolution=U;else F.push({type:"unsupported",feature:"resolution",details:`Unrecognized resolution "${J.resolution}". Use providerOptions.xai.resolution with "480p" or "720p" instead.`})}if(N)H.video={url:B.videoUrl};if($)H.video={url:B.videoUrl};if(J.image!=null)if(J.image.type==="url")H.image={url:J.image.url};else{let U=typeof J.image.data==="string"?J.image.data:wG(J.image.data);H.image={url:`data:${J.image.mediaType};base64,${U}`}}if(W)H.reference_images=B.referenceImageUrls.map((U)=>({url:U}));if(B!=null){for(let[U,x]of Object.entries(B))if(!["mode","pollIntervalMs","pollTimeoutMs","resolution","videoUrl","referenceImageUrls"].includes(U))H[U]=x}let j=(K=this.config.baseURL)!=null?K:"https://api.x.ai/v1",y;if(N)y=`${j}/videos/edits`;else if($)y=`${j}/videos/extensions`;else y=`${j}/videos/generations`;let{value:S}=await u({url:y,headers:g(this.config.headers(),J.headers),body:H,failedResponseHandler:r,successfulResponseHandler:d(gJ),abortSignal:J.abortSignal,fetch:this.config.fetch}),h=S.request_id;if(!h)throw new l({name:"XAI_VIDEO_GENERATION_ERROR",message:`No request_id returned from xAI API. Response: ${JSON.stringify(S)}`});let m=(z=B==null?void 0:B.pollIntervalMs)!=null?z:5000,I=(A=B==null?void 0:B.pollTimeoutMs)!=null?A:600000,P=Date.now(),f;while(!0){if(await FG(m,{abortSignal:J.abortSignal}),Date.now()-P>I)throw new l({name:"XAI_VIDEO_GENERATION_TIMEOUT",message:`Video generation timed out after ${I}ms`});let{value:U,responseHeaders:x}=await XG({url:`${j}/videos/${h}`,headers:g(this.config.headers(),J.headers),successfulResponseHandler:d(uJ),failedResponseHandler:r,abortSignal:J.abortSignal,fetch:this.config.fetch});if(f=x,U.status==="done"||U.status==null&&((Y=U.video)==null?void 0:Y.url)){if(((X=U.video)==null?void 0:X.respect_moderation)===!1)throw new l({name:"XAI_VIDEO_MODERATION_ERROR",message:"Video generation was blocked due to a content policy violation."});if(!((Z=U.video)==null?void 0:Z.url))throw new l({name:"XAI_VIDEO_GENERATION_ERROR",message:"Video generation completed but no video URL was returned."});return{videos:[{type:"url",url:U.video.url,mediaType:"video/mp4"}],warnings:F,response:{timestamp:E,modelId:this.modelId,headers:f},providerMetadata:{xai:{requestId:h,videoUrl:U.video.url,...U.video.duration!=null?{duration:U.video.duration}:{},...((M=U.usage)==null?void 0:M.cost_in_usd_ticks)!=null?{costInUsdTicks:U.usage.cost_in_usd_ticks}:{},...U.progress!=null?{progress:U.progress}:{}}}}}if(U.status==="expired")throw new l({name:"XAI_VIDEO_GENERATION_EXPIRED",message:"Video generation request expired."});if(U.status==="failed")throw new l({name:"XAI_VIDEO_GENERATION_FAILED",message:"Video generation failed."})}}},gJ=G.object({request_id:G.string().nullish()}),uJ=G.object({status:G.string().nullish(),video:G.object({url:G.string(),duration:G.number().nullish(),respect_moderation:G.boolean().nullish()}).nullish(),model:G.string().nullish(),usage:G.object({cost_in_usd_ticks:G.number().nullish()}).nullish(),progress:G.number().nullish(),error:G.object({code:G.string().nullish(),message:G.string().nullish()}).nullish()});function dJ(J={}){var D;let L=xG((D=J.baseURL)!=null?D:"https://api.x.ai/v1"),q=()=>OG({Authorization:`Bearer ${fG({apiKey:J.apiKey,environmentVariableName:"XAI_API_KEY",description:"xAI API key"})}`,...J.headers},`ai-sdk/xai/${CJ}`),K=(Z)=>{return new cG(Z,{provider:"xai.chat",baseURL:L,headers:q,generateId:$G,fetch:J.fetch})},z=(Z)=>{return new MJ(Z,{provider:"xai.responses",baseURL:L,headers:q,generateId:$G,fetch:J.fetch})},A=(Z)=>{return new aG(Z,{provider:"xai.image",baseURL:L,headers:q,fetch:J.fetch})},Y=(Z)=>{return new mJ(Z,{provider:"xai.video",baseURL:L,headers:q,fetch:J.fetch})},X=(Z)=>K(Z);return X.specificationVersion="v3",X.languageModel=K,X.chat=K,X.responses=z,X.embeddingModel=(Z)=>{throw new BG({modelId:Z,modelType:"embeddingModel"})},X.textEmbeddingModel=X.embeddingModel,X.imageModel=A,X.image=A,X.videoModel=Y,X.video=Y,X.tools=fJ,X}var RQ=dJ();export{fJ as xaiTools,RQ as xai,UJ as xSearch,qJ as webSearch,OJ as viewXVideo,NJ as viewImage,KJ as mcpServer,dJ as createXai,WJ as codeExecution,CJ as VERSION};
2
+ import{Aq as p,Bq as u,Gq as _,Iq as yG,Jq as YG,Kq as d,Lq as IG,Mq as RG,Oq as xG,Pp as g,Rp as FG,Tp as NG,Vp as wG,Wp as QG,Xp as SG,dq as $G,iq as OG,jq as XG,mq as fG,qq as v,tq as k,uq as s,xq as CG}from"./chunk-bf146hz2.js";import{Qq as l,Rq as GG,_q as BG,br as c}from"./chunk-t488d66k.js";import"./chunk-cqtkxwd8.js";import"./chunk-srf73nm4.js";import{Pu as G}from"./chunk-r7xp0xcn.js";import"./chunk-6g3m7yxf.js";import"./chunk-hh4c02fh.js";function vG(J){var D;let L=[],q=[];for(let{role:K,content:z}of J)switch(K){case"system":{L.push({role:"system",content:z});break}case"user":{if(z.length===1&&z[0].type==="text"){L.push({role:"user",content:z[0].text});break}L.push({role:"user",content:z.map((A)=>{switch(A.type){case"text":return{type:"text",text:A.text};case"file":if(A.mediaType.startsWith("image/")){let Y=A.mediaType==="image/*"?"image/jpeg":A.mediaType;return{type:"image_url",image_url:{url:A.data instanceof URL?A.data.toString():`data:${Y};base64,${QG(A.data)}`}}}else throw new c({functionality:`file part media type ${A.mediaType}`})}})});break}case"assistant":{let A="",Y=[];for(let X of z)switch(X.type){case"text":{A+=X.text;break}case"tool-call":{Y.push({id:X.toolCallId,type:"function",function:{name:X.toolName,arguments:JSON.stringify(X.input)}});break}}L.push({role:"assistant",content:A,tool_calls:Y.length>0?Y:void 0});break}case"tool":{for(let A of z){if(A.type==="tool-approval-response")continue;let Y=A.output,X;switch(Y.type){case"text":case"error-text":X=Y.value;break;case"execution-denied":X=(D=Y.reason)!=null?D:"Tool execution denied.";break;case"content":case"json":case"error-json":X=JSON.stringify(Y.value);break}L.push({role:"tool",tool_call_id:A.toolCallId,content:X})}break}default:throw Error(`Unsupported role: ${K}`)}return{messages:L,warnings:q}}function EG(J){var D,L,q,K;let z=(L=(D=J.prompt_tokens_details)==null?void 0:D.cached_tokens)!=null?L:0,A=(K=(q=J.completion_tokens_details)==null?void 0:q.reasoning_tokens)!=null?K:0,Y=z<=J.prompt_tokens;return{inputTokens:{total:Y?J.prompt_tokens:J.prompt_tokens+z,noCache:Y?J.prompt_tokens-z:J.prompt_tokens,cacheRead:z,cacheWrite:void 0},outputTokens:{total:J.completion_tokens+A,text:J.completion_tokens,reasoning:A},raw:J}}function JG({id:J,model:D,created:L,created_at:q}){let K=L!=null?L:q;return{id:J!=null?J:void 0,modelId:D!=null?D:void 0,timestamp:K!=null?new Date(K*1000):void 0}}function WG(J){switch(J){case"stop":return"stop";case"length":return"length";case"tool_calls":case"function_call":return"tool-calls";case"content_filter":return"content-filter";default:return"other"}}var kG=G.object({type:G.literal("web"),country:G.string().length(2).optional(),excludedWebsites:G.array(G.string()).max(5).optional(),allowedWebsites:G.array(G.string()).max(5).optional(),safeSearch:G.boolean().optional()}),bG=G.object({type:G.literal("x"),excludedXHandles:G.array(G.string()).optional(),includedXHandles:G.array(G.string()).optional(),postFavoriteCount:G.number().int().optional(),postViewCount:G.number().int().optional(),xHandles:G.array(G.string()).optional()}),hG=G.object({type:G.literal("news"),country:G.string().length(2).optional(),excludedWebsites:G.array(G.string()).max(5).optional(),safeSearch:G.boolean().optional()}),_G=G.object({type:G.literal("rss"),links:G.array(G.string().url()).max(1)}),mG=G.discriminatedUnion("type",[kG,bG,hG,_G]),gG=G.object({reasoningEffort:G.enum(["low","high"]).optional(),logprobs:G.boolean().optional(),topLogprobs:G.number().int().min(0).max(8).optional(),parallel_function_calling:G.boolean().optional(),searchParameters:G.object({mode:G.enum(["off","auto","on"]),returnCitations:G.boolean().optional(),fromDate:G.string().optional(),toDate:G.string().optional(),maxSearchResults:G.number().min(1).max(50).optional(),sources:G.array(mG).optional()}).optional()}),uG=G.object({error:G.object({message:G.string(),type:G.string().nullish(),param:G.any().nullish(),code:G.union([G.string(),G.number()]).nullish()})}),r=yG({errorSchema:uG,errorToMessage:(J)=>J.error.message});function dG({tools:J,toolChoice:D}){J=(J==null?void 0:J.length)?J:void 0;let L=[];if(J==null)return{tools:void 0,toolChoice:void 0,toolWarnings:L};let q=[];for(let z of J)if(z.type==="provider")L.push({type:"unsupported",feature:`provider-defined tool ${z.name}`});else q.push({type:"function",function:{name:z.name,description:z.description,parameters:z.inputSchema,...z.strict!=null?{strict:z.strict}:{}}});if(D==null)return{tools:q,toolChoice:void 0,toolWarnings:L};let K=D.type;switch(K){case"auto":case"none":return{tools:q,toolChoice:K,toolWarnings:L};case"required":return{tools:q,toolChoice:"required",toolWarnings:L};case"tool":return{tools:q,toolChoice:{type:"function",function:{name:D.toolName}},toolWarnings:L};default:throw new c({functionality:`tool choice type: ${K}`})}}var cG=class{constructor(J,D){this.specificationVersion="v3",this.supportedUrls={"image/*":[/^https?:\/\/.*$/]},this.modelId=J,this.config=D}get provider(){return this.config.provider}async getArgs({prompt:J,maxOutputTokens:D,temperature:L,topP:q,topK:K,frequencyPenalty:z,presencePenalty:A,stopSequences:Y,seed:X,responseFormat:Z,providerOptions:M,tools:E,toolChoice:F}){var B,R,N;let $=[],W=(B=await p({provider:"xai",providerOptions:M,schema:gG}))!=null?B:{};if(K!=null)$.push({type:"unsupported",feature:"topK"});if(z!=null)$.push({type:"unsupported",feature:"frequencyPenalty"});if(A!=null)$.push({type:"unsupported",feature:"presencePenalty"});if(Y!=null)$.push({type:"unsupported",feature:"stopSequences"});let{messages:H,warnings:O}=vG(J);$.push(...O);let{tools:C,toolChoice:w,toolWarnings:j}=dG({tools:E,toolChoice:F});return $.push(...j),{args:{model:this.modelId,logprobs:W.logprobs===!0||W.topLogprobs!=null?!0:void 0,top_logprobs:W.topLogprobs,max_completion_tokens:D,temperature:L,top_p:q,seed:X,reasoning_effort:W.reasoningEffort,parallel_function_calling:W.parallel_function_calling,response_format:(Z==null?void 0:Z.type)==="json"?Z.schema!=null?{type:"json_schema",json_schema:{name:(R=Z.name)!=null?R:"response",schema:Z.schema,strict:!0}}:{type:"json_object"}:void 0,search_parameters:W.searchParameters?{mode:W.searchParameters.mode,return_citations:W.searchParameters.returnCitations,from_date:W.searchParameters.fromDate,to_date:W.searchParameters.toDate,max_search_results:W.searchParameters.maxSearchResults,sources:(N=W.searchParameters.sources)==null?void 0:N.map((S)=>{var h;return{type:S.type,...S.type==="web"&&{country:S.country,excluded_websites:S.excludedWebsites,allowed_websites:S.allowedWebsites,safe_search:S.safeSearch},...S.type==="x"&&{excluded_x_handles:S.excludedXHandles,included_x_handles:(h=S.includedXHandles)!=null?h:S.xHandles,post_favorite_count:S.postFavoriteCount,post_view_count:S.postViewCount},...S.type==="news"&&{country:S.country,excluded_websites:S.excludedWebsites,safe_search:S.safeSearch},...S.type==="rss"&&{links:S.links}}})}:void 0,messages:H,tools:C,tool_choice:w},warnings:$}}async doGenerate(J){var D,L;let{args:q,warnings:K}=await this.getArgs(J),z=`${(D=this.config.baseURL)!=null?D:"https://api.x.ai/v1"}/chat/completions`,{responseHeaders:A,value:Y,rawValue:X}=await u({url:z,headers:g(this.config.headers(),J.headers),body:q,failedResponseHandler:r,successfulResponseHandler:d(pG),abortSignal:J.abortSignal,fetch:this.config.fetch});if(Y.error!=null)throw new GG({message:Y.error,url:z,requestBodyValues:q,statusCode:200,responseHeaders:A,responseBody:JSON.stringify(X),isRetryable:Y.code==="The service is currently unavailable"});let Z=Y.choices[0],M=[];if(Z.message.content!=null&&Z.message.content.length>0){let E=Z.message.content,F=q.messages[q.messages.length-1];if((F==null?void 0:F.role)==="assistant"&&E===F.content)E="";if(E.length>0)M.push({type:"text",text:E})}if(Z.message.reasoning_content!=null&&Z.message.reasoning_content.length>0)M.push({type:"reasoning",text:Z.message.reasoning_content});if(Z.message.tool_calls!=null)for(let E of Z.message.tool_calls)M.push({type:"tool-call",toolCallId:E.id,toolName:E.function.name,input:E.function.arguments});if(Y.citations!=null)for(let E of Y.citations)M.push({type:"source",sourceType:"url",id:this.config.generateId(),url:E});return{content:M,finishReason:{unified:WG(Z.finish_reason),raw:(L=Z.finish_reason)!=null?L:void 0},usage:Y.usage?EG(Y.usage):{inputTokens:{total:0,noCache:0,cacheRead:0,cacheWrite:0},outputTokens:{total:0,text:0,reasoning:0}},request:{body:q},response:{...JG(Y),headers:A,body:X},warnings:K}}async doStream(J){var D;let{args:L,warnings:q}=await this.getArgs(J),K={...L,stream:!0,stream_options:{include_usage:!0}},z=`${(D=this.config.baseURL)!=null?D:"https://api.x.ai/v1"}/chat/completions`,{responseHeaders:A,value:Y}=await u({url:z,headers:g(this.config.headers(),J.headers),body:K,failedResponseHandler:r,successfulResponseHandler:async({response:N})=>{let $=NG(N),W=N.headers.get("content-type");if(W==null?void 0:W.includes("application/json")){let H=await N.text(),O=await CG({text:H,schema:lG});if(O.success)throw new GG({message:O.value.error,url:z,requestBodyValues:K,statusCode:200,responseHeaders:$,responseBody:H,isRetryable:O.value.code==="The service is currently unavailable"});throw new GG({message:"Invalid JSON response",url:z,requestBodyValues:K,statusCode:200,responseHeaders:$,responseBody:H})}return YG(iG)({response:N,url:z,requestBodyValues:K})},abortSignal:J.abortSignal,fetch:this.config.fetch}),X={unified:"other",raw:void 0},Z=void 0,M=!0,E={},F={},B=void 0,R=this;return{stream:Y.pipeThrough(new TransformStream({start(N){N.enqueue({type:"stream-start",warnings:q})},transform(N,$){if(J.includeRawChunks)$.enqueue({type:"raw",rawValue:N.rawValue});if(!N.success){$.enqueue({type:"error",error:N.error});return}let W=N.value;if(M)$.enqueue({type:"response-metadata",...JG(W)}),M=!1;if(W.citations!=null)for(let w of W.citations)$.enqueue({type:"source",sourceType:"url",id:R.config.generateId(),url:w});if(W.usage!=null)Z=EG(W.usage);let H=W.choices[0];if((H==null?void 0:H.finish_reason)!=null)X={unified:WG(H.finish_reason),raw:H.finish_reason};if((H==null?void 0:H.delta)==null)return;let{delta:O,index:C}=H;if(O.content!=null&&O.content.length>0){let w=O.content;if(B!=null&&!E[B].ended)$.enqueue({type:"reasoning-end",id:B}),E[B].ended=!0,B=void 0;let j=K.messages[K.messages.length-1];if((j==null?void 0:j.role)==="assistant"&&w===j.content)return;let y=`text-${W.id||C}`;if(E[y]==null)E[y]={type:"text",ended:!1},$.enqueue({type:"text-start",id:y});$.enqueue({type:"text-delta",id:y,delta:w})}if(O.reasoning_content!=null&&O.reasoning_content.length>0){let w=`reasoning-${W.id||C}`;if(F[w]===O.reasoning_content)return;if(F[w]=O.reasoning_content,E[w]==null)E[w]={type:"reasoning",ended:!1},B=w,$.enqueue({type:"reasoning-start",id:w});$.enqueue({type:"reasoning-delta",id:w,delta:O.reasoning_content})}if(O.tool_calls!=null){if(B!=null&&!E[B].ended)$.enqueue({type:"reasoning-end",id:B}),E[B].ended=!0,B=void 0;for(let w of O.tool_calls){let j=w.id;$.enqueue({type:"tool-input-start",id:j,toolName:w.function.name}),$.enqueue({type:"tool-input-delta",id:j,delta:w.function.arguments}),$.enqueue({type:"tool-input-end",id:j}),$.enqueue({type:"tool-call",toolCallId:j,toolName:w.function.name,input:w.function.arguments})}}},flush(N){for(let[$,W]of Object.entries(E))if(!W.ended)N.enqueue({type:W.type==="text"?"text-end":"reasoning-end",id:$});N.enqueue({type:"finish",finishReason:X,usage:Z!=null?Z:{inputTokens:{total:0,noCache:0,cacheRead:0,cacheWrite:0},outputTokens:{total:0,text:0,reasoning:0}}})}})),request:{body:K},response:{headers:A}}}},TG=G.object({prompt_tokens:G.number(),completion_tokens:G.number(),total_tokens:G.number(),prompt_tokens_details:G.object({text_tokens:G.number().nullish(),audio_tokens:G.number().nullish(),image_tokens:G.number().nullish(),cached_tokens:G.number().nullish()}).nullish(),completion_tokens_details:G.object({reasoning_tokens:G.number().nullish(),audio_tokens:G.number().nullish(),accepted_prediction_tokens:G.number().nullish(),rejected_prediction_tokens:G.number().nullish()}).nullish()}),pG=G.object({id:G.string().nullish(),created:G.number().nullish(),model:G.string().nullish(),choices:G.array(G.object({message:G.object({role:G.literal("assistant"),content:G.string().nullish(),reasoning_content:G.string().nullish(),tool_calls:G.array(G.object({id:G.string(),type:G.literal("function"),function:G.object({name:G.string(),arguments:G.string()})})).nullish()}),index:G.number(),finish_reason:G.string().nullish()})).nullish(),object:G.literal("chat.completion").nullish(),usage:TG.nullish(),citations:G.array(G.string().url()).nullish(),code:G.string().nullish(),error:G.string().nullish()}),iG=G.object({id:G.string().nullish(),created:G.number().nullish(),model:G.string().nullish(),choices:G.array(G.object({delta:G.object({role:G.enum(["assistant"]).optional(),content:G.string().nullish(),reasoning_content:G.string().nullish(),tool_calls:G.array(G.object({id:G.string(),type:G.literal("function"),function:G.object({name:G.string(),arguments:G.string()})})).nullish()}),finish_reason:G.string().nullish(),index:G.number()})),usage:TG.nullish(),citations:G.array(G.string().url()).nullish()}),lG=G.object({code:G.string(),error:G.string()}),rG=G.object({aspect_ratio:G.string().optional(),output_format:G.string().optional(),sync_mode:G.boolean().optional(),resolution:G.enum(["1k","2k"]).optional(),quality:G.enum(["low","medium","high"]).optional(),user:G.string().optional()}),aG=class{constructor(J,D){this.modelId=J,this.config=D,this.specificationVersion="v3",this.maxImagesPerCall=3}get provider(){return this.config.provider}async doGenerate({prompt:J,n:D,size:L,aspectRatio:q,seed:K,providerOptions:z,headers:A,abortSignal:Y,files:X,mask:Z}){var M,E,F,B,R;let N=[];if(L!=null)N.push({type:"unsupported",feature:"size",details:"This model does not support the `size` option. Use `aspectRatio` instead."});if(K!=null)N.push({type:"unsupported",feature:"seed"});if(Z!=null)N.push({type:"unsupported",feature:"mask"});let $=await p({provider:"xai",providerOptions:z,schema:rG}),W=X!=null&&X.length>0,H=W?X.map((I)=>SG(I)):[],O=W?"/images/edits":"/images/generations",C={model:this.modelId,prompt:J,n:D,response_format:"b64_json"};if(q!=null)C.aspect_ratio=q;if(($==null?void 0:$.output_format)!=null)C.output_format=$.output_format;if(($==null?void 0:$.sync_mode)!=null)C.sync_mode=$.sync_mode;if(($==null?void 0:$.aspect_ratio)!=null&&q==null)C.aspect_ratio=$.aspect_ratio;if(($==null?void 0:$.resolution)!=null)C.resolution=$.resolution;if(($==null?void 0:$.quality)!=null)C.quality=$.quality;if(($==null?void 0:$.user)!=null)C.user=$.user;if(H.length===1)C.image={url:H[0],type:"image_url"};else if(H.length>1)C.images=H.map((I)=>({url:I,type:"image_url"}));let w=(M=this.config.baseURL)!=null?M:"https://api.x.ai/v1",j=(B=(F=(E=this.config._internal)==null?void 0:E.currentDate)==null?void 0:F.call(E))!=null?B:new Date,{value:y,responseHeaders:S}=await u({url:`${w}${O}`,headers:g(this.config.headers(),A),body:C,failedResponseHandler:r,successfulResponseHandler:d(nG),abortSignal:Y,fetch:this.config.fetch});return{images:y.data.every((I)=>I.b64_json!=null)?y.data.map((I)=>I.b64_json):await Promise.all(y.data.map((I)=>this.downloadImage(I.url,Y))),warnings:N,response:{timestamp:j,modelId:this.modelId,headers:S},providerMetadata:{xai:{images:y.data.map((I)=>({...I.revised_prompt?{revisedPrompt:I.revised_prompt}:{}})),...((R=y.usage)==null?void 0:R.cost_in_usd_ticks)!=null?{costInUsdTicks:y.usage.cost_in_usd_ticks}:{}}}}}async downloadImage(J,D){let{value:L}=await XG({url:J,abortSignal:D,failedResponseHandler:RG(),successfulResponseHandler:IG(),fetch:this.config.fetch});return L}},nG=G.object({data:G.array(G.object({url:G.string().nullish(),b64_json:G.string().nullish(),revised_prompt:G.string().nullish()})),usage:G.object({cost_in_usd_ticks:G.number().nullish()}).nullish()});async function sG({prompt:J}){var D,L,q,K,z;let A=[],Y=[];for(let X of J)switch(X.role){case"system":{A.push({role:"system",content:X.content});break}case"user":{let Z=[];for(let M of X.content)switch(M.type){case"text":{Z.push({type:"input_text",text:M.text});break}case"file":{if(M.mediaType.startsWith("image/")){let E=M.mediaType==="image/*"?"image/jpeg":M.mediaType,F=M.data instanceof URL?M.data.toString():`data:${E};base64,${QG(M.data)}`;Z.push({type:"input_image",image_url:F})}else throw new c({functionality:`file part media type ${M.mediaType}`});break}default:{let E=M;Y.push({type:"other",message:"xAI Responses API does not support this content type in user messages"})}}A.push({role:"user",content:Z});break}case"assistant":{for(let Z of X.content)switch(Z.type){case"text":{let M=typeof((L=(D=Z.providerOptions)==null?void 0:D.xai)==null?void 0:L.itemId)==="string"?Z.providerOptions.xai.itemId:void 0;A.push({role:"assistant",content:Z.text,id:M});break}case"tool-call":{if(Z.providerExecuted)break;let M=typeof((K=(q=Z.providerOptions)==null?void 0:q.xai)==null?void 0:K.itemId)==="string"?Z.providerOptions.xai.itemId:void 0;A.push({type:"function_call",id:M!=null?M:Z.toolCallId,call_id:Z.toolCallId,name:Z.toolName,arguments:JSON.stringify(Z.input),status:"completed"});break}case"tool-result":break;case"reasoning":case"file":{Y.push({type:"other",message:`xAI Responses API does not support ${Z.type} in assistant messages`});break}default:{let M=Z;Y.push({type:"other",message:"xAI Responses API does not support this content type in assistant messages"})}}break}case"tool":{for(let Z of X.content){if(Z.type==="tool-approval-response")continue;let M=Z.output,E;switch(M.type){case"text":case"error-text":E=M.value;break;case"execution-denied":E=(z=M.reason)!=null?z:"tool execution denied";break;case"json":case"error-json":E=JSON.stringify(M.value);break;case"content":E=M.value.map((F)=>{if(F.type==="text")return F.text;return""}).join("");break;default:{let F=M;E=""}}A.push({type:"function_call_output",call_id:Z.toolCallId,output:E})}break}default:{let Z=X;Y.push({type:"other",message:"unsupported message role"})}}return{input:A,inputWarnings:Y}}function ZG(J){var D,L,q,K;let z=(L=(D=J.input_tokens_details)==null?void 0:D.cached_tokens)!=null?L:0,A=(K=(q=J.output_tokens_details)==null?void 0:q.reasoning_tokens)!=null?K:0,Y=z<=J.input_tokens;return{inputTokens:{total:Y?J.input_tokens:J.input_tokens+z,noCache:Y?J.input_tokens-z:J.input_tokens,cacheRead:z,cacheWrite:void 0},outputTokens:{total:J.output_tokens,text:J.output_tokens-A,reasoning:A},raw:J}}function o(J){switch(J){case"stop":case"completed":return"stop";case"length":case"max_output_tokens":return"length";case"tool_calls":case"function_call":return"tool-calls";case"content_filter":return"content-filter";default:return"other"}}var KG=G.union([G.object({type:G.literal("url_citation"),url:G.string(),title:G.string().optional()}),G.object({type:G.string()})]),AG=G.object({type:G.string(),text:G.string().optional(),logprobs:G.array(G.any()).optional(),annotations:G.array(KG).optional()}),jG=G.object({type:G.string(),text:G.string()}),i=G.object({name:G.string().optional(),arguments:G.string().optional(),input:G.string().optional(),call_id:G.string().optional(),id:G.string(),status:G.string(),action:G.any().optional()}),tG=G.object({name:G.string().optional(),arguments:G.string().optional(),output:G.string().optional(),error:G.string().optional(),id:G.string(),status:G.string(),server_label:G.string().optional()}),DG=G.discriminatedUnion("type",[G.object({type:G.literal("web_search_call"),...i.shape}),G.object({type:G.literal("x_search_call"),...i.shape}),G.object({type:G.literal("code_interpreter_call"),...i.shape}),G.object({type:G.literal("code_execution_call"),...i.shape}),G.object({type:G.literal("view_image_call"),...i.shape}),G.object({type:G.literal("view_x_video_call"),...i.shape}),G.object({type:G.literal("file_search_call"),id:G.string(),status:G.string(),queries:G.array(G.string()).optional(),results:G.array(G.object({file_id:G.string(),filename:G.string(),score:G.number(),text:G.string()})).nullish()}),G.object({type:G.literal("custom_tool_call"),...i.shape}),G.object({type:G.literal("mcp_call"),...tG.shape}),G.object({type:G.literal("message"),role:G.string(),content:G.array(AG),id:G.string(),status:G.string()}),G.object({type:G.literal("function_call"),name:G.string(),arguments:G.string(),call_id:G.string(),id:G.string()}),G.object({type:G.literal("reasoning"),id:G.string(),summary:G.array(jG),status:G.string(),encrypted_content:G.string().nullish()})]),qG=G.object({input_tokens:G.number(),output_tokens:G.number(),total_tokens:G.number().optional(),input_tokens_details:G.object({cached_tokens:G.number().optional()}).optional(),output_tokens_details:G.object({reasoning_tokens:G.number().optional()}).optional(),num_sources_used:G.number().optional(),num_server_side_tools_used:G.number().optional()}),t=G.object({id:G.string().nullish(),created_at:G.number().nullish(),model:G.string().nullish(),object:G.literal("response"),output:G.array(DG),usage:qG.nullish(),status:G.string()}),eG=G.union([G.object({type:G.literal("response.created"),response:t.partial({usage:!0,status:!0})}),G.object({type:G.literal("response.in_progress"),response:t.partial({usage:!0,status:!0})}),G.object({type:G.literal("response.output_item.added"),item:DG,output_index:G.number()}),G.object({type:G.literal("response.output_item.done"),item:DG,output_index:G.number()}),G.object({type:G.literal("response.content_part.added"),item_id:G.string(),output_index:G.number(),content_index:G.number(),part:AG}),G.object({type:G.literal("response.content_part.done"),item_id:G.string(),output_index:G.number(),content_index:G.number(),part:AG}),G.object({type:G.literal("response.output_text.delta"),item_id:G.string(),output_index:G.number(),content_index:G.number(),delta:G.string(),logprobs:G.array(G.any()).optional()}),G.object({type:G.literal("response.output_text.done"),item_id:G.string(),output_index:G.number(),content_index:G.number(),text:G.string(),logprobs:G.array(G.any()).optional(),annotations:G.array(KG).optional()}),G.object({type:G.literal("response.output_text.annotation.added"),item_id:G.string(),output_index:G.number(),content_index:G.number(),annotation_index:G.number(),annotation:KG}),G.object({type:G.literal("response.reasoning_summary_part.added"),item_id:G.string(),output_index:G.number(),summary_index:G.number(),part:jG}),G.object({type:G.literal("response.reasoning_summary_part.done"),item_id:G.string(),output_index:G.number(),summary_index:G.number(),part:jG}),G.object({type:G.literal("response.reasoning_summary_text.delta"),item_id:G.string(),output_index:G.number(),summary_index:G.number(),delta:G.string()}),G.object({type:G.literal("response.reasoning_summary_text.done"),item_id:G.string(),output_index:G.number(),summary_index:G.number(),text:G.string()}),G.object({type:G.literal("response.reasoning_text.delta"),item_id:G.string(),output_index:G.number(),content_index:G.number(),delta:G.string()}),G.object({type:G.literal("response.reasoning_text.done"),item_id:G.string(),output_index:G.number(),content_index:G.number(),text:G.string()}),G.object({type:G.literal("response.web_search_call.in_progress"),item_id:G.string(),output_index:G.number()}),G.object({type:G.literal("response.web_search_call.searching"),item_id:G.string(),output_index:G.number()}),G.object({type:G.literal("response.web_search_call.completed"),item_id:G.string(),output_index:G.number()}),G.object({type:G.literal("response.x_search_call.in_progress"),item_id:G.string(),output_index:G.number()}),G.object({type:G.literal("response.x_search_call.searching"),item_id:G.string(),output_index:G.number()}),G.object({type:G.literal("response.x_search_call.completed"),item_id:G.string(),output_index:G.number()}),G.object({type:G.literal("response.file_search_call.in_progress"),item_id:G.string(),output_index:G.number()}),G.object({type:G.literal("response.file_search_call.searching"),item_id:G.string(),output_index:G.number()}),G.object({type:G.literal("response.file_search_call.completed"),item_id:G.string(),output_index:G.number()}),G.object({type:G.literal("response.code_execution_call.in_progress"),item_id:G.string(),output_index:G.number()}),G.object({type:G.literal("response.code_execution_call.executing"),item_id:G.string(),output_index:G.number()}),G.object({type:G.literal("response.code_execution_call.completed"),item_id:G.string(),output_index:G.number()}),G.object({type:G.literal("response.code_interpreter_call.in_progress"),item_id:G.string(),output_index:G.number()}),G.object({type:G.literal("response.code_interpreter_call.executing"),item_id:G.string(),output_index:G.number()}),G.object({type:G.literal("response.code_interpreter_call.interpreting"),item_id:G.string(),output_index:G.number()}),G.object({type:G.literal("response.code_interpreter_call.completed"),item_id:G.string(),output_index:G.number()}),G.object({type:G.literal("response.code_interpreter_call_code.delta"),item_id:G.string(),output_index:G.number(),delta:G.string()}),G.object({type:G.literal("response.code_interpreter_call_code.done"),item_id:G.string(),output_index:G.number(),code:G.string()}),G.object({type:G.literal("response.custom_tool_call_input.delta"),item_id:G.string(),output_index:G.number(),delta:G.string()}),G.object({type:G.literal("response.custom_tool_call_input.done"),item_id:G.string(),output_index:G.number(),input:G.string()}),G.object({type:G.literal("response.function_call_arguments.delta"),item_id:G.string(),output_index:G.number(),delta:G.string()}),G.object({type:G.literal("response.function_call_arguments.done"),item_id:G.string(),output_index:G.number(),arguments:G.string()}),G.object({type:G.literal("response.mcp_call.in_progress"),item_id:G.string(),output_index:G.number()}),G.object({type:G.literal("response.mcp_call.executing"),item_id:G.string(),output_index:G.number()}),G.object({type:G.literal("response.mcp_call.completed"),item_id:G.string(),output_index:G.number()}),G.object({type:G.literal("response.mcp_call.failed"),item_id:G.string(),output_index:G.number()}),G.object({type:G.literal("response.mcp_call_arguments.delta"),item_id:G.string(),output_index:G.number(),delta:G.string()}),G.object({type:G.literal("response.mcp_call_arguments.done"),item_id:G.string(),output_index:G.number(),arguments:G.string().optional()}),G.object({type:G.literal("response.mcp_call_output.delta"),item_id:G.string(),output_index:G.number(),delta:G.string()}),G.object({type:G.literal("response.mcp_call_output.done"),item_id:G.string(),output_index:G.number(),output:G.string().optional()}),G.object({type:G.literal("response.incomplete"),response:G.object({incomplete_details:G.object({reason:G.string()}).nullish(),usage:qG.nullish()})}),G.object({type:G.literal("response.failed"),response:G.object({error:G.object({code:G.string().nullish(),message:G.string()}).nullish(),incomplete_details:G.object({reason:G.string()}).nullish(),usage:qG.nullish()})}),G.object({type:G.literal("error"),code:G.string().nullish(),message:G.string(),param:G.string().nullish()}),G.object({type:G.literal("response.done"),response:t}),G.object({type:G.literal("response.completed"),response:t})]),oG=G.object({reasoningEffort:G.enum(["low","medium","high"]).optional(),logprobs:G.boolean().optional(),topLogprobs:G.number().int().min(0).max(8).optional(),store:G.boolean().optional(),previousResponseId:G.string().optional(),include:G.array(G.enum(["file_search_call.results"])).nullish()}),GJ=v(()=>k(G.object({vectorStoreIds:G.array(G.string()),maxNumResults:G.number().optional()}))),JJ=v(()=>k(G.object({queries:G.array(G.string()),results:G.array(G.object({fileId:G.string(),filename:G.string(),score:G.number().min(0).max(1),text:G.string()})).nullable()}))),QJ=_({id:"xai.file_search",inputSchema:v(()=>k(G.object({}))),outputSchema:JJ}),XJ=(J)=>QJ(J),YJ=v(()=>k(G.object({serverUrl:G.string().describe("The URL of the MCP server"),serverLabel:G.string().optional().describe("A label for the MCP server"),serverDescription:G.string().optional().describe("Description of the MCP server"),allowedTools:G.array(G.string()).optional().describe("List of allowed tool names"),headers:G.record(G.string(),G.string()).optional().describe("Custom headers to send"),authorization:G.string().optional().describe("Authorization header value")}))),ZJ=v(()=>k(G.object({name:G.string(),arguments:G.string(),result:G.unknown()}))),$J=_({id:"xai.mcp",inputSchema:v(()=>k(G.object({}))),outputSchema:ZJ}),KJ=(J)=>$J(J),AJ=v(()=>k(G.object({allowedDomains:G.array(G.string()).max(5).optional(),excludedDomains:G.array(G.string()).max(5).optional(),enableImageUnderstanding:G.boolean().optional()}))),jJ=v(()=>k(G.object({query:G.string(),sources:G.array(G.object({title:G.string(),url:G.string(),snippet:G.string()}))}))),DJ=_({id:"xai.web_search",inputSchema:v(()=>k(G.object({}))),outputSchema:jJ}),qJ=(J={})=>DJ(J),zJ=v(()=>k(G.object({allowedXHandles:G.array(G.string()).max(10).optional(),excludedXHandles:G.array(G.string()).max(10).optional(),fromDate:G.string().optional(),toDate:G.string().optional(),enableImageUnderstanding:G.boolean().optional(),enableVideoUnderstanding:G.boolean().optional()}))),VJ=v(()=>k(G.object({query:G.string(),posts:G.array(G.object({author:G.string(),text:G.string(),url:G.string(),likes:G.number()}))}))),LJ=_({id:"xai.x_search",inputSchema:v(()=>k(G.object({}))),outputSchema:VJ}),UJ=(J={})=>LJ(J);async function HJ({tools:J,toolChoice:D}){let L=(J==null?void 0:J.length)?J:void 0,q=[];if(L==null)return{tools:void 0,toolChoice:void 0,toolWarnings:q};let K=[],z=new Map;for(let Y of L)if(z.set(Y.name,Y),Y.type==="provider")switch(Y.id){case"xai.web_search":{let X=await s({value:Y.args,schema:AJ});K.push({type:"web_search",allowed_domains:X.allowedDomains,excluded_domains:X.excludedDomains,enable_image_understanding:X.enableImageUnderstanding});break}case"xai.x_search":{let X=await s({value:Y.args,schema:zJ});K.push({type:"x_search",allowed_x_handles:X.allowedXHandles,excluded_x_handles:X.excludedXHandles,from_date:X.fromDate,to_date:X.toDate,enable_image_understanding:X.enableImageUnderstanding,enable_video_understanding:X.enableVideoUnderstanding});break}case"xai.code_execution":{K.push({type:"code_interpreter"});break}case"xai.view_image":{K.push({type:"view_image"});break}case"xai.view_x_video":{K.push({type:"view_x_video"});break}case"xai.file_search":{let X=await s({value:Y.args,schema:GJ});K.push({type:"file_search",vector_store_ids:X.vectorStoreIds,max_num_results:X.maxNumResults});break}case"xai.mcp":{let X=await s({value:Y.args,schema:YJ});K.push({type:"mcp",server_url:X.serverUrl,server_label:X.serverLabel,server_description:X.serverDescription,allowed_tools:X.allowedTools,headers:X.headers,authorization:X.authorization});break}default:{q.push({type:"unsupported",feature:`provider-defined tool ${Y.name}`});break}}else K.push({type:"function",name:Y.name,description:Y.description,parameters:Y.inputSchema,...Y.strict!=null?{strict:Y.strict}:{}});if(D==null)return{tools:K,toolChoice:void 0,toolWarnings:q};let A=D.type;switch(A){case"auto":case"none":return{tools:K,toolChoice:A,toolWarnings:q};case"required":return{tools:K,toolChoice:"required",toolWarnings:q};case"tool":{let Y=z.get(D.toolName);if(Y==null)return{tools:K,toolChoice:void 0,toolWarnings:q};if(Y.type==="provider")return q.push({type:"unsupported",feature:`toolChoice for server-side tool "${Y.name}"`}),{tools:K,toolChoice:void 0,toolWarnings:q};return{tools:K,toolChoice:{type:"function",name:Y.name},toolWarnings:q}}default:throw new c({functionality:`tool choice type: ${A}`})}}var MJ=class{constructor(J,D){this.specificationVersion="v3",this.supportedUrls={"image/*":[/^https?:\/\/.*$/]},this.modelId=J,this.config=D}get provider(){return this.config.provider}async getArgs({prompt:J,maxOutputTokens:D,temperature:L,topP:q,stopSequences:K,seed:z,responseFormat:A,providerOptions:Y,tools:X,toolChoice:Z}){var M,E,F,B,R,N,$;let W=[],H=(M=await p({provider:"xai",providerOptions:Y,schema:oG}))!=null?M:{};if(K!=null)W.push({type:"unsupported",feature:"stopSequences"});let O=(E=X==null?void 0:X.find((x)=>x.type==="provider"&&x.id==="xai.web_search"))==null?void 0:E.name,C=(F=X==null?void 0:X.find((x)=>x.type==="provider"&&x.id==="xai.x_search"))==null?void 0:F.name,w=(B=X==null?void 0:X.find((x)=>x.type==="provider"&&x.id==="xai.code_execution"))==null?void 0:B.name,j=(R=X==null?void 0:X.find((x)=>x.type==="provider"&&x.id==="xai.mcp"))==null?void 0:R.name,y=(N=X==null?void 0:X.find((x)=>x.type==="provider"&&x.id==="xai.file_search"))==null?void 0:N.name,{input:S,inputWarnings:h}=await sG({prompt:J,store:!0});W.push(...h);let{tools:m,toolChoice:I,toolWarnings:P}=await HJ({tools:X,toolChoice:Z});W.push(...P);let f=H.include?[...H.include]:void 0;if(H.store===!1)if(f==null)f=["reasoning.encrypted_content"];else f=[...f,"reasoning.encrypted_content"];let U={model:this.modelId,input:S,logprobs:H.logprobs===!0||H.topLogprobs!=null?!0:void 0,top_logprobs:H.topLogprobs,max_output_tokens:D,temperature:L,top_p:q,seed:z,...(A==null?void 0:A.type)==="json"&&{text:{format:A.schema!=null?{type:"json_schema",strict:!0,name:($=A.name)!=null?$:"response",description:A.description,schema:A.schema}:{type:"json_object"}}},...H.reasoningEffort!=null&&{reasoning:{effort:H.reasoningEffort}},...H.store===!1&&{store:H.store},...f!=null&&{include:f},...H.previousResponseId!=null&&{previous_response_id:H.previousResponseId}};if(m&&m.length>0)U.tools=m;if(I!=null)U.tool_choice=I;return{args:U,warnings:W,webSearchToolName:O,xSearchToolName:C,codeExecutionToolName:w,mcpToolName:j,fileSearchToolName:y}}async doGenerate(J){var D,L,q,K,z,A,Y,X,Z,M,E,F,B;let{args:R,warnings:N,webSearchToolName:$,xSearchToolName:W,codeExecutionToolName:H,mcpToolName:O,fileSearchToolName:C}=await this.getArgs(J),{responseHeaders:w,value:j,rawValue:y}=await u({url:`${(D=this.config.baseURL)!=null?D:"https://api.x.ai/v1"}/responses`,headers:g(this.config.headers(),J.headers),body:R,failedResponseHandler:r,successfulResponseHandler:d(t),abortSignal:J.abortSignal,fetch:this.config.fetch}),S=[],h=!1,m=["web_search","web_search_with_snippets","browse_page"],I=["x_user_search","x_keyword_search","x_semantic_search","x_thread_fetch"];for(let P of j.output){if(P.type==="file_search_call"){let f=C!=null?C:"file_search";S.push({type:"tool-call",toolCallId:P.id,toolName:f,input:"",providerExecuted:!0}),S.push({type:"tool-result",toolCallId:P.id,toolName:f,result:{queries:(L=P.queries)!=null?L:[],results:(K=(q=P.results)==null?void 0:q.map((U)=>({fileId:U.file_id,filename:U.filename,score:U.score,text:U.text})))!=null?K:null}});continue}if(P.type==="web_search_call"||P.type==="x_search_call"||P.type==="code_interpreter_call"||P.type==="code_execution_call"||P.type==="view_image_call"||P.type==="view_x_video_call"||P.type==="custom_tool_call"||P.type==="mcp_call"){let f=(z=P.name)!=null?z:"";if(m.includes((A=P.name)!=null?A:"")||P.type==="web_search_call")f=$!=null?$:"web_search";else if(I.includes((Y=P.name)!=null?Y:"")||P.type==="x_search_call")f=W!=null?W:"x_search";else if(P.name==="code_execution"||P.type==="code_interpreter_call"||P.type==="code_execution_call")f=H!=null?H:"code_execution";else if(P.type==="mcp_call")f=(X=O!=null?O:P.name)!=null?X:"mcp";let U=P.type==="custom_tool_call"?(Z=P.input)!=null?Z:"":P.type==="mcp_call"?(M=P.arguments)!=null?M:"":(E=P.arguments)!=null?E:"";S.push({type:"tool-call",toolCallId:P.id,toolName:f,input:U,providerExecuted:!0});continue}switch(P.type){case"message":{for(let f of P.content){if(f.text)S.push({type:"text",text:f.text});if(f.annotations){for(let U of f.annotations)if(U.type==="url_citation"&&"url"in U)S.push({type:"source",sourceType:"url",id:this.config.generateId(),url:U.url,title:(F=U.title)!=null?F:U.url})}}break}case"function_call":{h=!0,S.push({type:"tool-call",toolCallId:P.call_id,toolName:P.name,input:P.arguments});break}case"reasoning":{let f=P.summary.map((U)=>U.text).filter((U)=>U&&U.length>0);if(f.length>0){let U=f.join("");if(P.encrypted_content||P.id)S.push({type:"reasoning",text:U,providerMetadata:{xai:{...P.encrypted_content&&{reasoningEncryptedContent:P.encrypted_content},...P.id&&{itemId:P.id}}}});else S.push({type:"reasoning",text:U})}break}default:break}}return{content:S,finishReason:{unified:h?"tool-calls":o(j.status),raw:(B=j.status)!=null?B:void 0},usage:j.usage?ZG(j.usage):{inputTokens:{total:0,noCache:0,cacheRead:0,cacheWrite:0},outputTokens:{total:0,text:0,reasoning:0}},request:{body:R},response:{...JG(j),headers:w,body:y},warnings:N}}async doStream(J){var D;let{args:L,warnings:q,webSearchToolName:K,xSearchToolName:z,codeExecutionToolName:A,mcpToolName:Y,fileSearchToolName:X}=await this.getArgs(J),Z={...L,stream:!0},{responseHeaders:M,value:E}=await u({url:`${(D=this.config.baseURL)!=null?D:"https://api.x.ai/v1"}/responses`,headers:g(this.config.headers(),J.headers),body:Z,failedResponseHandler:r,successfulResponseHandler:YG(eG),abortSignal:J.abortSignal,fetch:this.config.fetch}),F={unified:"other",raw:void 0},B=!1,R=void 0,N=!0,$={},W=new Set,H={},O={},C=this;return{stream:E.pipeThrough(new TransformStream({start(w){w.enqueue({type:"stream-start",warnings:q})},transform(w,j){var y,S,h,m,I,P,f,U,x,zG,VG,LG,UG,HG,MG;if(J.includeRawChunks)j.enqueue({type:"raw",rawValue:w.rawValue});if(!w.success){j.enqueue({type:"error",error:w.error});return}let V=w.value;if(V.type==="response.created"||V.type==="response.in_progress"){if(N)j.enqueue({type:"response-metadata",...JG(V.response)}),N=!1;return}if(V.type==="response.reasoning_summary_part.added"){let Q=`reasoning-${V.item_id}`;O[V.item_id]={},j.enqueue({type:"reasoning-start",id:Q,providerMetadata:{xai:{itemId:V.item_id}}})}if(V.type==="response.reasoning_summary_text.delta"){let Q=`reasoning-${V.item_id}`;j.enqueue({type:"reasoning-delta",id:Q,delta:V.delta,providerMetadata:{xai:{itemId:V.item_id}}});return}if(V.type==="response.reasoning_summary_text.done")return;if(V.type==="response.reasoning_text.delta"){let Q=`reasoning-${V.item_id}`;if(O[V.item_id]==null)O[V.item_id]={},j.enqueue({type:"reasoning-start",id:Q,providerMetadata:{xai:{itemId:V.item_id}}});j.enqueue({type:"reasoning-delta",id:Q,delta:V.delta,providerMetadata:{xai:{itemId:V.item_id}}});return}if(V.type==="response.reasoning_text.done")return;if(V.type==="response.output_text.delta"){let Q=`text-${V.item_id}`;if($[Q]==null)$[Q]={type:"text"},j.enqueue({type:"text-start",id:Q});j.enqueue({type:"text-delta",id:Q,delta:V.delta});return}if(V.type==="response.output_text.done"){if(V.annotations){for(let Q of V.annotations)if(Q.type==="url_citation"&&"url"in Q)j.enqueue({type:"source",sourceType:"url",id:C.config.generateId(),url:Q.url,title:(y=Q.title)!=null?y:Q.url})}return}if(V.type==="response.output_text.annotation.added"){let Q=V.annotation;if(Q.type==="url_citation"&&"url"in Q)j.enqueue({type:"source",sourceType:"url",id:C.config.generateId(),url:Q.url,title:(S=Q.title)!=null?S:Q.url});return}if(V.type==="response.done"||V.type==="response.completed"||V.type==="response.incomplete"){let Q=V.response;if(Q.usage)R=ZG(Q.usage);if(V.type==="response.incomplete"){let T="incomplete_details"in Q?(h=Q.incomplete_details)==null?void 0:h.reason:void 0;F={unified:T?o(T):"other",raw:T!=null?T:"incomplete"}}else if("status"in Q&&Q.status)F={unified:B?"tool-calls":o(Q.status),raw:Q.status};return}if(V.type==="response.failed"){let Q=(m=V.response.incomplete_details)==null?void 0:m.reason;if(F={unified:Q?o(Q):"error",raw:Q!=null?Q:"error"},V.response.usage)R=ZG(V.response.usage);return}if(V.type==="error"){j.enqueue({type:"error",error:V});return}if(V.type==="response.custom_tool_call_input.delta"||V.type==="response.custom_tool_call_input.done")return;if(V.type==="response.function_call_arguments.delta"){let Q=H[V.output_index];if(Q!=null)j.enqueue({type:"tool-input-delta",id:Q.toolCallId,delta:V.delta});return}if(V.type==="response.function_call_arguments.done")return;if(V.type==="response.output_item.added"||V.type==="response.output_item.done"){let Q=V.item;if(Q.type==="reasoning"){if(V.type==="response.output_item.done"){let T=`reasoning-${Q.id}`;if(!(Q.id in O))O[Q.id]={},j.enqueue({type:"reasoning-start",id:T,providerMetadata:{xai:{...Q.id&&{itemId:Q.id}}}});j.enqueue({type:"reasoning-end",id:T,providerMetadata:{xai:{...Q.encrypted_content&&{reasoningEncryptedContent:Q.encrypted_content},...Q.id&&{itemId:Q.id}}}}),delete O[Q.id]}return}if(Q.type==="file_search_call"){let T=X!=null?X:"file_search";if(!W.has(Q.id))W.add(Q.id),j.enqueue({type:"tool-input-start",id:Q.id,toolName:T}),j.enqueue({type:"tool-input-delta",id:Q.id,delta:""}),j.enqueue({type:"tool-input-end",id:Q.id}),j.enqueue({type:"tool-call",toolCallId:Q.id,toolName:T,input:"",providerExecuted:!0});if(V.type==="response.output_item.done")j.enqueue({type:"tool-result",toolCallId:Q.id,toolName:T,result:{queries:(I=Q.queries)!=null?I:[],results:(f=(P=Q.results)==null?void 0:P.map((b)=>({fileId:b.file_id,filename:b.filename,score:b.score,text:b.text})))!=null?f:null}});return}if(Q.type==="web_search_call"||Q.type==="x_search_call"||Q.type==="code_interpreter_call"||Q.type==="code_execution_call"||Q.type==="view_image_call"||Q.type==="view_x_video_call"||Q.type==="custom_tool_call"||Q.type==="mcp_call"){let T=["web_search","web_search_with_snippets","browse_page"],b=["x_user_search","x_keyword_search","x_semantic_search","x_thread_fetch"],n=(U=Q.name)!=null?U:"";if(T.includes((x=Q.name)!=null?x:"")||Q.type==="web_search_call")n=K!=null?K:"web_search";else if(b.includes((zG=Q.name)!=null?zG:"")||Q.type==="x_search_call")n=z!=null?z:"x_search";else if(Q.name==="code_execution"||Q.type==="code_interpreter_call"||Q.type==="code_execution_call")n=A!=null?A:"code_execution";else if(Q.type==="mcp_call")n=(VG=Y!=null?Y:Q.name)!=null?VG:"mcp";let PG=Q.type==="custom_tool_call"?(LG=Q.input)!=null?LG:"":Q.type==="mcp_call"?(UG=Q.arguments)!=null?UG:"":(HG=Q.arguments)!=null?HG:"";if((Q.type==="custom_tool_call"?V.type==="response.output_item.done":!W.has(Q.id))&&!W.has(Q.id))W.add(Q.id),j.enqueue({type:"tool-input-start",id:Q.id,toolName:n}),j.enqueue({type:"tool-input-delta",id:Q.id,delta:PG}),j.enqueue({type:"tool-input-end",id:Q.id}),j.enqueue({type:"tool-call",toolCallId:Q.id,toolName:n,input:PG,providerExecuted:!0});return}if(Q.type==="message")for(let T of Q.content){if(T.text&&T.text.length>0){let b=`text-${Q.id}`;if($[b]==null)$[b]={type:"text"},j.enqueue({type:"text-start",id:b}),j.enqueue({type:"text-delta",id:b,delta:T.text})}if(T.annotations){for(let b of T.annotations)if(b.type==="url_citation"&&"url"in b)j.enqueue({type:"source",sourceType:"url",id:C.config.generateId(),url:b.url,title:(MG=b.title)!=null?MG:b.url})}}else if(Q.type==="function_call"){if(V.type==="response.output_item.added")H[V.output_index]={toolName:Q.name,toolCallId:Q.call_id},j.enqueue({type:"tool-input-start",id:Q.call_id,toolName:Q.name});else if(V.type==="response.output_item.done")B=!0,H[V.output_index]=void 0,j.enqueue({type:"tool-input-end",id:Q.call_id}),j.enqueue({type:"tool-call",toolCallId:Q.call_id,toolName:Q.name,input:Q.arguments})}}},flush(w){for(let[j,y]of Object.entries($))if(y.type==="text")w.enqueue({type:"text-end",id:j});w.enqueue({type:"finish",finishReason:F,usage:R!=null?R:{inputTokens:{total:0,noCache:0,cacheRead:0,cacheWrite:0},outputTokens:{total:0,text:0,reasoning:0}}})}})),request:{body:Z},response:{headers:M}}}},PJ=G.object({output:G.string().describe("the output of the code execution"),error:G.string().optional().describe("any error that occurred")}),EJ=_({id:"xai.code_execution",inputSchema:G.object({}).describe("no input parameters"),outputSchema:PJ}),WJ=(J={})=>EJ(J),BJ=G.object({description:G.string().describe("description of the image"),objects:G.array(G.string()).optional().describe("objects detected in the image")}),FJ=_({id:"xai.view_image",inputSchema:G.object({}).describe("no input parameters"),outputSchema:BJ}),NJ=(J={})=>FJ(J),wJ=G.object({transcript:G.string().optional().describe("transcript of the video"),description:G.string().describe("description of the video content"),duration:G.number().optional().describe("duration in seconds")}),SJ=_({id:"xai.view_x_video",inputSchema:G.object({}).describe("no input parameters"),outputSchema:wJ}),OJ=(J={})=>SJ(J),fJ={codeExecution:WJ,fileSearch:XJ,mcpServer:KJ,viewImage:NJ,viewXVideo:OJ,webSearch:qJ,xSearch:UJ},CJ="3.0.82",a=G.string().min(1),yJ=G.enum(["480p","720p"]),IJ=G.enum(["edit-video","extend-video","reference-to-video"]),e={pollIntervalMs:G.number().positive().nullish(),pollTimeoutMs:G.number().positive().nullish(),resolution:yJ.nullish()},RJ=G.object({...e,mode:G.literal("edit-video"),videoUrl:a,referenceImageUrls:G.undefined().optional()}),xJ=G.object({...e,mode:G.literal("extend-video"),videoUrl:a,referenceImageUrls:G.undefined().optional()}),TJ=G.object({...e,mode:G.literal("reference-to-video"),referenceImageUrls:G.array(a).min(1).max(7),videoUrl:G.undefined().optional()}),vJ=G.object({...e,mode:G.undefined().optional(),videoUrl:a.optional(),referenceImageUrls:G.array(a).min(1).max(7).optional()}),IQ=G.union([RJ,xJ,TJ,vJ]),kJ=G.object({mode:IJ.optional(),videoUrl:a.optional(),referenceImageUrls:G.array(a).min(1).max(7).optional(),...e}).passthrough(),bJ=v(()=>k(kJ)),hJ={"1280x720":"720p","854x480":"480p","640x480":"480p"};function _J(J){if((J==null?void 0:J.mode)!=null)return J.mode;if((J==null?void 0:J.videoUrl)!=null)return"edit-video";if((J==null?void 0:J.referenceImageUrls)!=null&&J.referenceImageUrls.length>0)return"reference-to-video";return}var mJ=class{constructor(J,D){this.modelId=J,this.config=D,this.specificationVersion="v3",this.maxVideosPerCall=1}get provider(){return this.config.provider}async doGenerate(J){var D,L,q,K,z,A,Y,X,Z,M;let E=(q=(L=(D=this.config._internal)==null?void 0:D.currentDate)==null?void 0:L.call(D))!=null?q:new Date,F=[],B=await p({provider:"xai",providerOptions:J.providerOptions,schema:bJ}),R=_J(B),N=R==="edit-video",$=R==="extend-video",W=R==="reference-to-video";if(J.fps!=null)F.push({type:"unsupported",feature:"fps",details:"xAI video models do not support custom FPS."});if(J.seed!=null)F.push({type:"unsupported",feature:"seed",details:"xAI video models do not support seed."});if(J.n!=null&&J.n>1)F.push({type:"unsupported",feature:"n",details:"xAI video models do not support generating multiple videos per call. Only 1 video will be generated."});if(N&&J.duration!=null)F.push({type:"unsupported",feature:"duration",details:"xAI video editing does not support custom duration."});if(N&&J.aspectRatio!=null)F.push({type:"unsupported",feature:"aspectRatio",details:"xAI video editing does not support custom aspect ratio."});if(N&&((B==null?void 0:B.resolution)!=null||J.resolution!=null))F.push({type:"unsupported",feature:"resolution",details:"xAI video editing does not support custom resolution."});if($&&J.aspectRatio!=null)F.push({type:"unsupported",feature:"aspectRatio",details:"xAI video extension does not support custom aspect ratio."});if($&&((B==null?void 0:B.resolution)!=null||J.resolution!=null))F.push({type:"unsupported",feature:"resolution",details:"xAI video extension does not support custom resolution."});let H={model:this.modelId,prompt:J.prompt},O=!N,C=!N&&!$,w=!N&&!$;if(O&&J.duration!=null)H.duration=J.duration;if(C&&J.aspectRatio!=null)H.aspect_ratio=J.aspectRatio;if(w&&(B==null?void 0:B.resolution)!=null)H.resolution=B.resolution;else if(w&&J.resolution!=null){let U=hJ[J.resolution];if(U!=null)H.resolution=U;else F.push({type:"unsupported",feature:"resolution",details:`Unrecognized resolution "${J.resolution}". Use providerOptions.xai.resolution with "480p" or "720p" instead.`})}if(N)H.video={url:B.videoUrl};if($)H.video={url:B.videoUrl};if(J.image!=null)if(J.image.type==="url")H.image={url:J.image.url};else{let U=typeof J.image.data==="string"?J.image.data:wG(J.image.data);H.image={url:`data:${J.image.mediaType};base64,${U}`}}if(W)H.reference_images=B.referenceImageUrls.map((U)=>({url:U}));if(B!=null){for(let[U,x]of Object.entries(B))if(!["mode","pollIntervalMs","pollTimeoutMs","resolution","videoUrl","referenceImageUrls"].includes(U))H[U]=x}let j=(K=this.config.baseURL)!=null?K:"https://api.x.ai/v1",y;if(N)y=`${j}/videos/edits`;else if($)y=`${j}/videos/extensions`;else y=`${j}/videos/generations`;let{value:S}=await u({url:y,headers:g(this.config.headers(),J.headers),body:H,failedResponseHandler:r,successfulResponseHandler:d(gJ),abortSignal:J.abortSignal,fetch:this.config.fetch}),h=S.request_id;if(!h)throw new l({name:"XAI_VIDEO_GENERATION_ERROR",message:`No request_id returned from xAI API. Response: ${JSON.stringify(S)}`});let m=(z=B==null?void 0:B.pollIntervalMs)!=null?z:5000,I=(A=B==null?void 0:B.pollTimeoutMs)!=null?A:600000,P=Date.now(),f;while(!0){if(await FG(m,{abortSignal:J.abortSignal}),Date.now()-P>I)throw new l({name:"XAI_VIDEO_GENERATION_TIMEOUT",message:`Video generation timed out after ${I}ms`});let{value:U,responseHeaders:x}=await XG({url:`${j}/videos/${h}`,headers:g(this.config.headers(),J.headers),successfulResponseHandler:d(uJ),failedResponseHandler:r,abortSignal:J.abortSignal,fetch:this.config.fetch});if(f=x,U.status==="done"||U.status==null&&((Y=U.video)==null?void 0:Y.url)){if(((X=U.video)==null?void 0:X.respect_moderation)===!1)throw new l({name:"XAI_VIDEO_MODERATION_ERROR",message:"Video generation was blocked due to a content policy violation."});if(!((Z=U.video)==null?void 0:Z.url))throw new l({name:"XAI_VIDEO_GENERATION_ERROR",message:"Video generation completed but no video URL was returned."});return{videos:[{type:"url",url:U.video.url,mediaType:"video/mp4"}],warnings:F,response:{timestamp:E,modelId:this.modelId,headers:f},providerMetadata:{xai:{requestId:h,videoUrl:U.video.url,...U.video.duration!=null?{duration:U.video.duration}:{},...((M=U.usage)==null?void 0:M.cost_in_usd_ticks)!=null?{costInUsdTicks:U.usage.cost_in_usd_ticks}:{},...U.progress!=null?{progress:U.progress}:{}}}}}if(U.status==="expired")throw new l({name:"XAI_VIDEO_GENERATION_EXPIRED",message:"Video generation request expired."});if(U.status==="failed")throw new l({name:"XAI_VIDEO_GENERATION_FAILED",message:"Video generation failed."})}}},gJ=G.object({request_id:G.string().nullish()}),uJ=G.object({status:G.string().nullish(),video:G.object({url:G.string(),duration:G.number().nullish(),respect_moderation:G.boolean().nullish()}).nullish(),model:G.string().nullish(),usage:G.object({cost_in_usd_ticks:G.number().nullish()}).nullish(),progress:G.number().nullish(),error:G.object({code:G.string().nullish(),message:G.string().nullish()}).nullish()});function dJ(J={}){var D;let L=xG((D=J.baseURL)!=null?D:"https://api.x.ai/v1"),q=()=>OG({Authorization:`Bearer ${fG({apiKey:J.apiKey,environmentVariableName:"XAI_API_KEY",description:"xAI API key"})}`,...J.headers},`ai-sdk/xai/${CJ}`),K=(Z)=>{return new cG(Z,{provider:"xai.chat",baseURL:L,headers:q,generateId:$G,fetch:J.fetch})},z=(Z)=>{return new MJ(Z,{provider:"xai.responses",baseURL:L,headers:q,generateId:$G,fetch:J.fetch})},A=(Z)=>{return new aG(Z,{provider:"xai.image",baseURL:L,headers:q,fetch:J.fetch})},Y=(Z)=>{return new mJ(Z,{provider:"xai.video",baseURL:L,headers:q,fetch:J.fetch})},X=(Z)=>K(Z);return X.specificationVersion="v3",X.languageModel=K,X.chat=K,X.responses=z,X.embeddingModel=(Z)=>{throw new BG({modelId:Z,modelType:"embeddingModel"})},X.textEmbeddingModel=X.embeddingModel,X.imageModel=A,X.image=A,X.videoModel=Y,X.video=Y,X.tools=fJ,X}var RQ=dJ();export{fJ as xaiTools,RQ as xai,UJ as xSearch,qJ as webSearch,OJ as viewXVideo,NJ as viewImage,KJ as mcpServer,dJ as createXai,WJ as codeExecution,CJ as VERSION};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{$h as i,Ai as J,Bi as K,Ci as L,Di as M,Ei as N,Fi as O,Gi as P,Hi as Q,Ii as R,Th as a,Uh as b,Vh as c,Wh as d,Xh as e,Yh as f,Zh as g,_h as h,ai as j,bi as k,ci as l,di as m,ei as n,fi as o,gi as p,hi as q,ii as r,ji as s,ki as t,li as u,mi as v,ni as w,oi as x,pi as y,qi as z,ri as A,si as B,ti as C,ui as D,vi as E,wi as F,xi as G,yi as H,zi as I}from"./chunk-prrrw8t8.js";import"./chunk-fa03gsff.js";export{Q as parseModelsYml,m as isWorkflowModel,l as isResponsesApiModel,O as gitlab,n as getWorkflowModelRef,h as getValidModelsForProvider,g as getProviderForModelId,j as getOpenAIModelForModelId,k as getOpenAIApiType,f as getModelMapping,i as getAnthropicModelForModelId,R as discoverWorkflowModels,N as createGitLab,r as WorkflowType,s as WS_KEEPALIVE_PING_INTERVAL_MS,t as WS_HEARTBEAT_INTERVAL_MS,z as WORKFLOW_ENVIRONMENT,q as VERSION,K as TOKEN_EXPIRY_SKEW_MS,H as OPENCODE_GITLAB_AUTH_CLIENT_ID,L as OAUTH_SCOPES,e as MODEL_MAPPINGS,o as MODEL_ID_TO_ANTHROPIC_MODEL,B as GitLabWorkflowTokenClient,G as GitLabWorkflowLanguageModel,A as GitLabWorkflowClient,D as GitLabProjectDetector,C as GitLabProjectCache,p as GitLabOpenAILanguageModel,M as GitLabOAuthManager,E as GitLabModelDiscovery,P as GitLabModelConfigRegistry,F as GitLabModelCache,a as GitLabError,c as GitLabDirectAccessClient,d as GitLabAnthropicLanguageModel,J as GITLAB_COM_URL,u as DEFAULT_WORKFLOW_DEFINITION,v as DEFAULT_CLIENT_CAPABILITIES,b as DEFAULT_AI_GATEWAY_URL,y as DEFAULT_AGENT_PRIVILEGES,w as CLIENT_VERSION,I as BUNDLED_CLIENT_ID,x as AGENT_PRIVILEGES};
2
+ import{$h as l,Ai as M,Bi as N,Ci as O,Di as P,Ei as Q,Fi as R,Qh as a,Rh as b,Sh as c,Th as d,Uh as e,Vh as f,Wh as g,Xh as h,Yh as i,Zh as j,_h as k,ai as m,bi as n,ci as o,di as p,ei as q,fi as r,gi as s,hi as t,ii as u,ji as v,ki as w,li as x,mi as y,ni as z,oi as A,pi as B,qi as C,ri as D,si as E,ti as F,ui as G,vi as H,wi as I,xi as J,yi as K,zi as L}from"./chunk-ecwz9nhs.js";import"./chunk-hh4c02fh.js";export{Q as parseModelsYml,m as isWorkflowModel,l as isResponsesApiModel,O as gitlab,n as getWorkflowModelRef,h as getValidModelsForProvider,g as getProviderForModelId,j as getOpenAIModelForModelId,k as getOpenAIApiType,f as getModelMapping,i as getAnthropicModelForModelId,R as discoverWorkflowModels,N as createGitLab,r as WorkflowType,s as WS_KEEPALIVE_PING_INTERVAL_MS,t as WS_HEARTBEAT_INTERVAL_MS,z as WORKFLOW_ENVIRONMENT,q as VERSION,K as TOKEN_EXPIRY_SKEW_MS,H as OPENCODE_GITLAB_AUTH_CLIENT_ID,L as OAUTH_SCOPES,e as MODEL_MAPPINGS,o as MODEL_ID_TO_ANTHROPIC_MODEL,B as GitLabWorkflowTokenClient,G as GitLabWorkflowLanguageModel,A as GitLabWorkflowClient,D as GitLabProjectDetector,C as GitLabProjectCache,p as GitLabOpenAILanguageModel,M as GitLabOAuthManager,E as GitLabModelDiscovery,P as GitLabModelConfigRegistry,F as GitLabModelCache,a as GitLabError,c as GitLabDirectAccessClient,d as GitLabAnthropicLanguageModel,J as GITLAB_COM_URL,u as DEFAULT_WORKFLOW_DEFINITION,v as DEFAULT_CLIENT_CAPABILITIES,b as DEFAULT_AI_GATEWAY_URL,y as DEFAULT_AGENT_PRIVILEGES,w as CLIENT_VERSION,I as BUNDLED_CLIENT_ID,x as AGENT_PRIVILEGES};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Bl as s,Cl as t,Dl as u,Fl as v,Gl as w}from"./chunk-0z3z0gk1.js";import"./chunk-g7vkkmsk.js";import{En as q,Fn as r,Gm as a,gn as b,hn as c,in as d,jn as e,kn as f,ln as g,mn as h,nn as i,on as j,pn as k,rn as l,sn as m,tn as n,vn as o,xn as p}from"./chunk-m8djypsy.js";import"./chunk-3z1y040p.js";import"./chunk-3tdqsm5c.js";import"./chunk-a5zjrwqy.js";import"./chunk-tk3bve0x.js";import"./chunk-0w4v0fbs.js";import"./chunk-wf09j72q.js";import"./chunk-ep8zn49w.js";import"./chunk-f3kjp838.js";import"./chunk-zk8n8hnh.js";import"./chunk-1jh5p5qw.js";import"./chunk-kaeyhw2n.js";import"./chunk-f89gntcy.js";import"./chunk-bky5a42k.js";import"./chunk-r7xp0xcn.js";import"./chunk-6g3m7yxf.js";import"./chunk-v2kyarwz.js";import"./chunk-dkm7x8rj.js";import"./chunk-hh4c02fh.js";export{a as sql,e as or,f as not,c as ne,j as lte,i as lt,p as like,l as isNull,m as isNotNull,k as inArray,h as gte,g as gt,n as exists,b as eq,r as desc,t as count,o as between,q as asc,d as and,w as Storage,v as NotFoundError,s as JsonMigration,u as Database};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
2
  function t(o){return o}
3
- export{t as Od};
3
+ export{t as Pd};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{Bs as i}from"./chunk-dhvwrrqx.js";import{ct as o}from"./chunk-p20ft5mj.js";import{lP as c}from"./chunk-fa03gsff.js";var e=c(i(),1);import p from"path";function l(n,t){let r=t?.PATH??t?.Path??process.env.PATH??process.env.Path??"",h=r?r+p.delimiter+o.Path.bin:o.Path.bin,s=e.default.sync(n,{nothrow:!0,path:h,pathExt:t?.PATHEXT??t?.PathExt??process.env.PATHEXT??process.env.PathExt});return typeof s==="string"?s:null}
3
- export{l as sp};
2
+ import{Os as i}from"./chunk-ep8zn49w.js";import{pt as o}from"./chunk-zk8n8hnh.js";import{yP as c}from"./chunk-hh4c02fh.js";var e=c(i(),1);import p from"path";function l(n,t){let r=t?.PATH??t?.Path??process.env.PATH??process.env.Path??"",h=r?r+p.delimiter+o.Path.bin:o.Path.bin,s=e.default.sync(n,{nothrow:!0,path:h,pathExt:t?.PATHEXT??t?.PathExt??process.env.PATHEXT??process.env.PathExt});return typeof s==="string"?s:null}
3
+ export{l as Bp};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
2
  var o=[{test:(a)=>a.startsWith("en"),locale:"en"},{test:(a)=>a.startsWith("zh")&&/(hant|tw|hk|mo)/.test(a),locale:"zht"},{test:(a)=>a.startsWith("zh"),locale:"zh"},{test:(a)=>a.startsWith("ko"),locale:"ko"},{test:(a)=>a.startsWith("de"),locale:"de"},{test:(a)=>a.startsWith("es"),locale:"es"},{test:(a)=>a.startsWith("fr"),locale:"fr"},{test:(a)=>a.startsWith("da"),locale:"da"},{test:(a)=>a.startsWith("ja"),locale:"ja"},{test:(a)=>a.startsWith("pl"),locale:"pl"},{test:(a)=>a.startsWith("ru"),locale:"ru"},{test:(a)=>a.startsWith("ar"),locale:"ar"},{test:(a)=>/^(no|nb|nn)/.test(a),locale:"no"},{test:(a)=>a.startsWith("pt")&&/br/.test(a),locale:"br"},{test:(a)=>a.startsWith("pt"),locale:"pt"},{test:(a)=>a.startsWith("th"),locale:"th"},{test:(a)=>a.startsWith("bs"),locale:"bs"},{test:(a)=>a.startsWith("tr"),locale:"tr"}],s=new Set(["Asia/Shanghai","Asia/Chongqing","Asia/Harbin","Asia/Urumqi","Asia/Kashgar"]),A=new Set(["Asia/Hong_Kong","Asia/Macau","Asia/Macao","Asia/Taipei"]),m=new Set(["Asia/Tokyo"]),l=new Set(["Europe/Paris","Europe/Monaco","Indian/Reunion","Indian/Mayotte","Pacific/Noumea","Pacific/Tahiti","Pacific/Marquesas","Pacific/Gambier","America/Martinique","America/Guadeloupe","America/St_Barthelemy","America/Cayenne","America/Miquelon"]),u=new Set(["Europe/Moscow","Europe/Kaliningrad","Europe/Samara","Europe/Volgograd","Europe/Saratov","Europe/Astrakhan","Europe/Kirov","Europe/Ulyanovsk","Europe/Simferopol","Europe/Minsk","Asia/Yekaterinburg","Asia/Omsk","Asia/Novosibirsk","Asia/Novokuznetsk","Asia/Krasnoyarsk","Asia/Irkutsk","Asia/Chita","Asia/Yakutsk","Asia/Khandyga","Asia/Vladivostok","Asia/Ust-Nera","Asia/Magadan","Asia/Sakhalin","Asia/Srednekolymsk","Asia/Kamchatka","Asia/Anadyr","Asia/Barnaul","Asia/Tomsk"]),h=new Set(["Europe/Madrid","Atlantic/Canary","Africa/Ceuta","America/Mexico_City","America/Tijuana","America/Hermosillo","America/Mazatlan","America/Chihuahua","America/Monterrey","America/Cancun","America/Merida","America/Matamoros","America/Bahia_Banderas","America/Ojinaga","America/Havana","America/Santo_Domingo","America/Puerto_Rico","America/Panama","America/Guatemala","America/Tegucigalpa","America/Managua","America/Costa_Rica","America/El_Salvador","America/Bogota","America/Caracas","America/Guayaquil","America/Lima","America/La_Paz","America/Asuncion","America/Montevideo","America/Santiago","America/Punta_Arenas","Pacific/Easter","America/Argentina/Buenos_Aires","America/Argentina/Cordoba","America/Argentina/Salta","America/Argentina/Jujuy","America/Argentina/Tucuman","America/Argentina/Catamarca","America/Argentina/La_Rioja","America/Argentina/San_Juan","America/Argentina/Mendoza","America/Argentina/San_Luis","America/Argentina/Rio_Gallegos","America/Argentina/Ushuaia"]),d=new Set(["America/New_York","America/Detroit","America/Kentucky/Louisville","America/Kentucky/Monticello","America/Indiana/Indianapolis","America/Indiana/Vincennes","America/Indiana/Winamac","America/Indiana/Marengo","America/Indiana/Petersburg","America/Indiana/Vevay","America/Indiana/Tell_City","America/Indiana/Knox","America/Chicago","America/Menominee","America/North_Dakota/Center","America/North_Dakota/New_Salem","America/North_Dakota/Beulah","America/Denver","America/Boise","America/Phoenix","America/Los_Angeles","America/Anchorage","America/Juneau","America/Sitka","America/Metlakatla","America/Yakutat","America/Nome","America/Adak","Pacific/Honolulu","America/Toronto","America/Vancouver","America/Edmonton","America/Winnipeg","America/Halifax","America/St_Johns","America/Regina","America/Whitehorse","Europe/London","Europe/Belfast","Europe/Dublin","Australia/Sydney","Australia/Melbourne","Australia/Brisbane","Australia/Perth","Australia/Adelaide","Australia/Hobart","Australia/Darwin","Pacific/Auckland"]);function g(){try{let a=Intl.DateTimeFormat().resolvedOptions().timeZone;if(!a)return;if(A.has(a))return"zht";if(s.has(a))return"zh";if(m.has(a))return"ja";if(u.has(a))return"ru";if(l.has(a))return"fr";if(h.has(a))return"es";if(d.has(a))return"en"}catch{}return}function f(){let a=g();if(a)return a;for(let t of["LC_ALL","LC_MESSAGES","LANG","LANGUAGE"]){let e=process.env[t];if(!e)continue;for(let r of e.split(":")){let i=r.replace(/[.@].*$/,"").replace(/_/g,"-").toLowerCase();if(!i||i==="c"||i==="posix")continue;let n=o.find((c)=>c.test(i));if(n)return n.locale}}try{let t=Intl.DateTimeFormat().resolvedOptions().locale.toLowerCase(),e=o.find((r)=>r.test(t));if(e)return e.locale}catch{}return"en"}
3
- export{f as H};
3
+ export{f as I};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import"./chunk-7b69jj5g.js";import"./chunk-fa03gsff.js";var e={"ui.sessionReview.title":"Oturum de\u011Fi\u015Fiklikleri","ui.sessionReview.title.lastTurn":"Son tur de\u011Fi\u015Fiklikleri","ui.sessionReview.diffStyle.unified":"Birle\u015Fik","ui.sessionReview.diffStyle.split":"B\xF6l\xFCnm\xFC\u015F","ui.sessionReview.openFile":"Dosyay\u0131 a\xE7","ui.sessionReview.selection.line":"sat\u0131r {{line}}","ui.sessionReview.selection.lines":"sat\u0131rlar {{start}}-{{end}}","ui.sessionReview.expandAll":"T\xFCm\xFCn\xFC geni\u015Flet","ui.sessionReview.collapseAll":"T\xFCm\xFCn\xFC daralt","ui.sessionReview.change.added":"Eklendi","ui.sessionReview.change.removed":"Kald\u0131r\u0131ld\u0131","ui.sessionReview.change.modified":"De\u011Fi\u015Ftirildi","ui.sessionReview.image.loading":"Y\xFCkleniyor...","ui.sessionReview.image.placeholder":"G\xF6rsel","ui.sessionReview.largeDiff.title":"Fark g\xF6sterimi i\xE7in \xE7ok b\xFCy\xFCk","ui.sessionReview.largeDiff.meta":"Limit: {{limit}} de\u011Fi\u015Fen sat\u0131r. Mevcut: {{current}} de\u011Fi\u015Fen sat\u0131r.","ui.sessionReview.largeDiff.renderAnyway":"Yine de g\xF6ster","ui.fileMedia.kind.image":"g\xF6rsel","ui.fileMedia.kind.audio":"ses","ui.fileMedia.state.removed":"{{kind}} dosyas\u0131 kald\u0131r\u0131ld\u0131.","ui.fileMedia.state.loading":"{{kind}} y\xFCkleniyor...","ui.fileMedia.state.error":"{{kind}} y\xFCklenemedi.","ui.fileMedia.state.unavailable":"{{kind}} \xF6nizlemesi kullan\u0131lam\u0131yor.","ui.fileMedia.binary.title":"\u0130kili dosya","ui.fileMedia.binary.description.path":"{{path}} ikili dosyad\u0131r.","ui.fileMedia.binary.description.default":"\u0130kili i\xE7erik","ui.lineComment.label.prefix":"Yorum: ","ui.lineComment.label.suffix":"","ui.lineComment.editorLabel.prefix":"Yorum yap\u0131l\u0131yor: ","ui.lineComment.editorLabel.suffix":"","ui.lineComment.placeholder":"Yorum ekle","ui.lineComment.submit":"Yorum yap","ui.sessionTurn.steps.show":"Ad\u0131mlar\u0131 g\xF6ster","ui.sessionTurn.steps.hide":"Ad\u0131mlar\u0131 gizle","ui.sessionTurn.summary.response":"Yan\u0131t","ui.sessionTurn.diff.showMore":"Daha fazla de\u011Fi\u015Fiklik g\xF6ster ({{count}})","ui.sessionTurn.retry.retrying":"yeniden deneniyor","ui.sessionTurn.retry.inSeconds":"{{seconds}}sn i\xE7inde","ui.sessionTurn.retry.attempt":"deneme #{{attempt}}","ui.sessionTurn.retry.attemptLine":"{{line}} - deneme #{{attempt}}","ui.sessionTurn.retry.geminiHot":"gemini \u015Fu anda a\u015F\u0131r\u0131 yo\u011Fun","ui.sessionTurn.error.freeUsageExceeded":"\xDCcretsiz kullan\u0131m a\u015F\u0131ld\u0131","ui.sessionTurn.error.addQredits":"Kredi ekle","ui.sessionTurn.status.delegating":"G\xF6rev devrediliyor","ui.sessionTurn.status.planning":"Sonraki ad\u0131mlar planlan\u0131yor","ui.sessionTurn.status.gatheringContext":"Ke\u015Ffediliyor","ui.sessionTurn.status.gatheredContext":"Ke\u015Ffedildi","ui.sessionTurn.status.searchingCodebase":"Kod taban\u0131 aran\u0131yor","ui.sessionTurn.status.searchingWeb":"Web aran\u0131yor","ui.sessionTurn.status.makingEdits":"D\xFCzenlemeler yap\u0131l\u0131yor","ui.sessionTurn.status.runningCommands":"Komutlar \xE7al\u0131\u015Ft\u0131r\u0131l\u0131yor","ui.sessionTurn.status.thinking":"D\xFC\u015F\xFCn\xFCyor","ui.sessionTurn.status.thinkingWithTopic":"D\xFC\u015F\xFCn\xFCyor - {{topic}}","ui.sessionTurn.status.gatheringThoughts":"D\xFC\u015F\xFCnceler toplan\u0131yor","ui.sessionTurn.status.consideringNextSteps":"Sonraki ad\u0131mlar de\u011Ferlendiriliyor","ui.messagePart.questions.dismissed":"Sorular reddedildi","ui.messagePart.compaction":"Oturum s\u0131k\u0131\u015Ft\u0131r\u0131ld\u0131","ui.messagePart.context.read.one":"{{count}} okuma","ui.messagePart.context.read.other":"{{count}} okuma","ui.messagePart.context.search.one":"{{count}} arama","ui.messagePart.context.search.other":"{{count}} arama","ui.messagePart.context.list.one":"{{count}} liste","ui.messagePart.context.list.other":"{{count}} liste","ui.messagePart.diagnostic.error":"Hata","ui.messagePart.title.edit":"D\xFCzenle","ui.messagePart.title.write":"Yaz","ui.messagePart.option.typeOwnAnswer":"Kendi cevab\u0131n\u0131z\u0131 yaz\u0131n","ui.messagePart.review.title":"Cevaplar\u0131 inceleyin","ui.list.loading":"Y\xFCkleniyor","ui.list.empty":"Sonu\xE7 bulunamad\u0131","ui.list.clearFilter":"Filtreyi temizle","ui.list.emptyWithFilter.prefix":"Sonu\xE7 bulunamad\u0131:","ui.list.emptyWithFilter.suffix":"","ui.messageNav.newMessage":"Yeni mesaj","ui.textField.copyToClipboard":"Panoya kopyala","ui.textField.copyLink":"Ba\u011Flant\u0131 kopyala","ui.textField.copied":"Kopyaland\u0131","ui.imagePreview.alt":"G\xF6rsel \xF6nizleme","ui.scrollView.ariaLabel":"kayd\u0131r\u0131labilir i\xE7erik","ui.tool.read":"Oku","ui.tool.loaded":"Y\xFCklendi","ui.tool.list":"Listele","ui.tool.glob":"Glob","ui.tool.grep":"Grep","ui.tool.webfetch":"Web getir","ui.tool.websearch":"Web Aramas\u0131","ui.tool.codesearch":"Kod Aramas\u0131","ui.tool.shell":"Kabuk","ui.tool.patch":"Yama","ui.tool.todos":"G\xF6revler","ui.tool.todos.read":"G\xF6revleri oku","ui.tool.questions":"Sorular","ui.tool.agent":"{{type}} Ajan","ui.tool.agent.default":"Ajan","ui.common.file.one":"dosya","ui.common.file.other":"dosya","ui.common.question.one":"soru","ui.common.question.other":"soru","ui.common.add":"Ekle","ui.common.back":"Geri","ui.common.cancel":"\u0130ptal","ui.common.confirm":"Onayla","ui.common.dismiss":"Kapat","ui.common.close":"Kapat","ui.common.next":"\u0130leri","ui.common.submit":"G\xF6nder","ui.permission.deny":"Reddet","ui.permission.allowAlways":"Her zaman izin ver","ui.permission.allowOnce":"Bir kez izin ver","ui.message.expand":"Mesaj\u0131 geni\u015Flet","ui.message.collapse":"Mesaj\u0131 daralt","ui.message.copy":"Kopyala","ui.message.copyMessage":"Mesaj\u0131 kopyala","ui.message.forkMessage":"Yeni oturuma dalland\u0131r","ui.message.revertMessage":"Bu noktaya s\u0131f\u0131rla","ui.message.copyResponse":"Yan\u0131t\u0131 kopyala","ui.message.copied":"Kopyaland\u0131","ui.message.interrupted":"Kesildi","ui.message.queued":"S\u0131rada","ui.message.attachment.alt":"ek","ui.patch.action.deleted":"Silindi","ui.patch.action.created":"Olu\u015Fturuldu","ui.patch.action.moved":"Ta\u015F\u0131nd\u0131","ui.patch.action.patched":"Yamaland\u0131","ui.question.subtitle.answered":"{{count}} cevapland\u0131","ui.question.answer.none":"(cevap yok)","ui.question.review.notAnswered":"(cevaplanmad\u0131)","ui.question.multiHint":"Ge\xE7erli t\xFCm cevaplar\u0131 se\xE7in","ui.question.singleHint":"Bir cevap se\xE7in","ui.question.custom.placeholder":"Cevab\u0131n\u0131z\u0131 yaz\u0131n...","ui.fileSearch.placeholder":"Bul","ui.fileSearch.previousMatch":"\xD6nceki","ui.fileSearch.nextMatch":"Sonraki","ui.fileSearch.close":"Aramay\u0131 kapat","ui.tool.task":"G\xF6rev","ui.tool.skill":"Yetenek","ui.basicTool.called":"`{{tool}}` \xE7a\u011Fr\u0131ld\u0131","ui.toolErrorCard.failed":"Ba\u015Far\u0131s\u0131z","ui.toolErrorCard.copyError":"Hatay\u0131 kopyala","ui.message.duration.seconds":"{{count}}sn","ui.message.duration.minutesSeconds":"{{minutes}}dk {{seconds}}sn"};export{e as dict};
2
+ import"./chunk-5kmfnkzv.js";import"./chunk-hh4c02fh.js";var e={"ui.sessionReview.title":"Oturum de\u011Fi\u015Fiklikleri","ui.sessionReview.title.lastTurn":"Son tur de\u011Fi\u015Fiklikleri","ui.sessionReview.diffStyle.unified":"Birle\u015Fik","ui.sessionReview.diffStyle.split":"B\xF6l\xFCnm\xFC\u015F","ui.sessionReview.openFile":"Dosyay\u0131 a\xE7","ui.sessionReview.selection.line":"sat\u0131r {{line}}","ui.sessionReview.selection.lines":"sat\u0131rlar {{start}}-{{end}}","ui.sessionReview.expandAll":"T\xFCm\xFCn\xFC geni\u015Flet","ui.sessionReview.collapseAll":"T\xFCm\xFCn\xFC daralt","ui.sessionReview.change.added":"Eklendi","ui.sessionReview.change.removed":"Kald\u0131r\u0131ld\u0131","ui.sessionReview.change.modified":"De\u011Fi\u015Ftirildi","ui.sessionReview.image.loading":"Y\xFCkleniyor...","ui.sessionReview.image.placeholder":"G\xF6rsel","ui.sessionReview.largeDiff.title":"Fark g\xF6sterimi i\xE7in \xE7ok b\xFCy\xFCk","ui.sessionReview.largeDiff.meta":"Limit: {{limit}} de\u011Fi\u015Fen sat\u0131r. Mevcut: {{current}} de\u011Fi\u015Fen sat\u0131r.","ui.sessionReview.largeDiff.renderAnyway":"Yine de g\xF6ster","ui.fileMedia.kind.image":"g\xF6rsel","ui.fileMedia.kind.audio":"ses","ui.fileMedia.state.removed":"{{kind}} dosyas\u0131 kald\u0131r\u0131ld\u0131.","ui.fileMedia.state.loading":"{{kind}} y\xFCkleniyor...","ui.fileMedia.state.error":"{{kind}} y\xFCklenemedi.","ui.fileMedia.state.unavailable":"{{kind}} \xF6nizlemesi kullan\u0131lam\u0131yor.","ui.fileMedia.binary.title":"\u0130kili dosya","ui.fileMedia.binary.description.path":"{{path}} ikili dosyad\u0131r.","ui.fileMedia.binary.description.default":"\u0130kili i\xE7erik","ui.lineComment.label.prefix":"Yorum: ","ui.lineComment.label.suffix":"","ui.lineComment.editorLabel.prefix":"Yorum yap\u0131l\u0131yor: ","ui.lineComment.editorLabel.suffix":"","ui.lineComment.placeholder":"Yorum ekle","ui.lineComment.submit":"Yorum yap","ui.sessionTurn.steps.show":"Ad\u0131mlar\u0131 g\xF6ster","ui.sessionTurn.steps.hide":"Ad\u0131mlar\u0131 gizle","ui.sessionTurn.summary.response":"Yan\u0131t","ui.sessionTurn.diff.showMore":"Daha fazla de\u011Fi\u015Fiklik g\xF6ster ({{count}})","ui.sessionTurn.retry.retrying":"yeniden deneniyor","ui.sessionTurn.retry.inSeconds":"{{seconds}}sn i\xE7inde","ui.sessionTurn.retry.attempt":"deneme #{{attempt}}","ui.sessionTurn.retry.attemptLine":"{{line}} - deneme #{{attempt}}","ui.sessionTurn.retry.geminiHot":"gemini \u015Fu anda a\u015F\u0131r\u0131 yo\u011Fun","ui.sessionTurn.error.freeUsageExceeded":"\xDCcretsiz kullan\u0131m a\u015F\u0131ld\u0131","ui.sessionTurn.error.addQredits":"Kredi ekle","ui.sessionTurn.status.delegating":"G\xF6rev devrediliyor","ui.sessionTurn.status.planning":"Sonraki ad\u0131mlar planlan\u0131yor","ui.sessionTurn.status.gatheringContext":"Ke\u015Ffediliyor","ui.sessionTurn.status.gatheredContext":"Ke\u015Ffedildi","ui.sessionTurn.status.searchingCodebase":"Kod taban\u0131 aran\u0131yor","ui.sessionTurn.status.searchingWeb":"Web aran\u0131yor","ui.sessionTurn.status.makingEdits":"D\xFCzenlemeler yap\u0131l\u0131yor","ui.sessionTurn.status.runningCommands":"Komutlar \xE7al\u0131\u015Ft\u0131r\u0131l\u0131yor","ui.sessionTurn.status.thinking":"D\xFC\u015F\xFCn\xFCyor","ui.sessionTurn.status.thinkingWithTopic":"D\xFC\u015F\xFCn\xFCyor - {{topic}}","ui.sessionTurn.status.gatheringThoughts":"D\xFC\u015F\xFCnceler toplan\u0131yor","ui.sessionTurn.status.consideringNextSteps":"Sonraki ad\u0131mlar de\u011Ferlendiriliyor","ui.messagePart.questions.dismissed":"Sorular reddedildi","ui.messagePart.compaction":"Oturum s\u0131k\u0131\u015Ft\u0131r\u0131ld\u0131","ui.messagePart.context.read.one":"{{count}} okuma","ui.messagePart.context.read.other":"{{count}} okuma","ui.messagePart.context.search.one":"{{count}} arama","ui.messagePart.context.search.other":"{{count}} arama","ui.messagePart.context.list.one":"{{count}} liste","ui.messagePart.context.list.other":"{{count}} liste","ui.messagePart.diagnostic.error":"Hata","ui.messagePart.title.edit":"D\xFCzenle","ui.messagePart.title.write":"Yaz","ui.messagePart.option.typeOwnAnswer":"Kendi cevab\u0131n\u0131z\u0131 yaz\u0131n","ui.messagePart.review.title":"Cevaplar\u0131 inceleyin","ui.list.loading":"Y\xFCkleniyor","ui.list.empty":"Sonu\xE7 bulunamad\u0131","ui.list.clearFilter":"Filtreyi temizle","ui.list.emptyWithFilter.prefix":"Sonu\xE7 bulunamad\u0131:","ui.list.emptyWithFilter.suffix":"","ui.messageNav.newMessage":"Yeni mesaj","ui.textField.copyToClipboard":"Panoya kopyala","ui.textField.copyLink":"Ba\u011Flant\u0131 kopyala","ui.textField.copied":"Kopyaland\u0131","ui.imagePreview.alt":"G\xF6rsel \xF6nizleme","ui.scrollView.ariaLabel":"kayd\u0131r\u0131labilir i\xE7erik","ui.tool.read":"Oku","ui.tool.loaded":"Y\xFCklendi","ui.tool.list":"Listele","ui.tool.glob":"Glob","ui.tool.grep":"Grep","ui.tool.webfetch":"Web getir","ui.tool.websearch":"Web Aramas\u0131","ui.tool.codesearch":"Kod Aramas\u0131","ui.tool.shell":"Kabuk","ui.tool.patch":"Yama","ui.tool.todos":"G\xF6revler","ui.tool.todos.read":"G\xF6revleri oku","ui.tool.questions":"Sorular","ui.tool.agent":"{{type}} Ajan","ui.tool.agent.default":"Ajan","ui.common.file.one":"dosya","ui.common.file.other":"dosya","ui.common.question.one":"soru","ui.common.question.other":"soru","ui.common.add":"Ekle","ui.common.back":"Geri","ui.common.cancel":"\u0130ptal","ui.common.confirm":"Onayla","ui.common.dismiss":"Kapat","ui.common.close":"Kapat","ui.common.next":"\u0130leri","ui.common.submit":"G\xF6nder","ui.permission.deny":"Reddet","ui.permission.allowAlways":"Her zaman izin ver","ui.permission.allowOnce":"Bir kez izin ver","ui.message.expand":"Mesaj\u0131 geni\u015Flet","ui.message.collapse":"Mesaj\u0131 daralt","ui.message.copy":"Kopyala","ui.message.copyMessage":"Mesaj\u0131 kopyala","ui.message.forkMessage":"Yeni oturuma dalland\u0131r","ui.message.revertMessage":"Bu noktaya s\u0131f\u0131rla","ui.message.copyResponse":"Yan\u0131t\u0131 kopyala","ui.message.copied":"Kopyaland\u0131","ui.message.interrupted":"Kesildi","ui.message.queued":"S\u0131rada","ui.message.attachment.alt":"ek","ui.patch.action.deleted":"Silindi","ui.patch.action.created":"Olu\u015Fturuldu","ui.patch.action.moved":"Ta\u015F\u0131nd\u0131","ui.patch.action.patched":"Yamaland\u0131","ui.question.subtitle.answered":"{{count}} cevapland\u0131","ui.question.answer.none":"(cevap yok)","ui.question.review.notAnswered":"(cevaplanmad\u0131)","ui.question.multiHint":"Ge\xE7erli t\xFCm cevaplar\u0131 se\xE7in","ui.question.singleHint":"Bir cevap se\xE7in","ui.question.custom.placeholder":"Cevab\u0131n\u0131z\u0131 yaz\u0131n...","ui.fileSearch.placeholder":"Bul","ui.fileSearch.previousMatch":"\xD6nceki","ui.fileSearch.nextMatch":"Sonraki","ui.fileSearch.close":"Aramay\u0131 kapat","ui.tool.task":"G\xF6rev","ui.tool.skill":"Yetenek","ui.basicTool.called":"`{{tool}}` \xE7a\u011Fr\u0131ld\u0131","ui.toolErrorCard.failed":"Ba\u015Far\u0131s\u0131z","ui.toolErrorCard.copyError":"Hatay\u0131 kopyala","ui.message.duration.seconds":"{{count}}sn","ui.message.duration.minutesSeconds":"{{minutes}}dk {{seconds}}sn"};export{e as dict};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{dt as n}from"./chunk-p20ft5mj.js";function s(e){let r=e?.password??n.QITQODE_SERVER_PASSWORD;if(!r)return;let t=e?.username??n.QITQODE_SERVER_USERNAME??"qitqode";return`Basic ${Buffer.from(`${t}:${r}`).toString("base64")}`}function o(e){let r=s(e);if(!r)return;return{Authorization:r}}
3
- export{o as M};
2
+ import{qt as n}from"./chunk-zk8n8hnh.js";function s(e){let r=e?.password??n.QITQODE_SERVER_PASSWORD;if(!r)return;let t=e?.username??n.QITQODE_SERVER_USERNAME??"qitqode";return`Basic ${Buffer.from(`${t}:${r}`).toString("base64")}`}function o(e){let r=s(e);if(!r)return;return{Authorization:r}}
3
+ export{o as N};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import"./chunk-hh4c02fh.js";var _="./libopentui-0r5w9btr.so";export{_ as default};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{fd as a,gd as b,hd as c,id as d,jd as e,kd as f,ld as g,md as h,nd as i,od as j,pd as k,qd as l}from"./chunk-3degq6rv.js";import"./chunk-fa03gsff.js";export{i as setRendererCapabilities,a as pasteBytes,f as createTestRenderer,h as createTerminalCapabilities,j as createSpy,e as createMockMouse,c as createMockKeys,l as TestRecorder,d as MouseButtons,g as MockTreeSitterClient,k as ManualClock,b as KeyCodes};
2
+ import{gd as a,hd as b,id as c,jd as d,kd as e,ld as f,md as g,nd as h,od as i,pd as j,qd as k,rd as l}from"./chunk-jmjg8d8a.js";import"./chunk-hh4c02fh.js";export{i as setRendererCapabilities,a as pasteBytes,f as createTestRenderer,h as createTerminalCapabilities,j as createSpy,e as createMockMouse,c as createMockKeys,l as TestRecorder,d as MouseButtons,g as MockTreeSitterClient,k as ManualClock,b as KeyCodes};