@qitqode/qitqode-android-arm64 0.1.24 → 0.1.25

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 (422) hide show
  1. package/bundle/{chunk-4kse3awh.js → chunk-0304b7xg.js} +1 -1
  2. package/bundle/{chunk-hqg5qbxk.js → chunk-08ba67f4.js} +1 -1
  3. package/bundle/chunk-0eneddjj.js +2 -0
  4. package/bundle/{chunk-6nhje520.js → chunk-0hsb4knd.js} +1 -1
  5. package/bundle/{chunk-bas6x25m.js → chunk-0jaxgrq0.js} +2 -2
  6. package/bundle/chunk-0ke6x10y.js +5 -0
  7. package/bundle/{chunk-hh4c02fh.js → chunk-0rmmg3g4.js} +1 -1
  8. package/bundle/chunk-0vqrakhw.js +3 -0
  9. package/bundle/{chunk-sgtgvzv6.js → chunk-0x7dbj5e.js} +1 -1
  10. package/bundle/{chunk-7yf15a3a.js → chunk-0xmx2zfg.js} +1 -1
  11. package/bundle/chunk-0yb4pxjv.js +2 -0
  12. package/bundle/chunk-129kq1w7.js +2 -0
  13. package/bundle/{chunk-8cr7ks31.js → chunk-14qvaxtp.js} +1 -1
  14. package/bundle/chunk-1a5hq7d5.js +2 -0
  15. package/bundle/{chunk-k16hzy2q.js → chunk-1ce5jpdc.js} +1 -1
  16. package/bundle/{chunk-xv8gnkh5.js → chunk-1e8mja6v.js} +1 -1
  17. package/bundle/{chunk-cy2586rv.js → chunk-1n1dh6zj.js} +1 -1
  18. package/bundle/{chunk-pb7rnkke.js → chunk-1txkz6dt.js} +1 -1
  19. package/bundle/chunk-1w3y1dkk.js +2 -0
  20. package/bundle/{chunk-v7r9np94.js → chunk-23f6rc7a.js} +1 -1
  21. package/bundle/chunk-26qt44f1.js +3 -0
  22. package/bundle/{chunk-6mscvf6y.js → chunk-2armxd20.js} +1 -1
  23. package/bundle/{chunk-21ejqv4v.js → chunk-2je5tp0x.js} +1 -1
  24. package/bundle/{chunk-0rtshz2r.js → chunk-2k2axg73.js} +1 -1
  25. package/bundle/chunk-2pkake0h.js +2 -0
  26. package/bundle/{chunk-7y3y3j51.js → chunk-2rxt1s22.js} +2 -2
  27. package/bundle/{chunk-te1zfpzv.js → chunk-2s28fdbp.js} +1 -1
  28. package/bundle/{chunk-8pe047p0.js → chunk-2sy1wx99.js} +1 -1
  29. package/bundle/{chunk-9easaxy7.js → chunk-2z35ewwc.js} +1 -1
  30. package/bundle/{chunk-zeh481tm.js → chunk-2zj3h3xj.js} +2 -2
  31. package/bundle/chunk-32188rww.js +2 -0
  32. package/bundle/chunk-334tc1rh.js +2 -0
  33. package/bundle/{chunk-tzc4jkzg.js → chunk-3dvyfmgc.js} +1 -1
  34. package/bundle/{chunk-q3x4x2tq.js → chunk-3e8p4a3y.js} +1 -1
  35. package/bundle/{chunk-7mhffm9f.js → chunk-3f054f69.js} +183 -183
  36. package/bundle/chunk-3ff94m8r.js +2 -0
  37. package/bundle/{chunk-7a6p7dfx.js → chunk-3fy57jcy.js} +1 -1
  38. package/bundle/{chunk-ve5gb789.js → chunk-3h08jdq8.js} +2 -2
  39. package/bundle/{chunk-w7p2x973.js → chunk-3j7skhxg.js} +2 -2
  40. package/bundle/{chunk-p4hpr8d7.js → chunk-3jhx8g5d.js} +1 -1
  41. package/bundle/{chunk-jr9xnvjq.js → chunk-3nhth7c2.js} +1 -1
  42. package/bundle/{chunk-8ace31r2.js → chunk-3tnek022.js} +1 -1
  43. package/bundle/{chunk-rvvfs9ps.js → chunk-3xna2rk5.js} +1 -1
  44. package/bundle/{chunk-k9d927xe.js → chunk-42t25nkb.js} +1 -1
  45. package/bundle/chunk-4aqd2bty.js +2 -0
  46. package/bundle/{chunk-am73j1bt.js → chunk-4kb2efq3.js} +1 -1
  47. package/bundle/{chunk-wmw2gne9.js → chunk-4pssh5d3.js} +2 -2
  48. package/bundle/{chunk-pyq01301.js → chunk-4stgw33j.js} +1 -1
  49. package/bundle/{chunk-k9g77a02.js → chunk-4w5t515p.js} +1 -1
  50. package/bundle/chunk-4wa0gf8y.js +28 -0
  51. package/bundle/{chunk-jegn6jc3.js → chunk-4wgb80jm.js} +2 -2
  52. package/bundle/{chunk-jbd9k041.js → chunk-4wyjapes.js} +2 -2
  53. package/bundle/chunk-4xg5ptk9.js +2 -0
  54. package/bundle/{chunk-23geekk5.js → chunk-54pk7nna.js} +1 -1
  55. package/bundle/chunk-58680z2j.js +3 -0
  56. package/bundle/{chunk-ygj1cy0n.js → chunk-5mdsrv0a.js} +1 -1
  57. package/bundle/{chunk-xj73j10a.js → chunk-5mp82az0.js} +1 -1
  58. package/bundle/chunk-5nm36wxa.js +2 -0
  59. package/bundle/{chunk-7tgm8wp5.js → chunk-5zw7knvd.js} +1 -1
  60. package/bundle/{chunk-yz7rqzby.js → chunk-61ks7c71.js} +3 -3
  61. package/bundle/chunk-64jet8nc.js +2 -0
  62. package/bundle/chunk-6584d9m8.js +2 -0
  63. package/bundle/chunk-66hv9bbw.js +2 -0
  64. package/bundle/{chunk-mj24ntn9.js → chunk-692vn48b.js} +1 -1
  65. package/bundle/chunk-6a1g6jzn.js +2 -0
  66. package/bundle/chunk-6be8p915.js +2 -0
  67. package/bundle/{chunk-8651hq0k.js → chunk-6ddp36ar.js} +1 -1
  68. package/bundle/chunk-6f03158n.js +2 -0
  69. package/bundle/{chunk-zavtsfxz.js → chunk-6gbaw2pk.js} +1 -1
  70. package/bundle/{chunk-5h2hcp46.js → chunk-6rrmjrm2.js} +1 -1
  71. package/bundle/{chunk-ps543k72.js → chunk-6s2f5sv4.js} +1 -1
  72. package/bundle/{chunk-9jf67xb0.js → chunk-754varfr.js} +2 -2
  73. package/bundle/{chunk-wa2ce2sg.js → chunk-78h5dd4t.js} +2 -2
  74. package/bundle/{chunk-4d1a547n.js → chunk-7d6jhzng.js} +1 -1
  75. package/bundle/{chunk-kc3hpmr2.js → chunk-7fx6x8x9.js} +2 -2
  76. package/bundle/chunk-7jnjttqx.js +2 -0
  77. package/bundle/{chunk-jz3aav8a.js → chunk-7q5srx7q.js} +2 -2
  78. package/bundle/chunk-7q8pa6s8.js +2 -0
  79. package/bundle/{chunk-vvypb02q.js → chunk-7qvkyjjg.js} +1 -1
  80. package/bundle/{chunk-8r79zf3y.js → chunk-7rjf9b8n.js} +2 -2
  81. package/bundle/{chunk-t488d66k.js → chunk-7v4fzkbb.js} +1 -1
  82. package/bundle/chunk-7w84hfxs.js +3 -0
  83. package/bundle/{chunk-8717htya.js → chunk-7ws3gdjq.js} +1 -1
  84. package/bundle/{chunk-va4davgy.js → chunk-87x607rz.js} +259 -253
  85. package/bundle/{chunk-vftqwdpg.js → chunk-8ahpk8td.js} +1 -1
  86. package/bundle/{chunk-9vcw33dv.js → chunk-8atry88r.js} +1 -1
  87. package/bundle/chunk-8casywce.js +2 -0
  88. package/bundle/{chunk-tsn1jkr7.js → chunk-8cty50g7.js} +1 -1
  89. package/bundle/{chunk-qywwj58s.js → chunk-8gy99gfb.js} +2 -2
  90. package/bundle/chunk-8hxwxt5p.js +2 -0
  91. package/bundle/{chunk-58enbars.js → chunk-8jcx4tep.js} +2 -2
  92. package/bundle/chunk-8y8140dm.js +2 -0
  93. package/bundle/{chunk-frdc3ysq.js → chunk-8za87zkr.js} +1 -1
  94. package/bundle/{chunk-2qcndbxv.js → chunk-99p5m2f1.js} +1 -1
  95. package/bundle/{chunk-y3n31nnx.js → chunk-9dpn4792.js} +2 -2
  96. package/bundle/chunk-9dqcyt6x.js +2 -0
  97. package/bundle/{chunk-7gczzccz.js → chunk-9f6pqped.js} +1 -1
  98. package/bundle/chunk-9he248a8.js +2 -0
  99. package/bundle/{chunk-8h9r6c8g.js → chunk-9jncnqbj.js} +2 -2
  100. package/bundle/{chunk-cvchztkc.js → chunk-9jvnc14g.js} +1 -1
  101. package/bundle/chunk-9qmmse2n.js +2 -0
  102. package/bundle/chunk-9r6bvkp4.js +8 -0
  103. package/bundle/{chunk-dkv2mg97.js → chunk-9va5eh9s.js} +1 -1
  104. package/bundle/{chunk-hg563h5r.js → chunk-9w5rx0fb.js} +2 -2
  105. package/bundle/{chunk-xccs5c50.js → chunk-a27yjp71.js} +1 -1
  106. package/bundle/chunk-aabrsxrq.js +2 -0
  107. package/bundle/{chunk-dkm7x8rj.js → chunk-ag9thqkv.js} +2 -2
  108. package/bundle/chunk-amx3x4kd.js +3 -0
  109. package/bundle/{chunk-ktmazmas.js → chunk-aqm597px.js} +2 -2
  110. package/bundle/chunk-atd0q4v8.js +3 -0
  111. package/bundle/{chunk-ewyk4py6.js → chunk-av290sja.js} +1 -1
  112. package/bundle/chunk-avaba4sr.js +2 -0
  113. package/bundle/{chunk-dgzyn27r.js → chunk-aw0q4y3s.js} +1 -1
  114. package/bundle/{chunk-4k149ews.js → chunk-b2xya6pq.js} +1 -1
  115. package/bundle/{chunk-3tdqsm5c.js → chunk-b50t4jc5.js} +1 -1
  116. package/bundle/chunk-bdy1etja.js +2 -0
  117. package/bundle/{chunk-6szvs3k9.js → chunk-bnc4626b.js} +1 -1
  118. package/bundle/{chunk-fm4xa6yx.js → chunk-bpnpxdyv.js} +2 -2
  119. package/bundle/chunk-bqdvqmjc.js +2 -0
  120. package/bundle/chunk-bqs6a1ts.js +14 -0
  121. package/bundle/{chunk-78bajmqm.js → chunk-bsqcfqya.js} +1 -1
  122. package/bundle/{chunk-ecwz9nhs.js → chunk-c1ypbbka.js} +2 -2
  123. package/bundle/{chunk-1jsywey3.js → chunk-c27rpvdz.js} +1 -1
  124. package/bundle/chunk-cdws8ggq.js +2 -0
  125. package/bundle/{chunk-6j0365q3.js → chunk-cjxp72dv.js} +2 -2
  126. package/bundle/chunk-cqs9a2cs.js +2 -0
  127. package/bundle/{chunk-3wzqs241.js → chunk-crap29f6.js} +1 -1
  128. package/bundle/{chunk-1jh5p5qw.js → chunk-d0m7nbbx.js} +2 -2
  129. package/bundle/chunk-d0rjst58.js +2 -0
  130. package/bundle/{chunk-2eardzxs.js → chunk-d1bsxz2t.js} +1 -1
  131. package/bundle/{chunk-b6m4yyww.js → chunk-d5b0bqbr.js} +1 -1
  132. package/bundle/chunk-d833a2fj.js +2 -0
  133. package/bundle/{chunk-tk3bve0x.js → chunk-dd11kryy.js} +2 -2
  134. package/bundle/chunk-dday4nm2.js +2 -0
  135. package/bundle/{chunk-qw2hgs5b.js → chunk-ddxjc803.js} +2 -2
  136. package/bundle/{chunk-3tkp27x7.js → chunk-dee1a3yk.js} +2 -2
  137. package/bundle/{chunk-q6fbyvpq.js → chunk-dgggvses.js} +1 -1
  138. package/bundle/{chunk-apq38bt4.js → chunk-dk3z4k46.js} +3 -3
  139. package/bundle/{chunk-wf09j72q.js → chunk-e075v4e9.js} +2 -2
  140. package/bundle/{chunk-1xyn0sp2.js → chunk-e1pwnf0b.js} +2 -2
  141. package/bundle/chunk-e2sj30hk.js +2 -0
  142. package/bundle/{chunk-dann9gfq.js → chunk-eaatrmcg.js} +1 -1
  143. package/bundle/{chunk-1y9t7nxn.js → chunk-eg7drzzt.js} +1 -1
  144. package/bundle/chunk-enc0fykg.js +2 -0
  145. package/bundle/chunk-evan93av.js +2 -0
  146. package/bundle/{chunk-9f7y0dj0.js → chunk-evmfntm3.js} +1 -1
  147. package/bundle/{chunk-2gxjjqfx.js → chunk-ey4ktbyb.js} +1 -1
  148. package/bundle/{chunk-sswbfqcq.js → chunk-f55txcsa.js} +1 -1
  149. package/bundle/chunk-f600dzsr.js +2 -0
  150. package/bundle/chunk-f6jzwydk.js +2 -0
  151. package/bundle/{chunk-s9amvacw.js → chunk-f84cd0a1.js} +2 -2
  152. package/bundle/{chunk-6sdh1q7g.js → chunk-fgw420gb.js} +1 -1
  153. package/bundle/chunk-fv67ng8z.js +2 -0
  154. package/bundle/{chunk-x6z2b63w.js → chunk-g3s2z5xa.js} +1 -1
  155. package/bundle/{chunk-9xvctnjr.js → chunk-g4qwkcdv.js} +1 -1
  156. package/bundle/{chunk-3nhqd8wg.js → chunk-g73drh98.js} +3 -3
  157. package/bundle/{chunk-0pvbk8ks.js → chunk-gaen9ya4.js} +2 -2
  158. package/bundle/{chunk-ac202abt.js → chunk-gefh32jb.js} +1 -1
  159. package/bundle/chunk-gevazsx3.js +2 -0
  160. package/bundle/{chunk-n1chdwrs.js → chunk-gfmfrkxc.js} +1 -1
  161. package/bundle/{chunk-sjrmhd3e.js → chunk-ggeena9t.js} +1 -1
  162. package/bundle/chunk-gh18pzkx.js +2 -0
  163. package/bundle/chunk-gnvvgr4y.js +2 -0
  164. package/bundle/{chunk-4q9w2yve.js → chunk-grkkzrg1.js} +2 -2
  165. package/bundle/chunk-gsbjs2ws.js +2 -0
  166. package/bundle/{chunk-gff87y4n.js → chunk-gsz1wqy6.js} +1 -1
  167. package/bundle/{chunk-vf1r5ckp.js → chunk-gvtw9c44.js} +1 -1
  168. package/bundle/chunk-gw0j8hr9.js +3 -0
  169. package/bundle/{chunk-cesrhm09.js → chunk-h19ty95q.js} +1 -1
  170. package/bundle/{chunk-9nx8hm57.js → chunk-h2fh1g8g.js} +1 -1
  171. package/bundle/{chunk-p54bzjtv.js → chunk-h56jxxvj.js} +1 -1
  172. package/bundle/{chunk-jmjg8d8a.js → chunk-hmfefq0d.js} +4 -4
  173. package/bundle/{chunk-gn7xgd4c.js → chunk-hvpe07pt.js} +1 -1
  174. package/bundle/{chunk-gvzfffr4.js → chunk-hwbxehhf.js} +1 -1
  175. package/bundle/{chunk-zp2ffbc2.js → chunk-hznsed5n.js} +2 -2
  176. package/bundle/{chunk-w1atxyz0.js → chunk-j5b5h08g.js} +1 -1
  177. package/bundle/chunk-j7pdz979.js +2 -0
  178. package/bundle/{chunk-02txthqv.js → chunk-j9s62g01.js} +2 -2
  179. package/bundle/chunk-jfe2qbv8.js +2 -0
  180. package/bundle/{chunk-wj6aq50n.js → chunk-jgs6ngte.js} +1 -1
  181. package/bundle/{chunk-ep8zn49w.js → chunk-jhq5bvhs.js} +2 -2
  182. package/bundle/{chunk-2z6fzwyc.js → chunk-jq81hb32.js} +2 -2
  183. package/bundle/{chunk-dcx8hjbs.js → chunk-jqzejny3.js} +1 -1
  184. package/bundle/{chunk-j1veq3zr.js → chunk-jtrcnpm7.js} +2 -2
  185. package/bundle/{chunk-hbnr0j7h.js → chunk-jv98gw88.js} +2 -2
  186. package/bundle/{chunk-e346x00p.js → chunk-jvaffe5d.js} +1 -1
  187. package/bundle/chunk-k6zvb8xm.js +2 -0
  188. package/bundle/{chunk-5y8efy5b.js → chunk-k8bp3jjv.js} +1 -1
  189. package/bundle/{chunk-0ae5q6ck.js → chunk-kb14wxcs.js} +2 -2
  190. package/bundle/chunk-kcht9kvx.js +2 -0
  191. package/bundle/{chunk-edvcz2gd.js → chunk-kdcspxvq.js} +1 -1
  192. package/bundle/{chunk-t6w96xq2.js → chunk-kdct3e8s.js} +1 -1
  193. package/bundle/{chunk-1fnmkm0z.js → chunk-kgsq240v.js} +2 -2
  194. package/bundle/chunk-knvsa1d4.js +2 -0
  195. package/bundle/chunk-kp6d68hd.js +2 -0
  196. package/bundle/{chunk-jpygkh1c.js → chunk-kwm87f18.js} +1 -1
  197. package/bundle/{chunk-1p34bx7c.js → chunk-kyny0t2g.js} +2 -2
  198. package/bundle/{chunk-b8ag61vj.js → chunk-m2ang7yb.js} +1 -1
  199. package/bundle/{chunk-99n6czag.js → chunk-mbh1pdv9.js} +2 -2
  200. package/bundle/{chunk-y1srca0c.js → chunk-mczw8e3s.js} +2 -2
  201. package/bundle/chunk-me78p9x4.js +2 -0
  202. package/bundle/{chunk-g7vkkmsk.js → chunk-meaybtcc.js} +3 -3
  203. package/bundle/{chunk-9rqrm9y8.js → chunk-mkdyknbz.js} +1 -1
  204. package/bundle/{chunk-bf146hz2.js → chunk-mkyrg7gt.js} +2 -2
  205. package/bundle/{chunk-0pbt75ev.js → chunk-mr7agwgn.js} +1 -1
  206. package/bundle/{chunk-0w4v0fbs.js → chunk-msm3r7ny.js} +2 -2
  207. package/bundle/chunk-mv1d7wyt.js +2 -0
  208. package/bundle/{chunk-hh3w51wp.js → chunk-mybpgrjj.js} +2 -2
  209. package/bundle/{chunk-gf4ek7rv.js → chunk-n8dcmjph.js} +1 -1
  210. package/bundle/chunk-n8xmmxh5.js +2 -0
  211. package/bundle/chunk-n90219q9.js +2 -0
  212. package/bundle/chunk-nckg3ydx.js +2 -0
  213. package/bundle/{chunk-a5zjrwqy.js → chunk-nf8gkxbk.js} +2 -2
  214. package/bundle/chunk-nhaenjw3.js +2 -0
  215. package/bundle/chunk-nhtrt5ec.js +2 -0
  216. package/bundle/{chunk-6dxaty1v.js → chunk-nhx2xp2x.js} +1 -1
  217. package/bundle/{chunk-najzfhb2.js → chunk-nmnsf3fc.js} +1 -1
  218. package/bundle/{chunk-84gnbzky.js → chunk-nqefvn28.js} +1 -1
  219. package/bundle/{chunk-v2kyarwz.js → chunk-p409grvp.js} +2 -2
  220. package/bundle/chunk-p72n0tfq.js +2 -0
  221. package/bundle/{chunk-jr8qcf99.js → chunk-p80dc6kt.js} +2 -2
  222. package/bundle/{chunk-2wp1w8cy.js → chunk-p883sz67.js} +1 -1
  223. package/bundle/{chunk-fdezde1z.js → chunk-p8enedkf.js} +1 -1
  224. package/bundle/chunk-pd33qvr0.js +2 -0
  225. package/bundle/{chunk-d56zc21w.js → chunk-pepn5jp4.js} +1 -1
  226. package/bundle/chunk-pf7cj4jd.js +3 -0
  227. package/bundle/{chunk-bd21p9zz.js → chunk-pfn1db1m.js} +2 -2
  228. package/bundle/{chunk-srf73nm4.js → chunk-pk0tytcm.js} +1 -1
  229. package/bundle/chunk-pq3622ae.js +2 -0
  230. package/bundle/{chunk-ebjhggdw.js → chunk-psveqqv2.js} +1 -1
  231. package/bundle/{chunk-wfnk2vsd.js → chunk-pvee151a.js} +1 -1
  232. package/bundle/chunk-qatj4h6b.js +2 -0
  233. package/bundle/{chunk-3vbtra1j.js → chunk-qdnxv55k.js} +1 -1
  234. package/bundle/{chunk-gen6f3dn.js → chunk-qe0sfafy.js} +2 -2
  235. package/bundle/chunk-qfz0a58d.js +2 -0
  236. package/bundle/chunk-qjwfj51e.js +2 -0
  237. package/bundle/chunk-qkg73rs9.js +2 -0
  238. package/bundle/{chunk-5kmfnkzv.js → chunk-qm9ezq93.js} +1 -1
  239. package/bundle/{chunk-5rkmhzq0.js → chunk-qnqqrvvs.js} +2 -2
  240. package/bundle/{chunk-9pe4agdz.js → chunk-qnv2v02g.js} +2 -2
  241. package/bundle/{chunk-7dckfame.js → chunk-qpm5afdz.js} +1 -1
  242. package/bundle/chunk-qvcfst7n.js +11 -0
  243. package/bundle/{chunk-r48g0kaq.js → chunk-rgecc41f.js} +2 -2
  244. package/bundle/chunk-rjcptzem.js +8 -0
  245. package/bundle/{chunk-hh9a709t.js → chunk-rjf21v5c.js} +1 -1
  246. package/bundle/chunk-rmsqb6r4.js +10 -0
  247. package/bundle/{chunk-2mmspnr3.js → chunk-rq4hqwjy.js} +1 -1
  248. package/bundle/chunk-rqrpbcm6.js +2 -0
  249. package/bundle/{chunk-ftk58wxe.js → chunk-rs1mm5ef.js} +1 -1
  250. package/bundle/{chunk-a9y27zd2.js → chunk-rze20q68.js} +1 -1
  251. package/bundle/chunk-s76hdgw6.js +2 -0
  252. package/bundle/chunk-s7vhjg9e.js +2 -0
  253. package/bundle/{chunk-fkvccmgk.js → chunk-se79ke63.js} +2 -2
  254. package/bundle/chunk-sec3a60m.js +2 -0
  255. package/bundle/chunk-sjnt5e6w.js +2 -0
  256. package/bundle/chunk-sntb757q.js +2 -0
  257. package/bundle/chunk-svscftd7.js +2 -0
  258. package/bundle/chunk-sx0cabcs.js +2 -0
  259. package/bundle/{chunk-gn9p1d50.js → chunk-sx5m81em.js} +1 -1
  260. package/bundle/chunk-syhay5ye.js +7 -0
  261. package/bundle/{chunk-9798jffg.js → chunk-t07a5431.js} +1 -1
  262. package/bundle/{chunk-c31k8yh0.js → chunk-t0amhhsk.js} +1 -1
  263. package/bundle/{chunk-pfhp78cr.js → chunk-t2tsyazc.js} +1 -1
  264. package/bundle/{chunk-spm1yy6w.js → chunk-tdmaxc6n.js} +1 -1
  265. package/bundle/{chunk-gc9q0x8z.js → chunk-tf1me2r4.js} +3 -3
  266. package/bundle/{chunk-zfnbk5gy.js → chunk-tfggzzqw.js} +1 -1
  267. package/bundle/chunk-tmdm6vm6.js +2 -0
  268. package/bundle/{chunk-9sy9ws1w.js → chunk-v4xgceeq.js} +1 -1
  269. package/bundle/chunk-v6g0ksks.js +2 -0
  270. package/bundle/chunk-v7ah9gg0.js +3 -0
  271. package/bundle/{chunk-kr0fsqas.js → chunk-vb4e7y4d.js} +1 -1
  272. package/bundle/chunk-vbf73c7z.js +2 -0
  273. package/bundle/chunk-vbf9jpas.js +2 -0
  274. package/bundle/{chunk-r3yqe7x0.js → chunk-veev25yg.js} +1 -1
  275. package/bundle/{chunk-kaeyhw2n.js → chunk-vfj5nwab.js} +2 -2
  276. package/bundle/{chunk-6g3m7yxf.js → chunk-vmgknvxs.js} +2 -2
  277. package/bundle/{chunk-2y8qz8te.js → chunk-vq6bh2z9.js} +1 -1
  278. package/bundle/{chunk-b643cra9.js → chunk-vqq5vmh1.js} +195 -195
  279. package/bundle/chunk-vrcf5q4s.js +2 -0
  280. package/bundle/chunk-vxrsp6n7.js +2 -0
  281. package/bundle/chunk-w8ax3pvh.js +2 -0
  282. package/bundle/chunk-w98r39gd.js +9 -0
  283. package/bundle/{chunk-j1a64ade.js → chunk-wb69d52j.js} +2 -2
  284. package/bundle/{chunk-hg9nk090.js → chunk-wrgg270f.js} +1 -1
  285. package/bundle/{chunk-yzdty5t9.js → chunk-ww8ear80.js} +2 -2
  286. package/bundle/{chunk-ha1w0xzh.js → chunk-x36jhtex.js} +1 -1
  287. package/bundle/{chunk-hjbks7r9.js → chunk-x6b99nt3.js} +1 -1
  288. package/bundle/{chunk-yh174jhg.js → chunk-xdde80rf.js} +2 -2
  289. package/bundle/{chunk-17ggas8k.js → chunk-xjrt0dta.js} +1 -1
  290. package/bundle/chunk-xk2cmh49.js +2 -0
  291. package/bundle/{chunk-f819a7ec.js → chunk-xqa6qkx2.js} +1 -1
  292. package/bundle/{chunk-f3kjp838.js → chunk-xw283h2r.js} +2 -2
  293. package/bundle/{chunk-82gs5cmn.js → chunk-xy4t5qf8.js} +1 -1
  294. package/bundle/{chunk-0w0jfzb4.js → chunk-xyn3xxfs.js} +1 -1
  295. package/bundle/chunk-xzhkfctf.js +2 -0
  296. package/bundle/chunk-y0xt5a6g.js +2 -0
  297. package/bundle/{chunk-hxgb0y1w.js → chunk-ybn8tb09.js} +1 -1
  298. package/bundle/chunk-ydmrvx7q.js +2 -0
  299. package/bundle/{chunk-ns0pswww.js → chunk-ydsen7w0.js} +1 -1
  300. package/bundle/{chunk-hv4nhx6q.js → chunk-yhqk8bzk.js} +2 -2
  301. package/bundle/{chunk-g0v9g37f.js → chunk-ykfq8bem.js} +1 -1
  302. package/bundle/{chunk-r7xp0xcn.js → chunk-ym4ydwrz.js} +2 -2
  303. package/bundle/{chunk-4tn69nqs.js → chunk-yzchwmb4.js} +1 -1
  304. package/bundle/{chunk-1d64dywx.js → chunk-z015twaq.js} +2 -2
  305. package/bundle/chunk-z2rtcgad.js +3 -0
  306. package/bundle/{chunk-ms1fd6h4.js → chunk-z3zx6g09.js} +1 -1
  307. package/bundle/chunk-z9b3t2jm.js +2 -0
  308. package/bundle/{chunk-agdfqncf.js → chunk-zbdbsagd.js} +2 -2
  309. package/bundle/{chunk-evqxvhdb.js → chunk-zh808d4t.js} +1 -1
  310. package/bundle/{chunk-fhng5her.js → chunk-zny2qaqa.js} +2 -2
  311. package/bundle/{chunk-y2jmtfdh.js → chunk-zsnbxsdx.js} +2 -2
  312. package/bundle/{chunk-pv8jcpnf.js → chunk-zss93r48.js} +1 -1
  313. package/bundle/chunk-zzr8smtm.js +2 -0
  314. package/bundle/index.js +16 -16
  315. package/bundle/parser.worker.js +2 -2
  316. package/bundle/worker.js +1 -1
  317. package/package.json +1 -1
  318. package/bundle/chunk-0bvde0cx.js +0 -2
  319. package/bundle/chunk-0kbxnazj.js +0 -2
  320. package/bundle/chunk-0z3z0gk1.js +0 -5
  321. package/bundle/chunk-19z5q33z.js +0 -2
  322. package/bundle/chunk-1a0wnwna.js +0 -2
  323. package/bundle/chunk-1ddm2wxv.js +0 -2
  324. package/bundle/chunk-1fk4vsmc.js +0 -2
  325. package/bundle/chunk-1j2f9nd5.js +0 -2
  326. package/bundle/chunk-27s736an.js +0 -2
  327. package/bundle/chunk-2j17xrzj.js +0 -2
  328. package/bundle/chunk-2zca3nak.js +0 -2
  329. package/bundle/chunk-2zcvcfq4.js +0 -2
  330. package/bundle/chunk-38hwkfj5.js +0 -2
  331. package/bundle/chunk-3afqxvsn.js +0 -2
  332. package/bundle/chunk-3avc1ppg.js +0 -7
  333. package/bundle/chunk-3v4vtah1.js +0 -2
  334. package/bundle/chunk-3ypk0j2f.js +0 -2
  335. package/bundle/chunk-3z1y040p.js +0 -3
  336. package/bundle/chunk-4aykrj51.js +0 -9
  337. package/bundle/chunk-4dtbmqmq.js +0 -2
  338. package/bundle/chunk-4zjb6rps.js +0 -2
  339. package/bundle/chunk-5hkcjgwh.js +0 -2
  340. package/bundle/chunk-5snrz263.js +0 -2
  341. package/bundle/chunk-653c0mxr.js +0 -11
  342. package/bundle/chunk-6av7hrrk.js +0 -7
  343. package/bundle/chunk-6bswn7w5.js +0 -2
  344. package/bundle/chunk-6epghftw.js +0 -2
  345. package/bundle/chunk-6jjhxh8p.js +0 -2
  346. package/bundle/chunk-6ws7xyc5.js +0 -2
  347. package/bundle/chunk-7g28zhar.js +0 -2
  348. package/bundle/chunk-7v02b2ms.js +0 -2
  349. package/bundle/chunk-7vmp2034.js +0 -2
  350. package/bundle/chunk-7wxrypkr.js +0 -2
  351. package/bundle/chunk-8kk9gvdy.js +0 -2
  352. package/bundle/chunk-8ygpp4y3.js +0 -2
  353. package/bundle/chunk-95q60g1p.js +0 -2
  354. package/bundle/chunk-9mjbenja.js +0 -2
  355. package/bundle/chunk-9vn1gy8h.js +0 -2
  356. package/bundle/chunk-ajp3f08k.js +0 -2
  357. package/bundle/chunk-aptkpdkc.js +0 -2
  358. package/bundle/chunk-bky5a42k.js +0 -3
  359. package/bundle/chunk-bry94ar5.js +0 -2
  360. package/bundle/chunk-btzyvqkf.js +0 -2
  361. package/bundle/chunk-c94pjdfh.js +0 -2
  362. package/bundle/chunk-cct9ds5c.js +0 -2
  363. package/bundle/chunk-czn535v0.js +0 -2
  364. package/bundle/chunk-d7wd5hz1.js +0 -2
  365. package/bundle/chunk-d86cmjrp.js +0 -2
  366. package/bundle/chunk-dnq65xvn.js +0 -2
  367. package/bundle/chunk-dpqv8rtn.js +0 -2
  368. package/bundle/chunk-e9mh7s3z.js +0 -2
  369. package/bundle/chunk-ek2y5f6g.js +0 -2
  370. package/bundle/chunk-epdsay73.js +0 -2
  371. package/bundle/chunk-f89gntcy.js +0 -3
  372. package/bundle/chunk-ffnsn7tv.js +0 -2
  373. package/bundle/chunk-fkezc7ew.js +0 -2
  374. package/bundle/chunk-fsxddgj0.js +0 -2
  375. package/bundle/chunk-gbcsfg6v.js +0 -2
  376. package/bundle/chunk-gfmz85hp.js +0 -2
  377. package/bundle/chunk-gk63k4t6.js +0 -2
  378. package/bundle/chunk-j0vf8s12.js +0 -2
  379. package/bundle/chunk-j1bxt69x.js +0 -2
  380. package/bundle/chunk-jcem8s30.js +0 -2
  381. package/bundle/chunk-jjwjb9w0.js +0 -3
  382. package/bundle/chunk-jpham2a3.js +0 -2
  383. package/bundle/chunk-jzkymnr5.js +0 -2
  384. package/bundle/chunk-k0qtwnhb.js +0 -2
  385. package/bundle/chunk-k2rsky7z.js +0 -2
  386. package/bundle/chunk-kcetcysa.js +0 -2
  387. package/bundle/chunk-kjfc5v3s.js +0 -2
  388. package/bundle/chunk-kkvb2c2z.js +0 -8
  389. package/bundle/chunk-km2ayfyf.js +0 -2
  390. package/bundle/chunk-knrh89eb.js +0 -2
  391. package/bundle/chunk-ksqfjawv.js +0 -2
  392. package/bundle/chunk-m8djypsy.js +0 -11
  393. package/bundle/chunk-mjhb1q0n.js +0 -3
  394. package/bundle/chunk-mxcger73.js +0 -2
  395. package/bundle/chunk-nazkrkeb.js +0 -2
  396. package/bundle/chunk-nk01s49e.js +0 -2
  397. package/bundle/chunk-ns8b7rx1.js +0 -2
  398. package/bundle/chunk-ny6vpkx2.js +0 -2
  399. package/bundle/chunk-q0dd3ak6.js +0 -3
  400. package/bundle/chunk-q2s057bm.js +0 -2
  401. package/bundle/chunk-q5cqg2c0.js +0 -28
  402. package/bundle/chunk-qk2wnp2x.js +0 -2
  403. package/bundle/chunk-r012q335.js +0 -3
  404. package/bundle/chunk-rbdjbgkb.js +0 -2
  405. package/bundle/chunk-rxjprhgh.js +0 -2
  406. package/bundle/chunk-s3w9bmze.js +0 -2
  407. package/bundle/chunk-s3zste1a.js +0 -2
  408. package/bundle/chunk-sbt7qmwm.js +0 -3
  409. package/bundle/chunk-sf6h44pb.js +0 -2
  410. package/bundle/chunk-sgvzxs7m.js +0 -2
  411. package/bundle/chunk-sp9bndyh.js +0 -2
  412. package/bundle/chunk-vavrczqm.js +0 -3
  413. package/bundle/chunk-vg4styg5.js +0 -2
  414. package/bundle/chunk-vh09hhcs.js +0 -2
  415. package/bundle/chunk-vhktpm0n.js +0 -2
  416. package/bundle/chunk-vzjcmwry.js +0 -14
  417. package/bundle/chunk-wtp0yvqw.js +0 -2
  418. package/bundle/chunk-xmzs7q66.js +0 -2
  419. package/bundle/chunk-xv80476w.js +0 -2
  420. package/bundle/chunk-yjvr0et1.js +0 -2
  421. package/bundle/chunk-zk8n8hnh.js +0 -3
  422. package/bundle/chunk-zx3kcfkj.js +0 -2
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Aq as k,Bq as O,Fq as s,Gq as S,Iq as c,Jq as u,Kq as i,Oq as I3,Pp as T,Wp as m,dq as A,iq as O3,yq as l}from"./chunk-bf146hz2.js";import{Rq as q3,Wq as v,br as y}from"./chunk-t488d66k.js";import"./chunk-cqtkxwd8.js";import"./chunk-srf73nm4.js";import{Pu as j}from"./chunk-r7xp0xcn.js";import"./chunk-6g3m7yxf.js";import"./chunk-hh4c02fh.js";function h(Q){switch(Q.type){case"text":case"error-text":return Q.value;case"execution-denied":return Q.reason??"Tool execution denied.";case"content":case"json":case"error-json":return JSON.stringify(Q.value)}}function C(Q){return Q?.providerOptions?.copilot??{}}function Z3(Q){let G=[];for(let{role:W,content:N,...q}of Q){let L=C({...q});switch(W){case"system":{G.push({role:"system",content:N,...L});break}case"user":{if(N.length===1&&N[0].type==="text"){G.push({role:"user",content:N[0].text,...C(N[0])});break}G.push({role:"user",content:N.map((Z)=>{let Y=C(Z);switch(Z.type){case"text":return{type:"text",text:Z.text,...Y};case"file":if(Z.mediaType.startsWith("image/")){let $=Z.mediaType==="image/*"?"image/jpeg":Z.mediaType;return{type:"image_url",image_url:{url:Z.data instanceof URL?Z.data.toString():`data:${$};base64,${m(Z.data)}`},...Y}}else throw new y({functionality:`file part media type ${Z.mediaType}`})}}),...L});break}case"assistant":{let Z="",Y,$,J=[];for(let E of N){let _=C(E),X=E.providerOptions?.copilot?.reasoningOpaque;if(X&&!$)$=X;switch(E.type){case"text":{Z+=E.text;break}case"reasoning":{if(E.text)Y=E.text;break}case"tool-call":{J.push({id:E.toolCallId,type:"function",function:{name:E.toolName,arguments:JSON.stringify(E.input)},..._});break}}}G.push({role:"assistant",content:Z||null,tool_calls:J.length>0?J:void 0,reasoning_text:$?Y:void 0,reasoning_opaque:$,...L});break}case"tool":{for(let Z of N){if(Z.type==="tool-approval-response")continue;let Y=Z.output,$=C(Z);G.push({role:"tool",tool_call_id:Z.toolCallId,content:h(Y),...$})}break}default:throw Error(`Unsupported role: ${W}`)}}return G}function n({id:Q,model:G,created:W}){return{id:Q??void 0,modelId:G??void 0,timestamp:W!=null?new Date(W*1000):void 0}}function r(Q){switch(Q){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"other"}}var g=j.object({user:j.string().optional(),reasoningEffort:j.string().optional(),textVerbosity:j.string().optional(),thinking_budget:j.number().optional()});var t=j.object({error:j.object({message:j.string(),type:j.string().nullish(),param:j.any().nullish(),code:j.union([j.string(),j.number()]).nullish()})}),$3={errorSchema:t,errorToMessage:(Q)=>Q.error.message};function d(Q){return new TransformStream({start(G){G.enqueue({type:"stream-start",warnings:Q.warnings})},transform(G,W){if(Q.includeRawChunks)W.enqueue({type:"raw",rawValue:G.rawValue});if(!G.success){Q.onParseError(),W.enqueue({type:"error",error:G.error});return}Q.transformValue(G.value,W,G.rawValue)},flush:Q.flush})}function E3({tools:Q,toolChoice:G}){Q=Q?.length?Q:void 0;let W=[];if(Q==null)return{tools:void 0,toolChoice:void 0,toolWarnings:W};let N=[];for(let L of Q)if(L.type==="provider")W.push({type:"unsupported",feature:`tool type: ${L.type}`});else N.push({type:"function",function:{name:L.name,description:L.description,parameters:L.inputSchema}});if(G==null)return{tools:N,toolChoice:void 0,toolWarnings:W};let q=G.type;switch(q){case"auto":case"none":case"required":return{tools:N,toolChoice:q,toolWarnings:W};case"tool":return{tools:N,toolChoice:{type:"function",function:{name:G.toolName}},toolWarnings:W};default:throw new y({functionality:`tool choice type: ${q}`})}}class a{specificationVersion="v3";supportsStructuredOutputs;modelId;config;failedResponseHandler;chunkSchema;constructor(Q,G){this.modelId=Q,this.config=G;let W=G.errorStructure??$3;this.chunkSchema=h3(W.errorSchema),this.failedResponseHandler=c(W),this.supportsStructuredOutputs=G.supportsStructuredOutputs??!1}get provider(){return this.config.provider}get providerOptionsName(){return this.config.provider.split(".")[0].trim()}get supportedUrls(){return this.config.supportedUrls?.()??{}}async getArgs({prompt:Q,maxOutputTokens:G,temperature:W,topP:N,topK:q,frequencyPenalty:L,presencePenalty:Z,providerOptions:Y,stopSequences:$,responseFormat:J,seed:E,toolChoice:_,tools:X}){let K=[],B=Object.assign(await k({provider:"copilot",providerOptions:Y,schema:g})??{},await k({provider:this.providerOptionsName,providerOptions:Y,schema:g})??{});if(q!=null)K.push({type:"unsupported",feature:"topK"});if(J?.type==="json"&&J.schema!=null&&!this.supportsStructuredOutputs)K.push({type:"unsupported",feature:"responseFormat",details:"JSON response format schema is only supported with structuredOutputs"});let{tools:U,toolChoice:M,toolWarnings:V}=E3({tools:X,toolChoice:_});return{args:{model:this.modelId,user:B.user,max_tokens:G,temperature:W,top_p:N,frequency_penalty:L,presence_penalty:Z,response_format:J?.type==="json"?this.supportsStructuredOutputs===!0&&J.schema!=null?{type:"json_schema",json_schema:{schema:J.schema,name:J.name??"response",description:J.description}}:{type:"json_object"}:void 0,stop:$,seed:E,...Object.fromEntries(Object.entries(Y?.[this.providerOptionsName]??{}).filter(([H])=>!Object.keys(g.shape).includes(H))),reasoning_effort:B.reasoningEffort,verbosity:B.textVerbosity,messages:Z3(Q),tools:U,tool_choice:M,thinking_budget:B.thinking_budget},warnings:[...K,...V]}}async doGenerate(Q){let{args:G,warnings:W}=await this.getArgs({...Q}),N=JSON.stringify(G),{responseHeaders:q,value:L,rawValue:Z}=await O({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:T(this.config.headers(),Q.headers),body:G,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:i(m3),abortSignal:Q.abortSignal,fetch:this.config.fetch}),Y=L.choices[0],$=[],J=Y.message.content;if(J!=null&&J.length>0)$.push({type:"text",text:J,providerMetadata:Y.message.reasoning_opaque?{copilot:{reasoningOpaque:Y.message.reasoning_opaque}}:void 0});let E=Y.message.reasoning_text;if(E!=null&&E.length>0)$.push({type:"reasoning",text:E,providerMetadata:Y.message.reasoning_opaque?{copilot:{reasoningOpaque:Y.message.reasoning_opaque}}:void 0});if(Y.message.tool_calls!=null)for(let K of Y.message.tool_calls)$.push({type:"tool-call",toolCallId:K.id??A(),toolName:K.function.name,input:K.function.arguments,providerMetadata:Y.message.reasoning_opaque?{copilot:{reasoningOpaque:Y.message.reasoning_opaque}}:void 0});let _={[this.providerOptionsName]:{},...await this.config.metadataExtractor?.extractMetadata?.({parsedBody:Z})},X=L.usage?.completion_tokens_details;if(X?.accepted_prediction_tokens!=null)_[this.providerOptionsName].acceptedPredictionTokens=X?.accepted_prediction_tokens;if(X?.rejected_prediction_tokens!=null)_[this.providerOptionsName].rejectedPredictionTokens=X?.rejected_prediction_tokens;return{content:$,finishReason:{unified:r(Y.finish_reason),raw:Y.finish_reason??void 0},usage:{inputTokens:{total:L.usage?.prompt_tokens??void 0,noCache:void 0,cacheRead:L.usage?.prompt_tokens_details?.cached_tokens??void 0,cacheWrite:void 0},outputTokens:{total:L.usage?.completion_tokens??void 0,text:void 0,reasoning:L.usage?.completion_tokens_details?.reasoning_tokens??void 0},raw:L.usage??void 0},providerMetadata:_,request:{body:N},response:{...n(L),headers:q,body:Z},warnings:W}}async doStream(Q){let{args:G,warnings:W}=await this.getArgs({...Q}),N={...G,stream:!0,stream_options:this.config.includeUsage?{include_usage:!0}:void 0},q=this.config.metadataExtractor?.createStreamExtractor(),{responseHeaders:L,value:Z}=await O({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:T(this.config.headers(),Q.headers),body:N,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:u(this.chunkSchema),abortSignal:Q.abortSignal,fetch:this.config.fetch}),Y=[],$={unified:"other",raw:void 0},J={completionTokens:void 0,completionTokensDetails:{reasoningTokens:void 0,acceptedPredictionTokens:void 0,rejectedPredictionTokens:void 0},promptTokens:void 0,promptTokensDetails:{cachedTokens:void 0},totalTokens:void 0},E=!0,_=this.providerOptionsName,X=!1,K=!1,B,U=(M,V)=>{V.enqueue({type:"tool-input-end",id:M.id}),V.enqueue({type:"tool-call",toolCallId:M.id??A(),toolName:M.function.name,input:M.function.arguments,providerMetadata:B?{copilot:{reasoningOpaque:B}}:void 0}),M.hasFinished=!0};return{stream:Z.pipeThrough(d({warnings:W,includeRawChunks:Q.includeRawChunks,onParseError:()=>{$={unified:"error",raw:void 0}},transformValue:(M,V,H)=>{if(q?.processChunk(H),"error"in M){$={unified:"error",raw:void 0},V.enqueue({type:"error",error:M.error.message});return}if(E)E=!1,V.enqueue({type:"response-metadata",...n(M)});if(M.usage!=null){let{prompt_tokens:P,completion_tokens:b,total_tokens:f,prompt_tokens_details:R,completion_tokens_details:w}=M.usage;if(J.promptTokens=P??void 0,J.completionTokens=b??void 0,J.totalTokens=f??void 0,w?.reasoning_tokens!=null)J.completionTokensDetails.reasoningTokens=w?.reasoning_tokens;if(w?.accepted_prediction_tokens!=null)J.completionTokensDetails.acceptedPredictionTokens=w?.accepted_prediction_tokens;if(w?.rejected_prediction_tokens!=null)J.completionTokensDetails.rejectedPredictionTokens=w?.rejected_prediction_tokens;if(R?.cached_tokens!=null)J.promptTokensDetails.cachedTokens=R?.cached_tokens}let D=M.choices[0];if(D?.finish_reason!=null)$={unified:r(D.finish_reason),raw:D.finish_reason??void 0};if(D?.delta==null)return;let x=D.delta;if(x.reasoning_opaque){if(B!=null)throw new v({data:x,message:"Multiple reasoning_opaque values received in a single response. Only one thinking part per response is supported."});B=x.reasoning_opaque}let z=x.reasoning_text;if(z){if(!X)V.enqueue({type:"reasoning-start",id:"reasoning-0"}),X=!0;V.enqueue({type:"reasoning-delta",id:"reasoning-0",delta:z})}if(x.content){if(X&&!K)V.enqueue({type:"reasoning-end",id:"reasoning-0",providerMetadata:B?{copilot:{reasoningOpaque:B}}:void 0}),X=!1;if(!K)V.enqueue({type:"text-start",id:"txt-0",providerMetadata:B?{copilot:{reasoningOpaque:B}}:void 0}),K=!0;V.enqueue({type:"text-delta",id:"txt-0",delta:x.content})}if(x.tool_calls!=null){if(X)V.enqueue({type:"reasoning-end",id:"reasoning-0",providerMetadata:B?{copilot:{reasoningOpaque:B}}:void 0}),X=!1;for(let P of x.tool_calls){let b=P.index;if(Y[b]==null){if(P.id==null)throw new v({data:P,message:"Expected 'id' to be a string."});if(P.function?.name==null)throw new v({data:P,message:"Expected 'function.name' to be a string."});V.enqueue({type:"tool-input-start",id:P.id,toolName:P.function.name}),Y[b]={id:P.id,type:"function",function:{name:P.function.name,arguments:P.function.arguments??""},hasFinished:!1};let R=Y[b];if(R.function?.name!=null&&R.function?.arguments!=null){if(R.function.arguments.length>0)V.enqueue({type:"tool-input-delta",id:R.id,delta:R.function.arguments});if(l(R.function.arguments))U(R,V)}continue}let f=Y[b];if(f.hasFinished)continue;if(P.function?.arguments!=null)f.function.arguments+=P.function?.arguments??"";if(V.enqueue({type:"tool-input-delta",id:f.id,delta:P.function.arguments??""}),f.function?.name!=null&&f.function?.arguments!=null&&l(f.function.arguments))U(f,V)}}},flush:(M)=>{if(X)M.enqueue({type:"reasoning-end",id:"reasoning-0",providerMetadata:B?{copilot:{reasoningOpaque:B}}:void 0});if(K)M.enqueue({type:"text-end",id:"txt-0"});for(let H of Y.filter((D)=>!D.hasFinished))M.enqueue({type:"tool-input-end",id:H.id}),M.enqueue({type:"tool-call",toolCallId:H.id??A(),toolName:H.function.name,input:H.function.arguments});let V={[_]:{},...B?{copilot:{reasoningOpaque:B}}:{},...q?.buildMetadata()};if(J.completionTokensDetails.acceptedPredictionTokens!=null)V[_].acceptedPredictionTokens=J.completionTokensDetails.acceptedPredictionTokens;if(J.completionTokensDetails.rejectedPredictionTokens!=null)V[_].rejectedPredictionTokens=J.completionTokensDetails.rejectedPredictionTokens;M.enqueue({type:"finish",finishReason:$,usage:{inputTokens:{total:J.promptTokens,noCache:J.promptTokens!=null&&J.promptTokensDetails.cachedTokens!=null?J.promptTokens-J.promptTokensDetails.cachedTokens:void 0,cacheRead:J.promptTokensDetails.cachedTokens,cacheWrite:void 0},outputTokens:{total:J.completionTokens,text:void 0,reasoning:J.completionTokensDetails.reasoningTokens},raw:{prompt_tokens:J.promptTokens??null,completion_tokens:J.completionTokens??null,total_tokens:J.totalTokens??null}},providerMetadata:V})}})),request:{body:N},response:{headers:L}}}}var G3=j.object({prompt_tokens:j.number().nullish(),completion_tokens:j.number().nullish(),total_tokens:j.number().nullish(),prompt_tokens_details:j.object({cached_tokens:j.number().nullish()}).nullish(),completion_tokens_details:j.object({reasoning_tokens:j.number().nullish(),accepted_prediction_tokens:j.number().nullish(),rejected_prediction_tokens:j.number().nullish()}).nullish()}).nullish(),m3=j.object({id:j.string().nullish(),created:j.number().nullish(),model:j.string().nullish(),choices:j.array(j.object({message:j.object({role:j.literal("assistant").nullish(),content:j.string().nullish(),reasoning_text:j.string().nullish(),reasoning_opaque:j.string().nullish(),tool_calls:j.array(j.object({id:j.string().nullish(),function:j.object({name:j.string(),arguments:j.string()})})).nullish()}),finish_reason:j.string().nullish()})),usage:G3}),h3=(Q)=>j.union([j.object({id:j.string().nullish(),created:j.number().nullish(),model:j.string().nullish(),choices:j.array(j.object({delta:j.object({role:j.enum(["assistant"]).nullish(),content:j.string().nullish(),reasoning_text:j.string().nullish(),reasoning_opaque:j.string().nullish(),tool_calls:j.array(j.object({index:j.number(),id:j.string().nullish(),function:j.object({name:j.string().nullish(),arguments:j.string().nullish()})})).nullish()}).nullish(),finish_reason:j.string().nullish()})),usage:G3}),Q]);var g3=t,e=c({errorSchema:g3,errorToMessage:(Q)=>Q.error.message});var o=j.object({action:j.object({type:j.literal("exec"),command:j.array(j.string()),timeoutMs:j.number().optional(),user:j.string().optional(),workingDirectory:j.string().optional(),env:j.record(j.string(),j.string()).optional()})}),j3=j.object({output:j.string()}),o0=S({id:"openai.local_shell",inputSchema:o,outputSchema:j3});function J3(Q,G){if(!G)return!1;return G.some((W)=>Q.startsWith(W))}async function K3({prompt:Q,systemMessageMode:G,fileIdPrefixes:W,store:N,hasLocalShellTool:q=!1}){let L=[],Z=[],Y=new Set;for(let{role:$,content:J}of Q)switch($){case"system":{switch(G){case"system":{L.push({role:"system",content:J});break}case"developer":{L.push({role:"developer",content:J});break}case"remove":{Z.push({type:"other",message:"system messages are removed for this model"});break}default:throw Error(`Unsupported system message mode: ${G}`)}break}case"user":{L.push({role:"user",content:J.map((E,_)=>{switch(E.type){case"text":return{type:"input_text",text:E.text};case"file":if(E.mediaType.startsWith("image/")){let X=E.mediaType==="image/*"?"image/jpeg":E.mediaType;return{type:"input_image",...E.data instanceof URL?{image_url:E.data.toString()}:typeof E.data==="string"&&J3(E.data,W)?{file_id:E.data}:{image_url:`data:${X};base64,${m(E.data)}`},detail:E.providerOptions?.openai?.imageDetail}}else if(E.mediaType==="application/pdf"){if(E.data instanceof URL)return{type:"input_file",file_url:E.data.toString()};return{type:"input_file",...typeof E.data==="string"&&J3(E.data,W)?{file_id:E.data}:{filename:E.filename??`part-${_}.pdf`,file_data:`data:application/pdf;base64,${m(E.data)}`}}}else throw new y({functionality:`file part media type ${E.mediaType}`})}})});break}case"assistant":{let E={},_={};for(let X of J)switch(X.type){case"text":{L.push({role:"assistant",content:[{type:"output_text",text:X.text}],id:X.providerOptions?.openai?.itemId??void 0});break}case"tool-call":{if(_[X.toolCallId]=X,X.providerExecuted)break;if(q&&X.toolName==="local_shell"){let K=o.parse(X.input);L.push({type:"local_shell_call",call_id:X.toolCallId,id:X.providerOptions?.openai?.itemId??void 0,action:{type:"exec",command:K.action.command,timeout_ms:K.action.timeoutMs,user:K.action.user,working_directory:K.action.workingDirectory,env:K.action.env}});break}L.push({type:"function_call",call_id:X.toolCallId,name:X.toolName,arguments:JSON.stringify(X.input),id:X.providerOptions?.openai?.itemId??void 0});break}case"tool-result":{if(N)L.push({type:"item_reference",id:X.toolCallId});else Z.push({type:"other",message:`Results for OpenAI tool ${X.toolName} are not sent to the API when store is false`});break}case"reasoning":{let K=await k({provider:"copilot",providerOptions:X.providerOptions,schema:d3}),B=K?.itemId;if(B!=null){let U=E[B];if(N){if(U===void 0)L.push({type:"item_reference",id:B}),E[B]={type:"reasoning",id:B,summary:[]}}else{let M=[];if(X.text.length>0)M.push({type:"summary_text",text:X.text});else if(U!==void 0)Z.push({type:"other",message:`Cannot append empty reasoning part to existing reasoning sequence. Skipping reasoning part: ${JSON.stringify(X)}.`});if(U===void 0)E[B]={type:"reasoning",id:B,encrypted_content:K?.reasoningEncryptedContent,summary:M},L.push(E[B]);else U.summary.push(...M)}}else Z.push({type:"other",message:`Non-OpenAI reasoning parts are not supported. Skipping reasoning part: ${JSON.stringify(X)}.`});break}}break}case"tool":{for(let E of J){if(E.type==="tool-approval-response"){if(Y.has(E.approvalId))continue;if(Y.add(E.approvalId),N)L.push({type:"item_reference",id:E.approvalId});L.push({type:"mcp_approval_response",approval_request_id:E.approvalId,approve:E.approved});continue}let _=E.output;if(_.type==="execution-denied"){if(_.providerOptions?.openai?.approvalId)continue}if(q&&E.toolName==="local_shell"&&_.type==="json"){L.push({type:"local_shell_call_output",call_id:E.toolCallId,output:j3.parse(_.value).output});break}L.push({type:"function_call_output",call_id:E.toolCallId,output:h(_)})}break}default:throw Error(`Unsupported role: ${$}`)}return{input:L,warnings:Z}}var d3=j.object({itemId:j.string().nullish(),reasoningEncryptedContent:j.string().nullish()});function V3({finishReason:Q,hasFunctionCall:G}){switch(Q){case void 0:case null:return G?"tool-calls":"stop";case"max_output_tokens":return"length";case"content_filter":return"content-filter";default:return G?"tool-calls":"other"}}var v3=j.object({code:j.string().nullish(),containerId:j.string()}),c3=j.object({outputs:j.array(j.discriminatedUnion("type",[j.object({type:j.literal("logs"),logs:j.string()}),j.object({type:j.literal("image"),url:j.string()})])).nullish()}),H3=j.object({container:j.union([j.string(),j.object({fileIds:j.array(j.string()).optional()})]).optional()}),Kj=S({id:"openai.code_interpreter",inputSchema:v3,outputSchema:c3});var B3=j.object({key:j.string(),type:j.enum(["eq","ne","gt","gte","lt","lte"]),value:j.union([j.string(),j.number(),j.boolean()])}),L3=j.object({type:j.enum(["and","or"]),filters:j.array(j.union([B3,j.lazy(()=>L3)]))}),U3=j.object({vectorStoreIds:j.array(j.string()),maxNumResults:j.number().optional(),ranking:j.object({ranker:j.string().optional(),scoreThreshold:j.number().optional()}).optional(),filters:j.union([B3,L3]).optional()}),u3=j.object({queries:j.array(j.string()),results:j.array(j.object({attributes:j.record(j.string(),j.unknown()),fileId:j.string(),filename:j.string(),score:j.number(),text:j.string()})).nullable()}),Uj=S({id:"openai.file_search",inputSchema:j.object({}),outputSchema:u3});var I=j.discriminatedUnion("type",[j.object({type:j.literal("search"),query:j.string().nullish()}),j.object({type:j.literal("open_page"),url:j.string()}),j.object({type:j.literal("find"),url:j.string(),pattern:j.string()})]),p=j.object({type:j.literal("approximate"),country:j.string().optional(),city:j.string().optional(),region:j.string().optional(),timezone:j.string().optional()});var N3=j.object({filters:j.object({allowedDomains:j.array(j.string()).optional()}).optional(),searchContextSize:j.enum(["low","medium","high"]).optional(),userLocation:p.optional()}),Pj=s({id:"openai.web_search",inputSchema:j.object({action:I.nullish()})});var D3=j.object({searchContextSize:j.enum(["low","medium","high"]).optional(),userLocation:p.optional()}),Aj=s({id:"openai.web_search_preview",inputSchema:j.object({action:I.nullish()})});var W3=j.object({background:j.enum(["auto","opaque","transparent"]).optional(),inputFidelity:j.enum(["low","high"]).optional(),inputImageMask:j.object({fileId:j.string().optional(),imageUrl:j.string().optional()}).optional(),model:j.string().optional(),moderation:j.enum(["auto"]).optional(),outputCompression:j.number().int().min(0).max(100).optional(),outputFormat:j.enum(["png","jpeg","webp"]).optional(),partialImages:j.number().int().min(0).max(3).optional(),quality:j.enum(["auto","low","medium","high"]).optional(),size:j.enum(["1024x1024","1024x1536","1536x1024","auto"]).optional()}).strict(),i3=j.object({result:j.string()}),Sj=S({id:"openai.image_generation",inputSchema:j.object({}),outputSchema:i3});function _3({tools:Q,toolChoice:G,strictJsonSchema:W}){Q=Q?.length?Q:void 0;let N=[];if(Q==null)return{tools:void 0,toolChoice:void 0,toolWarnings:N};let q=[];for(let Z of Q)switch(Z.type){case"function":q.push({type:"function",name:Z.name,description:Z.description,parameters:Z.inputSchema,strict:W});break;case"provider":{switch(Z.id){case"openai.file_search":{let Y=U3.parse(Z.args);q.push({type:"file_search",vector_store_ids:Y.vectorStoreIds,max_num_results:Y.maxNumResults,ranking_options:Y.ranking?{ranker:Y.ranking.ranker,score_threshold:Y.ranking.scoreThreshold}:void 0,filters:Y.filters});break}case"openai.local_shell":{q.push({type:"local_shell"});break}case"openai.web_search_preview":{let Y=D3.parse(Z.args);q.push({type:"web_search_preview",search_context_size:Y.searchContextSize,user_location:Y.userLocation});break}case"openai.web_search":{let Y=N3.parse(Z.args);q.push({type:"web_search",filters:Y.filters!=null?{allowed_domains:Y.filters.allowedDomains}:void 0,search_context_size:Y.searchContextSize,user_location:Y.userLocation});break}case"openai.code_interpreter":{let Y=H3.parse(Z.args);q.push({type:"code_interpreter",container:Y.container==null?{type:"auto",file_ids:void 0}:typeof Y.container==="string"?Y.container:{type:"auto",file_ids:Y.container.fileIds}});break}case"openai.image_generation":{let Y=W3.parse(Z.args);q.push({type:"image_generation",background:Y.background,input_fidelity:Y.inputFidelity,input_image_mask:Y.inputImageMask?{file_id:Y.inputImageMask.fileId,image_url:Y.inputImageMask.imageUrl}:void 0,model:Y.model,moderation:Y.moderation,partial_images:Y.partialImages,quality:Y.quality,output_compression:Y.outputCompression,output_format:Y.outputFormat,size:Y.size});break}}break}default:N.push({type:"unsupported",feature:"tool type"});break}if(G==null)return{tools:q,toolChoice:void 0,toolWarnings:N};let L=G.type;switch(L){case"auto":case"none":case"required":return{tools:q,toolChoice:L,toolWarnings:N};case"tool":return{tools:q,toolChoice:G.toolName==="code_interpreter"||G.toolName==="file_search"||G.toolName==="image_generation"||G.toolName==="web_search_preview"||G.toolName==="web_search"?{type:G.toolName}:{type:"function",name:G.toolName},toolWarnings:N};default:throw new y({functionality:`tool choice type: ${L}`})}}var M3=j.object({type:j.literal("web_search_call"),id:j.string(),status:j.string(),action:I.nullish()}),P3=j.object({type:j.literal("file_search_call"),id:j.string(),queries:j.array(j.string()),results:j.array(j.object({attributes:j.record(j.string(),j.unknown()),file_id:j.string(),filename:j.string(),score:j.number(),text:j.string()})).nullish()}),Q3=j.object({type:j.literal("code_interpreter_call"),id:j.string(),code:j.string().nullable(),container_id:j.string(),outputs:j.array(j.discriminatedUnion("type",[j.object({type:j.literal("logs"),logs:j.string()}),j.object({type:j.literal("image"),url:j.string()})])).nullable()}),f3=j.object({type:j.literal("local_shell_call"),id:j.string(),call_id:j.string(),action:j.object({type:j.literal("exec"),command:j.array(j.string()),timeout_ms:j.number().optional(),user:j.string().optional(),working_directory:j.string().optional(),env:j.record(j.string(),j.string()).optional()})}),x3=j.object({type:j.literal("image_generation_call"),id:j.string(),result:j.string()}),R3=j.object({type:j.literal("file_citation"),file_id:j.string(),filename:j.string().nullish(),index:j.number().nullish(),start_index:j.number().nullish(),end_index:j.number().nullish(),quote:j.string().nullish()}),b3=j.object({type:j.literal("message"),id:j.string()}),A3=j.object({type:j.literal("reasoning"),id:j.string(),encrypted_content:j.string().nullish()}),w3=j.object({type:j.literal("function_call"),id:j.string(),call_id:j.string(),name:j.string(),arguments:j.string()}),F3=20,y3=j.array(j.object({token:j.string(),logprob:j.number(),top_logprobs:j.array(j.object({token:j.string(),logprob:j.number()}))}));class X3{specificationVersion="v3";modelId;config;constructor(Q,G){this.modelId=Q,this.config=G}supportedUrls={"image/*":[/^https?:\/\/.*$/],"application/pdf":[/^https?:\/\/.*$/]};get provider(){return this.config.provider}async getArgs({maxOutputTokens:Q,temperature:G,stopSequences:W,topP:N,topK:q,presencePenalty:L,frequencyPenalty:Z,seed:Y,prompt:$,providerOptions:J,tools:E,toolChoice:_,responseFormat:X}){let K=[],B=_0(this.modelId);if(q!=null)K.push({type:"unsupported",feature:"topK"});if(Y!=null)K.push({type:"unsupported",feature:"seed"});if(L!=null)K.push({type:"unsupported",feature:"presencePenalty"});if(Z!=null)K.push({type:"unsupported",feature:"frequencyPenalty"});if(W!=null)K.push({type:"unsupported",feature:"stopSequences"});let U=await k({provider:"copilot",providerOptions:J,schema:q0}),{input:M,warnings:V}=await K3({prompt:$,systemMessageMode:B.systemMessageMode,fileIdPrefixes:this.config.fileIdPrefixes,store:U?.store??!0,hasLocalShellTool:z("openai.local_shell")});K.push(...V);let H=U?.strictJsonSchema??!1,D=U?.include;function x(F){D=D!=null?[...D,F]:[F]}function z(F){return E?.find((Y3)=>Y3.type==="provider"&&Y3.id===F)!=null}let P=typeof U?.logprobs==="number"?U?.logprobs:U?.logprobs===!0?F3:void 0;if(P)x("message.output_text.logprobs");let b=E?.find((F)=>F.type==="provider"&&(F.id==="openai.web_search"||F.id==="openai.web_search_preview"))?.name;if(b)x("web_search_call.action.sources");if(z("openai.code_interpreter"))x("code_interpreter_call.outputs");let f={model:this.modelId,input:M,temperature:G,top_p:N,max_output_tokens:Q,...(X?.type==="json"||U?.textVerbosity)&&{text:{...X?.type==="json"&&{format:X.schema!=null?{type:"json_schema",strict:H,name:X.name??"response",description:X.description,schema:X.schema}:{type:"json_object"}},...U?.textVerbosity&&{verbosity:U.textVerbosity}}},max_tool_calls:U?.maxToolCalls,metadata:U?.metadata,parallel_tool_calls:U?.parallelToolCalls,previous_response_id:U?.previousResponseId,store:U?.store,user:U?.user,instructions:U?.instructions,service_tier:U?.serviceTier,include:D,prompt_cache_key:U?.promptCacheKey,safety_identifier:U?.safetyIdentifier,top_logprobs:P,...B.isReasoningModel&&(U?.reasoningEffort!=null||U?.reasoningSummary!=null)&&{reasoning:{...U?.reasoningEffort!=null&&{effort:U.reasoningEffort},...U?.reasoningSummary!=null&&{summary:U.reasoningSummary}}},...B.requiredAutoTruncation&&{truncation:"auto"}};if(B.isReasoningModel){if(f.temperature!=null)f.temperature=void 0,K.push({type:"unsupported",feature:"temperature",details:"temperature is not supported for reasoning models"});if(f.top_p!=null)f.top_p=void 0,K.push({type:"unsupported",feature:"topP",details:"topP is not supported for reasoning models"})}else{if(U?.reasoningEffort!=null)K.push({type:"unsupported",feature:"reasoningEffort",details:"reasoningEffort is not supported for non-reasoning models"});if(U?.reasoningSummary!=null)K.push({type:"unsupported",feature:"reasoningSummary",details:"reasoningSummary is not supported for non-reasoning models"})}if(U?.serviceTier==="flex"&&!B.supportsFlexProcessing)K.push({type:"unsupported",feature:"serviceTier",details:"flex processing is only available for o3, o4-mini, and gpt-5 models"}),f.service_tier=void 0;if(U?.serviceTier==="priority"&&!B.supportsPriorityProcessing)K.push({type:"unsupported",feature:"serviceTier",details:"priority processing is only available for supported models (gpt-4, gpt-5, gpt-5-mini, o3, o4-mini) and requires Enterprise access. gpt-5-nano is not supported"}),f.service_tier=void 0;let{tools:R,toolChoice:w,toolWarnings:C3}=_3({tools:E,toolChoice:_,strictJsonSchema:H});return{webSearchToolName:b,args:{...f,tools:R,tool_choice:w},warnings:[...K,...C3]}}async doGenerate(Q){let{args:G,warnings:W,webSearchToolName:N}=await this.getArgs(Q),q=this.config.url({path:"/responses",modelId:this.modelId}),{responseHeaders:L,value:Z,rawValue:Y}=await O({url:q,headers:T(this.config.headers(),Q.headers),body:G,failedResponseHandler:e,successfulResponseHandler:i(j.object({id:j.string(),created_at:j.number(),error:j.object({code:j.string(),message:j.string()}).nullish(),model:j.string(),output:j.array(j.discriminatedUnion("type",[j.object({type:j.literal("message"),role:j.literal("assistant"),id:j.string(),content:j.array(j.object({type:j.literal("output_text"),text:j.string(),logprobs:y3.nullish(),annotations:j.array(j.discriminatedUnion("type",[j.object({type:j.literal("url_citation"),start_index:j.number(),end_index:j.number(),url:j.string(),title:j.string()}),R3,j.object({type:j.literal("container_file_citation")})]))}))}),M3,P3,Q3,x3,f3,j.object({type:j.literal("function_call"),call_id:j.string(),name:j.string(),arguments:j.string(),id:j.string()}),j.object({type:j.literal("computer_call"),id:j.string(),status:j.string().optional()}),j.object({type:j.literal("reasoning"),id:j.string(),encrypted_content:j.string().nullish(),summary:j.array(j.object({type:j.literal("summary_text"),text:j.string()}))})])),service_tier:j.string().nullish(),incomplete_details:j.object({reason:j.string()}).nullish(),usage:S3})),abortSignal:Q.abortSignal,fetch:this.config.fetch});if(Z.error)throw new q3({message:Z.error.message,url:q,requestBodyValues:G,statusCode:400,responseHeaders:L,responseBody:Y,isRetryable:!1});let $=[],J=[],E=!1;for(let X of Z.output)switch(X.type){case"reasoning":{if(X.summary.length===0)X.summary.push({type:"summary_text",text:""});for(let K of X.summary)$.push({type:"reasoning",text:K.text,providerMetadata:{openai:{itemId:X.id,reasoningEncryptedContent:X.encrypted_content??null}}});break}case"image_generation_call":{$.push({type:"tool-call",toolCallId:X.id,toolName:"image_generation",input:"{}",providerExecuted:!0}),$.push({type:"tool-result",toolCallId:X.id,toolName:"image_generation",result:{result:X.result}});break}case"local_shell_call":{$.push({type:"tool-call",toolCallId:X.call_id,toolName:"local_shell",input:JSON.stringify({action:X.action}),providerMetadata:{openai:{itemId:X.id}}});break}case"message":{for(let K of X.content){if(Q.providerOptions?.openai?.logprobs&&K.logprobs)J.push(K.logprobs);$.push({type:"text",text:K.text,providerMetadata:{openai:{itemId:X.id}}});for(let B of K.annotations)if(B.type==="url_citation")$.push({type:"source",sourceType:"url",id:this.config.generateId?.()??A(),url:B.url,title:B.title});else if(B.type==="file_citation")$.push({type:"source",sourceType:"document",id:this.config.generateId?.()??A(),mediaType:"text/plain",title:B.quote??B.filename??"Document",filename:B.filename??B.file_id})}break}case"function_call":{E=!0,$.push({type:"tool-call",toolCallId:X.call_id,toolName:X.name,input:X.arguments,providerMetadata:{openai:{itemId:X.id}}});break}case"web_search_call":{$.push({type:"tool-call",toolCallId:X.id,toolName:N??"web_search",input:JSON.stringify({action:X.action}),providerExecuted:!0}),$.push({type:"tool-result",toolCallId:X.id,toolName:N??"web_search",result:{status:X.status}});break}case"computer_call":{$.push({type:"tool-call",toolCallId:X.id,toolName:"computer_use",input:"",providerExecuted:!0}),$.push({type:"tool-result",toolCallId:X.id,toolName:"computer_use",result:{type:"computer_use_tool_result",status:X.status||"completed"}});break}case"file_search_call":{$.push({type:"tool-call",toolCallId:X.id,toolName:"file_search",input:"{}",providerExecuted:!0}),$.push({type:"tool-result",toolCallId:X.id,toolName:"file_search",result:{queries:X.queries,results:X.results?.map((K)=>({attributes:K.attributes,fileId:K.file_id,filename:K.filename,score:K.score,text:K.text}))??null}});break}case"code_interpreter_call":{$.push({type:"tool-call",toolCallId:X.id,toolName:"code_interpreter",input:JSON.stringify({code:X.code,containerId:X.container_id}),providerExecuted:!0}),$.push({type:"tool-result",toolCallId:X.id,toolName:"code_interpreter",result:{outputs:X.outputs}});break}}let _={openai:{responseId:Z.id}};if(J.length>0)_.openai.logprobs=J;if(typeof Z.service_tier==="string")_.openai.serviceTier=Z.service_tier;return{content:$,finishReason:{unified:V3({finishReason:Z.incomplete_details?.reason,hasFunctionCall:E}),raw:Z.incomplete_details?.reason},usage:{inputTokens:{total:Z.usage.input_tokens,noCache:Z.usage.input_tokens_details?.cached_tokens!=null?Z.usage.input_tokens-Z.usage.input_tokens_details.cached_tokens:void 0,cacheRead:Z.usage.input_tokens_details?.cached_tokens??void 0,cacheWrite:void 0},outputTokens:{total:Z.usage.output_tokens,text:void 0,reasoning:Z.usage.output_tokens_details?.reasoning_tokens??void 0},raw:Z.usage},request:{body:G},response:{id:Z.id,timestamp:new Date(Z.created_at*1000),modelId:Z.model,headers:L,body:Y},providerMetadata:_,warnings:W}}async doStream(Q){let{args:G,warnings:W,webSearchToolName:N}=await this.getArgs(Q),{responseHeaders:q,value:L}=await O({url:this.config.url({path:"/responses",modelId:this.modelId}),headers:T(this.config.headers(),Q.headers),body:{...G,stream:!0},failedResponseHandler:e,successfulResponseHandler:u(Y0),abortSignal:Q.abortSignal,fetch:this.config.fetch}),Z=this,Y={unified:"other",raw:void 0},$={inputTokens:void 0,outputTokens:void 0,totalTokens:void 0,reasoningTokens:void 0,cachedInputTokens:void 0},J=[],E=null,_={},X=!1,K={},B=null,U=null,M;return{stream:L.pipeThrough(d({warnings:W,includeRawChunks:Q.includeRawChunks,onParseError:()=>{Y={unified:"error",raw:void 0}},transformValue:(V,H)=>{if(T3(V)){if(V.item.type==="function_call")_[V.output_index]={toolName:V.item.name,toolCallId:V.item.call_id},H.enqueue({type:"tool-input-start",id:V.item.call_id,toolName:V.item.name});else if(V.item.type==="web_search_call")_[V.output_index]={toolName:N??"web_search",toolCallId:V.item.id},H.enqueue({type:"tool-input-start",id:V.item.id,toolName:N??"web_search"});else if(V.item.type==="computer_call")_[V.output_index]={toolName:"computer_use",toolCallId:V.item.id},H.enqueue({type:"tool-input-start",id:V.item.id,toolName:"computer_use"});else if(V.item.type==="code_interpreter_call")_[V.output_index]={toolName:"code_interpreter",toolCallId:V.item.id,codeInterpreter:{containerId:V.item.container_id}},H.enqueue({type:"tool-input-start",id:V.item.id,toolName:"code_interpreter"}),H.enqueue({type:"tool-input-delta",id:V.item.id,delta:`{"containerId":"${V.item.container_id}","code":"`});else if(V.item.type==="file_search_call")H.enqueue({type:"tool-call",toolCallId:V.item.id,toolName:"file_search",input:"{}",providerExecuted:!0});else if(V.item.type==="image_generation_call")H.enqueue({type:"tool-call",toolCallId:V.item.id,toolName:"image_generation",input:"{}",providerExecuted:!0});else if(V.item.type==="message")U=V.item.id,H.enqueue({type:"text-start",id:V.item.id,providerMetadata:{openai:{itemId:V.item.id}}});else if(L0(V))K[V.output_index]={canonicalId:V.item.id,encryptedContent:V.item.encrypted_content,summaryParts:[0]},B=V.output_index,H.enqueue({type:"reasoning-start",id:`${V.item.id}:0`,providerMetadata:{openai:{itemId:V.item.id,reasoningEncryptedContent:V.item.encrypted_content??null}}})}else if(k3(V)){if(V.item.type==="function_call")_[V.output_index]=void 0,X=!0,H.enqueue({type:"tool-input-end",id:V.item.call_id}),H.enqueue({type:"tool-call",toolCallId:V.item.call_id,toolName:V.item.name,input:V.item.arguments,providerMetadata:{openai:{itemId:V.item.id}}});else if(V.item.type==="web_search_call")_[V.output_index]=void 0,H.enqueue({type:"tool-input-end",id:V.item.id}),H.enqueue({type:"tool-call",toolCallId:V.item.id,toolName:"web_search",input:JSON.stringify({action:V.item.action}),providerExecuted:!0}),H.enqueue({type:"tool-result",toolCallId:V.item.id,toolName:"web_search",result:{status:V.item.status}});else if(V.item.type==="computer_call")_[V.output_index]=void 0,H.enqueue({type:"tool-input-end",id:V.item.id}),H.enqueue({type:"tool-call",toolCallId:V.item.id,toolName:"computer_use",input:"",providerExecuted:!0}),H.enqueue({type:"tool-result",toolCallId:V.item.id,toolName:"computer_use",result:{type:"computer_use_tool_result",status:V.item.status||"completed"}});else if(V.item.type==="file_search_call")_[V.output_index]=void 0,H.enqueue({type:"tool-result",toolCallId:V.item.id,toolName:"file_search",result:{queries:V.item.queries,results:V.item.results?.map((D)=>({attributes:D.attributes,fileId:D.file_id,filename:D.filename,score:D.score,text:D.text}))??null}});else if(V.item.type==="code_interpreter_call")_[V.output_index]=void 0,H.enqueue({type:"tool-result",toolCallId:V.item.id,toolName:"code_interpreter",result:{outputs:V.item.outputs}});else if(V.item.type==="image_generation_call")H.enqueue({type:"tool-result",toolCallId:V.item.id,toolName:"image_generation",result:{result:V.item.result}});else if(V.item.type==="local_shell_call")_[V.output_index]=void 0,H.enqueue({type:"tool-call",toolCallId:V.item.call_id,toolName:"local_shell",input:JSON.stringify({action:{type:"exec",command:V.item.action.command,timeoutMs:V.item.action.timeout_ms,user:V.item.action.user,workingDirectory:V.item.action.working_directory,env:V.item.action.env}}),providerMetadata:{openai:{itemId:V.item.id}}});else if(V.item.type==="message"){if(U)H.enqueue({type:"text-end",id:U}),U=null}else if($0(V)){let D=K[V.output_index];if(D){for(let x of D.summaryParts)H.enqueue({type:"reasoning-end",id:`${D.canonicalId}:${x}`,providerMetadata:{openai:{itemId:D.canonicalId,reasoningEncryptedContent:V.item.encrypted_content??null}}});if(delete K[V.output_index],B===V.output_index)B=null}}}else if(J0(V)){let D=_[V.output_index];if(D!=null)H.enqueue({type:"tool-input-delta",id:D.toolCallId,delta:V.delta})}else if(K0(V))H.enqueue({type:"tool-result",toolCallId:V.item_id,toolName:"image_generation",result:{result:V.partial_image_b64}});else if(H0(V)){let D=_[V.output_index];if(D!=null)H.enqueue({type:"tool-input-delta",id:D.toolCallId,delta:JSON.stringify(V.delta).slice(1,-1)})}else if(B0(V)){let D=_[V.output_index];if(D!=null)H.enqueue({type:"tool-input-delta",id:D.toolCallId,delta:'"}'}),H.enqueue({type:"tool-input-end",id:D.toolCallId}),H.enqueue({type:"tool-call",toolCallId:D.toolCallId,toolName:"code_interpreter",input:JSON.stringify({code:V.code,containerId:D.codeInterpreter.containerId}),providerExecuted:!0})}else if(G0(V))E=V.response.id,H.enqueue({type:"response-metadata",id:V.response.id,timestamp:new Date(V.response.created_at*1000),modelId:V.response.model});else if(Z0(V)){if(!U)U=V.item_id,H.enqueue({type:"text-start",id:U,providerMetadata:{openai:{itemId:V.item_id}}});if(H.enqueue({type:"text-delta",id:U,delta:V.delta}),Q.providerOptions?.openai?.logprobs&&V.logprobs)J.push(V.logprobs)}else if(N0(V)){let D=B!==null?K[B]:null;if(D&&V.summary_index>0)D.summaryParts.push(V.summary_index),H.enqueue({type:"reasoning-start",id:`${D.canonicalId}:${V.summary_index}`,providerMetadata:{openai:{itemId:D.canonicalId,reasoningEncryptedContent:D.encryptedContent??null}}})}else if(D0(V)){let D=B!==null?K[B]:null;if(D)H.enqueue({type:"reasoning-delta",id:`${D.canonicalId}:${V.summary_index}`,delta:V.delta,providerMetadata:{openai:{itemId:D.canonicalId}}})}else if(E0(V)){if(Y={unified:V3({finishReason:V.response.incomplete_details?.reason,hasFunctionCall:X}),raw:V.response.incomplete_details?.reason??void 0},$.inputTokens=V.response.usage.input_tokens,$.outputTokens=V.response.usage.output_tokens,$.totalTokens=V.response.usage.input_tokens+V.response.usage.output_tokens,$.reasoningTokens=V.response.usage.output_tokens_details?.reasoning_tokens??void 0,$.cachedInputTokens=V.response.usage.input_tokens_details?.cached_tokens??void 0,typeof V.response.service_tier==="string")M=V.response.service_tier}else if(U0(V)){if(V.annotation.type==="url_citation")H.enqueue({type:"source",sourceType:"url",id:Z.config.generateId?.()??A(),url:V.annotation.url,title:V.annotation.title});else if(V.annotation.type==="file_citation")H.enqueue({type:"source",sourceType:"document",id:Z.config.generateId?.()??A(),mediaType:"text/plain",title:V.annotation.quote??V.annotation.filename??"Document",filename:V.annotation.filename??V.annotation.file_id})}else if(W0(V))H.enqueue({type:"error",error:V})},flush:(V)=>{if(U)V.enqueue({type:"text-end",id:U}),U=null;let H={openai:{responseId:E}};if(J.length>0)H.openai.logprobs=J;if(M!==void 0)H.openai.serviceTier=M;V.enqueue({type:"finish",finishReason:Y,usage:{inputTokens:{total:$.inputTokens,noCache:$.inputTokens!=null&&$.cachedInputTokens!=null?$.inputTokens-$.cachedInputTokens:void 0,cacheRead:$.cachedInputTokens,cacheWrite:void 0},outputTokens:{total:$.outputTokens,text:void 0,reasoning:$.reasoningTokens},raw:{input_tokens:$.inputTokens,output_tokens:$.outputTokens,total_tokens:$.totalTokens}},providerMetadata:H})}})),request:{body:G},response:{headers:q}}}}var S3=j.object({input_tokens:j.number(),input_tokens_details:j.object({cached_tokens:j.number().nullish()}).nullish(),output_tokens:j.number(),output_tokens_details:j.object({reasoning_tokens:j.number().nullish()}).nullish()}),p3=j.object({type:j.literal("response.output_text.delta"),item_id:j.string(),delta:j.string(),logprobs:y3.nullish()}),s3=j.object({type:j.literal("error"),code:j.string(),message:j.string(),param:j.string().nullish(),sequence_number:j.number()}),n3=j.object({type:j.enum(["response.completed","response.incomplete"]),response:j.object({incomplete_details:j.object({reason:j.string()}).nullish(),usage:S3,service_tier:j.string().nullish()})}),r3=j.object({type:j.literal("response.created"),response:j.object({id:j.string(),created_at:j.number(),model:j.string(),service_tier:j.string().nullish()})}),t3=j.object({type:j.literal("response.output_item.added"),output_index:j.number(),item:j.discriminatedUnion("type",[b3,A3,w3,j.object({type:j.literal("web_search_call"),id:j.string(),status:j.string(),action:j.object({type:j.literal("search"),query:j.string().optional()}).nullish()}),j.object({type:j.literal("computer_call"),id:j.string(),status:j.string()}),j.object({type:j.literal("file_search_call"),id:j.string()}),j.object({type:j.literal("image_generation_call"),id:j.string()}),Q3.extend({status:j.string()})])}),l3=j.object({type:j.literal("response.output_item.done"),output_index:j.number(),item:j.discriminatedUnion("type",[b3,A3,w3.extend({status:j.literal("completed")}),Q3,x3,M3,P3,f3,j.object({type:j.literal("computer_call"),id:j.string(),status:j.literal("completed")})])}),a3=j.object({type:j.literal("response.function_call_arguments.delta"),item_id:j.string(),output_index:j.number(),delta:j.string()}),e3=j.object({type:j.literal("response.image_generation_call.partial_image"),item_id:j.string(),output_index:j.number(),partial_image_b64:j.string()}),o3=j.object({type:j.literal("response.code_interpreter_call_code.delta"),item_id:j.string(),output_index:j.number(),delta:j.string()}),j0=j.object({type:j.literal("response.code_interpreter_call_code.done"),item_id:j.string(),output_index:j.number(),code:j.string()}),V0=j.object({type:j.literal("response.output_text.annotation.added"),annotation:j.discriminatedUnion("type",[j.object({type:j.literal("url_citation"),url:j.string(),title:j.string()}),R3])}),Q0=j.object({type:j.literal("response.reasoning_summary_part.added"),item_id:j.string(),summary_index:j.number()}),X0=j.object({type:j.literal("response.reasoning_summary_text.delta"),item_id:j.string(),summary_index:j.number(),delta:j.string()}),Y0=j.union([p3,n3,r3,t3,l3,a3,e3,o3,j0,V0,Q0,X0,s3,j.object({type:j.string()}).loose()]);function Z0(Q){return Q.type==="response.output_text.delta"}function k3(Q){return Q.type==="response.output_item.done"}function $0(Q){return k3(Q)&&Q.item.type==="reasoning"}function E0(Q){return Q.type==="response.completed"||Q.type==="response.incomplete"}function G0(Q){return Q.type==="response.created"}function J0(Q){return Q.type==="response.function_call_arguments.delta"}function K0(Q){return Q.type==="response.image_generation_call.partial_image"}function H0(Q){return Q.type==="response.code_interpreter_call_code.delta"}function B0(Q){return Q.type==="response.code_interpreter_call_code.done"}function T3(Q){return Q.type==="response.output_item.added"}function L0(Q){return T3(Q)&&Q.item.type==="reasoning"}function U0(Q){return Q.type==="response.output_text.annotation.added"}function N0(Q){return Q.type==="response.reasoning_summary_part.added"}function D0(Q){return Q.type==="response.reasoning_summary_text.delta"}function W0(Q){return Q.type==="error"}function _0(Q){let G=Q.startsWith("o3")||Q.startsWith("o4-mini")||Q.startsWith("gpt-5")&&!Q.startsWith("gpt-5-chat"),W=Q.startsWith("gpt-4")||Q.startsWith("gpt-5-mini")||Q.startsWith("gpt-5")&&!Q.startsWith("gpt-5-nano")&&!Q.startsWith("gpt-5-chat")||Q.startsWith("o3")||Q.startsWith("o4-mini"),N={requiredAutoTruncation:!1,systemMessageMode:"system",supportsFlexProcessing:G,supportsPriorityProcessing:W};if(Q.startsWith("gpt-5-chat"))return{...N,isReasoningModel:!1};if(Q.startsWith("o")||Q.startsWith("gpt-5")||Q.startsWith("codex-")||Q.startsWith("computer-use")){if(Q.startsWith("o1-mini")||Q.startsWith("o1-preview"))return{...N,isReasoningModel:!0,systemMessageMode:"remove"};return{...N,isReasoningModel:!0,systemMessageMode:"developer"}}return{...N,isReasoningModel:!1}}var q0=j.object({include:j.array(j.enum(["reasoning.encrypted_content","file_search_call.results","message.output_text.logprobs"])).nullish(),instructions:j.string().nullish(),logprobs:j.union([j.boolean(),j.number().min(1).max(F3)]).optional(),maxToolCalls:j.number().nullish(),metadata:j.any().nullish(),parallelToolCalls:j.boolean().nullish(),previousResponseId:j.string().nullish(),promptCacheKey:j.string().nullish(),reasoningEffort:j.string().nullish(),reasoningSummary:j.string().nullish(),safetyIdentifier:j.string().nullish(),serviceTier:j.enum(["auto","flex","priority"]).nullish(),store:j.boolean().nullish(),strictJsonSchema:j.boolean().nullish(),textVerbosity:j.enum(["low","medium","high"]).nullish(),user:j.string().nullish()});var M0="0.1.0";function z3(Q={}){let G=I3(Q.baseURL??"https://api.openai.com/v1");if(!G)throw Error("baseURL is required");let W={...Q.apiKey&&{Authorization:`Bearer ${Q.apiKey}`},...Q.headers},N=()=>O3(W,`ai-sdk/openai-compatible/${M0}`),q=($)=>{return new a($,{provider:`${Q.name??"openai-compatible"}.chat`,headers:N,url:({path:J})=>`${G}${J}`,fetch:Q.fetch})},L=($)=>{return new X3($,{provider:`${Q.name??"openai-compatible"}.responses`,headers:N,url:({path:J})=>`${G}${J}`,fetch:Q.fetch})},Z=($)=>q($),Y=function($){return q($)};return Y.languageModel=Z,Y.chat=q,Y.responses=L,Y}var P0=z3();export{P0 as openaiCompatible,z3 as createOpenaiCompatible};
2
+ import{Ao as m,Jo as A,Oo as O3,cp as l,ep as k,fp as O,jp as s,kp as S,mp as c,np as u,op as i,sp as I3,to as T}from"./chunk-mkyrg7gt.js";import{Ap as v,Hp as y,vp as q3}from"./chunk-7v4fzkbb.js";import"./chunk-cqtkxwd8.js";import"./chunk-pk0tytcm.js";import{ut as j}from"./chunk-ym4ydwrz.js";import"./chunk-vmgknvxs.js";import"./chunk-0rmmg3g4.js";function h(Q){switch(Q.type){case"text":case"error-text":return Q.value;case"execution-denied":return Q.reason??"Tool execution denied.";case"content":case"json":case"error-json":return JSON.stringify(Q.value)}}function C(Q){return Q?.providerOptions?.copilot??{}}function Z3(Q){let G=[];for(let{role:W,content:N,...q}of Q){let L=C({...q});switch(W){case"system":{G.push({role:"system",content:N,...L});break}case"user":{if(N.length===1&&N[0].type==="text"){G.push({role:"user",content:N[0].text,...C(N[0])});break}G.push({role:"user",content:N.map((Z)=>{let Y=C(Z);switch(Z.type){case"text":return{type:"text",text:Z.text,...Y};case"file":if(Z.mediaType.startsWith("image/")){let $=Z.mediaType==="image/*"?"image/jpeg":Z.mediaType;return{type:"image_url",image_url:{url:Z.data instanceof URL?Z.data.toString():`data:${$};base64,${m(Z.data)}`},...Y}}else throw new y({functionality:`file part media type ${Z.mediaType}`})}}),...L});break}case"assistant":{let Z="",Y,$,J=[];for(let E of N){let _=C(E),X=E.providerOptions?.copilot?.reasoningOpaque;if(X&&!$)$=X;switch(E.type){case"text":{Z+=E.text;break}case"reasoning":{if(E.text)Y=E.text;break}case"tool-call":{J.push({id:E.toolCallId,type:"function",function:{name:E.toolName,arguments:JSON.stringify(E.input)},..._});break}}}G.push({role:"assistant",content:Z||null,tool_calls:J.length>0?J:void 0,reasoning_text:$?Y:void 0,reasoning_opaque:$,...L});break}case"tool":{for(let Z of N){if(Z.type==="tool-approval-response")continue;let Y=Z.output,$=C(Z);G.push({role:"tool",tool_call_id:Z.toolCallId,content:h(Y),...$})}break}default:throw Error(`Unsupported role: ${W}`)}}return G}function n({id:Q,model:G,created:W}){return{id:Q??void 0,modelId:G??void 0,timestamp:W!=null?new Date(W*1000):void 0}}function r(Q){switch(Q){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"other"}}var g=j.object({user:j.string().optional(),reasoningEffort:j.string().optional(),textVerbosity:j.string().optional(),thinking_budget:j.number().optional()});var t=j.object({error:j.object({message:j.string(),type:j.string().nullish(),param:j.any().nullish(),code:j.union([j.string(),j.number()]).nullish()})}),$3={errorSchema:t,errorToMessage:(Q)=>Q.error.message};function d(Q){return new TransformStream({start(G){G.enqueue({type:"stream-start",warnings:Q.warnings})},transform(G,W){if(Q.includeRawChunks)W.enqueue({type:"raw",rawValue:G.rawValue});if(!G.success){Q.onParseError(),W.enqueue({type:"error",error:G.error});return}Q.transformValue(G.value,W,G.rawValue)},flush:Q.flush})}function E3({tools:Q,toolChoice:G}){Q=Q?.length?Q:void 0;let W=[];if(Q==null)return{tools:void 0,toolChoice:void 0,toolWarnings:W};let N=[];for(let L of Q)if(L.type==="provider")W.push({type:"unsupported",feature:`tool type: ${L.type}`});else N.push({type:"function",function:{name:L.name,description:L.description,parameters:L.inputSchema}});if(G==null)return{tools:N,toolChoice:void 0,toolWarnings:W};let q=G.type;switch(q){case"auto":case"none":case"required":return{tools:N,toolChoice:q,toolWarnings:W};case"tool":return{tools:N,toolChoice:{type:"function",function:{name:G.toolName}},toolWarnings:W};default:throw new y({functionality:`tool choice type: ${q}`})}}class a{specificationVersion="v3";supportsStructuredOutputs;modelId;config;failedResponseHandler;chunkSchema;constructor(Q,G){this.modelId=Q,this.config=G;let W=G.errorStructure??$3;this.chunkSchema=h3(W.errorSchema),this.failedResponseHandler=c(W),this.supportsStructuredOutputs=G.supportsStructuredOutputs??!1}get provider(){return this.config.provider}get providerOptionsName(){return this.config.provider.split(".")[0].trim()}get supportedUrls(){return this.config.supportedUrls?.()??{}}async getArgs({prompt:Q,maxOutputTokens:G,temperature:W,topP:N,topK:q,frequencyPenalty:L,presencePenalty:Z,providerOptions:Y,stopSequences:$,responseFormat:J,seed:E,toolChoice:_,tools:X}){let K=[],B=Object.assign(await k({provider:"copilot",providerOptions:Y,schema:g})??{},await k({provider:this.providerOptionsName,providerOptions:Y,schema:g})??{});if(q!=null)K.push({type:"unsupported",feature:"topK"});if(J?.type==="json"&&J.schema!=null&&!this.supportsStructuredOutputs)K.push({type:"unsupported",feature:"responseFormat",details:"JSON response format schema is only supported with structuredOutputs"});let{tools:U,toolChoice:M,toolWarnings:V}=E3({tools:X,toolChoice:_});return{args:{model:this.modelId,user:B.user,max_tokens:G,temperature:W,top_p:N,frequency_penalty:L,presence_penalty:Z,response_format:J?.type==="json"?this.supportsStructuredOutputs===!0&&J.schema!=null?{type:"json_schema",json_schema:{schema:J.schema,name:J.name??"response",description:J.description}}:{type:"json_object"}:void 0,stop:$,seed:E,...Object.fromEntries(Object.entries(Y?.[this.providerOptionsName]??{}).filter(([H])=>!Object.keys(g.shape).includes(H))),reasoning_effort:B.reasoningEffort,verbosity:B.textVerbosity,messages:Z3(Q),tools:U,tool_choice:M,thinking_budget:B.thinking_budget},warnings:[...K,...V]}}async doGenerate(Q){let{args:G,warnings:W}=await this.getArgs({...Q}),N=JSON.stringify(G),{responseHeaders:q,value:L,rawValue:Z}=await O({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:T(this.config.headers(),Q.headers),body:G,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:i(m3),abortSignal:Q.abortSignal,fetch:this.config.fetch}),Y=L.choices[0],$=[],J=Y.message.content;if(J!=null&&J.length>0)$.push({type:"text",text:J,providerMetadata:Y.message.reasoning_opaque?{copilot:{reasoningOpaque:Y.message.reasoning_opaque}}:void 0});let E=Y.message.reasoning_text;if(E!=null&&E.length>0)$.push({type:"reasoning",text:E,providerMetadata:Y.message.reasoning_opaque?{copilot:{reasoningOpaque:Y.message.reasoning_opaque}}:void 0});if(Y.message.tool_calls!=null)for(let K of Y.message.tool_calls)$.push({type:"tool-call",toolCallId:K.id??A(),toolName:K.function.name,input:K.function.arguments,providerMetadata:Y.message.reasoning_opaque?{copilot:{reasoningOpaque:Y.message.reasoning_opaque}}:void 0});let _={[this.providerOptionsName]:{},...await this.config.metadataExtractor?.extractMetadata?.({parsedBody:Z})},X=L.usage?.completion_tokens_details;if(X?.accepted_prediction_tokens!=null)_[this.providerOptionsName].acceptedPredictionTokens=X?.accepted_prediction_tokens;if(X?.rejected_prediction_tokens!=null)_[this.providerOptionsName].rejectedPredictionTokens=X?.rejected_prediction_tokens;return{content:$,finishReason:{unified:r(Y.finish_reason),raw:Y.finish_reason??void 0},usage:{inputTokens:{total:L.usage?.prompt_tokens??void 0,noCache:void 0,cacheRead:L.usage?.prompt_tokens_details?.cached_tokens??void 0,cacheWrite:void 0},outputTokens:{total:L.usage?.completion_tokens??void 0,text:void 0,reasoning:L.usage?.completion_tokens_details?.reasoning_tokens??void 0},raw:L.usage??void 0},providerMetadata:_,request:{body:N},response:{...n(L),headers:q,body:Z},warnings:W}}async doStream(Q){let{args:G,warnings:W}=await this.getArgs({...Q}),N={...G,stream:!0,stream_options:this.config.includeUsage?{include_usage:!0}:void 0},q=this.config.metadataExtractor?.createStreamExtractor(),{responseHeaders:L,value:Z}=await O({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:T(this.config.headers(),Q.headers),body:N,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:u(this.chunkSchema),abortSignal:Q.abortSignal,fetch:this.config.fetch}),Y=[],$={unified:"other",raw:void 0},J={completionTokens:void 0,completionTokensDetails:{reasoningTokens:void 0,acceptedPredictionTokens:void 0,rejectedPredictionTokens:void 0},promptTokens:void 0,promptTokensDetails:{cachedTokens:void 0},totalTokens:void 0},E=!0,_=this.providerOptionsName,X=!1,K=!1,B,U=(M,V)=>{V.enqueue({type:"tool-input-end",id:M.id}),V.enqueue({type:"tool-call",toolCallId:M.id??A(),toolName:M.function.name,input:M.function.arguments,providerMetadata:B?{copilot:{reasoningOpaque:B}}:void 0}),M.hasFinished=!0};return{stream:Z.pipeThrough(d({warnings:W,includeRawChunks:Q.includeRawChunks,onParseError:()=>{$={unified:"error",raw:void 0}},transformValue:(M,V,H)=>{if(q?.processChunk(H),"error"in M){$={unified:"error",raw:void 0},V.enqueue({type:"error",error:M.error.message});return}if(E)E=!1,V.enqueue({type:"response-metadata",...n(M)});if(M.usage!=null){let{prompt_tokens:P,completion_tokens:b,total_tokens:f,prompt_tokens_details:R,completion_tokens_details:w}=M.usage;if(J.promptTokens=P??void 0,J.completionTokens=b??void 0,J.totalTokens=f??void 0,w?.reasoning_tokens!=null)J.completionTokensDetails.reasoningTokens=w?.reasoning_tokens;if(w?.accepted_prediction_tokens!=null)J.completionTokensDetails.acceptedPredictionTokens=w?.accepted_prediction_tokens;if(w?.rejected_prediction_tokens!=null)J.completionTokensDetails.rejectedPredictionTokens=w?.rejected_prediction_tokens;if(R?.cached_tokens!=null)J.promptTokensDetails.cachedTokens=R?.cached_tokens}let D=M.choices[0];if(D?.finish_reason!=null)$={unified:r(D.finish_reason),raw:D.finish_reason??void 0};if(D?.delta==null)return;let x=D.delta;if(x.reasoning_opaque){if(B!=null)throw new v({data:x,message:"Multiple reasoning_opaque values received in a single response. Only one thinking part per response is supported."});B=x.reasoning_opaque}let z=x.reasoning_text;if(z){if(!X)V.enqueue({type:"reasoning-start",id:"reasoning-0"}),X=!0;V.enqueue({type:"reasoning-delta",id:"reasoning-0",delta:z})}if(x.content){if(X&&!K)V.enqueue({type:"reasoning-end",id:"reasoning-0",providerMetadata:B?{copilot:{reasoningOpaque:B}}:void 0}),X=!1;if(!K)V.enqueue({type:"text-start",id:"txt-0",providerMetadata:B?{copilot:{reasoningOpaque:B}}:void 0}),K=!0;V.enqueue({type:"text-delta",id:"txt-0",delta:x.content})}if(x.tool_calls!=null){if(X)V.enqueue({type:"reasoning-end",id:"reasoning-0",providerMetadata:B?{copilot:{reasoningOpaque:B}}:void 0}),X=!1;for(let P of x.tool_calls){let b=P.index;if(Y[b]==null){if(P.id==null)throw new v({data:P,message:"Expected 'id' to be a string."});if(P.function?.name==null)throw new v({data:P,message:"Expected 'function.name' to be a string."});V.enqueue({type:"tool-input-start",id:P.id,toolName:P.function.name}),Y[b]={id:P.id,type:"function",function:{name:P.function.name,arguments:P.function.arguments??""},hasFinished:!1};let R=Y[b];if(R.function?.name!=null&&R.function?.arguments!=null){if(R.function.arguments.length>0)V.enqueue({type:"tool-input-delta",id:R.id,delta:R.function.arguments});if(l(R.function.arguments))U(R,V)}continue}let f=Y[b];if(f.hasFinished)continue;if(P.function?.arguments!=null)f.function.arguments+=P.function?.arguments??"";if(V.enqueue({type:"tool-input-delta",id:f.id,delta:P.function.arguments??""}),f.function?.name!=null&&f.function?.arguments!=null&&l(f.function.arguments))U(f,V)}}},flush:(M)=>{if(X)M.enqueue({type:"reasoning-end",id:"reasoning-0",providerMetadata:B?{copilot:{reasoningOpaque:B}}:void 0});if(K)M.enqueue({type:"text-end",id:"txt-0"});for(let H of Y.filter((D)=>!D.hasFinished))M.enqueue({type:"tool-input-end",id:H.id}),M.enqueue({type:"tool-call",toolCallId:H.id??A(),toolName:H.function.name,input:H.function.arguments});let V={[_]:{},...B?{copilot:{reasoningOpaque:B}}:{},...q?.buildMetadata()};if(J.completionTokensDetails.acceptedPredictionTokens!=null)V[_].acceptedPredictionTokens=J.completionTokensDetails.acceptedPredictionTokens;if(J.completionTokensDetails.rejectedPredictionTokens!=null)V[_].rejectedPredictionTokens=J.completionTokensDetails.rejectedPredictionTokens;M.enqueue({type:"finish",finishReason:$,usage:{inputTokens:{total:J.promptTokens,noCache:J.promptTokens!=null&&J.promptTokensDetails.cachedTokens!=null?J.promptTokens-J.promptTokensDetails.cachedTokens:void 0,cacheRead:J.promptTokensDetails.cachedTokens,cacheWrite:void 0},outputTokens:{total:J.completionTokens,text:void 0,reasoning:J.completionTokensDetails.reasoningTokens},raw:{prompt_tokens:J.promptTokens??null,completion_tokens:J.completionTokens??null,total_tokens:J.totalTokens??null}},providerMetadata:V})}})),request:{body:N},response:{headers:L}}}}var G3=j.object({prompt_tokens:j.number().nullish(),completion_tokens:j.number().nullish(),total_tokens:j.number().nullish(),prompt_tokens_details:j.object({cached_tokens:j.number().nullish()}).nullish(),completion_tokens_details:j.object({reasoning_tokens:j.number().nullish(),accepted_prediction_tokens:j.number().nullish(),rejected_prediction_tokens:j.number().nullish()}).nullish()}).nullish(),m3=j.object({id:j.string().nullish(),created:j.number().nullish(),model:j.string().nullish(),choices:j.array(j.object({message:j.object({role:j.literal("assistant").nullish(),content:j.string().nullish(),reasoning_text:j.string().nullish(),reasoning_opaque:j.string().nullish(),tool_calls:j.array(j.object({id:j.string().nullish(),function:j.object({name:j.string(),arguments:j.string()})})).nullish()}),finish_reason:j.string().nullish()})),usage:G3}),h3=(Q)=>j.union([j.object({id:j.string().nullish(),created:j.number().nullish(),model:j.string().nullish(),choices:j.array(j.object({delta:j.object({role:j.enum(["assistant"]).nullish(),content:j.string().nullish(),reasoning_text:j.string().nullish(),reasoning_opaque:j.string().nullish(),tool_calls:j.array(j.object({index:j.number(),id:j.string().nullish(),function:j.object({name:j.string().nullish(),arguments:j.string().nullish()})})).nullish()}).nullish(),finish_reason:j.string().nullish()})),usage:G3}),Q]);var g3=t,e=c({errorSchema:g3,errorToMessage:(Q)=>Q.error.message});var o=j.object({action:j.object({type:j.literal("exec"),command:j.array(j.string()),timeoutMs:j.number().optional(),user:j.string().optional(),workingDirectory:j.string().optional(),env:j.record(j.string(),j.string()).optional()})}),j3=j.object({output:j.string()}),o0=S({id:"openai.local_shell",inputSchema:o,outputSchema:j3});function J3(Q,G){if(!G)return!1;return G.some((W)=>Q.startsWith(W))}async function K3({prompt:Q,systemMessageMode:G,fileIdPrefixes:W,store:N,hasLocalShellTool:q=!1}){let L=[],Z=[],Y=new Set;for(let{role:$,content:J}of Q)switch($){case"system":{switch(G){case"system":{L.push({role:"system",content:J});break}case"developer":{L.push({role:"developer",content:J});break}case"remove":{Z.push({type:"other",message:"system messages are removed for this model"});break}default:throw Error(`Unsupported system message mode: ${G}`)}break}case"user":{L.push({role:"user",content:J.map((E,_)=>{switch(E.type){case"text":return{type:"input_text",text:E.text};case"file":if(E.mediaType.startsWith("image/")){let X=E.mediaType==="image/*"?"image/jpeg":E.mediaType;return{type:"input_image",...E.data instanceof URL?{image_url:E.data.toString()}:typeof E.data==="string"&&J3(E.data,W)?{file_id:E.data}:{image_url:`data:${X};base64,${m(E.data)}`},detail:E.providerOptions?.openai?.imageDetail}}else if(E.mediaType==="application/pdf"){if(E.data instanceof URL)return{type:"input_file",file_url:E.data.toString()};return{type:"input_file",...typeof E.data==="string"&&J3(E.data,W)?{file_id:E.data}:{filename:E.filename??`part-${_}.pdf`,file_data:`data:application/pdf;base64,${m(E.data)}`}}}else throw new y({functionality:`file part media type ${E.mediaType}`})}})});break}case"assistant":{let E={},_={};for(let X of J)switch(X.type){case"text":{L.push({role:"assistant",content:[{type:"output_text",text:X.text}],id:X.providerOptions?.openai?.itemId??void 0});break}case"tool-call":{if(_[X.toolCallId]=X,X.providerExecuted)break;if(q&&X.toolName==="local_shell"){let K=o.parse(X.input);L.push({type:"local_shell_call",call_id:X.toolCallId,id:X.providerOptions?.openai?.itemId??void 0,action:{type:"exec",command:K.action.command,timeout_ms:K.action.timeoutMs,user:K.action.user,working_directory:K.action.workingDirectory,env:K.action.env}});break}L.push({type:"function_call",call_id:X.toolCallId,name:X.toolName,arguments:JSON.stringify(X.input),id:X.providerOptions?.openai?.itemId??void 0});break}case"tool-result":{if(N)L.push({type:"item_reference",id:X.toolCallId});else Z.push({type:"other",message:`Results for OpenAI tool ${X.toolName} are not sent to the API when store is false`});break}case"reasoning":{let K=await k({provider:"copilot",providerOptions:X.providerOptions,schema:d3}),B=K?.itemId;if(B!=null){let U=E[B];if(N){if(U===void 0)L.push({type:"item_reference",id:B}),E[B]={type:"reasoning",id:B,summary:[]}}else{let M=[];if(X.text.length>0)M.push({type:"summary_text",text:X.text});else if(U!==void 0)Z.push({type:"other",message:`Cannot append empty reasoning part to existing reasoning sequence. Skipping reasoning part: ${JSON.stringify(X)}.`});if(U===void 0)E[B]={type:"reasoning",id:B,encrypted_content:K?.reasoningEncryptedContent,summary:M},L.push(E[B]);else U.summary.push(...M)}}else Z.push({type:"other",message:`Non-OpenAI reasoning parts are not supported. Skipping reasoning part: ${JSON.stringify(X)}.`});break}}break}case"tool":{for(let E of J){if(E.type==="tool-approval-response"){if(Y.has(E.approvalId))continue;if(Y.add(E.approvalId),N)L.push({type:"item_reference",id:E.approvalId});L.push({type:"mcp_approval_response",approval_request_id:E.approvalId,approve:E.approved});continue}let _=E.output;if(_.type==="execution-denied"){if(_.providerOptions?.openai?.approvalId)continue}if(q&&E.toolName==="local_shell"&&_.type==="json"){L.push({type:"local_shell_call_output",call_id:E.toolCallId,output:j3.parse(_.value).output});break}L.push({type:"function_call_output",call_id:E.toolCallId,output:h(_)})}break}default:throw Error(`Unsupported role: ${$}`)}return{input:L,warnings:Z}}var d3=j.object({itemId:j.string().nullish(),reasoningEncryptedContent:j.string().nullish()});function V3({finishReason:Q,hasFunctionCall:G}){switch(Q){case void 0:case null:return G?"tool-calls":"stop";case"max_output_tokens":return"length";case"content_filter":return"content-filter";default:return G?"tool-calls":"other"}}var v3=j.object({code:j.string().nullish(),containerId:j.string()}),c3=j.object({outputs:j.array(j.discriminatedUnion("type",[j.object({type:j.literal("logs"),logs:j.string()}),j.object({type:j.literal("image"),url:j.string()})])).nullish()}),H3=j.object({container:j.union([j.string(),j.object({fileIds:j.array(j.string()).optional()})]).optional()}),Kj=S({id:"openai.code_interpreter",inputSchema:v3,outputSchema:c3});var B3=j.object({key:j.string(),type:j.enum(["eq","ne","gt","gte","lt","lte"]),value:j.union([j.string(),j.number(),j.boolean()])}),L3=j.object({type:j.enum(["and","or"]),filters:j.array(j.union([B3,j.lazy(()=>L3)]))}),U3=j.object({vectorStoreIds:j.array(j.string()),maxNumResults:j.number().optional(),ranking:j.object({ranker:j.string().optional(),scoreThreshold:j.number().optional()}).optional(),filters:j.union([B3,L3]).optional()}),u3=j.object({queries:j.array(j.string()),results:j.array(j.object({attributes:j.record(j.string(),j.unknown()),fileId:j.string(),filename:j.string(),score:j.number(),text:j.string()})).nullable()}),Uj=S({id:"openai.file_search",inputSchema:j.object({}),outputSchema:u3});var I=j.discriminatedUnion("type",[j.object({type:j.literal("search"),query:j.string().nullish()}),j.object({type:j.literal("open_page"),url:j.string()}),j.object({type:j.literal("find"),url:j.string(),pattern:j.string()})]),p=j.object({type:j.literal("approximate"),country:j.string().optional(),city:j.string().optional(),region:j.string().optional(),timezone:j.string().optional()});var N3=j.object({filters:j.object({allowedDomains:j.array(j.string()).optional()}).optional(),searchContextSize:j.enum(["low","medium","high"]).optional(),userLocation:p.optional()}),Pj=s({id:"openai.web_search",inputSchema:j.object({action:I.nullish()})});var D3=j.object({searchContextSize:j.enum(["low","medium","high"]).optional(),userLocation:p.optional()}),Aj=s({id:"openai.web_search_preview",inputSchema:j.object({action:I.nullish()})});var W3=j.object({background:j.enum(["auto","opaque","transparent"]).optional(),inputFidelity:j.enum(["low","high"]).optional(),inputImageMask:j.object({fileId:j.string().optional(),imageUrl:j.string().optional()}).optional(),model:j.string().optional(),moderation:j.enum(["auto"]).optional(),outputCompression:j.number().int().min(0).max(100).optional(),outputFormat:j.enum(["png","jpeg","webp"]).optional(),partialImages:j.number().int().min(0).max(3).optional(),quality:j.enum(["auto","low","medium","high"]).optional(),size:j.enum(["1024x1024","1024x1536","1536x1024","auto"]).optional()}).strict(),i3=j.object({result:j.string()}),Sj=S({id:"openai.image_generation",inputSchema:j.object({}),outputSchema:i3});function _3({tools:Q,toolChoice:G,strictJsonSchema:W}){Q=Q?.length?Q:void 0;let N=[];if(Q==null)return{tools:void 0,toolChoice:void 0,toolWarnings:N};let q=[];for(let Z of Q)switch(Z.type){case"function":q.push({type:"function",name:Z.name,description:Z.description,parameters:Z.inputSchema,strict:W});break;case"provider":{switch(Z.id){case"openai.file_search":{let Y=U3.parse(Z.args);q.push({type:"file_search",vector_store_ids:Y.vectorStoreIds,max_num_results:Y.maxNumResults,ranking_options:Y.ranking?{ranker:Y.ranking.ranker,score_threshold:Y.ranking.scoreThreshold}:void 0,filters:Y.filters});break}case"openai.local_shell":{q.push({type:"local_shell"});break}case"openai.web_search_preview":{let Y=D3.parse(Z.args);q.push({type:"web_search_preview",search_context_size:Y.searchContextSize,user_location:Y.userLocation});break}case"openai.web_search":{let Y=N3.parse(Z.args);q.push({type:"web_search",filters:Y.filters!=null?{allowed_domains:Y.filters.allowedDomains}:void 0,search_context_size:Y.searchContextSize,user_location:Y.userLocation});break}case"openai.code_interpreter":{let Y=H3.parse(Z.args);q.push({type:"code_interpreter",container:Y.container==null?{type:"auto",file_ids:void 0}:typeof Y.container==="string"?Y.container:{type:"auto",file_ids:Y.container.fileIds}});break}case"openai.image_generation":{let Y=W3.parse(Z.args);q.push({type:"image_generation",background:Y.background,input_fidelity:Y.inputFidelity,input_image_mask:Y.inputImageMask?{file_id:Y.inputImageMask.fileId,image_url:Y.inputImageMask.imageUrl}:void 0,model:Y.model,moderation:Y.moderation,partial_images:Y.partialImages,quality:Y.quality,output_compression:Y.outputCompression,output_format:Y.outputFormat,size:Y.size});break}}break}default:N.push({type:"unsupported",feature:"tool type"});break}if(G==null)return{tools:q,toolChoice:void 0,toolWarnings:N};let L=G.type;switch(L){case"auto":case"none":case"required":return{tools:q,toolChoice:L,toolWarnings:N};case"tool":return{tools:q,toolChoice:G.toolName==="code_interpreter"||G.toolName==="file_search"||G.toolName==="image_generation"||G.toolName==="web_search_preview"||G.toolName==="web_search"?{type:G.toolName}:{type:"function",name:G.toolName},toolWarnings:N};default:throw new y({functionality:`tool choice type: ${L}`})}}var M3=j.object({type:j.literal("web_search_call"),id:j.string(),status:j.string(),action:I.nullish()}),P3=j.object({type:j.literal("file_search_call"),id:j.string(),queries:j.array(j.string()),results:j.array(j.object({attributes:j.record(j.string(),j.unknown()),file_id:j.string(),filename:j.string(),score:j.number(),text:j.string()})).nullish()}),Q3=j.object({type:j.literal("code_interpreter_call"),id:j.string(),code:j.string().nullable(),container_id:j.string(),outputs:j.array(j.discriminatedUnion("type",[j.object({type:j.literal("logs"),logs:j.string()}),j.object({type:j.literal("image"),url:j.string()})])).nullable()}),f3=j.object({type:j.literal("local_shell_call"),id:j.string(),call_id:j.string(),action:j.object({type:j.literal("exec"),command:j.array(j.string()),timeout_ms:j.number().optional(),user:j.string().optional(),working_directory:j.string().optional(),env:j.record(j.string(),j.string()).optional()})}),x3=j.object({type:j.literal("image_generation_call"),id:j.string(),result:j.string()}),R3=j.object({type:j.literal("file_citation"),file_id:j.string(),filename:j.string().nullish(),index:j.number().nullish(),start_index:j.number().nullish(),end_index:j.number().nullish(),quote:j.string().nullish()}),b3=j.object({type:j.literal("message"),id:j.string()}),A3=j.object({type:j.literal("reasoning"),id:j.string(),encrypted_content:j.string().nullish()}),w3=j.object({type:j.literal("function_call"),id:j.string(),call_id:j.string(),name:j.string(),arguments:j.string()}),F3=20,y3=j.array(j.object({token:j.string(),logprob:j.number(),top_logprobs:j.array(j.object({token:j.string(),logprob:j.number()}))}));class X3{specificationVersion="v3";modelId;config;constructor(Q,G){this.modelId=Q,this.config=G}supportedUrls={"image/*":[/^https?:\/\/.*$/],"application/pdf":[/^https?:\/\/.*$/]};get provider(){return this.config.provider}async getArgs({maxOutputTokens:Q,temperature:G,stopSequences:W,topP:N,topK:q,presencePenalty:L,frequencyPenalty:Z,seed:Y,prompt:$,providerOptions:J,tools:E,toolChoice:_,responseFormat:X}){let K=[],B=_0(this.modelId);if(q!=null)K.push({type:"unsupported",feature:"topK"});if(Y!=null)K.push({type:"unsupported",feature:"seed"});if(L!=null)K.push({type:"unsupported",feature:"presencePenalty"});if(Z!=null)K.push({type:"unsupported",feature:"frequencyPenalty"});if(W!=null)K.push({type:"unsupported",feature:"stopSequences"});let U=await k({provider:"copilot",providerOptions:J,schema:q0}),{input:M,warnings:V}=await K3({prompt:$,systemMessageMode:B.systemMessageMode,fileIdPrefixes:this.config.fileIdPrefixes,store:U?.store??!0,hasLocalShellTool:z("openai.local_shell")});K.push(...V);let H=U?.strictJsonSchema??!1,D=U?.include;function x(F){D=D!=null?[...D,F]:[F]}function z(F){return E?.find((Y3)=>Y3.type==="provider"&&Y3.id===F)!=null}let P=typeof U?.logprobs==="number"?U?.logprobs:U?.logprobs===!0?F3:void 0;if(P)x("message.output_text.logprobs");let b=E?.find((F)=>F.type==="provider"&&(F.id==="openai.web_search"||F.id==="openai.web_search_preview"))?.name;if(b)x("web_search_call.action.sources");if(z("openai.code_interpreter"))x("code_interpreter_call.outputs");let f={model:this.modelId,input:M,temperature:G,top_p:N,max_output_tokens:Q,...(X?.type==="json"||U?.textVerbosity)&&{text:{...X?.type==="json"&&{format:X.schema!=null?{type:"json_schema",strict:H,name:X.name??"response",description:X.description,schema:X.schema}:{type:"json_object"}},...U?.textVerbosity&&{verbosity:U.textVerbosity}}},max_tool_calls:U?.maxToolCalls,metadata:U?.metadata,parallel_tool_calls:U?.parallelToolCalls,previous_response_id:U?.previousResponseId,store:U?.store,user:U?.user,instructions:U?.instructions,service_tier:U?.serviceTier,include:D,prompt_cache_key:U?.promptCacheKey,safety_identifier:U?.safetyIdentifier,top_logprobs:P,...B.isReasoningModel&&(U?.reasoningEffort!=null||U?.reasoningSummary!=null)&&{reasoning:{...U?.reasoningEffort!=null&&{effort:U.reasoningEffort},...U?.reasoningSummary!=null&&{summary:U.reasoningSummary}}},...B.requiredAutoTruncation&&{truncation:"auto"}};if(B.isReasoningModel){if(f.temperature!=null)f.temperature=void 0,K.push({type:"unsupported",feature:"temperature",details:"temperature is not supported for reasoning models"});if(f.top_p!=null)f.top_p=void 0,K.push({type:"unsupported",feature:"topP",details:"topP is not supported for reasoning models"})}else{if(U?.reasoningEffort!=null)K.push({type:"unsupported",feature:"reasoningEffort",details:"reasoningEffort is not supported for non-reasoning models"});if(U?.reasoningSummary!=null)K.push({type:"unsupported",feature:"reasoningSummary",details:"reasoningSummary is not supported for non-reasoning models"})}if(U?.serviceTier==="flex"&&!B.supportsFlexProcessing)K.push({type:"unsupported",feature:"serviceTier",details:"flex processing is only available for o3, o4-mini, and gpt-5 models"}),f.service_tier=void 0;if(U?.serviceTier==="priority"&&!B.supportsPriorityProcessing)K.push({type:"unsupported",feature:"serviceTier",details:"priority processing is only available for supported models (gpt-4, gpt-5, gpt-5-mini, o3, o4-mini) and requires Enterprise access. gpt-5-nano is not supported"}),f.service_tier=void 0;let{tools:R,toolChoice:w,toolWarnings:C3}=_3({tools:E,toolChoice:_,strictJsonSchema:H});return{webSearchToolName:b,args:{...f,tools:R,tool_choice:w},warnings:[...K,...C3]}}async doGenerate(Q){let{args:G,warnings:W,webSearchToolName:N}=await this.getArgs(Q),q=this.config.url({path:"/responses",modelId:this.modelId}),{responseHeaders:L,value:Z,rawValue:Y}=await O({url:q,headers:T(this.config.headers(),Q.headers),body:G,failedResponseHandler:e,successfulResponseHandler:i(j.object({id:j.string(),created_at:j.number(),error:j.object({code:j.string(),message:j.string()}).nullish(),model:j.string(),output:j.array(j.discriminatedUnion("type",[j.object({type:j.literal("message"),role:j.literal("assistant"),id:j.string(),content:j.array(j.object({type:j.literal("output_text"),text:j.string(),logprobs:y3.nullish(),annotations:j.array(j.discriminatedUnion("type",[j.object({type:j.literal("url_citation"),start_index:j.number(),end_index:j.number(),url:j.string(),title:j.string()}),R3,j.object({type:j.literal("container_file_citation")})]))}))}),M3,P3,Q3,x3,f3,j.object({type:j.literal("function_call"),call_id:j.string(),name:j.string(),arguments:j.string(),id:j.string()}),j.object({type:j.literal("computer_call"),id:j.string(),status:j.string().optional()}),j.object({type:j.literal("reasoning"),id:j.string(),encrypted_content:j.string().nullish(),summary:j.array(j.object({type:j.literal("summary_text"),text:j.string()}))})])),service_tier:j.string().nullish(),incomplete_details:j.object({reason:j.string()}).nullish(),usage:S3})),abortSignal:Q.abortSignal,fetch:this.config.fetch});if(Z.error)throw new q3({message:Z.error.message,url:q,requestBodyValues:G,statusCode:400,responseHeaders:L,responseBody:Y,isRetryable:!1});let $=[],J=[],E=!1;for(let X of Z.output)switch(X.type){case"reasoning":{if(X.summary.length===0)X.summary.push({type:"summary_text",text:""});for(let K of X.summary)$.push({type:"reasoning",text:K.text,providerMetadata:{openai:{itemId:X.id,reasoningEncryptedContent:X.encrypted_content??null}}});break}case"image_generation_call":{$.push({type:"tool-call",toolCallId:X.id,toolName:"image_generation",input:"{}",providerExecuted:!0}),$.push({type:"tool-result",toolCallId:X.id,toolName:"image_generation",result:{result:X.result}});break}case"local_shell_call":{$.push({type:"tool-call",toolCallId:X.call_id,toolName:"local_shell",input:JSON.stringify({action:X.action}),providerMetadata:{openai:{itemId:X.id}}});break}case"message":{for(let K of X.content){if(Q.providerOptions?.openai?.logprobs&&K.logprobs)J.push(K.logprobs);$.push({type:"text",text:K.text,providerMetadata:{openai:{itemId:X.id}}});for(let B of K.annotations)if(B.type==="url_citation")$.push({type:"source",sourceType:"url",id:this.config.generateId?.()??A(),url:B.url,title:B.title});else if(B.type==="file_citation")$.push({type:"source",sourceType:"document",id:this.config.generateId?.()??A(),mediaType:"text/plain",title:B.quote??B.filename??"Document",filename:B.filename??B.file_id})}break}case"function_call":{E=!0,$.push({type:"tool-call",toolCallId:X.call_id,toolName:X.name,input:X.arguments,providerMetadata:{openai:{itemId:X.id}}});break}case"web_search_call":{$.push({type:"tool-call",toolCallId:X.id,toolName:N??"web_search",input:JSON.stringify({action:X.action}),providerExecuted:!0}),$.push({type:"tool-result",toolCallId:X.id,toolName:N??"web_search",result:{status:X.status}});break}case"computer_call":{$.push({type:"tool-call",toolCallId:X.id,toolName:"computer_use",input:"",providerExecuted:!0}),$.push({type:"tool-result",toolCallId:X.id,toolName:"computer_use",result:{type:"computer_use_tool_result",status:X.status||"completed"}});break}case"file_search_call":{$.push({type:"tool-call",toolCallId:X.id,toolName:"file_search",input:"{}",providerExecuted:!0}),$.push({type:"tool-result",toolCallId:X.id,toolName:"file_search",result:{queries:X.queries,results:X.results?.map((K)=>({attributes:K.attributes,fileId:K.file_id,filename:K.filename,score:K.score,text:K.text}))??null}});break}case"code_interpreter_call":{$.push({type:"tool-call",toolCallId:X.id,toolName:"code_interpreter",input:JSON.stringify({code:X.code,containerId:X.container_id}),providerExecuted:!0}),$.push({type:"tool-result",toolCallId:X.id,toolName:"code_interpreter",result:{outputs:X.outputs}});break}}let _={openai:{responseId:Z.id}};if(J.length>0)_.openai.logprobs=J;if(typeof Z.service_tier==="string")_.openai.serviceTier=Z.service_tier;return{content:$,finishReason:{unified:V3({finishReason:Z.incomplete_details?.reason,hasFunctionCall:E}),raw:Z.incomplete_details?.reason},usage:{inputTokens:{total:Z.usage.input_tokens,noCache:Z.usage.input_tokens_details?.cached_tokens!=null?Z.usage.input_tokens-Z.usage.input_tokens_details.cached_tokens:void 0,cacheRead:Z.usage.input_tokens_details?.cached_tokens??void 0,cacheWrite:void 0},outputTokens:{total:Z.usage.output_tokens,text:void 0,reasoning:Z.usage.output_tokens_details?.reasoning_tokens??void 0},raw:Z.usage},request:{body:G},response:{id:Z.id,timestamp:new Date(Z.created_at*1000),modelId:Z.model,headers:L,body:Y},providerMetadata:_,warnings:W}}async doStream(Q){let{args:G,warnings:W,webSearchToolName:N}=await this.getArgs(Q),{responseHeaders:q,value:L}=await O({url:this.config.url({path:"/responses",modelId:this.modelId}),headers:T(this.config.headers(),Q.headers),body:{...G,stream:!0},failedResponseHandler:e,successfulResponseHandler:u(Y0),abortSignal:Q.abortSignal,fetch:this.config.fetch}),Z=this,Y={unified:"other",raw:void 0},$={inputTokens:void 0,outputTokens:void 0,totalTokens:void 0,reasoningTokens:void 0,cachedInputTokens:void 0},J=[],E=null,_={},X=!1,K={},B=null,U=null,M;return{stream:L.pipeThrough(d({warnings:W,includeRawChunks:Q.includeRawChunks,onParseError:()=>{Y={unified:"error",raw:void 0}},transformValue:(V,H)=>{if(T3(V)){if(V.item.type==="function_call")_[V.output_index]={toolName:V.item.name,toolCallId:V.item.call_id},H.enqueue({type:"tool-input-start",id:V.item.call_id,toolName:V.item.name});else if(V.item.type==="web_search_call")_[V.output_index]={toolName:N??"web_search",toolCallId:V.item.id},H.enqueue({type:"tool-input-start",id:V.item.id,toolName:N??"web_search"});else if(V.item.type==="computer_call")_[V.output_index]={toolName:"computer_use",toolCallId:V.item.id},H.enqueue({type:"tool-input-start",id:V.item.id,toolName:"computer_use"});else if(V.item.type==="code_interpreter_call")_[V.output_index]={toolName:"code_interpreter",toolCallId:V.item.id,codeInterpreter:{containerId:V.item.container_id}},H.enqueue({type:"tool-input-start",id:V.item.id,toolName:"code_interpreter"}),H.enqueue({type:"tool-input-delta",id:V.item.id,delta:`{"containerId":"${V.item.container_id}","code":"`});else if(V.item.type==="file_search_call")H.enqueue({type:"tool-call",toolCallId:V.item.id,toolName:"file_search",input:"{}",providerExecuted:!0});else if(V.item.type==="image_generation_call")H.enqueue({type:"tool-call",toolCallId:V.item.id,toolName:"image_generation",input:"{}",providerExecuted:!0});else if(V.item.type==="message")U=V.item.id,H.enqueue({type:"text-start",id:V.item.id,providerMetadata:{openai:{itemId:V.item.id}}});else if(L0(V))K[V.output_index]={canonicalId:V.item.id,encryptedContent:V.item.encrypted_content,summaryParts:[0]},B=V.output_index,H.enqueue({type:"reasoning-start",id:`${V.item.id}:0`,providerMetadata:{openai:{itemId:V.item.id,reasoningEncryptedContent:V.item.encrypted_content??null}}})}else if(k3(V)){if(V.item.type==="function_call")_[V.output_index]=void 0,X=!0,H.enqueue({type:"tool-input-end",id:V.item.call_id}),H.enqueue({type:"tool-call",toolCallId:V.item.call_id,toolName:V.item.name,input:V.item.arguments,providerMetadata:{openai:{itemId:V.item.id}}});else if(V.item.type==="web_search_call")_[V.output_index]=void 0,H.enqueue({type:"tool-input-end",id:V.item.id}),H.enqueue({type:"tool-call",toolCallId:V.item.id,toolName:"web_search",input:JSON.stringify({action:V.item.action}),providerExecuted:!0}),H.enqueue({type:"tool-result",toolCallId:V.item.id,toolName:"web_search",result:{status:V.item.status}});else if(V.item.type==="computer_call")_[V.output_index]=void 0,H.enqueue({type:"tool-input-end",id:V.item.id}),H.enqueue({type:"tool-call",toolCallId:V.item.id,toolName:"computer_use",input:"",providerExecuted:!0}),H.enqueue({type:"tool-result",toolCallId:V.item.id,toolName:"computer_use",result:{type:"computer_use_tool_result",status:V.item.status||"completed"}});else if(V.item.type==="file_search_call")_[V.output_index]=void 0,H.enqueue({type:"tool-result",toolCallId:V.item.id,toolName:"file_search",result:{queries:V.item.queries,results:V.item.results?.map((D)=>({attributes:D.attributes,fileId:D.file_id,filename:D.filename,score:D.score,text:D.text}))??null}});else if(V.item.type==="code_interpreter_call")_[V.output_index]=void 0,H.enqueue({type:"tool-result",toolCallId:V.item.id,toolName:"code_interpreter",result:{outputs:V.item.outputs}});else if(V.item.type==="image_generation_call")H.enqueue({type:"tool-result",toolCallId:V.item.id,toolName:"image_generation",result:{result:V.item.result}});else if(V.item.type==="local_shell_call")_[V.output_index]=void 0,H.enqueue({type:"tool-call",toolCallId:V.item.call_id,toolName:"local_shell",input:JSON.stringify({action:{type:"exec",command:V.item.action.command,timeoutMs:V.item.action.timeout_ms,user:V.item.action.user,workingDirectory:V.item.action.working_directory,env:V.item.action.env}}),providerMetadata:{openai:{itemId:V.item.id}}});else if(V.item.type==="message"){if(U)H.enqueue({type:"text-end",id:U}),U=null}else if($0(V)){let D=K[V.output_index];if(D){for(let x of D.summaryParts)H.enqueue({type:"reasoning-end",id:`${D.canonicalId}:${x}`,providerMetadata:{openai:{itemId:D.canonicalId,reasoningEncryptedContent:V.item.encrypted_content??null}}});if(delete K[V.output_index],B===V.output_index)B=null}}}else if(J0(V)){let D=_[V.output_index];if(D!=null)H.enqueue({type:"tool-input-delta",id:D.toolCallId,delta:V.delta})}else if(K0(V))H.enqueue({type:"tool-result",toolCallId:V.item_id,toolName:"image_generation",result:{result:V.partial_image_b64}});else if(H0(V)){let D=_[V.output_index];if(D!=null)H.enqueue({type:"tool-input-delta",id:D.toolCallId,delta:JSON.stringify(V.delta).slice(1,-1)})}else if(B0(V)){let D=_[V.output_index];if(D!=null)H.enqueue({type:"tool-input-delta",id:D.toolCallId,delta:'"}'}),H.enqueue({type:"tool-input-end",id:D.toolCallId}),H.enqueue({type:"tool-call",toolCallId:D.toolCallId,toolName:"code_interpreter",input:JSON.stringify({code:V.code,containerId:D.codeInterpreter.containerId}),providerExecuted:!0})}else if(G0(V))E=V.response.id,H.enqueue({type:"response-metadata",id:V.response.id,timestamp:new Date(V.response.created_at*1000),modelId:V.response.model});else if(Z0(V)){if(!U)U=V.item_id,H.enqueue({type:"text-start",id:U,providerMetadata:{openai:{itemId:V.item_id}}});if(H.enqueue({type:"text-delta",id:U,delta:V.delta}),Q.providerOptions?.openai?.logprobs&&V.logprobs)J.push(V.logprobs)}else if(N0(V)){let D=B!==null?K[B]:null;if(D&&V.summary_index>0)D.summaryParts.push(V.summary_index),H.enqueue({type:"reasoning-start",id:`${D.canonicalId}:${V.summary_index}`,providerMetadata:{openai:{itemId:D.canonicalId,reasoningEncryptedContent:D.encryptedContent??null}}})}else if(D0(V)){let D=B!==null?K[B]:null;if(D)H.enqueue({type:"reasoning-delta",id:`${D.canonicalId}:${V.summary_index}`,delta:V.delta,providerMetadata:{openai:{itemId:D.canonicalId}}})}else if(E0(V)){if(Y={unified:V3({finishReason:V.response.incomplete_details?.reason,hasFunctionCall:X}),raw:V.response.incomplete_details?.reason??void 0},$.inputTokens=V.response.usage.input_tokens,$.outputTokens=V.response.usage.output_tokens,$.totalTokens=V.response.usage.input_tokens+V.response.usage.output_tokens,$.reasoningTokens=V.response.usage.output_tokens_details?.reasoning_tokens??void 0,$.cachedInputTokens=V.response.usage.input_tokens_details?.cached_tokens??void 0,typeof V.response.service_tier==="string")M=V.response.service_tier}else if(U0(V)){if(V.annotation.type==="url_citation")H.enqueue({type:"source",sourceType:"url",id:Z.config.generateId?.()??A(),url:V.annotation.url,title:V.annotation.title});else if(V.annotation.type==="file_citation")H.enqueue({type:"source",sourceType:"document",id:Z.config.generateId?.()??A(),mediaType:"text/plain",title:V.annotation.quote??V.annotation.filename??"Document",filename:V.annotation.filename??V.annotation.file_id})}else if(W0(V))H.enqueue({type:"error",error:V})},flush:(V)=>{if(U)V.enqueue({type:"text-end",id:U}),U=null;let H={openai:{responseId:E}};if(J.length>0)H.openai.logprobs=J;if(M!==void 0)H.openai.serviceTier=M;V.enqueue({type:"finish",finishReason:Y,usage:{inputTokens:{total:$.inputTokens,noCache:$.inputTokens!=null&&$.cachedInputTokens!=null?$.inputTokens-$.cachedInputTokens:void 0,cacheRead:$.cachedInputTokens,cacheWrite:void 0},outputTokens:{total:$.outputTokens,text:void 0,reasoning:$.reasoningTokens},raw:{input_tokens:$.inputTokens,output_tokens:$.outputTokens,total_tokens:$.totalTokens}},providerMetadata:H})}})),request:{body:G},response:{headers:q}}}}var S3=j.object({input_tokens:j.number(),input_tokens_details:j.object({cached_tokens:j.number().nullish()}).nullish(),output_tokens:j.number(),output_tokens_details:j.object({reasoning_tokens:j.number().nullish()}).nullish()}),p3=j.object({type:j.literal("response.output_text.delta"),item_id:j.string(),delta:j.string(),logprobs:y3.nullish()}),s3=j.object({type:j.literal("error"),code:j.string(),message:j.string(),param:j.string().nullish(),sequence_number:j.number()}),n3=j.object({type:j.enum(["response.completed","response.incomplete"]),response:j.object({incomplete_details:j.object({reason:j.string()}).nullish(),usage:S3,service_tier:j.string().nullish()})}),r3=j.object({type:j.literal("response.created"),response:j.object({id:j.string(),created_at:j.number(),model:j.string(),service_tier:j.string().nullish()})}),t3=j.object({type:j.literal("response.output_item.added"),output_index:j.number(),item:j.discriminatedUnion("type",[b3,A3,w3,j.object({type:j.literal("web_search_call"),id:j.string(),status:j.string(),action:j.object({type:j.literal("search"),query:j.string().optional()}).nullish()}),j.object({type:j.literal("computer_call"),id:j.string(),status:j.string()}),j.object({type:j.literal("file_search_call"),id:j.string()}),j.object({type:j.literal("image_generation_call"),id:j.string()}),Q3.extend({status:j.string()})])}),l3=j.object({type:j.literal("response.output_item.done"),output_index:j.number(),item:j.discriminatedUnion("type",[b3,A3,w3.extend({status:j.literal("completed")}),Q3,x3,M3,P3,f3,j.object({type:j.literal("computer_call"),id:j.string(),status:j.literal("completed")})])}),a3=j.object({type:j.literal("response.function_call_arguments.delta"),item_id:j.string(),output_index:j.number(),delta:j.string()}),e3=j.object({type:j.literal("response.image_generation_call.partial_image"),item_id:j.string(),output_index:j.number(),partial_image_b64:j.string()}),o3=j.object({type:j.literal("response.code_interpreter_call_code.delta"),item_id:j.string(),output_index:j.number(),delta:j.string()}),j0=j.object({type:j.literal("response.code_interpreter_call_code.done"),item_id:j.string(),output_index:j.number(),code:j.string()}),V0=j.object({type:j.literal("response.output_text.annotation.added"),annotation:j.discriminatedUnion("type",[j.object({type:j.literal("url_citation"),url:j.string(),title:j.string()}),R3])}),Q0=j.object({type:j.literal("response.reasoning_summary_part.added"),item_id:j.string(),summary_index:j.number()}),X0=j.object({type:j.literal("response.reasoning_summary_text.delta"),item_id:j.string(),summary_index:j.number(),delta:j.string()}),Y0=j.union([p3,n3,r3,t3,l3,a3,e3,o3,j0,V0,Q0,X0,s3,j.object({type:j.string()}).loose()]);function Z0(Q){return Q.type==="response.output_text.delta"}function k3(Q){return Q.type==="response.output_item.done"}function $0(Q){return k3(Q)&&Q.item.type==="reasoning"}function E0(Q){return Q.type==="response.completed"||Q.type==="response.incomplete"}function G0(Q){return Q.type==="response.created"}function J0(Q){return Q.type==="response.function_call_arguments.delta"}function K0(Q){return Q.type==="response.image_generation_call.partial_image"}function H0(Q){return Q.type==="response.code_interpreter_call_code.delta"}function B0(Q){return Q.type==="response.code_interpreter_call_code.done"}function T3(Q){return Q.type==="response.output_item.added"}function L0(Q){return T3(Q)&&Q.item.type==="reasoning"}function U0(Q){return Q.type==="response.output_text.annotation.added"}function N0(Q){return Q.type==="response.reasoning_summary_part.added"}function D0(Q){return Q.type==="response.reasoning_summary_text.delta"}function W0(Q){return Q.type==="error"}function _0(Q){let G=Q.startsWith("o3")||Q.startsWith("o4-mini")||Q.startsWith("gpt-5")&&!Q.startsWith("gpt-5-chat"),W=Q.startsWith("gpt-4")||Q.startsWith("gpt-5-mini")||Q.startsWith("gpt-5")&&!Q.startsWith("gpt-5-nano")&&!Q.startsWith("gpt-5-chat")||Q.startsWith("o3")||Q.startsWith("o4-mini"),N={requiredAutoTruncation:!1,systemMessageMode:"system",supportsFlexProcessing:G,supportsPriorityProcessing:W};if(Q.startsWith("gpt-5-chat"))return{...N,isReasoningModel:!1};if(Q.startsWith("o")||Q.startsWith("gpt-5")||Q.startsWith("codex-")||Q.startsWith("computer-use")){if(Q.startsWith("o1-mini")||Q.startsWith("o1-preview"))return{...N,isReasoningModel:!0,systemMessageMode:"remove"};return{...N,isReasoningModel:!0,systemMessageMode:"developer"}}return{...N,isReasoningModel:!1}}var q0=j.object({include:j.array(j.enum(["reasoning.encrypted_content","file_search_call.results","message.output_text.logprobs"])).nullish(),instructions:j.string().nullish(),logprobs:j.union([j.boolean(),j.number().min(1).max(F3)]).optional(),maxToolCalls:j.number().nullish(),metadata:j.any().nullish(),parallelToolCalls:j.boolean().nullish(),previousResponseId:j.string().nullish(),promptCacheKey:j.string().nullish(),reasoningEffort:j.string().nullish(),reasoningSummary:j.string().nullish(),safetyIdentifier:j.string().nullish(),serviceTier:j.enum(["auto","flex","priority"]).nullish(),store:j.boolean().nullish(),strictJsonSchema:j.boolean().nullish(),textVerbosity:j.enum(["low","medium","high"]).nullish(),user:j.string().nullish()});var M0="0.1.0";function z3(Q={}){let G=I3(Q.baseURL??"https://api.openai.com/v1");if(!G)throw Error("baseURL is required");let W={...Q.apiKey&&{Authorization:`Bearer ${Q.apiKey}`},...Q.headers},N=()=>O3(W,`ai-sdk/openai-compatible/${M0}`),q=($)=>{return new a($,{provider:`${Q.name??"openai-compatible"}.chat`,headers:N,url:({path:J})=>`${G}${J}`,fetch:Q.fetch})},L=($)=>{return new X3($,{provider:`${Q.name??"openai-compatible"}.responses`,headers:N,url:({path:J})=>`${G}${J}`,fetch:Q.fetch})},Z=($)=>q($),Y=function($){return q($)};return Y.languageModel=Z,Y.chat=q,Y.responses=L,Y}var P0=z3();export{P0 as openaiCompatible,z3 as createOpenaiCompatible};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{CP as Z,zP as I}from"./chunk-hh4c02fh.js";var x=I((r0,u)=>{u.exports=v;v.sync=K0;var N=Z("fs");function T0(q,L){var $=L.pathExt!==void 0?L.pathExt:process.env.PATHEXT;if(!$)return!0;if($=$.split(";"),$.indexOf("")!==-1)return!0;for(var G=0;G<$.length;G++){var H=$[G].toLowerCase();if(H&&q.substr(-H.length).toLowerCase()===H)return!0}return!1}function R(q,L,$){if(!q.isSymbolicLink()&&!q.isFile())return!1;return T0(L,$)}function v(q,L,$){N.stat(q,function(G,H){$(G,G?!1:R(H,q,L))})}function K0(q,L){return R(N.statSync(q),q,L)}});var g=I((o0,E)=>{E.exports=b;b.sync=f0;var C=Z("fs");function b(q,L,$){C.stat(q,function(G,H){$(G,G?!1:w(H,L))})}function f0(q,L){return w(C.statSync(q),L)}function w(q,L){return q.isFile()&&A0(q,L)}function A0(q,L){var{mode:$,uid:G,gid:H}=q,X=L.uid!==void 0?L.uid:process.getuid&&process.getuid(),k=L.gid!==void 0?L.gid:process.getgid&&process.getgid(),J=parseInt("100",8),Y=parseInt("010",8),B=parseInt("001",8),V=J|Y,Q=$&B||$&Y&&H===k||$&J&&G===X||$&V&&X===0;return Q}});var h=I((s0,c)=>{var p0=Z("fs"),K;if(process.platform==="win32"||global.TESTING_WINDOWS)K=x();else K=g();c.exports=A;A.sync=D0;function A(q,L,$){if(typeof L==="function")$=L,L={};if(!$){if(typeof Promise!=="function")throw TypeError("callback not provided");return new Promise(function(G,H){A(q,L||{},function(X,k){if(X)H(X);else G(k)})})}K(q,L||{},function(G,H){if(G){if(G.code==="EACCES"||L&&L.ignoreErrors)G=null,H=!1}$(G,H)})}function D0(q,L){try{return K.sync(q,L||{})}catch($){if(L&&L.ignoreErrors||$.code==="EACCES")return!1;else throw $}}});var r=I((a0,d)=>{var _=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",l=Z("path"),F0=_?";":":",m=h(),n=(q)=>Object.assign(Error(`not found: ${q}`),{code:"ENOENT"}),i=(q,L)=>{let $=L.colon||F0,G=q.match(/\//)||_&&q.match(/\\/)?[""]:[..._?[process.cwd()]:[],...(L.path||process.env.PATH||"").split($)],H=_?L.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",X=_?H.split($):[""];if(_){if(q.indexOf(".")!==-1&&X[0]!=="")X.unshift("")}return{pathEnv:G,pathExt:X,pathExtExe:H}},t=(q,L,$)=>{if(typeof L==="function")$=L,L={};if(!L)L={};let{pathEnv:G,pathExt:H,pathExtExe:X}=i(q,L),k=[],J=(B)=>new Promise((V,Q)=>{if(B===G.length)return L.all&&k.length?V(k):Q(n(q));let U=G[B],T=/^".*"$/.test(U)?U.slice(1,-1):U,z=l.join(T,q),f=!T&&/^\.[\\\/]/.test(q)?q.slice(0,2)+z:z;V(Y(f,B,0))}),Y=(B,V,Q)=>new Promise((U,T)=>{if(Q===H.length)return U(J(V+1));let z=H[Q];m(B+z,{pathExt:X},(f,M0)=>{if(!f&&M0)if(L.all)k.push(B+z);else return U(B+z);return U(Y(B,V,Q+1))})});return $?J(0).then((B)=>$(null,B),$):J(0)},O0=(q,L)=>{L=L||{};let{pathEnv:$,pathExt:G,pathExtExe:H}=i(q,L),X=[];for(let k=0;k<$.length;k++){let J=$[k],Y=/^".*"$/.test(J)?J.slice(1,-1):J,B=l.join(Y,q),V=!Y&&/^\.[\\\/]/.test(q)?q.slice(0,2)+B:B;for(let Q=0;Q<G.length;Q++){let U=V+G[Q];try{if(m.sync(U,{pathExt:H}))if(L.all)X.push(U);else return U}catch(T){}}}if(L.all&&X.length)return X;if(L.nothrow)return null;throw n(q)};d.exports=t;t.sync=O0});var p=I((e0,D)=>{var o=(q={})=>{let L=q.env||process.env;if((q.platform||process.platform)!=="win32")return"PATH";return Object.keys(L).reverse().find((G)=>G.toUpperCase()==="PATH")||"Path"};D.exports=o;D.exports.default=o});var q0=I((qq,e)=>{var s=Z("path"),P0=r(),S0=p();function a(q,L){let $=q.options.env||process.env,G=process.cwd(),H=q.options.cwd!=null,X=H&&process.chdir!==void 0&&!process.chdir.disabled;if(X)try{process.chdir(q.options.cwd)}catch(J){}let k;try{k=P0.sync(q.command,{path:$[S0({env:$})],pathExt:L?s.delimiter:void 0})}catch(J){}finally{if(X)process.chdir(G)}if(k)k=s.resolve(H?q.options.cwd:"",k);return k}function j0(q){return a(q)||a(q,!0)}e.exports=j0});var L0=I((N0,O)=>{var F=/([()\][%!^"`<>&|;, *?])/g;function W0(q){return q=q.replace(F,"^$1"),q}function y0(q,L){if(q=`${q}`,q=q.replace(/(?=(\\+?)?)\1"/g,"$1$1\\\""),q=q.replace(/(?=(\\+?)?)\1$/,"$1$1"),q=`"${q}"`,q=q.replace(F,"^$1"),L)q=q.replace(F,"^$1");return q}N0.command=W0;N0.argument=y0});var G0=I((Lq,$0)=>{$0.exports=/^#!(.*)/});var X0=I(($q,H0)=>{var u0=G0();H0.exports=(q="")=>{let L=q.match(u0);if(!L)return null;let[$,G]=L[0].replace(/#! ?/,"").split(" "),H=$.split("/").pop();if(H==="env")return G;return G?`${H} ${G}`:H}});var B0=I((Gq,k0)=>{var P=Z("fs"),x0=X0();function C0(q){let $=Buffer.alloc(150),G;try{G=P.openSync(q,"r"),P.readSync(G,$,0,150,0),P.closeSync(G)}catch(H){}return x0($.toString())}k0.exports=C0});var U0=I((Hq,Q0)=>{var b0=Z("path"),I0=q0(),J0=L0(),w0=B0(),E0=process.platform==="win32",g0=/\.(?:com|exe)$/i,c0=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function h0(q){q.file=I0(q);let L=q.file&&w0(q.file);if(L)return q.args.unshift(q.file),q.command=L,I0(q);return q.file}function l0(q){if(!E0)return q;let L=h0(q),$=!g0.test(L);if(q.options.forceShell||$){let G=c0.test(L);q.command=b0.normalize(q.command),q.command=J0.command(q.command),q.args=q.args.map((X)=>J0.argument(X,G));let H=[q.command].concat(q.args).join(" ");q.args=["/d","/s","/c",`"${H}"`],q.command=process.env.comspec||"cmd.exe",q.options.windowsVerbatimArguments=!0}return q}function m0(q,L,$){if(L&&!Array.isArray(L))$=L,L=null;L=L?L.slice(0):[],$=Object.assign({},$);let G={command:q,args:L,options:$,file:void 0,original:{command:q,args:L}};return $.shell?G:l0(G)}Q0.exports=m0});var Z0=I((Xq,Y0)=>{var S=process.platform==="win32";function j(q,L){return Object.assign(Error(`${L} ${q.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${L} ${q.command}`,path:q.command,spawnargs:q.args})}function n0(q,L){if(!S)return;let $=q.emit;q.emit=function(G,H){if(G==="exit"){let X=V0(H,L);if(X)return $.call(q,"error",X)}return $.apply(q,arguments)}}function V0(q,L){if(S&&q===1&&!L.file)return j(L.original,"spawn");return null}function i0(q,L){if(S&&q===1&&!L.file)return j(L.original,"spawnSync");return null}Y0.exports={hookChildProcess:n0,verifyENOENT:V0,verifyENOENTSync:i0,notFoundError:j}});var d0=I((kq,M)=>{var z0=Z("child_process"),W=U0(),y=Z0();function _0(q,L,$){let G=W(q,L,$),H=z0.spawn(G.command,G.args,G.options);return y.hookChildProcess(H,G),H}function t0(q,L,$){let G=W(q,L,$),H=z0.spawnSync(G.command,G.args,G.options);return H.error=H.error||y.verifyENOENTSync(H.status,G),H}M.exports=_0;M.exports.spawn=_0;M.exports.sync=t0;M.exports._parse=W;M.exports._enoent=y});
3
- export{d0 as Ut};
2
+ import{eO as I,hO as Z}from"./chunk-0rmmg3g4.js";var x=I((r0,u)=>{u.exports=v;v.sync=K0;var N=Z("fs");function T0(q,L){var $=L.pathExt!==void 0?L.pathExt:process.env.PATHEXT;if(!$)return!0;if($=$.split(";"),$.indexOf("")!==-1)return!0;for(var G=0;G<$.length;G++){var H=$[G].toLowerCase();if(H&&q.substr(-H.length).toLowerCase()===H)return!0}return!1}function R(q,L,$){if(!q.isSymbolicLink()&&!q.isFile())return!1;return T0(L,$)}function v(q,L,$){N.stat(q,function(G,H){$(G,G?!1:R(H,q,L))})}function K0(q,L){return R(N.statSync(q),q,L)}});var g=I((o0,E)=>{E.exports=b;b.sync=f0;var C=Z("fs");function b(q,L,$){C.stat(q,function(G,H){$(G,G?!1:w(H,L))})}function f0(q,L){return w(C.statSync(q),L)}function w(q,L){return q.isFile()&&A0(q,L)}function A0(q,L){var{mode:$,uid:G,gid:H}=q,X=L.uid!==void 0?L.uid:process.getuid&&process.getuid(),k=L.gid!==void 0?L.gid:process.getgid&&process.getgid(),J=parseInt("100",8),Y=parseInt("010",8),B=parseInt("001",8),V=J|Y,Q=$&B||$&Y&&H===k||$&J&&G===X||$&V&&X===0;return Q}});var h=I((s0,c)=>{var p0=Z("fs"),K;if(process.platform==="win32"||global.TESTING_WINDOWS)K=x();else K=g();c.exports=A;A.sync=D0;function A(q,L,$){if(typeof L==="function")$=L,L={};if(!$){if(typeof Promise!=="function")throw TypeError("callback not provided");return new Promise(function(G,H){A(q,L||{},function(X,k){if(X)H(X);else G(k)})})}K(q,L||{},function(G,H){if(G){if(G.code==="EACCES"||L&&L.ignoreErrors)G=null,H=!1}$(G,H)})}function D0(q,L){try{return K.sync(q,L||{})}catch($){if(L&&L.ignoreErrors||$.code==="EACCES")return!1;else throw $}}});var r=I((a0,d)=>{var _=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",l=Z("path"),F0=_?";":":",m=h(),n=(q)=>Object.assign(Error(`not found: ${q}`),{code:"ENOENT"}),i=(q,L)=>{let $=L.colon||F0,G=q.match(/\//)||_&&q.match(/\\/)?[""]:[..._?[process.cwd()]:[],...(L.path||process.env.PATH||"").split($)],H=_?L.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",X=_?H.split($):[""];if(_){if(q.indexOf(".")!==-1&&X[0]!=="")X.unshift("")}return{pathEnv:G,pathExt:X,pathExtExe:H}},t=(q,L,$)=>{if(typeof L==="function")$=L,L={};if(!L)L={};let{pathEnv:G,pathExt:H,pathExtExe:X}=i(q,L),k=[],J=(B)=>new Promise((V,Q)=>{if(B===G.length)return L.all&&k.length?V(k):Q(n(q));let U=G[B],T=/^".*"$/.test(U)?U.slice(1,-1):U,z=l.join(T,q),f=!T&&/^\.[\\\/]/.test(q)?q.slice(0,2)+z:z;V(Y(f,B,0))}),Y=(B,V,Q)=>new Promise((U,T)=>{if(Q===H.length)return U(J(V+1));let z=H[Q];m(B+z,{pathExt:X},(f,M0)=>{if(!f&&M0)if(L.all)k.push(B+z);else return U(B+z);return U(Y(B,V,Q+1))})});return $?J(0).then((B)=>$(null,B),$):J(0)},O0=(q,L)=>{L=L||{};let{pathEnv:$,pathExt:G,pathExtExe:H}=i(q,L),X=[];for(let k=0;k<$.length;k++){let J=$[k],Y=/^".*"$/.test(J)?J.slice(1,-1):J,B=l.join(Y,q),V=!Y&&/^\.[\\\/]/.test(q)?q.slice(0,2)+B:B;for(let Q=0;Q<G.length;Q++){let U=V+G[Q];try{if(m.sync(U,{pathExt:H}))if(L.all)X.push(U);else return U}catch(T){}}}if(L.all&&X.length)return X;if(L.nothrow)return null;throw n(q)};d.exports=t;t.sync=O0});var p=I((e0,D)=>{var o=(q={})=>{let L=q.env||process.env;if((q.platform||process.platform)!=="win32")return"PATH";return Object.keys(L).reverse().find((G)=>G.toUpperCase()==="PATH")||"Path"};D.exports=o;D.exports.default=o});var q0=I((qq,e)=>{var s=Z("path"),P0=r(),S0=p();function a(q,L){let $=q.options.env||process.env,G=process.cwd(),H=q.options.cwd!=null,X=H&&process.chdir!==void 0&&!process.chdir.disabled;if(X)try{process.chdir(q.options.cwd)}catch(J){}let k;try{k=P0.sync(q.command,{path:$[S0({env:$})],pathExt:L?s.delimiter:void 0})}catch(J){}finally{if(X)process.chdir(G)}if(k)k=s.resolve(H?q.options.cwd:"",k);return k}function j0(q){return a(q)||a(q,!0)}e.exports=j0});var L0=I((N0,O)=>{var F=/([()\][%!^"`<>&|;, *?])/g;function W0(q){return q=q.replace(F,"^$1"),q}function y0(q,L){if(q=`${q}`,q=q.replace(/(?=(\\+?)?)\1"/g,"$1$1\\\""),q=q.replace(/(?=(\\+?)?)\1$/,"$1$1"),q=`"${q}"`,q=q.replace(F,"^$1"),L)q=q.replace(F,"^$1");return q}N0.command=W0;N0.argument=y0});var G0=I((Lq,$0)=>{$0.exports=/^#!(.*)/});var X0=I(($q,H0)=>{var u0=G0();H0.exports=(q="")=>{let L=q.match(u0);if(!L)return null;let[$,G]=L[0].replace(/#! ?/,"").split(" "),H=$.split("/").pop();if(H==="env")return G;return G?`${H} ${G}`:H}});var B0=I((Gq,k0)=>{var P=Z("fs"),x0=X0();function C0(q){let $=Buffer.alloc(150),G;try{G=P.openSync(q,"r"),P.readSync(G,$,0,150,0),P.closeSync(G)}catch(H){}return x0($.toString())}k0.exports=C0});var U0=I((Hq,Q0)=>{var b0=Z("path"),I0=q0(),J0=L0(),w0=B0(),E0=process.platform==="win32",g0=/\.(?:com|exe)$/i,c0=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function h0(q){q.file=I0(q);let L=q.file&&w0(q.file);if(L)return q.args.unshift(q.file),q.command=L,I0(q);return q.file}function l0(q){if(!E0)return q;let L=h0(q),$=!g0.test(L);if(q.options.forceShell||$){let G=c0.test(L);q.command=b0.normalize(q.command),q.command=J0.command(q.command),q.args=q.args.map((X)=>J0.argument(X,G));let H=[q.command].concat(q.args).join(" ");q.args=["/d","/s","/c",`"${H}"`],q.command=process.env.comspec||"cmd.exe",q.options.windowsVerbatimArguments=!0}return q}function m0(q,L,$){if(L&&!Array.isArray(L))$=L,L=null;L=L?L.slice(0):[],$=Object.assign({},$);let G={command:q,args:L,options:$,file:void 0,original:{command:q,args:L}};return $.shell?G:l0(G)}Q0.exports=m0});var Z0=I((Xq,Y0)=>{var S=process.platform==="win32";function j(q,L){return Object.assign(Error(`${L} ${q.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${L} ${q.command}`,path:q.command,spawnargs:q.args})}function n0(q,L){if(!S)return;let $=q.emit;q.emit=function(G,H){if(G==="exit"){let X=V0(H,L);if(X)return $.call(q,"error",X)}return $.apply(q,arguments)}}function V0(q,L){if(S&&q===1&&!L.file)return j(L.original,"spawn");return null}function i0(q,L){if(S&&q===1&&!L.file)return j(L.original,"spawnSync");return null}Y0.exports={hookChildProcess:n0,verifyENOENT:V0,verifyENOENTSync:i0,notFoundError:j}});var d0=I((kq,M)=>{var z0=Z("child_process"),W=U0(),y=Z0();function _0(q,L,$){let G=W(q,L,$),H=z0.spawn(G.command,G.args,G.options);return y.hookChildProcess(H,G),H}function t0(q,L,$){let G=W(q,L,$),H=z0.spawnSync(G.command,G.args,G.options);return H.error=H.error||y.verifyENOENTSync(H.status,G),H}M.exports=_0;M.exports.spawn=_0;M.exports.sync=t0;M.exports._parse=W;M.exports._enoent=y});
3
+ export{d0 as Xs};