@qitqode/qitqode-android-arm64 0.1.33 → 0.1.35

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 (386) hide show
  1. package/bundle/{chunk-x4sp99g6.js → chunk-03xppy47.js} +1 -1
  2. package/bundle/chunk-0442cmw2.js +2 -0
  3. package/bundle/{chunk-2vn41ecx.js → chunk-04hvaaje.js} +1 -1
  4. package/bundle/{chunk-6phh70sp.js → chunk-06k6egt2.js} +1 -1
  5. package/bundle/{chunk-x5trw1f5.js → chunk-085pvqr4.js} +1 -1
  6. package/bundle/{chunk-8n20thvd.js → chunk-08f4khsw.js} +2 -2
  7. package/bundle/{chunk-mk1bfzg5.js → chunk-08m0hkdz.js} +1 -1
  8. package/bundle/{chunk-kfxv5rfg.js → chunk-09pkckr1.js} +1 -1
  9. package/bundle/{chunk-6kp07m7p.js → chunk-0c6ep9mc.js} +1 -1
  10. package/bundle/{chunk-0v0vqbn5.js → chunk-0h8wdch6.js} +1 -1
  11. package/bundle/{chunk-t56r99hp.js → chunk-0msqaywp.js} +1 -1
  12. package/bundle/chunk-0x5jn813.js +2 -0
  13. package/bundle/{chunk-yphsjp71.js → chunk-11g2rpv8.js} +1 -1
  14. package/bundle/{chunk-vhe0tth1.js → chunk-11v7vz3y.js} +1 -1
  15. package/bundle/{chunk-1sgahe1s.js → chunk-1byd3wma.js} +1 -1
  16. package/bundle/{chunk-x3y2xzhn.js → chunk-1dtzxt2w.js} +1 -1
  17. package/bundle/{chunk-31qrzrwy.js → chunk-1gf116rg.js} +1 -1
  18. package/bundle/{chunk-05mce0j3.js → chunk-1me21qdc.js} +1 -1
  19. package/bundle/{chunk-rvkrgkeq.js → chunk-1pg6pv0m.js} +1 -1
  20. package/bundle/{chunk-0bbs01f0.js → chunk-1yt5rsew.js} +1 -1
  21. package/bundle/chunk-28t9akfn.js +2 -0
  22. package/bundle/{chunk-52bam8g7.js → chunk-2h1fcqvf.js} +1 -1
  23. package/bundle/{chunk-vykgpaqt.js → chunk-2kens6wh.js} +1 -1
  24. package/bundle/chunk-2scyp9ns.js +2 -0
  25. package/bundle/{chunk-hbbsbyyq.js → chunk-2swch6mx.js} +1 -1
  26. package/bundle/chunk-2tw58kwb.js +2 -0
  27. package/bundle/chunk-2vxx0tax.js +2 -0
  28. package/bundle/chunk-2ybt3p5z.js +2 -0
  29. package/bundle/chunk-2zpkw3ge.js +2 -0
  30. package/bundle/{chunk-zzv0yayn.js → chunk-31g86yn6.js} +1 -1
  31. package/bundle/{chunk-xthkjax9.js → chunk-34p46th6.js} +1 -1
  32. package/bundle/chunk-397be2x0.js +2 -0
  33. package/bundle/chunk-3c78nkgn.js +2 -0
  34. package/bundle/{chunk-g453xy7p.js → chunk-3d91q2qd.js} +1 -1
  35. package/bundle/{chunk-7xm75w1e.js → chunk-3k2b05fv.js} +1 -1
  36. package/bundle/{chunk-tvdmnee6.js → chunk-3mzcr3fw.js} +1 -1
  37. package/bundle/{chunk-enpzvmtc.js → chunk-41v0x1jk.js} +1 -1
  38. package/bundle/chunk-43yv7tz1.js +2 -0
  39. package/bundle/chunk-496ajawz.js +2 -0
  40. package/bundle/{chunk-78ymd20x.js → chunk-499gp5g5.js} +1 -1
  41. package/bundle/{chunk-ea5ph627.js → chunk-4hzm14xt.js} +1 -1
  42. package/bundle/{chunk-rzhdkkpz.js → chunk-4ttf9rjd.js} +1 -1
  43. package/bundle/{chunk-vywnd5sf.js → chunk-4wxxyrxn.js} +1 -1
  44. package/bundle/chunk-4xw14sed.js +2 -0
  45. package/bundle/chunk-536naqqv.js +2 -0
  46. package/bundle/{chunk-0h6rn479.js → chunk-54wh8b12.js} +1 -1
  47. package/bundle/chunk-57nvmhjq.js +2 -0
  48. package/bundle/{chunk-60v5jvgt.js → chunk-5a7fs1hg.js} +1 -1
  49. package/bundle/{chunk-tc18nbmn.js → chunk-5e4fxy99.js} +44 -44
  50. package/bundle/chunk-5he3d7cy.js +2 -0
  51. package/bundle/{chunk-r1zf109g.js → chunk-5qr286w8.js} +1 -1
  52. package/bundle/{chunk-srt5peec.js → chunk-606vpgc4.js} +1 -1
  53. package/bundle/{chunk-gwp17r03.js → chunk-67d5d8mr.js} +1 -1
  54. package/bundle/{chunk-gxq9vh1z.js → chunk-6a1skxcj.js} +1 -1
  55. package/bundle/{chunk-ftnadrks.js → chunk-6a77w77q.js} +1 -1
  56. package/bundle/{chunk-yek0sk2q.js → chunk-6a7c7wnf.js} +1 -1
  57. package/bundle/chunk-6cj7cn5x.js +2 -0
  58. package/bundle/{chunk-fgg9txzb.js → chunk-6gb65bv1.js} +1 -1
  59. package/bundle/{chunk-rh9vnpgr.js → chunk-6ged58yw.js} +1 -1
  60. package/bundle/chunk-6hybp2mt.js +2 -0
  61. package/bundle/{chunk-d6ry9418.js → chunk-6p94fpbn.js} +2 -2
  62. package/bundle/{chunk-xcmgkc57.js → chunk-6styp5dn.js} +1 -1
  63. package/bundle/chunk-6y423jax.js +3 -0
  64. package/bundle/{chunk-ejrhvy38.js → chunk-6ynxf3q7.js} +1 -1
  65. package/bundle/{chunk-cfgvm15x.js → chunk-71zw0qhf.js} +1 -1
  66. package/bundle/chunk-72ghkgcn.js +2 -0
  67. package/bundle/{chunk-bh53dz71.js → chunk-7311jry1.js} +1 -1
  68. package/bundle/{chunk-d07p6fpk.js → chunk-73myw3bj.js} +2 -2
  69. package/bundle/chunk-741teh8k.js +2 -0
  70. package/bundle/{chunk-10bjs581.js → chunk-79agp7v3.js} +2 -2
  71. package/bundle/chunk-7b3wx6kn.js +2 -0
  72. package/bundle/{chunk-40efytmk.js → chunk-7eexey82.js} +1 -1
  73. package/bundle/{chunk-33e9y2aw.js → chunk-7mxt5b0h.js} +1 -1
  74. package/bundle/{chunk-yjf3kyej.js → chunk-7vd91wsd.js} +1 -1
  75. package/bundle/{chunk-nv3eyyaj.js → chunk-81trveht.js} +1 -1
  76. package/bundle/{chunk-dnwefyhv.js → chunk-8762ty72.js} +1 -1
  77. package/bundle/{chunk-qc8rsn4v.js → chunk-891yevv2.js} +1 -1
  78. package/bundle/{chunk-ctpy42xe.js → chunk-8c1ypgw5.js} +1 -1
  79. package/bundle/{chunk-8qswepp2.js → chunk-8ktgy41r.js} +1 -1
  80. package/bundle/{chunk-w18xs2h5.js → chunk-8q73cjyj.js} +1 -1
  81. package/bundle/chunk-8rt63jbm.js +2 -0
  82. package/bundle/{chunk-481k3dag.js → chunk-8vg4fmg2.js} +20 -20
  83. package/bundle/chunk-8y623qdx.js +2 -0
  84. package/bundle/chunk-921vn745.js +2 -0
  85. package/bundle/chunk-945ebhte.js +2 -0
  86. package/bundle/{chunk-4jtxtkj7.js → chunk-94pcpztx.js} +2 -2
  87. package/bundle/chunk-9548cc0c.js +2 -0
  88. package/bundle/{chunk-ff8nb7b3.js → chunk-9ayxg9mq.js} +1 -1
  89. package/bundle/{chunk-a7amey9s.js → chunk-9fxkh84w.js} +1 -1
  90. package/bundle/{chunk-8hytwgwf.js → chunk-9qdr9t8c.js} +1 -1
  91. package/bundle/{chunk-gt31468k.js → chunk-9x25d115.js} +1 -1
  92. package/bundle/{chunk-s08qccxa.js → chunk-9yrypq1r.js} +1 -1
  93. package/bundle/{chunk-zs8kqdsf.js → chunk-a0rp7gh4.js} +2 -2
  94. package/bundle/chunk-a1hzeejj.js +5 -0
  95. package/bundle/{chunk-tq0239xp.js → chunk-a3a1trap.js} +1 -1
  96. package/bundle/{chunk-n9xns8by.js → chunk-a48t0g95.js} +2 -2
  97. package/bundle/{chunk-d8dsdcb3.js → chunk-a949at1c.js} +1 -1
  98. package/bundle/{chunk-n1600mnf.js → chunk-aa8hymcv.js} +1 -1
  99. package/bundle/chunk-akk84fnc.js +2 -0
  100. package/bundle/chunk-aw7j7brm.js +2 -0
  101. package/bundle/{chunk-e1w70zdn.js → chunk-axdzm75h.js} +2 -2
  102. package/bundle/{chunk-js1n8tgv.js → chunk-azhw650z.js} +1 -1
  103. package/bundle/{chunk-t8m74g39.js → chunk-b4knxpqh.js} +1 -1
  104. package/bundle/{chunk-a1kazz9r.js → chunk-b6cybdj3.js} +1 -1
  105. package/bundle/{chunk-jef04wyf.js → chunk-ba3h1pzs.js} +1 -1
  106. package/bundle/{chunk-71xz70r9.js → chunk-bbzztav6.js} +1 -1
  107. package/bundle/{chunk-dactgryw.js → chunk-bj00xk8k.js} +1 -1
  108. package/bundle/{chunk-cxnfy6qk.js → chunk-bk4phk66.js} +1 -1
  109. package/bundle/{chunk-e01wnqvc.js → chunk-bnss5dkk.js} +1 -1
  110. package/bundle/{chunk-fvzwbjh8.js → chunk-bv29k2pf.js} +1 -1
  111. package/bundle/{chunk-v1xjc3s8.js → chunk-by855es0.js} +1 -1
  112. package/bundle/{chunk-zy9w1vkc.js → chunk-c5fa8cb1.js} +1 -1
  113. package/bundle/{chunk-x9rbv6p6.js → chunk-c5pb87yf.js} +1 -1
  114. package/bundle/{chunk-ck2gfaba.js → chunk-c6vfwjg4.js} +1 -1
  115. package/bundle/{chunk-2et3wkjy.js → chunk-ca4r31we.js} +1 -1
  116. package/bundle/chunk-ckbwdrm3.js +2 -0
  117. package/bundle/{chunk-a3aqmm3x.js → chunk-cqj21rfj.js} +1 -1
  118. package/bundle/{chunk-3632wgg1.js → chunk-cs38g1bx.js} +1 -1
  119. package/bundle/{chunk-53bqcctj.js → chunk-cz3h5n1v.js} +1 -1
  120. package/bundle/{chunk-rg0mrprz.js → chunk-d00c1k9w.js} +1 -1
  121. package/bundle/{chunk-p18axz0m.js → chunk-dcndy4sr.js} +1 -1
  122. package/bundle/{chunk-e7ny0b3x.js → chunk-dctj3c22.js} +1 -1
  123. package/bundle/{chunk-vvxmwyrw.js → chunk-df2aswz3.js} +1 -1
  124. package/bundle/{chunk-skqbaadf.js → chunk-dffhkd30.js} +1 -1
  125. package/bundle/chunk-dhc6e1t7.js +2 -0
  126. package/bundle/{chunk-pe29yy6s.js → chunk-dhqaqeq6.js} +1 -1
  127. package/bundle/chunk-dk6rbqvp.js +2 -0
  128. package/bundle/{chunk-te47zdxd.js → chunk-dk975etf.js} +2 -2
  129. package/bundle/chunk-dwajajaq.js +2 -0
  130. package/bundle/{chunk-dryzt12j.js → chunk-dxcrggvq.js} +1 -1
  131. package/bundle/chunk-dyt3n3fe.js +2 -0
  132. package/bundle/{chunk-fn9h4ync.js → chunk-dyv2hqvc.js} +1 -1
  133. package/bundle/{chunk-93p131d5.js → chunk-e6xnynaz.js} +1 -1
  134. package/bundle/{chunk-wefez1gt.js → chunk-e74efvj2.js} +6 -6
  135. package/bundle/chunk-e7ah0e61.js +2 -0
  136. package/bundle/{chunk-tqj69nh6.js → chunk-e7v9trve.js} +2 -2
  137. package/bundle/chunk-e8ws454m.js +2 -0
  138. package/bundle/{chunk-chpr8ekb.js → chunk-ebcdxmdd.js} +1 -1
  139. package/bundle/{chunk-zw815d68.js → chunk-ee23d2nz.js} +2 -2
  140. package/bundle/chunk-efndtzby.js +2 -0
  141. package/bundle/{chunk-gb00fh4z.js → chunk-egn55fa2.js} +3 -3
  142. package/bundle/chunk-eq2pepce.js +2 -0
  143. package/bundle/{chunk-rryytkmg.js → chunk-er38zew1.js} +2 -2
  144. package/bundle/{chunk-mpkvpn2y.js → chunk-eva3nqqb.js} +2 -2
  145. package/bundle/{chunk-s2x0rqj4.js → chunk-exmw8jfa.js} +1 -1
  146. package/bundle/{chunk-famryv52.js → chunk-f3bnn9rf.js} +2 -2
  147. package/bundle/chunk-f693s9vn.js +2 -0
  148. package/bundle/{chunk-0dt0bxz6.js → chunk-fg35hwa0.js} +2 -2
  149. package/bundle/{chunk-ktzq4ha1.js → chunk-fmq0m4k5.js} +1 -1
  150. package/bundle/chunk-ftepqwyq.js +2 -0
  151. package/bundle/chunk-g18ax6yp.js +2 -0
  152. package/bundle/{chunk-jh0bw59r.js → chunk-g4gjz7sq.js} +1 -1
  153. package/bundle/{chunk-g5rabwre.js → chunk-g6cyhxwg.js} +2 -2
  154. package/bundle/chunk-gadyp6mb.js +2 -0
  155. package/bundle/{chunk-q6pn67ps.js → chunk-gckgaqqr.js} +1 -1
  156. package/bundle/{chunk-fgzk49cr.js → chunk-ge8315te.js} +1 -1
  157. package/bundle/{chunk-a1wdeapb.js → chunk-ggydr1ze.js} +1 -1
  158. package/bundle/chunk-gk28ffhg.js +2 -0
  159. package/bundle/{chunk-c11d28qn.js → chunk-gmzrvxnv.js} +2 -2
  160. package/bundle/chunk-gpfc4z4v.js +2 -0
  161. package/bundle/chunk-gqvg02zp.js +2 -0
  162. package/bundle/chunk-gsyt2sv7.js +2 -0
  163. package/bundle/{chunk-3c6p8tm3.js → chunk-gws1rn1v.js} +1 -1
  164. package/bundle/{chunk-hnzegjgv.js → chunk-gy0wm7e1.js} +1 -1
  165. package/bundle/{chunk-pp2eqkse.js → chunk-h3k1dk9m.js} +1 -1
  166. package/bundle/chunk-h8c3dcqt.js +2 -0
  167. package/bundle/chunk-hfq11w4h.js +2 -0
  168. package/bundle/{chunk-01my2y0c.js → chunk-hj3ddt53.js} +1 -1
  169. package/bundle/{chunk-rzt0ge3t.js → chunk-hv6eccx1.js} +4 -4
  170. package/bundle/{chunk-ay8emwym.js → chunk-hw5qyht3.js} +1 -1
  171. package/bundle/chunk-hwf58w1k.js +2 -0
  172. package/bundle/{chunk-kq6b222y.js → chunk-jgjnz82k.js} +1 -1
  173. package/bundle/{chunk-wfb608qf.js → chunk-jkh6eg7d.js} +3 -3
  174. package/bundle/{chunk-5gmjtmc4.js → chunk-jyczz3yh.js} +2 -2
  175. package/bundle/{chunk-np50azpb.js → chunk-k8k8z6b7.js} +2 -2
  176. package/bundle/{chunk-6hpgb8h4.js → chunk-ke7n9t5p.js} +3 -3
  177. package/bundle/{chunk-vcw00k0n.js → chunk-keveg5gx.js} +2 -2
  178. package/bundle/{chunk-dxpj0cxh.js → chunk-kfmz2p27.js} +2 -2
  179. package/bundle/{chunk-xm7wascx.js → chunk-kjyw00jp.js} +1 -1
  180. package/bundle/chunk-kk3ve911.js +2 -0
  181. package/bundle/{chunk-gsar6xda.js → chunk-kmcsz8yv.js} +1 -1
  182. package/bundle/{chunk-4cnwn1rh.js → chunk-kv72hxkp.js} +2 -2
  183. package/bundle/{chunk-kj20f048.js → chunk-kwx9ewe0.js} +1 -1
  184. package/bundle/chunk-m4j7jyrd.js +3 -0
  185. package/bundle/{chunk-5hw6xa49.js → chunk-md8161zd.js} +1 -1
  186. package/bundle/{chunk-xzrb857v.js → chunk-mex0fe9s.js} +1 -1
  187. package/bundle/{chunk-ctaze2hn.js → chunk-mf3sm0pk.js} +1 -1
  188. package/bundle/chunk-mkng9ykt.js +2 -0
  189. package/bundle/{chunk-mzs2pjyc.js → chunk-mpygdb5a.js} +2 -2
  190. package/bundle/{chunk-81qwdg5s.js → chunk-mq6jn47r.js} +1 -1
  191. package/bundle/{chunk-yp8wyzzm.js → chunk-mr8j7rc6.js} +1 -1
  192. package/bundle/{chunk-48nm6v8b.js → chunk-mxvypy3s.js} +1 -1
  193. package/bundle/chunk-n5ypgxrn.js +28 -0
  194. package/bundle/{chunk-h4j5xzc8.js → chunk-n6gtdx5h.js} +1 -1
  195. package/bundle/{chunk-h2afsbm1.js → chunk-n6msxne8.js} +1 -1
  196. package/bundle/{chunk-jbx3s7nw.js → chunk-n96tvjgj.js} +2 -2
  197. package/bundle/{chunk-ftas05da.js → chunk-n9xw9kqc.js} +1 -1
  198. package/bundle/{chunk-v7w4nfn7.js → chunk-nc4wbc89.js} +1 -1
  199. package/bundle/{chunk-9f1z9xce.js → chunk-ngccf7ga.js} +1 -1
  200. package/bundle/{chunk-2bn2b29j.js → chunk-ngk67rt3.js} +1 -1
  201. package/bundle/{chunk-0t4324w5.js → chunk-nj2bbtmx.js} +1 -1
  202. package/bundle/chunk-nj4d554m.js +11 -0
  203. package/bundle/{chunk-dynv30gm.js → chunk-nj61v4n7.js} +1 -1
  204. package/bundle/{chunk-12vef2pr.js → chunk-nkk4fyqf.js} +1 -1
  205. package/bundle/{chunk-gbpvs0fx.js → chunk-nmehsm3w.js} +1 -1
  206. package/bundle/chunk-nr1g57b2.js +2 -0
  207. package/bundle/chunk-p0ahbpxv.js +2 -0
  208. package/bundle/{chunk-73e409hd.js → chunk-p3qkexpk.js} +1 -1
  209. package/bundle/chunk-p7y8z5rd.js +2 -0
  210. package/bundle/{chunk-yhbcbjfk.js → chunk-p825vsjy.js} +1 -1
  211. package/bundle/{chunk-rbk8seme.js → chunk-p9cnzxb8.js} +1 -1
  212. package/bundle/{chunk-15hw2z9t.js → chunk-pkc4ddw1.js} +1 -1
  213. package/bundle/{chunk-1gx18dm5.js → chunk-prh3c44x.js} +1 -1
  214. package/bundle/chunk-pt26gerr.js +2 -0
  215. package/bundle/{chunk-zscer8rc.js → chunk-pxmhe36r.js} +1 -1
  216. package/bundle/{chunk-g7ccdh7r.js → chunk-q8hd01j7.js} +1 -1
  217. package/bundle/{chunk-e10py6yr.js → chunk-qa2j0qmy.js} +1 -1
  218. package/bundle/{chunk-g10d6x57.js → chunk-qddt2gcs.js} +1 -1
  219. package/bundle/{chunk-y3b4k38p.js → chunk-qg2vk5fw.js} +1 -1
  220. package/bundle/{chunk-7z5jh4ra.js → chunk-qkjdr337.js} +1 -1
  221. package/bundle/chunk-qkk1as5n.js +2 -0
  222. package/bundle/{chunk-5q4harvc.js → chunk-qrtc3etn.js} +2 -2
  223. package/bundle/chunk-qsm9xw87.js +2 -0
  224. package/bundle/chunk-qw980y8h.js +2 -0
  225. package/bundle/{chunk-7avcnwv8.js → chunk-qzj6027k.js} +1 -1
  226. package/bundle/{chunk-70ck4v3t.js → chunk-r0k21apr.js} +1 -1
  227. package/bundle/chunk-r2w3gr8d.js +2 -0
  228. package/bundle/chunk-r5bqcpkz.js +2 -0
  229. package/bundle/chunk-r67c858b.js +2 -0
  230. package/bundle/chunk-r9fvfkee.js +2 -0
  231. package/bundle/chunk-rcn0dhbj.js +2 -0
  232. package/bundle/{chunk-69nzndk7.js → chunk-rkwrjphh.js} +1 -1
  233. package/bundle/{chunk-0mx2psfc.js → chunk-rmve21dh.js} +1 -1
  234. package/bundle/chunk-rq47pn3r.js +2 -0
  235. package/bundle/{chunk-b8gjz6bk.js → chunk-rq4w0by4.js} +1 -1
  236. package/bundle/{chunk-jrqb0jwy.js → chunk-rsszcqxd.js} +1 -1
  237. package/bundle/{chunk-xvwvd4kq.js → chunk-rv1stdvb.js} +1 -1
  238. package/bundle/chunk-rvt1tdy8.js +2 -0
  239. package/bundle/{chunk-3bxg5bta.js → chunk-ry7q8xn6.js} +1 -1
  240. package/bundle/{chunk-rjd8gbs5.js → chunk-ryfqwsft.js} +1 -1
  241. package/bundle/chunk-s27xvrft.js +2 -0
  242. package/bundle/{chunk-p9qfbr02.js → chunk-s4qtphwx.js} +1 -1
  243. package/bundle/{chunk-4fgzp2zd.js → chunk-s5nde2kd.js} +1 -1
  244. package/bundle/{chunk-qrsveve6.js → chunk-s8hq6trz.js} +1 -1
  245. package/bundle/chunk-scy39p6q.js +2 -0
  246. package/bundle/{chunk-71sjjjr8.js → chunk-seghf5fc.js} +1 -1
  247. package/bundle/{chunk-2zq4k837.js → chunk-sfes6pp1.js} +1 -1
  248. package/bundle/{chunk-qn6gdhns.js → chunk-sjw56r2n.js} +2 -2
  249. package/bundle/{chunk-htz93dsd.js → chunk-snr44en9.js} +2 -2
  250. package/bundle/{chunk-pfyhg0m7.js → chunk-srpe3v8e.js} +1 -1
  251. package/bundle/{chunk-cphrgyp6.js → chunk-ssk8tkwd.js} +1 -1
  252. package/bundle/{chunk-ccmbckek.js → chunk-st5jaszz.js} +1 -1
  253. package/bundle/{chunk-mrt1z4m8.js → chunk-t2vm08v6.js} +1 -1
  254. package/bundle/{chunk-vrc0h1q7.js → chunk-t3eymzg1.js} +1 -1
  255. package/bundle/{chunk-yv0xrnn9.js → chunk-t5qamf96.js} +1 -1
  256. package/bundle/{chunk-xn70ep9n.js → chunk-tbgczapt.js} +1 -1
  257. package/bundle/chunk-tns5x4w0.js +3 -0
  258. package/bundle/chunk-ttevj0pj.js +2 -0
  259. package/bundle/{chunk-rvfvk2ty.js → chunk-txbwmwxj.js} +1 -1
  260. package/bundle/chunk-v7c54cyj.js +2 -0
  261. package/bundle/chunk-vgefaens.js +2 -0
  262. package/bundle/{chunk-24jg9d61.js → chunk-vsr8mnj6.js} +1 -1
  263. package/bundle/{chunk-6d5rrre9.js → chunk-vszbqv24.js} +1 -1
  264. package/bundle/chunk-vv59b4re.js +2 -0
  265. package/bundle/chunk-vwqy7n3g.js +2 -0
  266. package/bundle/{chunk-n6wt9m2k.js → chunk-vysa9hp4.js} +1 -1
  267. package/bundle/{chunk-a1g7jr3r.js → chunk-w1n4rf6n.js} +1 -1
  268. package/bundle/{chunk-gagtmjmp.js → chunk-wfd5h6ax.js} +2 -2
  269. package/bundle/{chunk-ht5w06x7.js → chunk-wgk7ynt3.js} +2 -2
  270. package/bundle/chunk-wn076jwj.js +2 -0
  271. package/bundle/{chunk-35xk4g91.js → chunk-wvf5q2hz.js} +1 -1
  272. package/bundle/chunk-x0m1qye9.js +2 -0
  273. package/bundle/{chunk-p62gb4wj.js → chunk-x66ycpfs.js} +1 -1
  274. package/bundle/{chunk-48ge2ryx.js → chunk-xgr6jnd6.js} +1 -1
  275. package/bundle/{chunk-2hc5z7b5.js → chunk-xqdrr7xg.js} +1 -1
  276. package/bundle/{chunk-bnap670d.js → chunk-xvntsbb1.js} +1 -1
  277. package/bundle/{chunk-ss2ms1r3.js → chunk-y437vyza.js} +1 -1
  278. package/bundle/chunk-y70aachh.js +2 -0
  279. package/bundle/{chunk-db405hjg.js → chunk-y9zstzed.js} +1 -1
  280. package/bundle/{chunk-pp6vhqrr.js → chunk-yjk6zv2z.js} +1 -1
  281. package/bundle/{chunk-326p5b10.js → chunk-yk97q51d.js} +1 -1
  282. package/bundle/{chunk-kf167jw7.js → chunk-ynwkr3yh.js} +1 -1
  283. package/bundle/{chunk-9bzhxenb.js → chunk-yprmd5b7.js} +2 -2
  284. package/bundle/{chunk-y9q0hb7b.js → chunk-yqk58hf6.js} +2 -2
  285. package/bundle/chunk-ysgxt83y.js +2 -0
  286. package/bundle/{chunk-tt30dybd.js → chunk-yz6898wy.js} +1 -1
  287. package/bundle/{chunk-x562b0xk.js → chunk-z1ay3qd0.js} +1 -1
  288. package/bundle/{chunk-9emq67vc.js → chunk-z7430qxg.js} +1 -1
  289. package/bundle/{chunk-2maqde7w.js → chunk-z8gdmvgg.js} +2 -2
  290. package/bundle/{chunk-3bssxmtg.js → chunk-zddknkw7.js} +1 -1
  291. package/bundle/chunk-ze9e6nt3.js +3 -0
  292. package/bundle/{chunk-vxyy2dp3.js → chunk-zfcp509b.js} +1 -1
  293. package/bundle/{chunk-x7k5yeey.js → chunk-zfn0z4sh.js} +1 -1
  294. package/bundle/{chunk-ag8kz1e7.js → chunk-zh3fny3z.js} +2 -2
  295. package/bundle/{chunk-9k6hz80e.js → chunk-znzan00b.js} +1 -1
  296. package/bundle/chunk-zrp55k47.js +2 -0
  297. package/bundle/chunk-zwdnh860.js +2 -0
  298. package/bundle/{chunk-1vb79bw1.js → chunk-zwnhf4z1.js} +1 -1
  299. package/bundle/index.js +3 -3
  300. package/bundle/parser.worker.js +2 -2
  301. package/bundle/worker.js +1 -1
  302. package/package.json +1 -1
  303. package/bundle/chunk-0e1vkdze.js +0 -2
  304. package/bundle/chunk-0p27fvfr.js +0 -2
  305. package/bundle/chunk-0qs1vx97.js +0 -2
  306. package/bundle/chunk-18bj8z8m.js +0 -28
  307. package/bundle/chunk-19g6dhva.js +0 -2
  308. package/bundle/chunk-1ap7sh2c.js +0 -2
  309. package/bundle/chunk-1rhhhm88.js +0 -2
  310. package/bundle/chunk-1wbjh23g.js +0 -2
  311. package/bundle/chunk-3dadmgxa.js +0 -2
  312. package/bundle/chunk-42p59wm4.js +0 -2
  313. package/bundle/chunk-43xt69m8.js +0 -2
  314. package/bundle/chunk-4512pvca.js +0 -2
  315. package/bundle/chunk-456bmaww.js +0 -2
  316. package/bundle/chunk-48pajrnt.js +0 -2
  317. package/bundle/chunk-4fy9c54h.js +0 -2
  318. package/bundle/chunk-4m5yesw8.js +0 -2
  319. package/bundle/chunk-59y8q9m5.js +0 -2
  320. package/bundle/chunk-5tray1fw.js +0 -3
  321. package/bundle/chunk-5v6b8mr6.js +0 -2
  322. package/bundle/chunk-64ezpbwt.js +0 -2
  323. package/bundle/chunk-6r7z94e6.js +0 -3
  324. package/bundle/chunk-711dc303.js +0 -5
  325. package/bundle/chunk-7mke41x0.js +0 -2
  326. package/bundle/chunk-7ry9cvby.js +0 -2
  327. package/bundle/chunk-7wczs9mx.js +0 -2
  328. package/bundle/chunk-8v96pmqn.js +0 -2
  329. package/bundle/chunk-8y2scz6z.js +0 -2
  330. package/bundle/chunk-8zx7vnx6.js +0 -2
  331. package/bundle/chunk-94a76f8w.js +0 -2
  332. package/bundle/chunk-9ng7jjp7.js +0 -2
  333. package/bundle/chunk-9tpgnjy8.js +0 -2
  334. package/bundle/chunk-a7ym9f0v.js +0 -2
  335. package/bundle/chunk-a8f2xvy3.js +0 -2
  336. package/bundle/chunk-a99cvwta.js +0 -2
  337. package/bundle/chunk-aecc391x.js +0 -2
  338. package/bundle/chunk-avys5mnz.js +0 -2
  339. package/bundle/chunk-axvjd10y.js +0 -2
  340. package/bundle/chunk-b4pphqab.js +0 -2
  341. package/bundle/chunk-b6087ak4.js +0 -2
  342. package/bundle/chunk-bdd97g5y.js +0 -2
  343. package/bundle/chunk-bn0h9dny.js +0 -10
  344. package/bundle/chunk-bnmz683j.js +0 -2
  345. package/bundle/chunk-brkqxbjy.js +0 -2
  346. package/bundle/chunk-c26qxt5g.js +0 -2
  347. package/bundle/chunk-c6zscb38.js +0 -2
  348. package/bundle/chunk-cjww2jmv.js +0 -3
  349. package/bundle/chunk-d2ttw3wf.js +0 -2
  350. package/bundle/chunk-dafmkrhn.js +0 -2
  351. package/bundle/chunk-dgprdym0.js +0 -2
  352. package/bundle/chunk-dsamees2.js +0 -2
  353. package/bundle/chunk-dxje3azs.js +0 -2
  354. package/bundle/chunk-dyqpxx3b.js +0 -2
  355. package/bundle/chunk-etvs6a6y.js +0 -2
  356. package/bundle/chunk-ftn49yn1.js +0 -2
  357. package/bundle/chunk-gwzw92jt.js +0 -2
  358. package/bundle/chunk-hdrbyarv.js +0 -3
  359. package/bundle/chunk-hkqnqw3x.js +0 -2
  360. package/bundle/chunk-hp7tssgv.js +0 -2
  361. package/bundle/chunk-ht0hbdmx.js +0 -2
  362. package/bundle/chunk-m1s19p9n.js +0 -2
  363. package/bundle/chunk-ngm6pqyt.js +0 -2
  364. package/bundle/chunk-ngtavamt.js +0 -2
  365. package/bundle/chunk-nkhc32s3.js +0 -2
  366. package/bundle/chunk-npse2xrd.js +0 -2
  367. package/bundle/chunk-p3pemdns.js +0 -2
  368. package/bundle/chunk-p6e4vqy7.js +0 -2
  369. package/bundle/chunk-pqkjhn8h.js +0 -2
  370. package/bundle/chunk-qd8w2gkd.js +0 -2
  371. package/bundle/chunk-rbbw7bs0.js +0 -2
  372. package/bundle/chunk-rf12t4n5.js +0 -2
  373. package/bundle/chunk-rpgne7xh.js +0 -2
  374. package/bundle/chunk-rvgj1vky.js +0 -2
  375. package/bundle/chunk-ss2jvqrg.js +0 -2
  376. package/bundle/chunk-tt9smgmg.js +0 -2
  377. package/bundle/chunk-tvwwq4b3.js +0 -2
  378. package/bundle/chunk-v2n26eg4.js +0 -2
  379. package/bundle/chunk-v7ezt8k3.js +0 -2
  380. package/bundle/chunk-vqg5q96v.js +0 -2
  381. package/bundle/chunk-x24y7qyd.js +0 -2
  382. package/bundle/chunk-y2d0w09y.js +0 -2
  383. package/bundle/chunk-yb79f79m.js +0 -2
  384. package/bundle/chunk-yjnyzpmt.js +0 -2
  385. package/bundle/chunk-yqbcnsa1.js +0 -2
  386. package/bundle/chunk-z3mra3nm.js +0 -2
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import"./chunk-3k2b05fv.js";var E="./tree-sitter-markdown_inline-j5349f42.wasm";export{E as default};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Fd as m,Id as P,Jd as R,Kd as k,Ld as O,Nd as q,Od as $,Pd as I}from"./chunk-p62gb4wj.js";import"./chunk-x4sp99g6.js";import{Rd as h}from"./chunk-yajd975f.js";import{Vf as r}from"./chunk-rbk8seme.js";import{gh as L}from"./chunk-tc18nbmn.js";import{Uh as E}from"./chunk-481k3dag.js";import"./chunk-vxyy2dp3.js";import"./chunk-yp5bypsp.js";import"./chunk-7hm0c2yg.js";import"./chunk-gj0wt0cy.js";import"./chunk-5hw6xa49.js";import"./chunk-326p5b10.js";import{ck as N,rl as x}from"./chunk-wefez1gt.js";import"./chunk-ccmbckek.js";import{lm as i}from"./chunk-711dc303.js";import"./chunk-qn6gdhns.js";import"./chunk-bn0h9dny.js";import"./chunk-mpkvpn2y.js";import"./chunk-9bzhxenb.js";import"./chunk-htz93dsd.js";import"./chunk-vcw00k0n.js";import"./chunk-famryv52.js";import"./chunk-2hc5z7b5.js";import"./chunk-e1w70zdn.js";import"./chunk-4jtxtkj7.js";import"./chunk-ay8emwym.js";import"./chunk-2maqde7w.js";import"./chunk-kj20f048.js";import"./chunk-cqtkxwd8.js";import"./chunk-x9rbv6p6.js";import"./chunk-g5rabwre.js";import"./chunk-jbx3s7nw.js";import"./chunk-15hw2z9t.js";import"./chunk-48ge2ryx.js";import"./chunk-n9xns8by.js";import"./chunk-y9q0hb7b.js";import"./chunk-rryytkmg.js";import"./chunk-te47zdxd.js";import"./chunk-d6ry9418.js";import"./chunk-0dt0bxz6.js";import"./chunk-10bjs581.js";import"./chunk-4cnwn1rh.js";import"./chunk-0t4324w5.js";import{Qs as j}from"./chunk-hdrbyarv.js";import{st as C}from"./chunk-tqj69nh6.js";import"./chunk-ag8kz1e7.js";import"./chunk-5tray1fw.js";import"./chunk-c11d28qn.js";import"./chunk-mzs2pjyc.js";import"./chunk-gagtmjmp.js";import"./chunk-zs8kqdsf.js";import"./chunk-dxpj0cxh.js";import"./chunk-zw815d68.js";import{BO as F}from"./chunk-7xm75w1e.js";import u from"path";import U from"fs/promises";var T=F(N(),1);import{EOL as S}from"os";var c=["bash","read","write","edit","glob","grep","webfetch","actor","task"],B=h({command:"create",describe:"create a new agent",builder:(o)=>o.option("path",{type:"string",describe:"directory path to generate the agent file"}).option("description",{type:"string",describe:"what the agent should do"}).option("mode",{type:"string",describe:"agent mode",choices:["all","primary","subagent"]}).option("tools",{type:"string",describe:`comma-separated list of tools to enable (default: all). Available: "${c.join(", ")}"`}).option("model",{type:"string",alias:["m"],describe:"model to use in the format of provider/model"}),async handler(o){await i.provide({directory:process.cwd(),async fn(){let{path:l,description:t,mode:s,tools:p}=o,d=l&&t&&s&&p!==void 0;if(!d)r.empty(),R("Create agent");let D=i.project,g;if(l)g=u.join(l,"agent");else{let e="global";if(D.vcs==="git"){let n=await $({message:"Location",options:[{label:"Current project",value:"project",hint:i.worktree},{label:"Global",value:"global",hint:j.Path.config}]});if(m(n))throw new r.CancelledError;e=n}g=u.join(e==="global"?j.Path.config:u.join(i.worktree,".qitqode"),"agent")}let b;if(t)b=t;else{let e=await I({message:"Description",placeholder:"What should this agent do?",validate:(n)=>n&&n.length>0?void 0:"Required"});if(m(e))throw new r.CancelledError;b=e}let w=q();w.start("Generating agent configuration...");let G=o.model?x.parseModel(o.model):void 0,f=await L.runPromise(E.Service.use((e)=>e.generate({description:b,model:G}))).catch((e)=>{if(w.stop(`LLM failed to generate agent: ${e.message}`,1),d)process.exit(1);throw new r.CancelledError});w.stop(`Agent ${f.identifier} generated`);let y;if(p!==void 0)y=p?p.split(",").map((e)=>e.trim()):c;else{let e=await O({message:"Select tools to enable (Space to toggle)",options:c.map((n)=>({label:n,value:n})),initialValues:c});if(m(e))throw new r.CancelledError;y=e}let v;if(s)v=s;else{let e=await $({message:"Agent mode",options:[{label:"All",value:"all",hint:"Can function in both primary and subagent roles"},{label:"Primary",value:"primary",hint:"Acts as a primary/main agent"},{label:"Subagent",value:"subagent",hint:"Can be used as a subagent by other agents"}],initialValue:"all"});if(m(e))throw new r.CancelledError;v=e}let A={};for(let e of c)if(!y.includes(e))A[e]=!1;let M={description:f.whenToUse,mode:v};if(Object.keys(A).length>0)M.tools=A;let V=T.default.stringify(f.systemPrompt,M),a=u.join(g,`${f.identifier}.md`);if(await U.mkdir(g,{recursive:!0}),await C.exists(a)){if(d)console.error(`Error: Agent file already exists: ${a}`),process.exit(1);throw P.error(`Agent file already exists: ${a}`),new r.CancelledError}if(await C.write(a,V),d)console.log(a);else P.success(`Agent created: ${a}`),k("Done")}})}}),J=h({command:"list",describe:"list all available agents",async handler(){await i.provide({directory:process.cwd(),async fn(){let l=(await L.runPromise(E.Service.use((t)=>t.list()))).sort((t,s)=>{if(t.native!==s.native)return t.native?-1:1;return t.name.localeCompare(s.name)});for(let t of l)process.stdout.write(`${t.name} (${t.mode})`+S),process.stdout.write(` ${JSON.stringify(t.permission,null,2)}`+S)}})}}),ne=h({command:"agent",describe:"manage agents",builder:(o)=>o.command(B).command(J).demandCommand(),async handler(){}});export{ne as AgentCommand};
2
+ import{Fd as m,Id as P,Jd as R,Kd as k,Ld as O,Nd as q,Od as $,Pd as I}from"./chunk-x66ycpfs.js";import"./chunk-03xppy47.js";import{Rd as h}from"./chunk-yajd975f.js";import{Vf as r}from"./chunk-p9cnzxb8.js";import{gh as L}from"./chunk-5e4fxy99.js";import{Uh as E}from"./chunk-8vg4fmg2.js";import"./chunk-zfcp509b.js";import"./chunk-yp5bypsp.js";import"./chunk-7hm0c2yg.js";import"./chunk-gj0wt0cy.js";import"./chunk-md8161zd.js";import"./chunk-yk97q51d.js";import{ck as N,rl as x}from"./chunk-e74efvj2.js";import"./chunk-st5jaszz.js";import{lm as i}from"./chunk-a1hzeejj.js";import"./chunk-sjw56r2n.js";import"./chunk-nj4d554m.js";import"./chunk-eva3nqqb.js";import"./chunk-yprmd5b7.js";import"./chunk-snr44en9.js";import"./chunk-keveg5gx.js";import"./chunk-f3bnn9rf.js";import"./chunk-xqdrr7xg.js";import"./chunk-axdzm75h.js";import"./chunk-94pcpztx.js";import"./chunk-hw5qyht3.js";import"./chunk-z8gdmvgg.js";import"./chunk-kwx9ewe0.js";import"./chunk-cqtkxwd8.js";import"./chunk-c5pb87yf.js";import"./chunk-g6cyhxwg.js";import"./chunk-n96tvjgj.js";import"./chunk-pkc4ddw1.js";import"./chunk-xgr6jnd6.js";import"./chunk-a48t0g95.js";import"./chunk-yqk58hf6.js";import"./chunk-er38zew1.js";import"./chunk-dk975etf.js";import"./chunk-6p94fpbn.js";import"./chunk-fg35hwa0.js";import"./chunk-79agp7v3.js";import"./chunk-kv72hxkp.js";import"./chunk-nj2bbtmx.js";import{nu as j}from"./chunk-tns5x4w0.js";import{Ru as C}from"./chunk-e7v9trve.js";import"./chunk-zh3fny3z.js";import"./chunk-m4j7jyrd.js";import"./chunk-gmzrvxnv.js";import"./chunk-mpygdb5a.js";import"./chunk-wfd5h6ax.js";import"./chunk-a0rp7gh4.js";import"./chunk-kfmz2p27.js";import"./chunk-ee23d2nz.js";import{_P as F}from"./chunk-3k2b05fv.js";import u from"path";import U from"fs/promises";var T=F(N(),1);import{EOL as S}from"os";var c=["bash","read","write","edit","glob","grep","webfetch","actor","task"],B=h({command:"create",describe:"create a new agent",builder:(o)=>o.option("path",{type:"string",describe:"directory path to generate the agent file"}).option("description",{type:"string",describe:"what the agent should do"}).option("mode",{type:"string",describe:"agent mode",choices:["all","primary","subagent"]}).option("tools",{type:"string",describe:`comma-separated list of tools to enable (default: all). Available: "${c.join(", ")}"`}).option("model",{type:"string",alias:["m"],describe:"model to use in the format of provider/model"}),async handler(o){await i.provide({directory:process.cwd(),async fn(){let{path:l,description:t,mode:s,tools:p}=o,d=l&&t&&s&&p!==void 0;if(!d)r.empty(),R("Create agent");let D=i.project,g;if(l)g=u.join(l,"agent");else{let e="global";if(D.vcs==="git"){let n=await $({message:"Location",options:[{label:"Current project",value:"project",hint:i.worktree},{label:"Global",value:"global",hint:j.Path.config}]});if(m(n))throw new r.CancelledError;e=n}g=u.join(e==="global"?j.Path.config:u.join(i.worktree,".qitqode"),"agent")}let b;if(t)b=t;else{let e=await I({message:"Description",placeholder:"What should this agent do?",validate:(n)=>n&&n.length>0?void 0:"Required"});if(m(e))throw new r.CancelledError;b=e}let w=q();w.start("Generating agent configuration...");let G=o.model?x.parseModel(o.model):void 0,f=await L.runPromise(E.Service.use((e)=>e.generate({description:b,model:G}))).catch((e)=>{if(w.stop(`LLM failed to generate agent: ${e.message}`,1),d)process.exit(1);throw new r.CancelledError});w.stop(`Agent ${f.identifier} generated`);let y;if(p!==void 0)y=p?p.split(",").map((e)=>e.trim()):c;else{let e=await O({message:"Select tools to enable (Space to toggle)",options:c.map((n)=>({label:n,value:n})),initialValues:c});if(m(e))throw new r.CancelledError;y=e}let v;if(s)v=s;else{let e=await $({message:"Agent mode",options:[{label:"All",value:"all",hint:"Can function in both primary and subagent roles"},{label:"Primary",value:"primary",hint:"Acts as a primary/main agent"},{label:"Subagent",value:"subagent",hint:"Can be used as a subagent by other agents"}],initialValue:"all"});if(m(e))throw new r.CancelledError;v=e}let A={};for(let e of c)if(!y.includes(e))A[e]=!1;let M={description:f.whenToUse,mode:v};if(Object.keys(A).length>0)M.tools=A;let V=T.default.stringify(f.systemPrompt,M),a=u.join(g,`${f.identifier}.md`);if(await U.mkdir(g,{recursive:!0}),await C.exists(a)){if(d)console.error(`Error: Agent file already exists: ${a}`),process.exit(1);throw P.error(`Agent file already exists: ${a}`),new r.CancelledError}if(await C.write(a,V),d)console.log(a);else P.success(`Agent created: ${a}`),k("Done")}})}}),J=h({command:"list",describe:"list all available agents",async handler(){await i.provide({directory:process.cwd(),async fn(){let l=(await L.runPromise(E.Service.use((t)=>t.list()))).sort((t,s)=>{if(t.native!==s.native)return t.native?-1:1;return t.name.localeCompare(s.name)});for(let t of l)process.stdout.write(`${t.name} (${t.mode})`+S),process.stdout.write(` ${JSON.stringify(t.permission,null,2)}`+S)}})}}),ne=h({command:"agent",describe:"manage agents",builder:(o)=>o.command(B).command(J).demandCommand(),async handler(){}});export{ne as AgentCommand};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{In as j,Jn as R,Kn as O,Ln as A,Rn as y,Wn as q,Xn as M,Zn as C,do as K}from"./chunk-9bzhxenb.js";import{Ns as v,Qs as D}from"./chunk-hdrbyarv.js";import{$s as m,bt as b,ht as I,st as d}from"./chunk-tqj69nh6.js";import{GO as T,HO as _}from"./chunk-7xm75w1e.js";import P from"path";function pt(t){let e=t&&typeof t==="object"&&"cause"in t?t.cause??t:t;if(!(e instanceof I.RunFailedError))return{error:e,detail:b(e),missing:!1};let r=e.stderr.toString().split(/\r?\n/).map((o)=>o.trim()).filter(Boolean),n=r.filter((o)=>o.startsWith("error:")).map((o)=>o.replace(/^error:\s*/,""));return{error:e,detail:n[0]??r.at(-1),missing:r.some((o)=>o.includes("No version matching"))}}var $={resolve:(t)=>q(t)},z={readText:(t)=>d.readText(t),write:async(t,e)=>{await d.write(t,e)},exists:(t)=>d.exists(t),files:(t,e)=>K(t,e)},G=z;function V(t){if(typeof t==="string")return t;if(!Array.isArray(t))return;if(typeof t[0]!=="string")return;return t[0]}function H(t){if(!t||typeof t!=="object"||Array.isArray(t))return;let e=t;if(!Array.isArray(e.plugin))return;return e.plugin}function Q(t){if(typeof t==="string"){let e=t.trim();if(e)return e;return}if(!m(t))return;for(let e of["import","default"]){let r=t[e];if(typeof r!=="string")continue;let n=r.trim();if(!n)continue;return n}}function U(t){if(!m(t))return;let e=t.config;if(!m(e))return;return e}function E(t,e){let r=t.exports;if(!m(r))return;let n=r[`./${e}`];if(!Q(n))return;return{opts:U(n)}}function X(t){let e=t.main;if(typeof e!=="string")return!1;return Boolean(e.trim())}function Y(t){let e=typeof t.json.name==="string"&&t.json.name.trim().length>0?t.json.name.trim():P.basename(t.dir),r=[],n=E(t.json,"server");if(n)r.push({kind:"server",opts:n.opts});else if(X(t.json))r.push({kind:"server"});let o=E(t.json,"tui");if(o)r.push({kind:"tui",opts:o.opts});if(!r.some((c)=>c.kind==="tui")&&C(e,t).length)r.push({kind:"tui"});return r}function g(t,e,r,n=!1){return A(t,O(t,e,r,{formattingOptions:{tabSize:2,insertSpaces:!0},isArrayInsertion:n}))}function Z(t,e,r,n,o=!1){let c=y(r).pkg,u=(e??[]).map((i,p)=>({item:i,i:p,spec:V(i)})).filter((i)=>{if(!i.spec)return!1;if(i.spec===r)return!0;if(i.spec.startsWith("file://"))return!1;return y(i.spec).pkg===c});if(!u.length){if(!e)return{mode:"add",text:g(t,["plugin"],[n])};return{mode:"add",text:g(t,["plugin",e.length],n,!0)}}if(!o)return{mode:"noop",text:t};let s=u[0];if(!s)return{mode:"noop",text:t};if(u.length===1&&s.spec===r)return{mode:"noop",text:t};let a=t;if(typeof s.item==="string")a=g(a,["plugin",s.i],n);if(Array.isArray(s.item)&&typeof s.item[0]==="string")a=g(a,["plugin",s.i,0],r);let l=u.map((i)=>i.i).filter((i)=>i!==s.i).sort((i,p)=>p-i);for(let i of l)a=g(a,["plugin",i],void 0);return{mode:"replace",text:a}}async function gt(t,e=$){let r=await e.resolve(t).then((n)=>({ok:!0,item:n}),(n)=>({ok:!1,error:n}));if(!r.ok)return{ok:!1,code:"install_failed",error:r.error};return{ok:!0,target:r.item}}async function dt(t){let e=await M(t).then((n)=>({ok:!0,item:n}),(n)=>({ok:!1,error:n}));if(!e.ok)return{ok:!1,code:"manifest_read_failed",file:t,error:e.error};let r=await Promise.resolve().then(()=>Y(e.item)).then((n)=>({ok:!0,item:n}),(n)=>({ok:!1,error:n}));if(!r.ok)return{ok:!1,code:"manifest_read_failed",file:e.item.pkg,error:r.error};if(!r.item.length)return{ok:!1,code:"manifest_no_targets",file:e.item.pkg};return{ok:!0,targets:r.item}}function tt(t){if(t.global)return t.config??D.Path.config;let r=t.vcs==="git"&&t.worktree!=="/"?t.worktree:t.directory;return P.join(r,".qitqode")}function et(t){if(t==="server")return"qitqode";return"tui"}async function rt(t,e,r,n,o){let x=[];try{let c=et(e.kind);const S=T(x,await v.acquire(`plug-config:${d.resolve(P.join(t,c))}`),1);let u=o.files(t,c);let s=u[0];for(let f of u){if(!await o.exists(f))continue;s=f;break}let a=await o.readText(s).catch((f)=>{if(f.code==="ENOENT")return"{}";return f});if(a instanceof Error)return{ok:!1,code:"patch_failed",kind:e.kind,error:a};let l=a.trim()?a:"{}";let i=[];let p=j(l,i,{allowTrailingComma:!0});if(i.length){let f=i[0],h=l.substring(0,f.offset).split(`
2
+ import{Cp as K,fp as j,gp as R,hp as O,ip as A,op as y,tp as q,up as M,wp as C}from"./chunk-yprmd5b7.js";import{ku as v,nu as D}from"./chunk-tns5x4w0.js";import{Au as b,Gu as I,Ru as d,yu as m}from"./chunk-e7v9trve.js";import{dQ as T,eQ as _}from"./chunk-3k2b05fv.js";import P from"path";function pt(t){let e=t&&typeof t==="object"&&"cause"in t?t.cause??t:t;if(!(e instanceof I.RunFailedError))return{error:e,detail:b(e),missing:!1};let r=e.stderr.toString().split(/\r?\n/).map((o)=>o.trim()).filter(Boolean),n=r.filter((o)=>o.startsWith("error:")).map((o)=>o.replace(/^error:\s*/,""));return{error:e,detail:n[0]??r.at(-1),missing:r.some((o)=>o.includes("No version matching"))}}var $={resolve:(t)=>q(t)},z={readText:(t)=>d.readText(t),write:async(t,e)=>{await d.write(t,e)},exists:(t)=>d.exists(t),files:(t,e)=>K(t,e)},G=z;function V(t){if(typeof t==="string")return t;if(!Array.isArray(t))return;if(typeof t[0]!=="string")return;return t[0]}function H(t){if(!t||typeof t!=="object"||Array.isArray(t))return;let e=t;if(!Array.isArray(e.plugin))return;return e.plugin}function Q(t){if(typeof t==="string"){let e=t.trim();if(e)return e;return}if(!m(t))return;for(let e of["import","default"]){let r=t[e];if(typeof r!=="string")continue;let n=r.trim();if(!n)continue;return n}}function U(t){if(!m(t))return;let e=t.config;if(!m(e))return;return e}function E(t,e){let r=t.exports;if(!m(r))return;let n=r[`./${e}`];if(!Q(n))return;return{opts:U(n)}}function X(t){let e=t.main;if(typeof e!=="string")return!1;return Boolean(e.trim())}function Y(t){let e=typeof t.json.name==="string"&&t.json.name.trim().length>0?t.json.name.trim():P.basename(t.dir),r=[],n=E(t.json,"server");if(n)r.push({kind:"server",opts:n.opts});else if(X(t.json))r.push({kind:"server"});let o=E(t.json,"tui");if(o)r.push({kind:"tui",opts:o.opts});if(!r.some((c)=>c.kind==="tui")&&C(e,t).length)r.push({kind:"tui"});return r}function g(t,e,r,n=!1){return A(t,O(t,e,r,{formattingOptions:{tabSize:2,insertSpaces:!0},isArrayInsertion:n}))}function Z(t,e,r,n,o=!1){let c=y(r).pkg,u=(e??[]).map((i,p)=>({item:i,i:p,spec:V(i)})).filter((i)=>{if(!i.spec)return!1;if(i.spec===r)return!0;if(i.spec.startsWith("file://"))return!1;return y(i.spec).pkg===c});if(!u.length){if(!e)return{mode:"add",text:g(t,["plugin"],[n])};return{mode:"add",text:g(t,["plugin",e.length],n,!0)}}if(!o)return{mode:"noop",text:t};let s=u[0];if(!s)return{mode:"noop",text:t};if(u.length===1&&s.spec===r)return{mode:"noop",text:t};let a=t;if(typeof s.item==="string")a=g(a,["plugin",s.i],n);if(Array.isArray(s.item)&&typeof s.item[0]==="string")a=g(a,["plugin",s.i,0],r);let l=u.map((i)=>i.i).filter((i)=>i!==s.i).sort((i,p)=>p-i);for(let i of l)a=g(a,["plugin",i],void 0);return{mode:"replace",text:a}}async function gt(t,e=$){let r=await e.resolve(t).then((n)=>({ok:!0,item:n}),(n)=>({ok:!1,error:n}));if(!r.ok)return{ok:!1,code:"install_failed",error:r.error};return{ok:!0,target:r.item}}async function dt(t){let e=await M(t).then((n)=>({ok:!0,item:n}),(n)=>({ok:!1,error:n}));if(!e.ok)return{ok:!1,code:"manifest_read_failed",file:t,error:e.error};let r=await Promise.resolve().then(()=>Y(e.item)).then((n)=>({ok:!0,item:n}),(n)=>({ok:!1,error:n}));if(!r.ok)return{ok:!1,code:"manifest_read_failed",file:e.item.pkg,error:r.error};if(!r.item.length)return{ok:!1,code:"manifest_no_targets",file:e.item.pkg};return{ok:!0,targets:r.item}}function tt(t){if(t.global)return t.config??D.Path.config;let r=t.vcs==="git"&&t.worktree!=="/"?t.worktree:t.directory;return P.join(r,".qitqode")}function et(t){if(t==="server")return"qitqode";return"tui"}async function rt(t,e,r,n,o){let x=[];try{let c=et(e.kind);const S=T(x,await v.acquire(`plug-config:${d.resolve(P.join(t,c))}`),1);let u=o.files(t,c);let s=u[0];for(let f of u){if(!await o.exists(f))continue;s=f;break}let a=await o.readText(s).catch((f)=>{if(f.code==="ENOENT")return"{}";return f});if(a instanceof Error)return{ok:!1,code:"patch_failed",kind:e.kind,error:a};let l=a.trim()?a:"{}";let i=[];let p=j(l,i,{allowTrailingComma:!0});if(i.length){let f=i[0],h=l.substring(0,f.offset).split(`
3
3
  `);return{ok:!1,code:"invalid_json",kind:e.kind,file:s,line:h.length,col:h[h.length-1].length+1,parse:R(f.error)}}let N=H(p);let F=e.opts?[r,e.opts]:r;let k=Z(l,N,r,F,n);if(k.mode==="noop")return{ok:!0,item:{kind:e.kind,mode:k.mode,file:s}};let w=await o.write(s,k.text).catch((f)=>f);if(w instanceof Error)return{ok:!1,code:"patch_failed",kind:e.kind,error:w};return{ok:!0,item:{kind:e.kind,mode:k.mode,file:s}}}catch(J){var B=J,L=1}finally{var W=_(x,B,L);W&&await W}}async function mt(t,e=G){let r=tt(t),n=[];for(let o of t.targets){let c=await rt(r,o,t.spec,Boolean(t.force),e);if(!c.ok)return{...c,dir:r};n.push(c.item)}return{ok:!0,dir:r,items:n}}
4
4
  export{pt as p,z as q,gt as r,dt as s,mt as t};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{$e as R,Ge as x,Je as F,Oe as v,Pe as m,Se as u,df as M,ef as _,ff as g,hf as d}from"./chunk-e7ny0b3x.js";import{aq as C,dq as h}from"./chunk-kj20f048.js";import"./chunk-cqtkxwd8.js";import"./chunk-x9rbv6p6.js";import{St as z}from"./chunk-c11d28qn.js";import"./chunk-mzs2pjyc.js";import"./chunk-7xm75w1e.js";function I(D){var G,Q,N;if(D==null)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};let U=(G=D.prompt_tokens)!=null?G:0,Y=(Q=D.completion_tokens)!=null?Q:0,B=(N=D.reasoning_tokens)!=null?N:0;return{inputTokens:{total:U,noCache:U,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:Y,text:Y-B,reasoning:B},raw:D}}function i(D){let G=[];for(let{role:Q,content:N}of D)switch(Q){case"system":{G.push({role:"system",content:N});break}case"user":case"assistant":{let U=N.some((B)=>B.type==="file"&&B.mediaType.startsWith("image/")||B.type==="file"&&B.mediaType==="application/pdf"),Y=N.map((B,$)=>{var Z;switch(B.type){case"text":return{type:"text",text:B.text};case"file":if(B.mediaType==="application/pdf")return B.data instanceof URL?{type:"file_url",file_url:{url:B.data.toString()},file_name:B.filename}:{type:"file_url",file_url:{url:typeof B.data==="string"?B.data:F(B.data)},file_name:B.filename||`document-${$}.pdf`};else if(B.mediaType.startsWith("image/"))return B.data instanceof URL?{type:"image_url",image_url:{url:B.data.toString()}}:{type:"image_url",image_url:{url:`data:${(Z=B.mediaType)!=null?Z:"image/jpeg"};base64,${typeof B.data==="string"?B.data:F(B.data)}`}}}}).filter(Boolean);G.push({role:Q,content:U?Y:Y.filter((B)=>B.type==="text").map((B)=>B.text).join("")});break}case"tool":throw new h({functionality:"Tool messages"});default:throw Error(`Unsupported role: ${Q}`)}return G}function b(D){switch(D){case"stop":case"length":return D;default:return"other"}}var p=class{constructor(D,G){this.specificationVersion="v3",this.provider="perplexity",this.supportedUrls={},this.modelId=D,this.config=G}getArgs({prompt:D,maxOutputTokens:G,temperature:Q,topP:N,topK:U,frequencyPenalty:Y,presencePenalty:B,stopSequences:$,responseFormat:Z,seed:J,providerOptions:E}){var L;let W=[];if(U!=null)W.push({type:"unsupported",feature:"topK"});if($!=null)W.push({type:"unsupported",feature:"stopSequences"});if(J!=null)W.push({type:"unsupported",feature:"seed"});return{args:{model:this.modelId,frequency_penalty:Y,max_tokens:G,presence_penalty:B,temperature:Q,top_k:U,top_p:N,response_format:(Z==null?void 0:Z.type)==="json"?{type:"json_schema",json_schema:{schema:Z.schema}}:void 0,...(L=E==null?void 0:E.perplexity)!=null?L:{},messages:i(D)},warnings:W}}async doGenerate(D){var G,Q,N,U,Y,B,$,Z,J,E,L,W;let{args:j,warnings:O}=this.getArgs(D),{responseHeaders:P,value:X,rawValue:w}=await R({url:`${this.config.baseURL}/chat/completions`,headers:x(this.config.headers(),D.headers),body:j,failedResponseHandler:M({errorSchema:f,errorToMessage:k}),successfulResponseHandler:g(n),abortSignal:D.abortSignal,fetch:this.config.fetch}),q=X.choices[0],H=[],A=q.message.content;if(A.length>0)H.push({type:"text",text:A});if(X.citations!=null)for(let V of X.citations)H.push({type:"source",sourceType:"url",id:this.config.generateId(),url:V});return{content:H,finishReason:{unified:b(q.finish_reason),raw:(G=q.finish_reason)!=null?G:void 0},usage:I(X.usage),request:{body:j},response:{...T(X),headers:P,body:w},warnings:O,providerMetadata:{perplexity:{images:(N=(Q=X.images)==null?void 0:Q.map((V)=>({imageUrl:V.image_url,originUrl:V.origin_url,height:V.height,width:V.width})))!=null?N:null,usage:{citationTokens:(Y=(U=X.usage)==null?void 0:U.citation_tokens)!=null?Y:null,numSearchQueries:($=(B=X.usage)==null?void 0:B.num_search_queries)!=null?$:null},cost:((Z=X.usage)==null?void 0:Z.cost)?{inputTokensCost:(J=X.usage.cost.input_tokens_cost)!=null?J:null,outputTokensCost:(E=X.usage.cost.output_tokens_cost)!=null?E:null,requestCost:(L=X.usage.cost.request_cost)!=null?L:null,totalCost:(W=X.usage.cost.total_cost)!=null?W:null}:null}}}}async doStream(D){let{args:G,warnings:Q}=this.getArgs(D),N={...G,stream:!0},{responseHeaders:U,value:Y}=await R({url:`${this.config.baseURL}/chat/completions`,headers:x(this.config.headers(),D.headers),body:N,failedResponseHandler:M({errorSchema:f,errorToMessage:k}),successfulResponseHandler:_(a),abortSignal:D.abortSignal,fetch:this.config.fetch}),B={unified:"other",raw:void 0},$=void 0,Z={perplexity:{usage:{citationTokens:null,numSearchQueries:null},cost:null,images:null}},J=!0,E=!1,L=this;return{stream:Y.pipeThrough(new TransformStream({start(W){W.enqueue({type:"stream-start",warnings:Q})},transform(W,j){var O,P,X,w,q,H,A;if(D.includeRawChunks)j.enqueue({type:"raw",rawValue:W.rawValue});if(!W.success){j.enqueue({type:"error",error:W.error});return}let V=W.value;if(J)j.enqueue({type:"response-metadata",...T(V)}),(O=V.citations)==null||O.forEach((K)=>{j.enqueue({type:"source",sourceType:"url",id:L.config.generateId(),url:K})}),J=!1;if(V.usage!=null)$=V.usage,Z.perplexity.usage={citationTokens:(P=V.usage.citation_tokens)!=null?P:null,numSearchQueries:(X=V.usage.num_search_queries)!=null?X:null},Z.perplexity.cost=V.usage.cost?{inputTokensCost:(w=V.usage.cost.input_tokens_cost)!=null?w:null,outputTokensCost:(q=V.usage.cost.output_tokens_cost)!=null?q:null,requestCost:(H=V.usage.cost.request_cost)!=null?H:null,totalCost:(A=V.usage.cost.total_cost)!=null?A:null}:null;if(V.images!=null)Z.perplexity.images=V.images.map((K)=>({imageUrl:K.image_url,originUrl:K.origin_url,height:K.height,width:K.width}));let S=V.choices[0];if((S==null?void 0:S.finish_reason)!=null)B={unified:b(S.finish_reason),raw:S.finish_reason};if((S==null?void 0:S.delta)==null)return;let y=S.delta.content;if(y!=null){if(!E)j.enqueue({type:"text-start",id:"0"}),E=!0;j.enqueue({type:"text-delta",id:"0",delta:y})}},flush(W){if(E)W.enqueue({type:"text-end",id:"0"});W.enqueue({type:"finish",finishReason:B,usage:I($),providerMetadata:Z})}})),request:{body:N},response:{headers:U}}}};function T({id:D,model:G,created:Q}){return{id:D,modelId:G,timestamp:new Date(Q*1000)}}var s=z.object({input_tokens_cost:z.number().nullish(),output_tokens_cost:z.number().nullish(),request_cost:z.number().nullish(),total_cost:z.number().nullish()}),c=z.object({prompt_tokens:z.number(),completion_tokens:z.number(),total_tokens:z.number().nullish(),citation_tokens:z.number().nullish(),num_search_queries:z.number().nullish(),reasoning_tokens:z.number().nullish(),cost:s.nullish()}),l=z.object({image_url:z.string(),origin_url:z.string(),height:z.number(),width:z.number()}),n=z.object({id:z.string(),created:z.number(),model:z.string(),choices:z.array(z.object({message:z.object({role:z.literal("assistant"),content:z.string()}),finish_reason:z.string().nullish()})),citations:z.array(z.string()).nullish(),images:z.array(l).nullish(),usage:c.nullish()}),a=z.object({id:z.string(),created:z.number(),model:z.string(),choices:z.array(z.object({delta:z.object({role:z.literal("assistant"),content:z.string()}),finish_reason:z.string().nullish()})),citations:z.array(z.string()).nullish(),images:z.array(l).nullish(),usage:c.nullish()}),f=z.object({error:z.object({code:z.number(),message:z.string().nullish(),type:z.string().nullish()})}),k=(D)=>{var G,Q;return(Q=(G=D.error.message)!=null?G:D.error.type)!=null?Q:"unknown error"},t="3.0.26";function r(D={}){let G=()=>m({Authorization:`Bearer ${u({apiKey:D.apiKey,environmentVariableName:"PERPLEXITY_API_KEY",description:"Perplexity"})}`,...D.headers},`ai-sdk/perplexity/${t}`),Q=(U)=>{var Y;return new p(U,{baseURL:d((Y=D.baseURL)!=null?Y:"https://api.perplexity.ai"),headers:G,generateId:v,fetch:D.fetch})},N=(U)=>Q(U);return N.specificationVersion="v3",N.languageModel=Q,N.embeddingModel=(U)=>{throw new C({modelId:U,modelType:"embeddingModel"})},N.textEmbeddingModel=N.embeddingModel,N.imageModel=(U)=>{throw new C({modelId:U,modelType:"imageModel"})},N}var Qz=r();export{Qz as perplexity,r as createPerplexity,t as VERSION};
2
+ import{$e as R,Ge as x,Je as F,Oe as v,Pe as m,Se as u,df as M,ef as _,ff as g,hf as d}from"./chunk-dctj3c22.js";import{Cr as h,zr as C}from"./chunk-kwx9ewe0.js";import"./chunk-cqtkxwd8.js";import"./chunk-c5pb87yf.js";import{pv as z}from"./chunk-gmzrvxnv.js";import"./chunk-mpygdb5a.js";import"./chunk-3k2b05fv.js";function I(D){var G,Q,N;if(D==null)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};let U=(G=D.prompt_tokens)!=null?G:0,Y=(Q=D.completion_tokens)!=null?Q:0,B=(N=D.reasoning_tokens)!=null?N:0;return{inputTokens:{total:U,noCache:U,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:Y,text:Y-B,reasoning:B},raw:D}}function i(D){let G=[];for(let{role:Q,content:N}of D)switch(Q){case"system":{G.push({role:"system",content:N});break}case"user":case"assistant":{let U=N.some((B)=>B.type==="file"&&B.mediaType.startsWith("image/")||B.type==="file"&&B.mediaType==="application/pdf"),Y=N.map((B,$)=>{var Z;switch(B.type){case"text":return{type:"text",text:B.text};case"file":if(B.mediaType==="application/pdf")return B.data instanceof URL?{type:"file_url",file_url:{url:B.data.toString()},file_name:B.filename}:{type:"file_url",file_url:{url:typeof B.data==="string"?B.data:F(B.data)},file_name:B.filename||`document-${$}.pdf`};else if(B.mediaType.startsWith("image/"))return B.data instanceof URL?{type:"image_url",image_url:{url:B.data.toString()}}:{type:"image_url",image_url:{url:`data:${(Z=B.mediaType)!=null?Z:"image/jpeg"};base64,${typeof B.data==="string"?B.data:F(B.data)}`}}}}).filter(Boolean);G.push({role:Q,content:U?Y:Y.filter((B)=>B.type==="text").map((B)=>B.text).join("")});break}case"tool":throw new h({functionality:"Tool messages"});default:throw Error(`Unsupported role: ${Q}`)}return G}function b(D){switch(D){case"stop":case"length":return D;default:return"other"}}var p=class{constructor(D,G){this.specificationVersion="v3",this.provider="perplexity",this.supportedUrls={},this.modelId=D,this.config=G}getArgs({prompt:D,maxOutputTokens:G,temperature:Q,topP:N,topK:U,frequencyPenalty:Y,presencePenalty:B,stopSequences:$,responseFormat:Z,seed:J,providerOptions:E}){var L;let W=[];if(U!=null)W.push({type:"unsupported",feature:"topK"});if($!=null)W.push({type:"unsupported",feature:"stopSequences"});if(J!=null)W.push({type:"unsupported",feature:"seed"});return{args:{model:this.modelId,frequency_penalty:Y,max_tokens:G,presence_penalty:B,temperature:Q,top_k:U,top_p:N,response_format:(Z==null?void 0:Z.type)==="json"?{type:"json_schema",json_schema:{schema:Z.schema}}:void 0,...(L=E==null?void 0:E.perplexity)!=null?L:{},messages:i(D)},warnings:W}}async doGenerate(D){var G,Q,N,U,Y,B,$,Z,J,E,L,W;let{args:j,warnings:O}=this.getArgs(D),{responseHeaders:P,value:X,rawValue:w}=await R({url:`${this.config.baseURL}/chat/completions`,headers:x(this.config.headers(),D.headers),body:j,failedResponseHandler:M({errorSchema:f,errorToMessage:k}),successfulResponseHandler:g(n),abortSignal:D.abortSignal,fetch:this.config.fetch}),q=X.choices[0],H=[],A=q.message.content;if(A.length>0)H.push({type:"text",text:A});if(X.citations!=null)for(let V of X.citations)H.push({type:"source",sourceType:"url",id:this.config.generateId(),url:V});return{content:H,finishReason:{unified:b(q.finish_reason),raw:(G=q.finish_reason)!=null?G:void 0},usage:I(X.usage),request:{body:j},response:{...T(X),headers:P,body:w},warnings:O,providerMetadata:{perplexity:{images:(N=(Q=X.images)==null?void 0:Q.map((V)=>({imageUrl:V.image_url,originUrl:V.origin_url,height:V.height,width:V.width})))!=null?N:null,usage:{citationTokens:(Y=(U=X.usage)==null?void 0:U.citation_tokens)!=null?Y:null,numSearchQueries:($=(B=X.usage)==null?void 0:B.num_search_queries)!=null?$:null},cost:((Z=X.usage)==null?void 0:Z.cost)?{inputTokensCost:(J=X.usage.cost.input_tokens_cost)!=null?J:null,outputTokensCost:(E=X.usage.cost.output_tokens_cost)!=null?E:null,requestCost:(L=X.usage.cost.request_cost)!=null?L:null,totalCost:(W=X.usage.cost.total_cost)!=null?W:null}:null}}}}async doStream(D){let{args:G,warnings:Q}=this.getArgs(D),N={...G,stream:!0},{responseHeaders:U,value:Y}=await R({url:`${this.config.baseURL}/chat/completions`,headers:x(this.config.headers(),D.headers),body:N,failedResponseHandler:M({errorSchema:f,errorToMessage:k}),successfulResponseHandler:_(a),abortSignal:D.abortSignal,fetch:this.config.fetch}),B={unified:"other",raw:void 0},$=void 0,Z={perplexity:{usage:{citationTokens:null,numSearchQueries:null},cost:null,images:null}},J=!0,E=!1,L=this;return{stream:Y.pipeThrough(new TransformStream({start(W){W.enqueue({type:"stream-start",warnings:Q})},transform(W,j){var O,P,X,w,q,H,A;if(D.includeRawChunks)j.enqueue({type:"raw",rawValue:W.rawValue});if(!W.success){j.enqueue({type:"error",error:W.error});return}let V=W.value;if(J)j.enqueue({type:"response-metadata",...T(V)}),(O=V.citations)==null||O.forEach((K)=>{j.enqueue({type:"source",sourceType:"url",id:L.config.generateId(),url:K})}),J=!1;if(V.usage!=null)$=V.usage,Z.perplexity.usage={citationTokens:(P=V.usage.citation_tokens)!=null?P:null,numSearchQueries:(X=V.usage.num_search_queries)!=null?X:null},Z.perplexity.cost=V.usage.cost?{inputTokensCost:(w=V.usage.cost.input_tokens_cost)!=null?w:null,outputTokensCost:(q=V.usage.cost.output_tokens_cost)!=null?q:null,requestCost:(H=V.usage.cost.request_cost)!=null?H:null,totalCost:(A=V.usage.cost.total_cost)!=null?A:null}:null;if(V.images!=null)Z.perplexity.images=V.images.map((K)=>({imageUrl:K.image_url,originUrl:K.origin_url,height:K.height,width:K.width}));let S=V.choices[0];if((S==null?void 0:S.finish_reason)!=null)B={unified:b(S.finish_reason),raw:S.finish_reason};if((S==null?void 0:S.delta)==null)return;let y=S.delta.content;if(y!=null){if(!E)j.enqueue({type:"text-start",id:"0"}),E=!0;j.enqueue({type:"text-delta",id:"0",delta:y})}},flush(W){if(E)W.enqueue({type:"text-end",id:"0"});W.enqueue({type:"finish",finishReason:B,usage:I($),providerMetadata:Z})}})),request:{body:N},response:{headers:U}}}};function T({id:D,model:G,created:Q}){return{id:D,modelId:G,timestamp:new Date(Q*1000)}}var s=z.object({input_tokens_cost:z.number().nullish(),output_tokens_cost:z.number().nullish(),request_cost:z.number().nullish(),total_cost:z.number().nullish()}),c=z.object({prompt_tokens:z.number(),completion_tokens:z.number(),total_tokens:z.number().nullish(),citation_tokens:z.number().nullish(),num_search_queries:z.number().nullish(),reasoning_tokens:z.number().nullish(),cost:s.nullish()}),l=z.object({image_url:z.string(),origin_url:z.string(),height:z.number(),width:z.number()}),n=z.object({id:z.string(),created:z.number(),model:z.string(),choices:z.array(z.object({message:z.object({role:z.literal("assistant"),content:z.string()}),finish_reason:z.string().nullish()})),citations:z.array(z.string()).nullish(),images:z.array(l).nullish(),usage:c.nullish()}),a=z.object({id:z.string(),created:z.number(),model:z.string(),choices:z.array(z.object({delta:z.object({role:z.literal("assistant"),content:z.string()}),finish_reason:z.string().nullish()})),citations:z.array(z.string()).nullish(),images:z.array(l).nullish(),usage:c.nullish()}),f=z.object({error:z.object({code:z.number(),message:z.string().nullish(),type:z.string().nullish()})}),k=(D)=>{var G,Q;return(Q=(G=D.error.message)!=null?G:D.error.type)!=null?Q:"unknown error"},t="3.0.26";function r(D={}){let G=()=>m({Authorization:`Bearer ${u({apiKey:D.apiKey,environmentVariableName:"PERPLEXITY_API_KEY",description:"Perplexity"})}`,...D.headers},`ai-sdk/perplexity/${t}`),Q=(U)=>{var Y;return new p(U,{baseURL:d((Y=D.baseURL)!=null?Y:"https://api.perplexity.ai"),headers:G,generateId:v,fetch:D.fetch})},N=(U)=>Q(U);return N.specificationVersion="v3",N.languageModel=Q,N.embeddingModel=(U)=>{throw new C({modelId:U,modelType:"embeddingModel"})},N.textEmbeddingModel=N.embeddingModel,N.imageModel=(U)=>{throw new C({modelId:U,modelType:"imageModel"})},N}var Qz=r();export{Qz as perplexity,r as createPerplexity,t as VERSION};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{Ed as p}from"./chunk-n1600mnf.js";import{Fd as x,Gd as b,Id as w,Jd as v,Kd as c}from"./chunk-p62gb4wj.js";import"./chunk-x4sp99g6.js";import{Rd as g}from"./chunk-yajd975f.js";import{Vf as r}from"./chunk-rbk8seme.js";import{gh as m}from"./chunk-tc18nbmn.js";import"./chunk-481k3dag.js";import"./chunk-vxyy2dp3.js";import"./chunk-yp5bypsp.js";import"./chunk-7hm0c2yg.js";import"./chunk-gj0wt0cy.js";import"./chunk-5hw6xa49.js";import"./chunk-326p5b10.js";import{Cl as f,kk as y}from"./chunk-wefez1gt.js";import"./chunk-ccmbckek.js";import"./chunk-711dc303.js";import"./chunk-qn6gdhns.js";import"./chunk-bn0h9dny.js";import"./chunk-mpkvpn2y.js";import"./chunk-9bzhxenb.js";import"./chunk-htz93dsd.js";import"./chunk-vcw00k0n.js";import"./chunk-famryv52.js";import"./chunk-2hc5z7b5.js";import"./chunk-e1w70zdn.js";import"./chunk-4jtxtkj7.js";import"./chunk-ay8emwym.js";import"./chunk-2maqde7w.js";import"./chunk-kj20f048.js";import"./chunk-cqtkxwd8.js";import"./chunk-x9rbv6p6.js";import"./chunk-g5rabwre.js";import"./chunk-jbx3s7nw.js";import"./chunk-15hw2z9t.js";import"./chunk-48ge2ryx.js";import"./chunk-n9xns8by.js";import"./chunk-y9q0hb7b.js";import"./chunk-rryytkmg.js";import"./chunk-te47zdxd.js";import"./chunk-d6ry9418.js";import"./chunk-0dt0bxz6.js";import"./chunk-10bjs581.js";import"./chunk-4cnwn1rh.js";import"./chunk-0t4324w5.js";import"./chunk-hdrbyarv.js";import"./chunk-tqj69nh6.js";import"./chunk-ag8kz1e7.js";import"./chunk-5tray1fw.js";import"./chunk-c11d28qn.js";import"./chunk-mzs2pjyc.js";import"./chunk-gagtmjmp.js";import"./chunk-zs8kqdsf.js";import"./chunk-dxpj0cxh.js";import"./chunk-zw815d68.js";import"./chunk-7xm75w1e.js";import{EOL as S}from"os";function s(e,t,i){return i.trim()?`[redacted:${e}:${t}]`:i}function o(e,t,i){if(!i)return i;return Object.keys(i).length?{redacted:`${e}:${t}`}:i}function a(e,t){return{...t,value:s("file-text",e,t.value)}}function l(e,t){return t?.map((i,u)=>({...i,file:s(`${e}-file`,String(u),i.file),patch:s(`${e}-patch`,String(u),i.patch)}))}function I(e){if(!e.source)return e.source;if(e.source.type==="symbol")return{...e.source,path:s("file-path",e.id,e.source.path),name:s("file-symbol",e.id,e.source.name),text:a(e.id,e.source.text)};if(e.source.type==="resource")return{...e.source,clientName:s("file-client",e.id,e.source.clientName),uri:s("file-uri",e.id,e.source.uri),text:a(e.id,e.source.text)};return{...e.source,path:s("file-path",e.id,e.source.path),text:a(e.id,e.source.text)}}function h(e){return{...e,url:s("file-url",e.id,e.url),filename:e.filename===void 0?void 0:s("file-name",e.id,e.filename),source:I(e)}}function $(e){switch(e.type){case"text":return{...e,text:s("text",e.id,e.text),metadata:o("text-metadata",e.id,e.metadata)};case"reasoning":return{...e,text:s("reasoning",e.id,e.text),metadata:o("reasoning-metadata",e.id,e.metadata)};case"file":return h(e);case"subtask":return{...e,prompt:s("subtask-prompt",e.id,e.prompt),description:s("subtask-description",e.id,e.description),command:e.command===void 0?void 0:s("subtask-command",e.id,e.command)};case"tool":return{...e,metadata:o("tool-metadata",e.id,e.metadata),state:e.state.status==="pending"?{...e.state,input:o("tool-input",e.id,e.state.input)??e.state.input,raw:s("tool-raw",e.id,e.state.raw)}:e.state.status==="running"?{...e.state,input:o("tool-input",e.id,e.state.input)??e.state.input,title:e.state.title===void 0?void 0:s("tool-title",e.id,e.state.title),metadata:o("tool-state-metadata",e.id,e.state.metadata)}:e.state.status==="completed"?{...e.state,input:o("tool-input",e.id,e.state.input)??e.state.input,output:s("tool-output",e.id,e.state.output),title:s("tool-title",e.id,e.state.title),metadata:o("tool-state-metadata",e.id,e.state.metadata)??e.state.metadata,attachments:e.state.attachments?.map(h)}:{...e.state,input:o("tool-input",e.id,e.state.input)??e.state.input,metadata:o("tool-state-metadata",e.id,e.state.metadata)}};case"patch":return{...e,hash:s("patch",e.id,e.hash),files:e.files.map((t,i)=>s("patch-file",`${e.id}-${i}`,t))};case"snapshot":return{...e,snapshot:s("snapshot",e.id,e.snapshot)};case"step-start":return{...e,snapshot:e.snapshot===void 0?void 0:s("snapshot",e.id,e.snapshot)};case"step-finish":return{...e,snapshot:e.snapshot===void 0?void 0:s("snapshot",e.id,e.snapshot)};case"agent":return{...e,source:!e.source?e.source:{...e.source,value:s("agent-source",e.id,e.source.value)}};default:return e}}var D=$;function P(e){return{info:{...e.info,title:s("session-title",e.info.id,e.info.title),directory:s("session-directory",e.info.id,e.info.directory),summary:!e.info.summary?e.info.summary:{...e.info.summary,diffs:l("session-diff",e.info.summary.diffs)},revert:!e.info.revert?e.info.revert:{...e.info.revert,snapshot:e.info.revert.snapshot===void 0?void 0:s("revert-snapshot",e.info.id,e.info.revert.snapshot),diff:e.info.revert.diff===void 0?void 0:s("revert-diff",e.info.id,e.info.revert.diff)}},messages:e.messages.map((t)=>({info:t.info.role==="user"?{...t.info,system:t.info.system===void 0?void 0:s("system",t.info.id,t.info.system),summary:!t.info.summary?t.info.summary:{...t.info.summary,title:t.info.summary.title===void 0?void 0:s("summary-title",t.info.id,t.info.summary.title),body:t.info.summary.body===void 0?void 0:s("summary-body",t.info.id,t.info.summary.body),diffs:l("message-diff",t.info.summary.diffs)}}:{...t.info,path:{cwd:s("cwd",t.info.id,t.info.path.cwd),root:s("root",t.info.id,t.info.path.root)}},parts:t.parts.map(D)}))}}var A=g({command:"export [sessionID]",describe:"export session data as JSON",builder:(e)=>{return e.positional("sessionID",{describe:"session id to export",type:"string"}).option("sanitize",{describe:"redact sensitive transcript and file data",type:"boolean"})},handler:async(e)=>{await p(process.cwd(),async()=>{let t=e.sessionID?y.make(e.sessionID):void 0;if(process.stderr.write(`Exporting session: ${t??"latest"}
2
+ import{Ed as p}from"./chunk-aa8hymcv.js";import{Fd as x,Gd as b,Id as w,Jd as v,Kd as c}from"./chunk-x66ycpfs.js";import"./chunk-03xppy47.js";import{Rd as g}from"./chunk-yajd975f.js";import{Vf as r}from"./chunk-p9cnzxb8.js";import{gh as m}from"./chunk-5e4fxy99.js";import"./chunk-8vg4fmg2.js";import"./chunk-zfcp509b.js";import"./chunk-yp5bypsp.js";import"./chunk-7hm0c2yg.js";import"./chunk-gj0wt0cy.js";import"./chunk-md8161zd.js";import"./chunk-yk97q51d.js";import{Cl as f,kk as y}from"./chunk-e74efvj2.js";import"./chunk-st5jaszz.js";import"./chunk-a1hzeejj.js";import"./chunk-sjw56r2n.js";import"./chunk-nj4d554m.js";import"./chunk-eva3nqqb.js";import"./chunk-yprmd5b7.js";import"./chunk-snr44en9.js";import"./chunk-keveg5gx.js";import"./chunk-f3bnn9rf.js";import"./chunk-xqdrr7xg.js";import"./chunk-axdzm75h.js";import"./chunk-94pcpztx.js";import"./chunk-hw5qyht3.js";import"./chunk-z8gdmvgg.js";import"./chunk-kwx9ewe0.js";import"./chunk-cqtkxwd8.js";import"./chunk-c5pb87yf.js";import"./chunk-g6cyhxwg.js";import"./chunk-n96tvjgj.js";import"./chunk-pkc4ddw1.js";import"./chunk-xgr6jnd6.js";import"./chunk-a48t0g95.js";import"./chunk-yqk58hf6.js";import"./chunk-er38zew1.js";import"./chunk-dk975etf.js";import"./chunk-6p94fpbn.js";import"./chunk-fg35hwa0.js";import"./chunk-79agp7v3.js";import"./chunk-kv72hxkp.js";import"./chunk-nj2bbtmx.js";import"./chunk-tns5x4w0.js";import"./chunk-e7v9trve.js";import"./chunk-zh3fny3z.js";import"./chunk-m4j7jyrd.js";import"./chunk-gmzrvxnv.js";import"./chunk-mpygdb5a.js";import"./chunk-wfd5h6ax.js";import"./chunk-a0rp7gh4.js";import"./chunk-kfmz2p27.js";import"./chunk-ee23d2nz.js";import"./chunk-3k2b05fv.js";import{EOL as S}from"os";function s(e,t,i){return i.trim()?`[redacted:${e}:${t}]`:i}function o(e,t,i){if(!i)return i;return Object.keys(i).length?{redacted:`${e}:${t}`}:i}function a(e,t){return{...t,value:s("file-text",e,t.value)}}function l(e,t){return t?.map((i,u)=>({...i,file:s(`${e}-file`,String(u),i.file),patch:s(`${e}-patch`,String(u),i.patch)}))}function I(e){if(!e.source)return e.source;if(e.source.type==="symbol")return{...e.source,path:s("file-path",e.id,e.source.path),name:s("file-symbol",e.id,e.source.name),text:a(e.id,e.source.text)};if(e.source.type==="resource")return{...e.source,clientName:s("file-client",e.id,e.source.clientName),uri:s("file-uri",e.id,e.source.uri),text:a(e.id,e.source.text)};return{...e.source,path:s("file-path",e.id,e.source.path),text:a(e.id,e.source.text)}}function h(e){return{...e,url:s("file-url",e.id,e.url),filename:e.filename===void 0?void 0:s("file-name",e.id,e.filename),source:I(e)}}function $(e){switch(e.type){case"text":return{...e,text:s("text",e.id,e.text),metadata:o("text-metadata",e.id,e.metadata)};case"reasoning":return{...e,text:s("reasoning",e.id,e.text),metadata:o("reasoning-metadata",e.id,e.metadata)};case"file":return h(e);case"subtask":return{...e,prompt:s("subtask-prompt",e.id,e.prompt),description:s("subtask-description",e.id,e.description),command:e.command===void 0?void 0:s("subtask-command",e.id,e.command)};case"tool":return{...e,metadata:o("tool-metadata",e.id,e.metadata),state:e.state.status==="pending"?{...e.state,input:o("tool-input",e.id,e.state.input)??e.state.input,raw:s("tool-raw",e.id,e.state.raw)}:e.state.status==="running"?{...e.state,input:o("tool-input",e.id,e.state.input)??e.state.input,title:e.state.title===void 0?void 0:s("tool-title",e.id,e.state.title),metadata:o("tool-state-metadata",e.id,e.state.metadata)}:e.state.status==="completed"?{...e.state,input:o("tool-input",e.id,e.state.input)??e.state.input,output:s("tool-output",e.id,e.state.output),title:s("tool-title",e.id,e.state.title),metadata:o("tool-state-metadata",e.id,e.state.metadata)??e.state.metadata,attachments:e.state.attachments?.map(h)}:{...e.state,input:o("tool-input",e.id,e.state.input)??e.state.input,metadata:o("tool-state-metadata",e.id,e.state.metadata)}};case"patch":return{...e,hash:s("patch",e.id,e.hash),files:e.files.map((t,i)=>s("patch-file",`${e.id}-${i}`,t))};case"snapshot":return{...e,snapshot:s("snapshot",e.id,e.snapshot)};case"step-start":return{...e,snapshot:e.snapshot===void 0?void 0:s("snapshot",e.id,e.snapshot)};case"step-finish":return{...e,snapshot:e.snapshot===void 0?void 0:s("snapshot",e.id,e.snapshot)};case"agent":return{...e,source:!e.source?e.source:{...e.source,value:s("agent-source",e.id,e.source.value)}};default:return e}}var D=$;function P(e){return{info:{...e.info,title:s("session-title",e.info.id,e.info.title),directory:s("session-directory",e.info.id,e.info.directory),summary:!e.info.summary?e.info.summary:{...e.info.summary,diffs:l("session-diff",e.info.summary.diffs)},revert:!e.info.revert?e.info.revert:{...e.info.revert,snapshot:e.info.revert.snapshot===void 0?void 0:s("revert-snapshot",e.info.id,e.info.revert.snapshot),diff:e.info.revert.diff===void 0?void 0:s("revert-diff",e.info.id,e.info.revert.diff)}},messages:e.messages.map((t)=>({info:t.info.role==="user"?{...t.info,system:t.info.system===void 0?void 0:s("system",t.info.id,t.info.system),summary:!t.info.summary?t.info.summary:{...t.info.summary,title:t.info.summary.title===void 0?void 0:s("summary-title",t.info.id,t.info.summary.title),body:t.info.summary.body===void 0?void 0:s("summary-body",t.info.id,t.info.summary.body),diffs:l("message-diff",t.info.summary.diffs)}}:{...t.info,path:{cwd:s("cwd",t.info.id,t.info.path.cwd),root:s("root",t.info.id,t.info.path.root)}},parts:t.parts.map(D)}))}}var A=g({command:"export [sessionID]",describe:"export session data as JSON",builder:(e)=>{return e.positional("sessionID",{describe:"session id to export",type:"string"}).option("sanitize",{describe:"redact sensitive transcript and file data",type:"boolean"})},handler:async(e)=>{await p(process.cwd(),async()=>{let t=e.sessionID?y.make(e.sessionID):void 0;if(process.stderr.write(`Exporting session: ${t??"latest"}
3
3
  `),!t){r.empty(),v("Export session",{output:process.stderr});let i=[];for await(let n of f.list())i.push(n);if(i.length===0){w.error("No sessions found",{output:process.stderr}),c("Done",{output:process.stderr});return}i.sort((n,d)=>d.time.updated-n.time.updated);let u=await b({message:"Select session to export",maxItems:10,options:i.map((n)=>({label:n.title,value:n.id,hint:`${new Date(n.time.updated).toLocaleString()} \u2022 ${n.id.slice(-8)}`})),output:process.stderr});if(x(u))throw new r.CancelledError;t=u,c("Exporting session...",{output:process.stderr})}try{let i=await m.runPromise(f.Service.use((d)=>d.get(t))),u=await m.runPromise(f.Service.use((d)=>d.messages({sessionID:i.id,agentID:"*"}))),n={info:i,messages:u};process.stdout.write(JSON.stringify(e.sanitize?P(n):n,null,2)),process.stdout.write(S)}catch{r.error(`Session not found: ${t}`),process.exit(1)}})}});export{A as ExportCommand};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{N as R9}from"./chunk-rh9vnpgr.js";import{Ed as E9}from"./chunk-n1600mnf.js";import{Fd as P6,Id as p$,Jd as S9,Kd as U9,Nd as H9,Od as q6}from"./chunk-p62gb4wj.js";import"./chunk-x4sp99g6.js";import{Rd as T0}from"./chunk-yajd975f.js";import{Vf as O}from"./chunk-rbk8seme.js";import{Vg as j9,ch as I9,gh as E$}from"./chunk-tc18nbmn.js";import"./chunk-481k3dag.js";import"./chunk-vxyy2dp3.js";import"./chunk-yp5bypsp.js";import"./chunk-7hm0c2yg.js";import"./chunk-gj0wt0cy.js";import"./chunk-5hw6xa49.js";import"./chunk-326p5b10.js";import{Cl as b9,Wj as T9,lk as O6,mk as M0,rl as w9,tl as D9}from"./chunk-wefez1gt.js";import{Pl as N9}from"./chunk-ccmbckek.js";import{cm as A0,lm as T$}from"./chunk-711dc303.js";import"./chunk-qn6gdhns.js";import"./chunk-bn0h9dny.js";import"./chunk-mpkvpn2y.js";import"./chunk-9bzhxenb.js";import"./chunk-htz93dsd.js";import"./chunk-vcw00k0n.js";import"./chunk-famryv52.js";import"./chunk-2hc5z7b5.js";import"./chunk-e1w70zdn.js";import"./chunk-4jtxtkj7.js";import"./chunk-ay8emwym.js";import"./chunk-2maqde7w.js";import"./chunk-kj20f048.js";import"./chunk-cqtkxwd8.js";import"./chunk-x9rbv6p6.js";import"./chunk-g5rabwre.js";import"./chunk-jbx3s7nw.js";import"./chunk-15hw2z9t.js";import"./chunk-48ge2ryx.js";import"./chunk-n9xns8by.js";import"./chunk-y9q0hb7b.js";import"./chunk-rryytkmg.js";import"./chunk-te47zdxd.js";import"./chunk-d6ry9418.js";import"./chunk-0dt0bxz6.js";import"./chunk-10bjs581.js";import"./chunk-4cnwn1rh.js";import"./chunk-0t4324w5.js";import{Zr as V9,as as R6,bs as L9,gs as F9}from"./chunk-hdrbyarv.js";import{ht as C6,st as A9}from"./chunk-tqj69nh6.js";import"./chunk-ag8kz1e7.js";import"./chunk-5tray1fw.js";import"./chunk-c11d28qn.js";import"./chunk-mzs2pjyc.js";import"./chunk-gagtmjmp.js";import{pH as M9}from"./chunk-zs8kqdsf.js";import"./chunk-dxpj0cxh.js";import"./chunk-zw815d68.js";import{BO as q0,CO as D,FO as E}from"./chunk-7xm75w1e.js";var JZ=D((zZ)=>{/*!
2
+ import{N as R9}from"./chunk-6ged58yw.js";import{Ed as E9}from"./chunk-aa8hymcv.js";import{Fd as P6,Id as p$,Jd as S9,Kd as U9,Nd as H9,Od as q6}from"./chunk-x66ycpfs.js";import"./chunk-03xppy47.js";import{Rd as T0}from"./chunk-yajd975f.js";import{Vf as O}from"./chunk-p9cnzxb8.js";import{Vg as j9,ch as I9,gh as E$}from"./chunk-5e4fxy99.js";import"./chunk-8vg4fmg2.js";import"./chunk-zfcp509b.js";import"./chunk-yp5bypsp.js";import"./chunk-7hm0c2yg.js";import"./chunk-gj0wt0cy.js";import"./chunk-md8161zd.js";import"./chunk-yk97q51d.js";import{Cl as b9,Wj as T9,lk as O6,mk as M0,rl as w9,tl as D9}from"./chunk-e74efvj2.js";import{Pl as N9}from"./chunk-st5jaszz.js";import{cm as A0,lm as T$}from"./chunk-a1hzeejj.js";import"./chunk-sjw56r2n.js";import"./chunk-nj4d554m.js";import"./chunk-eva3nqqb.js";import"./chunk-yprmd5b7.js";import"./chunk-snr44en9.js";import"./chunk-keveg5gx.js";import"./chunk-f3bnn9rf.js";import"./chunk-xqdrr7xg.js";import"./chunk-axdzm75h.js";import"./chunk-94pcpztx.js";import"./chunk-hw5qyht3.js";import"./chunk-z8gdmvgg.js";import"./chunk-kwx9ewe0.js";import"./chunk-cqtkxwd8.js";import"./chunk-c5pb87yf.js";import"./chunk-g6cyhxwg.js";import"./chunk-n96tvjgj.js";import"./chunk-pkc4ddw1.js";import"./chunk-xgr6jnd6.js";import"./chunk-a48t0g95.js";import"./chunk-yqk58hf6.js";import"./chunk-er38zew1.js";import"./chunk-dk975etf.js";import"./chunk-6p94fpbn.js";import"./chunk-fg35hwa0.js";import"./chunk-79agp7v3.js";import"./chunk-kv72hxkp.js";import"./chunk-nj2bbtmx.js";import{At as L9,Ft as F9,wt as V9,zt as R6}from"./chunk-tns5x4w0.js";import{Gu as C6,Ru as A9}from"./chunk-e7v9trve.js";import"./chunk-zh3fny3z.js";import"./chunk-m4j7jyrd.js";import"./chunk-gmzrvxnv.js";import"./chunk-mpygdb5a.js";import"./chunk-wfd5h6ax.js";import{OI as M9}from"./chunk-a0rp7gh4.js";import"./chunk-kfmz2p27.js";import"./chunk-ee23d2nz.js";import{$P as D,_P as q0,cQ as E}from"./chunk-3k2b05fv.js";var JZ=D((zZ)=>{/*!
3
3
  * content-type
4
4
  * Copyright(c) 2015 Douglas Christopher Wilson
5
5
  * MIT Licensed
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{ue as u}from"./chunk-01my2y0c.js";import{Ae as m,Be as S}from"./chunk-ht5w06x7.js";import{Ce as C}from"./chunk-enpzvmtc.js";import{wf as h}from"./chunk-tq0239xp.js";import{CO as R}from"./chunk-7xm75w1e.js";var WB=R((s)=>{var H=C(),K=m(),V=h(),v=S(),q=u(),b=(B)=>H.HttpResponse.isInstance(B)?B.headers?.date??B.headers?.Date:void 0,I=(B)=>new Date(Date.now()+B),P=(B,J)=>Math.abs(I(J).getTime()-B)>=300000,A=(B,J)=>{let Q=Date.parse(B);if(P(Q,J))return Q-Date.now();return J},M=(B,J)=>{if(!J)throw Error(`Property \`${B}\` is not resolved for AWS SDK SigV4Auth`);return J},w=async(B)=>{let J=M("context",B.context),Q=M("config",B.config),L=J.endpointV2?.properties?.authSchemes?.[0],z=await M("signer",Q.signer)(L),j=B?.signingRegion,Z=B?.signingRegionSet,Y=B?.signingName;return{config:Q,signer:z,signingRegion:j,signingRegionSet:Z,signingName:Y}};class D{async sign(B,J,Q){if(!H.HttpRequest.isInstance(B))throw Error("The request is not an instance of `HttpRequest` and cannot be signed");let L=await w(Q),{config:$,signer:z}=L,{signingRegion:j,signingName:Z}=L,Y=Q.context;if(Y?.authSchemes?.length??!1){let[G,X]=Y.authSchemes;if(G?.name==="sigv4a"&&X?.name==="sigv4")j=X?.signingRegion??j,Z=X?.signingName??Z}return await z.sign(B,{signingDate:I($.systemClockOffset),signingRegion:j,signingService:Z})}errorHandler(B){return(J)=>{let Q=J.ServerTime??b(J.$response);if(Q){let L=M("config",B.config),$=L.systemClockOffset;if(L.systemClockOffset=A(Q,L.systemClockOffset),L.systemClockOffset!==$&&J.$metadata)J.$metadata.clockSkewCorrected=!0}throw J}}successHandler(B,J){let Q=b(B);if(Q){let L=M("config",J.config);L.systemClockOffset=A(Q,L.systemClockOffset)}}}var p=D;class _ extends D{async sign(B,J,Q){if(!H.HttpRequest.isInstance(B))throw Error("The request is not an instance of `HttpRequest` and cannot be signed");let{config:L,signer:$,signingRegion:z,signingRegionSet:j,signingName:Z}=await w(Q),W=(await L.sigv4aSigningRegionSet?.()??j??[z]).join(",");return await $.sign(B,{signingDate:I(L.systemClockOffset),signingRegion:W,signingService:Z})}}var T=(B)=>typeof B==="string"&&B.length>0?B.split(",").map((J)=>J.trim()):[],O=(B)=>`AWS_BEARER_TOKEN_${B.replace(/[\s-]/g,"_").toUpperCase()}`,N="AWS_AUTH_SCHEME_PREFERENCE",y="auth_scheme_preference",l={environmentVariableSelector:(B,J)=>{if(J?.signingName){if(O(J.signingName)in B)return["httpBearerAuth"]}if(!(N in B))return;return T(B[N])},configFileSelector:(B)=>{if(!(y in B))return;return T(B[y])},default:[]},a=(B)=>{return B.sigv4aSigningRegionSet=K.normalizeProvider(B.sigv4aSigningRegionSet),B},d={environmentVariableSelector(B){if(B.AWS_SIGV4A_SIGNING_REGION_SET)return B.AWS_SIGV4A_SIGNING_REGION_SET.split(",").map((J)=>J.trim());throw new V.ProviderError("AWS_SIGV4A_SIGNING_REGION_SET not set in env.",{tryNextLink:!0})},configFileSelector(B){if(B.sigv4a_signing_region_set)return(B.sigv4a_signing_region_set??"").split(",").map((J)=>J.trim());throw new V.ProviderError("sigv4a_signing_region_set not set in profile.",{tryNextLink:!0})},default:void 0},E=(B)=>{let J=B.credentials,Q=!!B.credentials,L=void 0;Object.defineProperty(B,"credentials",{set(W){if(W&&W!==J&&W!==L)Q=!0;J=W;let G=c(B,{credentials:J,credentialDefaultProvider:B.credentialDefaultProvider}),X=t(B,G);if(Q&&!X.attributed){let F=typeof J==="object"&&J!==null;L=async(U)=>{let x=await X(U);if(F&&(!x.$source||Object.keys(x.$source).length===0))return v.setCredentialFeature(x,"CREDENTIALS_CODE","e");return x},L.memoized=X.memoized,L.configBound=X.configBound,L.attributed=!0}else L=X},get(){return L},enumerable:!0,configurable:!0}),B.credentials=J;let{signingEscapePath:$=!0,systemClockOffset:z=B.systemClockOffset||0,sha256:j}=B,Z;if(B.signer)Z=K.normalizeProvider(B.signer);else if(B.regionInfoProvider)Z=()=>K.normalizeProvider(B.region)().then(async(W)=>[await B.regionInfoProvider(W,{useFipsEndpoint:await B.useFipsEndpoint(),useDualstackEndpoint:await B.useDualstackEndpoint()})||{},W]).then(([W,G])=>{let{signingRegion:X,signingService:F}=W;B.signingRegion=B.signingRegion||X||G,B.signingName=B.signingName||F||B.serviceId;let U={...B,credentials:B.credentials,region:B.signingRegion,service:B.signingName,sha256:j,uriEscapePath:$};return new(B.signerConstructor||q.SignatureV4)(U)});else Z=async(W)=>{W=Object.assign({},{name:"sigv4",signingName:B.signingName||B.defaultSigningName,signingRegion:await K.normalizeProvider(B.region)(),properties:{}},W);let{signingRegion:G,signingName:X}=W;B.signingRegion=B.signingRegion||G,B.signingName=B.signingName||X||B.serviceId;let F={...B,credentials:B.credentials,region:B.signingRegion,service:B.signingName,sha256:j,uriEscapePath:$};return new(B.signerConstructor||q.SignatureV4)(F)};return Object.assign(B,{systemClockOffset:z,signingEscapePath:$,signer:Z})},f=E;function c(B,{credentials:J,credentialDefaultProvider:Q}){let L;if(J)if(!J?.memoized)L=K.memoizeIdentityProvider(J,K.isIdentityExpired,K.doesIdentityRequireRefresh);else L=J;else if(Q)L=K.normalizeProvider(Q(Object.assign({},B,{parentClientConfig:B})));else L=async()=>{throw Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured.")};return L.memoized=!0,L}function t(B,J){if(J.configBound)return J;let Q=async(L)=>J({...L,callerClientConfig:B});return Q.memoized=J.memoized,Q.configBound=!0,Q}s.AWSSDKSigV4Signer=p;s.AwsSdkSigV4ASigner=_;s.AwsSdkSigV4Signer=D;s.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS=l;s.NODE_SIGV4A_CONFIG_OPTIONS=d;s.getBearerTokenEnvKey=O;s.resolveAWSSDKSigV4Config=f;s.resolveAwsSdkSigV4AConfig=a;s.resolveAwsSdkSigV4Config=E;s.validateSigningProperties=w});
2
+ import{ue as u}from"./chunk-hj3ddt53.js";import{Ae as m,Be as S}from"./chunk-wgk7ynt3.js";import{Ce as C}from"./chunk-41v0x1jk.js";import{wf as h}from"./chunk-a3a1trap.js";import{$P as R}from"./chunk-3k2b05fv.js";var WB=R((s)=>{var H=C(),K=m(),V=h(),v=S(),q=u(),b=(B)=>H.HttpResponse.isInstance(B)?B.headers?.date??B.headers?.Date:void 0,I=(B)=>new Date(Date.now()+B),P=(B,J)=>Math.abs(I(J).getTime()-B)>=300000,A=(B,J)=>{let Q=Date.parse(B);if(P(Q,J))return Q-Date.now();return J},M=(B,J)=>{if(!J)throw Error(`Property \`${B}\` is not resolved for AWS SDK SigV4Auth`);return J},w=async(B)=>{let J=M("context",B.context),Q=M("config",B.config),L=J.endpointV2?.properties?.authSchemes?.[0],z=await M("signer",Q.signer)(L),j=B?.signingRegion,Z=B?.signingRegionSet,Y=B?.signingName;return{config:Q,signer:z,signingRegion:j,signingRegionSet:Z,signingName:Y}};class D{async sign(B,J,Q){if(!H.HttpRequest.isInstance(B))throw Error("The request is not an instance of `HttpRequest` and cannot be signed");let L=await w(Q),{config:$,signer:z}=L,{signingRegion:j,signingName:Z}=L,Y=Q.context;if(Y?.authSchemes?.length??!1){let[G,X]=Y.authSchemes;if(G?.name==="sigv4a"&&X?.name==="sigv4")j=X?.signingRegion??j,Z=X?.signingName??Z}return await z.sign(B,{signingDate:I($.systemClockOffset),signingRegion:j,signingService:Z})}errorHandler(B){return(J)=>{let Q=J.ServerTime??b(J.$response);if(Q){let L=M("config",B.config),$=L.systemClockOffset;if(L.systemClockOffset=A(Q,L.systemClockOffset),L.systemClockOffset!==$&&J.$metadata)J.$metadata.clockSkewCorrected=!0}throw J}}successHandler(B,J){let Q=b(B);if(Q){let L=M("config",J.config);L.systemClockOffset=A(Q,L.systemClockOffset)}}}var p=D;class _ extends D{async sign(B,J,Q){if(!H.HttpRequest.isInstance(B))throw Error("The request is not an instance of `HttpRequest` and cannot be signed");let{config:L,signer:$,signingRegion:z,signingRegionSet:j,signingName:Z}=await w(Q),W=(await L.sigv4aSigningRegionSet?.()??j??[z]).join(",");return await $.sign(B,{signingDate:I(L.systemClockOffset),signingRegion:W,signingService:Z})}}var T=(B)=>typeof B==="string"&&B.length>0?B.split(",").map((J)=>J.trim()):[],O=(B)=>`AWS_BEARER_TOKEN_${B.replace(/[\s-]/g,"_").toUpperCase()}`,N="AWS_AUTH_SCHEME_PREFERENCE",y="auth_scheme_preference",l={environmentVariableSelector:(B,J)=>{if(J?.signingName){if(O(J.signingName)in B)return["httpBearerAuth"]}if(!(N in B))return;return T(B[N])},configFileSelector:(B)=>{if(!(y in B))return;return T(B[y])},default:[]},a=(B)=>{return B.sigv4aSigningRegionSet=K.normalizeProvider(B.sigv4aSigningRegionSet),B},d={environmentVariableSelector(B){if(B.AWS_SIGV4A_SIGNING_REGION_SET)return B.AWS_SIGV4A_SIGNING_REGION_SET.split(",").map((J)=>J.trim());throw new V.ProviderError("AWS_SIGV4A_SIGNING_REGION_SET not set in env.",{tryNextLink:!0})},configFileSelector(B){if(B.sigv4a_signing_region_set)return(B.sigv4a_signing_region_set??"").split(",").map((J)=>J.trim());throw new V.ProviderError("sigv4a_signing_region_set not set in profile.",{tryNextLink:!0})},default:void 0},E=(B)=>{let J=B.credentials,Q=!!B.credentials,L=void 0;Object.defineProperty(B,"credentials",{set(W){if(W&&W!==J&&W!==L)Q=!0;J=W;let G=c(B,{credentials:J,credentialDefaultProvider:B.credentialDefaultProvider}),X=t(B,G);if(Q&&!X.attributed){let F=typeof J==="object"&&J!==null;L=async(U)=>{let x=await X(U);if(F&&(!x.$source||Object.keys(x.$source).length===0))return v.setCredentialFeature(x,"CREDENTIALS_CODE","e");return x},L.memoized=X.memoized,L.configBound=X.configBound,L.attributed=!0}else L=X},get(){return L},enumerable:!0,configurable:!0}),B.credentials=J;let{signingEscapePath:$=!0,systemClockOffset:z=B.systemClockOffset||0,sha256:j}=B,Z;if(B.signer)Z=K.normalizeProvider(B.signer);else if(B.regionInfoProvider)Z=()=>K.normalizeProvider(B.region)().then(async(W)=>[await B.regionInfoProvider(W,{useFipsEndpoint:await B.useFipsEndpoint(),useDualstackEndpoint:await B.useDualstackEndpoint()})||{},W]).then(([W,G])=>{let{signingRegion:X,signingService:F}=W;B.signingRegion=B.signingRegion||X||G,B.signingName=B.signingName||F||B.serviceId;let U={...B,credentials:B.credentials,region:B.signingRegion,service:B.signingName,sha256:j,uriEscapePath:$};return new(B.signerConstructor||q.SignatureV4)(U)});else Z=async(W)=>{W=Object.assign({},{name:"sigv4",signingName:B.signingName||B.defaultSigningName,signingRegion:await K.normalizeProvider(B.region)(),properties:{}},W);let{signingRegion:G,signingName:X}=W;B.signingRegion=B.signingRegion||G,B.signingName=B.signingName||X||B.serviceId;let F={...B,credentials:B.credentials,region:B.signingRegion,service:B.signingName,sha256:j,uriEscapePath:$};return new(B.signerConstructor||q.SignatureV4)(F)};return Object.assign(B,{systemClockOffset:z,signingEscapePath:$,signer:Z})},f=E;function c(B,{credentials:J,credentialDefaultProvider:Q}){let L;if(J)if(!J?.memoized)L=K.memoizeIdentityProvider(J,K.isIdentityExpired,K.doesIdentityRequireRefresh);else L=J;else if(Q)L=K.normalizeProvider(Q(Object.assign({},B,{parentClientConfig:B})));else L=async()=>{throw Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured.")};return L.memoized=!0,L}function t(B,J){if(J.configBound)return J;let Q=async(L)=>J({...L,callerClientConfig:B});return Q.memoized=J.memoized,Q.configBound=!0,Q}s.AWSSDKSigV4Signer=p;s.AwsSdkSigV4ASigner=_;s.AwsSdkSigV4Signer=D;s.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS=l;s.NODE_SIGV4A_CONFIG_OPTIONS=d;s.getBearerTokenEnvKey=O;s.resolveAWSSDKSigV4Config=f;s.resolveAwsSdkSigV4AConfig=a;s.resolveAwsSdkSigV4Config=E;s.validateSigningProperties=w});
3
3
  export{WB as te};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Cl as a}from"./chunk-e74efvj2.js";import"./chunk-st5jaszz.js";import"./chunk-a1hzeejj.js";import"./chunk-sjw56r2n.js";import"./chunk-nj4d554m.js";import"./chunk-eva3nqqb.js";import"./chunk-yprmd5b7.js";import"./chunk-snr44en9.js";import"./chunk-keveg5gx.js";import"./chunk-f3bnn9rf.js";import"./chunk-xqdrr7xg.js";import"./chunk-axdzm75h.js";import"./chunk-94pcpztx.js";import"./chunk-hw5qyht3.js";import"./chunk-z8gdmvgg.js";import"./chunk-kwx9ewe0.js";import"./chunk-cqtkxwd8.js";import"./chunk-c5pb87yf.js";import"./chunk-g6cyhxwg.js";import"./chunk-n96tvjgj.js";import"./chunk-pkc4ddw1.js";import"./chunk-xgr6jnd6.js";import"./chunk-er38zew1.js";import"./chunk-dk975etf.js";import"./chunk-6p94fpbn.js";import"./chunk-fg35hwa0.js";import"./chunk-79agp7v3.js";import"./chunk-kv72hxkp.js";import"./chunk-nj2bbtmx.js";import"./chunk-tns5x4w0.js";import"./chunk-e7v9trve.js";import"./chunk-zh3fny3z.js";import"./chunk-m4j7jyrd.js";import"./chunk-gmzrvxnv.js";import"./chunk-mpygdb5a.js";import"./chunk-wfd5h6ax.js";import"./chunk-a0rp7gh4.js";import"./chunk-ee23d2nz.js";import"./chunk-3k2b05fv.js";export{a as Session};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Ap as g,Cp as v,Dp as k,Jp as b,Kp as R,Lp as XG,Mp as I,Qp as d,Ro as V,To as l,Xo as e,Yo as t,fp as a,kp as o,lp as GG,op as JG,sp as NG,vp as QG}from"./chunk-2maqde7w.js";import{Sp as f,Yp as C,aq as m,dq as O}from"./chunk-kj20f048.js";import"./chunk-cqtkxwd8.js";import"./chunk-x9rbv6p6.js";import{St as G}from"./chunk-c11d28qn.js";import"./chunk-mzs2pjyc.js";import"./chunk-7xm75w1e.js";function c(J){var Q,$,K,j,z,q;if(J==null)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};let A=(Q=J.prompt_tokens)!=null?Q:0,Z=($=J.completion_tokens)!=null?$:0,N=(j=(K=J.prompt_tokens_details)==null?void 0:K.cached_tokens)!=null?j:0,X=(q=(z=J.completion_tokens_details)==null?void 0:z.reasoning_tokens)!=null?q:0;return{inputTokens:{total:A,noCache:A-N,cacheRead:N,cacheWrite:void 0},outputTokens:{total:Z,text:Z-X,reasoning:X},raw:J}}function _(J){switch(J){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"}}function u({id:J,model:Q,created:$}){return{id:J!=null?J:void 0,modelId:Q!=null?Q:void 0,timestamp:$!=null?new Date($*1000):void 0}}function i({tools:J,toolChoice:Q}){J=(J==null?void 0:J.length)?J:void 0;let $=[];if(J==null)return{tools:void 0,toolChoice:void 0,toolWarnings:$};let K=[];for(let z of J)if(z.type==="provider")$.push({type:"unsupported",feature:`provider-defined tool ${z.id}`});else K.push({type:"function",function:{name:z.name,description:z.description,parameters:z.inputSchema,...z.strict!=null?{strict:z.strict}:{}}});if(Q==null)return{tools:K,toolChoice:void 0,toolWarnings:$};let j=Q.type;switch(j){case"auto":case"none":case"required":return{tools:K,toolChoice:j,toolWarnings:$};case"tool":return{tools:K,toolChoice:{type:"function",function:{name:Q.toolName}},toolWarnings:$};default:throw new O({functionality:`tool choice type: ${j}`})}}var $G=G.object({enableThinking:G.boolean().optional(),thinkingBudget:G.number().positive().optional(),parallelToolCalls:G.boolean().optional()});function p(J){var Q,$,K,j;let z=c(J),q=($=(Q=J==null?void 0:J.prompt_tokens_details)==null?void 0:Q.cache_creation_input_tokens)!=null?$:0,A=((K=z.inputTokens.total)!=null?K:0)-((j=z.inputTokens.cacheRead)!=null?j:0)-q;return{...z,inputTokens:{...z.inputTokens,cacheWrite:q,noCache:A}}}function zG({data:J,mediaType:Q}){return J instanceof URL?J.toString():`data:${Q};base64,${t(J)}`}function BG({prompt:J,cacheControlValidator:Q}){var $,K;let j=[];for(let{role:z,content:q,...A}of J){let Z=Q==null?void 0:Q.getCacheControl(A.providerOptions);switch(z){case"system":{if(Z)j.push({role:"system",content:[{type:"text",text:q,cache_control:Z}]});else j.push({role:"system",content:q});break}case"user":{j.push({role:"user",content:q.map((N,X)=>{var E;let L=X===q.length-1,B=(E=Q==null?void 0:Q.getCacheControl(N.providerOptions))!=null?E:L?Z:void 0;switch(N.type){case"text":return{type:"text",text:N.text,...B?{cache_control:B}:{}};case"file":if(N.mediaType.startsWith("image/")){let U=N.mediaType==="image/*"?"image/jpeg":N.mediaType;return{type:"image_url",image_url:{url:zG({data:N.data,mediaType:U})},...B?{cache_control:B}:{}}}else throw new O({functionality:"Only image file parts are supported"})}})});break}case"assistant":{let N="",X=[];for(let E of q)switch(E.type){case"text":{N+=E.text;break}case"tool-call":{X.push({id:E.toolCallId,type:"function",function:{name:E.toolName,arguments:JSON.stringify(E.input)}});break}case"reasoning":{N+=E.text;break}}j.push({role:"assistant",content:Z?[{type:"text",text:N,cache_control:Z}]:N||null,tool_calls:X.length>0?X:void 0});break}case"tool":{let N=q.filter((X)=>X.type!=="tool-approval-response");for(let X=0;X<N.length;X++){let E=N[X],L=E.output,B=X===N.length-1,U=($=Q==null?void 0:Q.getCacheControl(E.providerOptions))!=null?$:B?Z:void 0,Y;switch(L.type){case"text":case"error-text":Y=L.value;break;case"execution-denied":Y=(K=L.reason)!=null?K:"Tool execution denied.";break;case"content":case"json":case"error-json":Y=JSON.stringify(L.value);break}j.push({role:"tool",tool_call_id:E.toolCallId,content:U?[{type:"text",text:Y,cache_control:U}]:Y})}break}default:throw Error(`Unsupported role: ${z}`)}}return j}var r=4;function EG(J){var Q;let $=J==null?void 0:J.alibaba;return(Q=$==null?void 0:$.cacheControl)!=null?Q:$==null?void 0:$.cache_control}var jG=class{constructor(){this.breakpointCount=0,this.warnings=[]}getCacheControl(J){let Q=EG(J);if(!Q)return;if(this.breakpointCount++,this.breakpointCount>r)this.warnings.push({type:"other",message:`Max breakpoint limit exceeded. Only the last ${r} cache markers will take effect.`});return Q}getWarnings(){return this.warnings}},KG=class{constructor(J,Q){this.specificationVersion="v3",this.supportedUrls={"image/*":[/^https?:\/\/.*$/]},this.modelId=J,this.config=Q}get provider(){return this.config.provider}async getArgs({prompt:J,maxOutputTokens:Q,temperature:$,topP:K,topK:j,frequencyPenalty:z,presencePenalty:q,stopSequences:A,responseFormat:Z,seed:N,providerOptions:X,tools:E,toolChoice:L}){var B;let U=[],Y=new jG,P=await v({provider:"alibaba",providerOptions:X,schema:$G});if(z!=null)U.push({type:"unsupported",feature:"frequencyPenalty"});let w={model:this.modelId,max_tokens:Q,temperature:$,top_p:K,top_k:j,presence_penalty:q,stop:A,seed:N,response_format:(Z==null?void 0:Z.type)==="json"?Z.schema!=null?{type:"json_schema",json_schema:{schema:Z.schema,name:(B=Z.name)!=null?B:"response",description:Z.description}}:{type:"json_object"}:void 0,...(P==null?void 0:P.enableThinking)!=null?{enable_thinking:P.enableThinking}:{},...(P==null?void 0:P.thinkingBudget)!=null?{thinking_budget:P.thinkingBudget}:{},messages:BG({prompt:J,cacheControlValidator:Y})},{tools:y,toolChoice:S,toolWarnings:F}=i({tools:E,toolChoice:L});return U.push(...Y.getWarnings()),{args:{...w,tools:y,tool_choice:S,...y!=null&&(P==null?void 0:P.parallelToolCalls)!==void 0?{parallel_tool_calls:P.parallelToolCalls}:{}},warnings:[...U,...F]}}async doGenerate(J){var Q;let{args:$,warnings:K}=await this.getArgs(J),{responseHeaders:j,value:z,rawValue:q}=await k({url:`${this.config.baseURL}/chat/completions`,headers:V(this.config.headers(),J.headers),body:$,failedResponseHandler:s,successfulResponseHandler:I(qG),abortSignal:J.abortSignal,fetch:this.config.fetch}),A=z.choices[0],Z=[],N=A.message.content;if(N!=null&&N.length>0)Z.push({type:"text",text:N});let X=A.message.reasoning_content;if(X!=null&&X.length>0)Z.push({type:"reasoning",text:X});if(A.message.tool_calls!=null)for(let E of A.message.tool_calls)Z.push({type:"tool-call",toolCallId:E.id,toolName:E.function.name,input:E.function.arguments});return{content:Z,finishReason:{unified:_(A.finish_reason),raw:(Q=A.finish_reason)!=null?Q:void 0},usage:p(z.usage),request:{body:JSON.stringify($)},response:{...u(z),headers:j,body:q},warnings:K}}async doStream(J){let{args:Q,warnings:$}=await this.getArgs(J),K={...Q,stream:!0,stream_options:this.config.includeUsage?{include_usage:!0}:void 0},{responseHeaders:j,value:z}=await k({url:`${this.config.baseURL}/chat/completions`,headers:V(this.config.headers(),J.headers),body:K,failedResponseHandler:s,successfulResponseHandler:XG(AG),abortSignal:J.abortSignal,fetch:this.config.fetch}),q={unified:"other",raw:void 0},A=void 0,Z=!0,N=!1,X=null,E=[];return{stream:z.pipeThrough(new TransformStream({start(L){L.enqueue({type:"stream-start",warnings:$})},transform(L,B){var U,Y,P,w;if(J.includeRawChunks)B.enqueue({type:"raw",rawValue:L.rawValue});if(!L.success){B.enqueue({type:"error",error:L.error});return}let y=L.value;if(Z)Z=!1,B.enqueue({type:"response-metadata",...u(y)});if(y.usage!=null)A=y.usage;if(y.choices.length===0)return;let S=y.choices[0],F=S.delta;if(F.reasoning_content!=null&&F.reasoning_content.length>0){if(X==null){if(N)B.enqueue({type:"text-end",id:"0"}),N=!1;X=a(),B.enqueue({type:"reasoning-start",id:X})}B.enqueue({type:"reasoning-delta",id:X,delta:F.reasoning_content})}if(F.content!=null&&F.content.length>0){if(X!=null)B.enqueue({type:"reasoning-end",id:X}),X=null;if(!N)B.enqueue({type:"text-start",id:"0"}),N=!0;B.enqueue({type:"text-delta",id:"0",delta:F.content})}if(F.tool_calls!=null){if(X!=null)B.enqueue({type:"reasoning-end",id:X}),X=null;if(N)B.enqueue({type:"text-end",id:"0"}),N=!1;for(let W of F.tool_calls){let M=(U=W.index)!=null?U:E.length;if(E[M]==null){if(W.id==null)throw new C({data:W,message:"Expected 'id' to be a string."});if(((Y=W.function)==null?void 0:Y.name)==null)throw new C({data:W,message:"Expected 'function.name' to be a string."});B.enqueue({type:"tool-input-start",id:W.id,toolName:W.function.name}),E[M]={id:W.id,type:"function",function:{name:W.function.name,arguments:(P=W.function.arguments)!=null?P:""},hasFinished:!1};let D=E[M];if(D.function.arguments.length>0)B.enqueue({type:"tool-input-delta",id:D.id,delta:D.function.arguments});if(g(D.function.arguments))B.enqueue({type:"tool-input-end",id:D.id}),B.enqueue({type:"tool-call",toolCallId:D.id,toolName:D.function.name,input:D.function.arguments}),D.hasFinished=!0;continue}let H=E[M];if(H.hasFinished)continue;if(((w=W.function)==null?void 0:w.arguments)!=null)H.function.arguments+=W.function.arguments,B.enqueue({type:"tool-input-delta",id:H.id,delta:W.function.arguments});if(g(H.function.arguments))B.enqueue({type:"tool-input-end",id:H.id}),B.enqueue({type:"tool-call",toolCallId:H.id,toolName:H.function.name,input:H.function.arguments}),H.hasFinished=!0}}if(S.finish_reason!=null)q={unified:_(S.finish_reason),raw:S.finish_reason}},flush(L){if(X!=null)L.enqueue({type:"reasoning-end",id:X});if(N)L.enqueue({type:"text-end",id:"0"});L.enqueue({type:"finish",finishReason:q,usage:p(A)})}})),request:{body:JSON.stringify(K)},response:{headers:j}}}},YG=G.object({prompt_tokens:G.number(),completion_tokens:G.number(),total_tokens:G.number(),prompt_tokens_details:G.object({cached_tokens:G.number().nullish(),cache_creation_input_tokens:G.number().nullish()}).nullish(),completion_tokens_details:G.object({reasoning_tokens:G.number().nullish()}).nullish()}),qG=G.object({id:G.string().nullish(),created:G.number().nullish(),model:G.string().nullish(),choices:G.array(G.object({message:G.object({role:G.literal("assistant").nullish(),content:G.string().nullish(),reasoning_content:G.string().nullish(),tool_calls:G.array(G.object({id:G.string(),type:G.literal("function"),function:G.object({name:G.string(),arguments:G.string()})})).nullish()}),finish_reason:G.string().nullish(),index:G.number()})),usage:YG.nullish()}),AG=G.object({id:G.string().nullish(),created:G.number().nullish(),model:G.string().nullish(),choices:G.array(G.object({delta:G.object({role:G.enum(["assistant"]).nullish(),content:G.string().nullish(),reasoning_content:G.string().nullish(),tool_calls:G.array(G.object({index:G.number().nullish(),id:G.string().nullish(),type:G.literal("function").nullish(),function:G.object({name:G.string().nullish(),arguments:G.string().nullish()}).nullish()})).nullish()}),finish_reason:G.string().nullish(),index:G.number()})),usage:YG.nullish()}),HG=NG(()=>QG(G.object({negativePrompt:G.string().nullish(),audioUrl:G.string().nullish(),promptExtend:G.boolean().nullish(),shotType:G.enum(["single","multi"]).nullish(),watermark:G.boolean().nullish(),audio:G.boolean().nullish(),referenceUrls:G.array(G.string()).nullish(),pollIntervalMs:G.number().positive().nullish(),pollTimeoutMs:G.number().positive().nullish()}).passthrough())),LG=G.object({code:G.string().nullish(),message:G.string(),request_id:G.string().nullish()}),n=R({errorSchema:LG,errorToMessage:(J)=>J.message}),PG=G.object({output:G.object({task_status:G.string(),task_id:G.string()}).nullish(),request_id:G.string().nullish()}),WG=G.object({output:G.object({task_id:G.string(),task_status:G.string(),video_url:G.string().nullish(),submit_time:G.string().nullish(),scheduled_time:G.string().nullish(),end_time:G.string().nullish(),orig_prompt:G.string().nullish(),actual_prompt:G.string().nullish(),code:G.string().nullish(),message:G.string().nullish()}).nullish(),usage:G.object({duration:G.number().nullish(),output_video_duration:G.number().nullish(),SR:G.number().nullish(),size:G.string().nullish()}).nullish(),request_id:G.string().nullish()});function UG(J){if(J.includes("-i2v"))return"i2v";if(J.includes("-r2v"))return"r2v";return"t2v"}var wG=class{constructor(J,Q){this.modelId=J,this.config=Q,this.specificationVersion="v3",this.maxVideosPerCall=1}get provider(){return this.config.provider}async doGenerate(J){var Q,$,K,j,z,q,A,Z,N,X,E;let L=(K=($=(Q=this.config._internal)==null?void 0:Q.currentDate)==null?void 0:$.call(Q))!=null?K:new Date,B=[],U=UG(this.modelId),Y=await v({provider:"alibaba",providerOptions:J.providerOptions,schema:HG}),P={};if(J.prompt!=null)P.prompt=J.prompt;if((Y==null?void 0:Y.negativePrompt)!=null)P.negative_prompt=Y.negativePrompt;if((Y==null?void 0:Y.audioUrl)!=null)P.audio_url=Y.audioUrl;if(U==="i2v"&&J.image!=null)if(J.image.type==="url")P.img_url=J.image.url;else{let x=typeof J.image.data==="string"?J.image.data:e(J.image.data);P.img_url=x}if(U==="r2v"&&(Y==null?void 0:Y.referenceUrls)!=null)P.reference_urls=Y.referenceUrls;let w={};if(J.duration!=null)w.duration=J.duration;if(J.seed!=null)w.seed=J.seed;if(J.resolution!=null)if(U==="i2v"){let x={"1280x720":"720P","720x1280":"720P","960x960":"720P","1088x832":"720P","832x1088":"720P","1920x1080":"1080P","1080x1920":"1080P","1440x1440":"1080P","1632x1248":"1080P","1248x1632":"1080P","832x480":"480P","480x832":"480P","624x624":"480P"};w.resolution=x[J.resolution]||J.resolution}else w.size=J.resolution.replace("x","*");if((Y==null?void 0:Y.promptExtend)!=null)w.prompt_extend=Y.promptExtend;if((Y==null?void 0:Y.shotType)!=null)w.shot_type=Y.shotType;if((Y==null?void 0:Y.watermark)!=null)w.watermark=Y.watermark;if((Y==null?void 0:Y.audio)!=null)w.audio=Y.audio;if(J.aspectRatio)B.push({type:"unsupported",feature:"aspectRatio",details:"Alibaba video models use explicit size/resolution dimensions. Use the resolution option or providerOptions.alibaba for size control."});if(J.fps)B.push({type:"unsupported",feature:"fps",details:"Alibaba video models do not support custom FPS."});if(J.n!=null&&J.n>1)B.push({type:"unsupported",feature:"n",details:"Alibaba video models only support generating 1 video per call."});let{value:y}=await k({url:`${this.config.baseURL}/api/v1/services/aigc/video-generation/video-synthesis`,headers:V(await b(this.config.headers),J.headers,{"X-DashScope-Async":"enable"}),body:{model:this.modelId,input:P,parameters:w},successfulResponseHandler:I(PG),failedResponseHandler:n,abortSignal:J.abortSignal,fetch:this.config.fetch}),S=(j=y.output)==null?void 0:j.task_id;if(!S)throw new f({name:"ALIBABA_VIDEO_GENERATION_ERROR",message:`No task_id returned from Alibaba API. Response: ${JSON.stringify(y)}`});let F=(z=Y==null?void 0:Y.pollIntervalMs)!=null?z:5000,W=(q=Y==null?void 0:Y.pollTimeoutMs)!=null?q:600000,M=Date.now(),H,D;while(!0){if(await l(F,{abortSignal:J.abortSignal}),Date.now()-M>W)throw new f({name:"ALIBABA_VIDEO_GENERATION_TIMEOUT",message:`Video generation timed out after ${W}ms`});let{value:x,responseHeaders:ZG}=await GG({url:`${this.config.baseURL}/api/v1/tasks/${S}`,headers:V(await b(this.config.headers),J.headers),successfulResponseHandler:I(WG),failedResponseHandler:n,abortSignal:J.abortSignal,fetch:this.config.fetch});D=ZG;let T=(A=x.output)==null?void 0:A.task_status;if(T==="SUCCEEDED"){H=x;break}if(T==="FAILED"||T==="CANCELED")throw new f({name:"ALIBABA_VIDEO_GENERATION_FAILED",message:`Video generation ${T.toLowerCase()}. Task ID: ${S}. ${(N=(Z=x.output)==null?void 0:Z.message)!=null?N:""}`})}let h=(X=H==null?void 0:H.output)==null?void 0:X.video_url;if(!h)throw new f({name:"ALIBABA_VIDEO_GENERATION_ERROR",message:`No video URL in response. Task ID: ${S}`});return{videos:[{type:"url",url:h,mediaType:"video/mp4"}],warnings:B,response:{timestamp:L,modelId:this.modelId,headers:D},providerMetadata:{alibaba:{taskId:S,videoUrl:h,...((E=H==null?void 0:H.output)==null?void 0:E.actual_prompt)?{actualPrompt:H.output.actual_prompt}:{},...(H==null?void 0:H.usage)?{usage:{duration:H.usage.duration,outputVideoDuration:H.usage.output_video_duration,resolution:H.usage.SR,size:H.usage.size}}:{}}}}}},SG="1.0.17",FG=G.object({error:G.object({message:G.string(),code:G.string().nullish(),type:G.string().nullish()})}),s=R({errorSchema:FG,errorToMessage:(J)=>J.error.message});function DG(J={}){var Q,$;let K=(Q=d(J.baseURL))!=null?Q:"https://dashscope-intl.aliyuncs.com/compatible-mode/v1",j=($=d(J.videoBaseURL))!=null?$:"https://dashscope-intl.aliyuncs.com",z=()=>o({Authorization:`Bearer ${JG({apiKey:J.apiKey,environmentVariableName:"ALIBABA_API_KEY",description:"Alibaba Cloud (DashScope)"})}`,...J.headers},`ai-sdk/alibaba/${SG}`),q=(N)=>{var X;return new KG(N,{provider:"alibaba.chat",baseURL:K,headers:z,fetch:J.fetch,includeUsage:(X=J.includeUsage)!=null?X:!0})},A=(N)=>new wG(N,{provider:"alibaba.video",baseURL:j,headers:z,fetch:J.fetch}),Z=function(N){if(new.target)throw Error("The Alibaba model function cannot be called with the new keyword.");return q(N)};return Z.specificationVersion="v3",Z.languageModel=q,Z.chatModel=q,Z.video=A,Z.videoModel=A,Z.imageModel=(N)=>{throw new m({modelId:N,modelType:"imageModel"})},Z.embeddingModel=(N)=>{throw new m({modelId:N,modelType:"embeddingModel"})},Z}var gG=DG();export{DG as createAlibaba,gG as alibaba,SG as VERSION};
2
+ import{$q as v,Eq as a,Jq as o,Kq as GG,Nq as JG,Rq as NG,Uq as QG,Zq as g,ar as k,gr as b,hr as R,ir as XG,jr as I,nr as d,oq as V,qq as l,uq as e,vq as t}from"./chunk-z8gdmvgg.js";import{Cr as O,pr as f,vr as C,zr as m}from"./chunk-kwx9ewe0.js";import"./chunk-cqtkxwd8.js";import"./chunk-c5pb87yf.js";import{pv as G}from"./chunk-gmzrvxnv.js";import"./chunk-mpygdb5a.js";import"./chunk-3k2b05fv.js";function c(J){var Q,$,K,j,z,q;if(J==null)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};let A=(Q=J.prompt_tokens)!=null?Q:0,Z=($=J.completion_tokens)!=null?$:0,N=(j=(K=J.prompt_tokens_details)==null?void 0:K.cached_tokens)!=null?j:0,X=(q=(z=J.completion_tokens_details)==null?void 0:z.reasoning_tokens)!=null?q:0;return{inputTokens:{total:A,noCache:A-N,cacheRead:N,cacheWrite:void 0},outputTokens:{total:Z,text:Z-X,reasoning:X},raw:J}}function _(J){switch(J){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"}}function u({id:J,model:Q,created:$}){return{id:J!=null?J:void 0,modelId:Q!=null?Q:void 0,timestamp:$!=null?new Date($*1000):void 0}}function i({tools:J,toolChoice:Q}){J=(J==null?void 0:J.length)?J:void 0;let $=[];if(J==null)return{tools:void 0,toolChoice:void 0,toolWarnings:$};let K=[];for(let z of J)if(z.type==="provider")$.push({type:"unsupported",feature:`provider-defined tool ${z.id}`});else K.push({type:"function",function:{name:z.name,description:z.description,parameters:z.inputSchema,...z.strict!=null?{strict:z.strict}:{}}});if(Q==null)return{tools:K,toolChoice:void 0,toolWarnings:$};let j=Q.type;switch(j){case"auto":case"none":case"required":return{tools:K,toolChoice:j,toolWarnings:$};case"tool":return{tools:K,toolChoice:{type:"function",function:{name:Q.toolName}},toolWarnings:$};default:throw new O({functionality:`tool choice type: ${j}`})}}var $G=G.object({enableThinking:G.boolean().optional(),thinkingBudget:G.number().positive().optional(),parallelToolCalls:G.boolean().optional()});function p(J){var Q,$,K,j;let z=c(J),q=($=(Q=J==null?void 0:J.prompt_tokens_details)==null?void 0:Q.cache_creation_input_tokens)!=null?$:0,A=((K=z.inputTokens.total)!=null?K:0)-((j=z.inputTokens.cacheRead)!=null?j:0)-q;return{...z,inputTokens:{...z.inputTokens,cacheWrite:q,noCache:A}}}function zG({data:J,mediaType:Q}){return J instanceof URL?J.toString():`data:${Q};base64,${t(J)}`}function BG({prompt:J,cacheControlValidator:Q}){var $,K;let j=[];for(let{role:z,content:q,...A}of J){let Z=Q==null?void 0:Q.getCacheControl(A.providerOptions);switch(z){case"system":{if(Z)j.push({role:"system",content:[{type:"text",text:q,cache_control:Z}]});else j.push({role:"system",content:q});break}case"user":{j.push({role:"user",content:q.map((N,X)=>{var E;let L=X===q.length-1,B=(E=Q==null?void 0:Q.getCacheControl(N.providerOptions))!=null?E:L?Z:void 0;switch(N.type){case"text":return{type:"text",text:N.text,...B?{cache_control:B}:{}};case"file":if(N.mediaType.startsWith("image/")){let U=N.mediaType==="image/*"?"image/jpeg":N.mediaType;return{type:"image_url",image_url:{url:zG({data:N.data,mediaType:U})},...B?{cache_control:B}:{}}}else throw new O({functionality:"Only image file parts are supported"})}})});break}case"assistant":{let N="",X=[];for(let E of q)switch(E.type){case"text":{N+=E.text;break}case"tool-call":{X.push({id:E.toolCallId,type:"function",function:{name:E.toolName,arguments:JSON.stringify(E.input)}});break}case"reasoning":{N+=E.text;break}}j.push({role:"assistant",content:Z?[{type:"text",text:N,cache_control:Z}]:N||null,tool_calls:X.length>0?X:void 0});break}case"tool":{let N=q.filter((X)=>X.type!=="tool-approval-response");for(let X=0;X<N.length;X++){let E=N[X],L=E.output,B=X===N.length-1,U=($=Q==null?void 0:Q.getCacheControl(E.providerOptions))!=null?$:B?Z:void 0,Y;switch(L.type){case"text":case"error-text":Y=L.value;break;case"execution-denied":Y=(K=L.reason)!=null?K:"Tool execution denied.";break;case"content":case"json":case"error-json":Y=JSON.stringify(L.value);break}j.push({role:"tool",tool_call_id:E.toolCallId,content:U?[{type:"text",text:Y,cache_control:U}]:Y})}break}default:throw Error(`Unsupported role: ${z}`)}}return j}var r=4;function EG(J){var Q;let $=J==null?void 0:J.alibaba;return(Q=$==null?void 0:$.cacheControl)!=null?Q:$==null?void 0:$.cache_control}var jG=class{constructor(){this.breakpointCount=0,this.warnings=[]}getCacheControl(J){let Q=EG(J);if(!Q)return;if(this.breakpointCount++,this.breakpointCount>r)this.warnings.push({type:"other",message:`Max breakpoint limit exceeded. Only the last ${r} cache markers will take effect.`});return Q}getWarnings(){return this.warnings}},KG=class{constructor(J,Q){this.specificationVersion="v3",this.supportedUrls={"image/*":[/^https?:\/\/.*$/]},this.modelId=J,this.config=Q}get provider(){return this.config.provider}async getArgs({prompt:J,maxOutputTokens:Q,temperature:$,topP:K,topK:j,frequencyPenalty:z,presencePenalty:q,stopSequences:A,responseFormat:Z,seed:N,providerOptions:X,tools:E,toolChoice:L}){var B;let U=[],Y=new jG,P=await v({provider:"alibaba",providerOptions:X,schema:$G});if(z!=null)U.push({type:"unsupported",feature:"frequencyPenalty"});let w={model:this.modelId,max_tokens:Q,temperature:$,top_p:K,top_k:j,presence_penalty:q,stop:A,seed:N,response_format:(Z==null?void 0:Z.type)==="json"?Z.schema!=null?{type:"json_schema",json_schema:{schema:Z.schema,name:(B=Z.name)!=null?B:"response",description:Z.description}}:{type:"json_object"}:void 0,...(P==null?void 0:P.enableThinking)!=null?{enable_thinking:P.enableThinking}:{},...(P==null?void 0:P.thinkingBudget)!=null?{thinking_budget:P.thinkingBudget}:{},messages:BG({prompt:J,cacheControlValidator:Y})},{tools:y,toolChoice:S,toolWarnings:F}=i({tools:E,toolChoice:L});return U.push(...Y.getWarnings()),{args:{...w,tools:y,tool_choice:S,...y!=null&&(P==null?void 0:P.parallelToolCalls)!==void 0?{parallel_tool_calls:P.parallelToolCalls}:{}},warnings:[...U,...F]}}async doGenerate(J){var Q;let{args:$,warnings:K}=await this.getArgs(J),{responseHeaders:j,value:z,rawValue:q}=await k({url:`${this.config.baseURL}/chat/completions`,headers:V(this.config.headers(),J.headers),body:$,failedResponseHandler:s,successfulResponseHandler:I(qG),abortSignal:J.abortSignal,fetch:this.config.fetch}),A=z.choices[0],Z=[],N=A.message.content;if(N!=null&&N.length>0)Z.push({type:"text",text:N});let X=A.message.reasoning_content;if(X!=null&&X.length>0)Z.push({type:"reasoning",text:X});if(A.message.tool_calls!=null)for(let E of A.message.tool_calls)Z.push({type:"tool-call",toolCallId:E.id,toolName:E.function.name,input:E.function.arguments});return{content:Z,finishReason:{unified:_(A.finish_reason),raw:(Q=A.finish_reason)!=null?Q:void 0},usage:p(z.usage),request:{body:JSON.stringify($)},response:{...u(z),headers:j,body:q},warnings:K}}async doStream(J){let{args:Q,warnings:$}=await this.getArgs(J),K={...Q,stream:!0,stream_options:this.config.includeUsage?{include_usage:!0}:void 0},{responseHeaders:j,value:z}=await k({url:`${this.config.baseURL}/chat/completions`,headers:V(this.config.headers(),J.headers),body:K,failedResponseHandler:s,successfulResponseHandler:XG(AG),abortSignal:J.abortSignal,fetch:this.config.fetch}),q={unified:"other",raw:void 0},A=void 0,Z=!0,N=!1,X=null,E=[];return{stream:z.pipeThrough(new TransformStream({start(L){L.enqueue({type:"stream-start",warnings:$})},transform(L,B){var U,Y,P,w;if(J.includeRawChunks)B.enqueue({type:"raw",rawValue:L.rawValue});if(!L.success){B.enqueue({type:"error",error:L.error});return}let y=L.value;if(Z)Z=!1,B.enqueue({type:"response-metadata",...u(y)});if(y.usage!=null)A=y.usage;if(y.choices.length===0)return;let S=y.choices[0],F=S.delta;if(F.reasoning_content!=null&&F.reasoning_content.length>0){if(X==null){if(N)B.enqueue({type:"text-end",id:"0"}),N=!1;X=a(),B.enqueue({type:"reasoning-start",id:X})}B.enqueue({type:"reasoning-delta",id:X,delta:F.reasoning_content})}if(F.content!=null&&F.content.length>0){if(X!=null)B.enqueue({type:"reasoning-end",id:X}),X=null;if(!N)B.enqueue({type:"text-start",id:"0"}),N=!0;B.enqueue({type:"text-delta",id:"0",delta:F.content})}if(F.tool_calls!=null){if(X!=null)B.enqueue({type:"reasoning-end",id:X}),X=null;if(N)B.enqueue({type:"text-end",id:"0"}),N=!1;for(let W of F.tool_calls){let M=(U=W.index)!=null?U:E.length;if(E[M]==null){if(W.id==null)throw new C({data:W,message:"Expected 'id' to be a string."});if(((Y=W.function)==null?void 0:Y.name)==null)throw new C({data:W,message:"Expected 'function.name' to be a string."});B.enqueue({type:"tool-input-start",id:W.id,toolName:W.function.name}),E[M]={id:W.id,type:"function",function:{name:W.function.name,arguments:(P=W.function.arguments)!=null?P:""},hasFinished:!1};let D=E[M];if(D.function.arguments.length>0)B.enqueue({type:"tool-input-delta",id:D.id,delta:D.function.arguments});if(g(D.function.arguments))B.enqueue({type:"tool-input-end",id:D.id}),B.enqueue({type:"tool-call",toolCallId:D.id,toolName:D.function.name,input:D.function.arguments}),D.hasFinished=!0;continue}let H=E[M];if(H.hasFinished)continue;if(((w=W.function)==null?void 0:w.arguments)!=null)H.function.arguments+=W.function.arguments,B.enqueue({type:"tool-input-delta",id:H.id,delta:W.function.arguments});if(g(H.function.arguments))B.enqueue({type:"tool-input-end",id:H.id}),B.enqueue({type:"tool-call",toolCallId:H.id,toolName:H.function.name,input:H.function.arguments}),H.hasFinished=!0}}if(S.finish_reason!=null)q={unified:_(S.finish_reason),raw:S.finish_reason}},flush(L){if(X!=null)L.enqueue({type:"reasoning-end",id:X});if(N)L.enqueue({type:"text-end",id:"0"});L.enqueue({type:"finish",finishReason:q,usage:p(A)})}})),request:{body:JSON.stringify(K)},response:{headers:j}}}},YG=G.object({prompt_tokens:G.number(),completion_tokens:G.number(),total_tokens:G.number(),prompt_tokens_details:G.object({cached_tokens:G.number().nullish(),cache_creation_input_tokens:G.number().nullish()}).nullish(),completion_tokens_details:G.object({reasoning_tokens:G.number().nullish()}).nullish()}),qG=G.object({id:G.string().nullish(),created:G.number().nullish(),model:G.string().nullish(),choices:G.array(G.object({message:G.object({role:G.literal("assistant").nullish(),content:G.string().nullish(),reasoning_content:G.string().nullish(),tool_calls:G.array(G.object({id:G.string(),type:G.literal("function"),function:G.object({name:G.string(),arguments:G.string()})})).nullish()}),finish_reason:G.string().nullish(),index:G.number()})),usage:YG.nullish()}),AG=G.object({id:G.string().nullish(),created:G.number().nullish(),model:G.string().nullish(),choices:G.array(G.object({delta:G.object({role:G.enum(["assistant"]).nullish(),content:G.string().nullish(),reasoning_content:G.string().nullish(),tool_calls:G.array(G.object({index:G.number().nullish(),id:G.string().nullish(),type:G.literal("function").nullish(),function:G.object({name:G.string().nullish(),arguments:G.string().nullish()}).nullish()})).nullish()}),finish_reason:G.string().nullish(),index:G.number()})),usage:YG.nullish()}),HG=NG(()=>QG(G.object({negativePrompt:G.string().nullish(),audioUrl:G.string().nullish(),promptExtend:G.boolean().nullish(),shotType:G.enum(["single","multi"]).nullish(),watermark:G.boolean().nullish(),audio:G.boolean().nullish(),referenceUrls:G.array(G.string()).nullish(),pollIntervalMs:G.number().positive().nullish(),pollTimeoutMs:G.number().positive().nullish()}).passthrough())),LG=G.object({code:G.string().nullish(),message:G.string(),request_id:G.string().nullish()}),n=R({errorSchema:LG,errorToMessage:(J)=>J.message}),PG=G.object({output:G.object({task_status:G.string(),task_id:G.string()}).nullish(),request_id:G.string().nullish()}),WG=G.object({output:G.object({task_id:G.string(),task_status:G.string(),video_url:G.string().nullish(),submit_time:G.string().nullish(),scheduled_time:G.string().nullish(),end_time:G.string().nullish(),orig_prompt:G.string().nullish(),actual_prompt:G.string().nullish(),code:G.string().nullish(),message:G.string().nullish()}).nullish(),usage:G.object({duration:G.number().nullish(),output_video_duration:G.number().nullish(),SR:G.number().nullish(),size:G.string().nullish()}).nullish(),request_id:G.string().nullish()});function UG(J){if(J.includes("-i2v"))return"i2v";if(J.includes("-r2v"))return"r2v";return"t2v"}var wG=class{constructor(J,Q){this.modelId=J,this.config=Q,this.specificationVersion="v3",this.maxVideosPerCall=1}get provider(){return this.config.provider}async doGenerate(J){var Q,$,K,j,z,q,A,Z,N,X,E;let L=(K=($=(Q=this.config._internal)==null?void 0:Q.currentDate)==null?void 0:$.call(Q))!=null?K:new Date,B=[],U=UG(this.modelId),Y=await v({provider:"alibaba",providerOptions:J.providerOptions,schema:HG}),P={};if(J.prompt!=null)P.prompt=J.prompt;if((Y==null?void 0:Y.negativePrompt)!=null)P.negative_prompt=Y.negativePrompt;if((Y==null?void 0:Y.audioUrl)!=null)P.audio_url=Y.audioUrl;if(U==="i2v"&&J.image!=null)if(J.image.type==="url")P.img_url=J.image.url;else{let x=typeof J.image.data==="string"?J.image.data:e(J.image.data);P.img_url=x}if(U==="r2v"&&(Y==null?void 0:Y.referenceUrls)!=null)P.reference_urls=Y.referenceUrls;let w={};if(J.duration!=null)w.duration=J.duration;if(J.seed!=null)w.seed=J.seed;if(J.resolution!=null)if(U==="i2v"){let x={"1280x720":"720P","720x1280":"720P","960x960":"720P","1088x832":"720P","832x1088":"720P","1920x1080":"1080P","1080x1920":"1080P","1440x1440":"1080P","1632x1248":"1080P","1248x1632":"1080P","832x480":"480P","480x832":"480P","624x624":"480P"};w.resolution=x[J.resolution]||J.resolution}else w.size=J.resolution.replace("x","*");if((Y==null?void 0:Y.promptExtend)!=null)w.prompt_extend=Y.promptExtend;if((Y==null?void 0:Y.shotType)!=null)w.shot_type=Y.shotType;if((Y==null?void 0:Y.watermark)!=null)w.watermark=Y.watermark;if((Y==null?void 0:Y.audio)!=null)w.audio=Y.audio;if(J.aspectRatio)B.push({type:"unsupported",feature:"aspectRatio",details:"Alibaba video models use explicit size/resolution dimensions. Use the resolution option or providerOptions.alibaba for size control."});if(J.fps)B.push({type:"unsupported",feature:"fps",details:"Alibaba video models do not support custom FPS."});if(J.n!=null&&J.n>1)B.push({type:"unsupported",feature:"n",details:"Alibaba video models only support generating 1 video per call."});let{value:y}=await k({url:`${this.config.baseURL}/api/v1/services/aigc/video-generation/video-synthesis`,headers:V(await b(this.config.headers),J.headers,{"X-DashScope-Async":"enable"}),body:{model:this.modelId,input:P,parameters:w},successfulResponseHandler:I(PG),failedResponseHandler:n,abortSignal:J.abortSignal,fetch:this.config.fetch}),S=(j=y.output)==null?void 0:j.task_id;if(!S)throw new f({name:"ALIBABA_VIDEO_GENERATION_ERROR",message:`No task_id returned from Alibaba API. Response: ${JSON.stringify(y)}`});let F=(z=Y==null?void 0:Y.pollIntervalMs)!=null?z:5000,W=(q=Y==null?void 0:Y.pollTimeoutMs)!=null?q:600000,M=Date.now(),H,D;while(!0){if(await l(F,{abortSignal:J.abortSignal}),Date.now()-M>W)throw new f({name:"ALIBABA_VIDEO_GENERATION_TIMEOUT",message:`Video generation timed out after ${W}ms`});let{value:x,responseHeaders:ZG}=await GG({url:`${this.config.baseURL}/api/v1/tasks/${S}`,headers:V(await b(this.config.headers),J.headers),successfulResponseHandler:I(WG),failedResponseHandler:n,abortSignal:J.abortSignal,fetch:this.config.fetch});D=ZG;let T=(A=x.output)==null?void 0:A.task_status;if(T==="SUCCEEDED"){H=x;break}if(T==="FAILED"||T==="CANCELED")throw new f({name:"ALIBABA_VIDEO_GENERATION_FAILED",message:`Video generation ${T.toLowerCase()}. Task ID: ${S}. ${(N=(Z=x.output)==null?void 0:Z.message)!=null?N:""}`})}let h=(X=H==null?void 0:H.output)==null?void 0:X.video_url;if(!h)throw new f({name:"ALIBABA_VIDEO_GENERATION_ERROR",message:`No video URL in response. Task ID: ${S}`});return{videos:[{type:"url",url:h,mediaType:"video/mp4"}],warnings:B,response:{timestamp:L,modelId:this.modelId,headers:D},providerMetadata:{alibaba:{taskId:S,videoUrl:h,...((E=H==null?void 0:H.output)==null?void 0:E.actual_prompt)?{actualPrompt:H.output.actual_prompt}:{},...(H==null?void 0:H.usage)?{usage:{duration:H.usage.duration,outputVideoDuration:H.usage.output_video_duration,resolution:H.usage.SR,size:H.usage.size}}:{}}}}}},SG="1.0.17",FG=G.object({error:G.object({message:G.string(),code:G.string().nullish(),type:G.string().nullish()})}),s=R({errorSchema:FG,errorToMessage:(J)=>J.error.message});function DG(J={}){var Q,$;let K=(Q=d(J.baseURL))!=null?Q:"https://dashscope-intl.aliyuncs.com/compatible-mode/v1",j=($=d(J.videoBaseURL))!=null?$:"https://dashscope-intl.aliyuncs.com",z=()=>o({Authorization:`Bearer ${JG({apiKey:J.apiKey,environmentVariableName:"ALIBABA_API_KEY",description:"Alibaba Cloud (DashScope)"})}`,...J.headers},`ai-sdk/alibaba/${SG}`),q=(N)=>{var X;return new KG(N,{provider:"alibaba.chat",baseURL:K,headers:z,fetch:J.fetch,includeUsage:(X=J.includeUsage)!=null?X:!0})},A=(N)=>new wG(N,{provider:"alibaba.video",baseURL:j,headers:z,fetch:J.fetch}),Z=function(N){if(new.target)throw Error("The Alibaba model function cannot be called with the new keyword.");return q(N)};return Z.specificationVersion="v3",Z.languageModel=q,Z.chatModel=q,Z.video=A,Z.videoModel=A,Z.imageModel=(N)=>{throw new m({modelId:N,modelType:"imageModel"})},Z.embeddingModel=(N)=>{throw new m({modelId:N,modelType:"embeddingModel"})},Z}var gG=DG();export{DG as createAlibaba,gG as alibaba,SG as VERSION};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{Zr as c,bs as s}from"./chunk-hdrbyarv.js";var r=["openai","anthropic"],p=["deepseek","zai","zhipuai","moonshotai","moonshotai-cn","kimi-for-coding","stepfun"],d=["opencode","openrouter"],l=["alibaba","alibaba-cn","bytedance","alibaba-coding-plan","alibaba-coding-plan-cn","zai-coding-plan","zhipuai-coding-plan","tencent-coding-plan","minimax-coding-plan","minimax-cn-coding-plan","kuae-cloud-coding-plan"],R=["opencode-go","github-copilot","google","vercel"],P=[r,p,d,l,R],g=Object.fromEntries(P.flatMap((i,a,e)=>{let n=e.slice(0,a).reduce((o,t)=>o+t.length,0);return i.map((o,t)=>[o,n+t])}));function m(i){return i in g}function O(i,a,e){return c(i,s((n)=>a[n.id]??99,(n)=>n.name??n.id),(n)=>n.map((o)=>({label:o.name,value:o.id,hint:e(o)})))}
2
+ import{At as s,wt as c}from"./chunk-tns5x4w0.js";var r=["openai","anthropic"],p=["deepseek","zai","zhipuai","moonshotai","moonshotai-cn","kimi-for-coding","stepfun"],d=["opencode","openrouter"],l=["alibaba","alibaba-cn","bytedance","alibaba-coding-plan","alibaba-coding-plan-cn","zai-coding-plan","zhipuai-coding-plan","tencent-coding-plan","minimax-coding-plan","minimax-cn-coding-plan","kuae-cloud-coding-plan"],R=["opencode-go","github-copilot","google","vercel"],P=[r,p,d,l,R],g=Object.fromEntries(P.flatMap((i,a,e)=>{let n=e.slice(0,a).reduce((o,t)=>o+t.length,0);return i.map((o,t)=>[o,n+t])}));function m(i){return i in g}function O(i,a,e){return c(i,s((n)=>a[n.id]??99,(n)=>n.name??n.id),(n)=>n.map((o)=>({label:o.name,value:o.id,hint:e(o)})))}
3
3
  export{g as L,m as M,O as N};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Cf as a}from"./chunk-dxcrggvq.js";import"./chunk-ywkvq7zb.js";import"./chunk-nfg7nt13.js";import"./chunk-rv1stdvb.js";import"./chunk-3k2b05fv.js";export{a as default};