@qitqode/qitqode-android-arm64 0.2.9 → 0.2.10

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 (425) hide show
  1. package/bundle/chunk-062chtrq.js +2 -0
  2. package/bundle/chunk-062vs7bp.js +2 -0
  3. package/bundle/chunk-08g14hmz.js +2 -0
  4. package/bundle/{chunk-wgkcyqn1.js → chunk-0bhzhh7s.js} +2 -2
  5. package/bundle/{chunk-cfwz1hgr.js → chunk-0mwzxqt5.js} +3 -3
  6. package/bundle/{chunk-mr17tppa.js → chunk-0sfc21qe.js} +2 -2
  7. package/bundle/{chunk-7adsab4h.js → chunk-0tkznq75.js} +1 -1
  8. package/bundle/chunk-0w2v8dfy.js +2 -0
  9. package/bundle/chunk-10fr7a2y.js +2 -0
  10. package/bundle/chunk-141p12c4.js +4 -0
  11. package/bundle/chunk-15bjhfav.js +3 -0
  12. package/bundle/{chunk-92r1gw2j.js → chunk-1h96bk6p.js} +2 -2
  13. package/bundle/chunk-1hv61m11.js +2 -0
  14. package/bundle/{chunk-0z1keh2w.js → chunk-1m78yy4k.js} +1 -1
  15. package/bundle/chunk-1q10jyka.js +29 -0
  16. package/bundle/{chunk-g4tyaj0m.js → chunk-1r81q7m3.js} +1 -1
  17. package/bundle/{chunk-29q89bge.js → chunk-2cvwrabw.js} +2 -2
  18. package/bundle/{chunk-8p0t8qah.js → chunk-2dmcpqak.js} +1 -1
  19. package/bundle/{chunk-35fj1sfm.js → chunk-2fbkw84y.js} +2 -2
  20. package/bundle/chunk-2mkvx8b2.js +2 -0
  21. package/bundle/chunk-2rykfc3a.js +2 -0
  22. package/bundle/chunk-2w5hx4fs.js +2 -0
  23. package/bundle/{chunk-t3w43rft.js → chunk-2y5bthrp.js} +1 -1
  24. package/bundle/chunk-2yy63sxz.js +2 -0
  25. package/bundle/chunk-2z3fe4qw.js +2 -0
  26. package/bundle/{chunk-g7v6sp3c.js → chunk-2zjet9tx.js} +2 -2
  27. package/bundle/{chunk-qgkb6n8k.js → chunk-32xd626h.js} +2 -2
  28. package/bundle/chunk-361cmmrp.js +2 -0
  29. package/bundle/{chunk-eg1m81ax.js → chunk-3mtjxmw1.js} +1 -1
  30. package/bundle/chunk-3r6dq1h3.js +2 -0
  31. package/bundle/{chunk-wtt5wms9.js → chunk-3sj0jv91.js} +1 -1
  32. package/bundle/{chunk-hz02vrqs.js → chunk-3vae1s42.js} +1 -1
  33. package/bundle/{chunk-t18ka1e7.js → chunk-3yfjgks3.js} +1 -1
  34. package/bundle/{chunk-phf37x1c.js → chunk-3zzrdpsx.js} +1 -1
  35. package/bundle/chunk-4a12wv2m.js +2 -0
  36. package/bundle/{chunk-1rgt2vmt.js → chunk-4a9jqe5s.js} +1 -1
  37. package/bundle/{chunk-wqk1v8t0.js → chunk-4sa9t0vx.js} +2 -2
  38. package/bundle/{chunk-qbnt4ynd.js → chunk-532fnfmw.js} +2 -2
  39. package/bundle/chunk-547a55ba.js +2 -0
  40. package/bundle/{chunk-vr8nwzp0.js → chunk-56yp5v0w.js} +1 -1
  41. package/bundle/{chunk-ag8wxwwz.js → chunk-5fcyb122.js} +1 -1
  42. package/bundle/{chunk-4pmvxnkj.js → chunk-5nm5egq0.js} +2 -2
  43. package/bundle/{chunk-1v0khv7p.js → chunk-5p2r8bxx.js} +1 -1
  44. package/bundle/{chunk-5bv63rqj.js → chunk-5rqjze1g.js} +1 -1
  45. package/bundle/{chunk-sy9w1t2y.js → chunk-5w7ebtcd.js} +1 -1
  46. package/bundle/chunk-5ztmc770.js +2 -0
  47. package/bundle/{chunk-a1z8rnq7.js → chunk-61t4g8bh.js} +4 -4
  48. package/bundle/chunk-62x3r2q8.js +2 -0
  49. package/bundle/chunk-62y6zk9x.js +2 -0
  50. package/bundle/{chunk-c76cjhn0.js → chunk-6axm2qtj.js} +1 -1
  51. package/bundle/{chunk-zfrftgcy.js → chunk-6gbdvz6p.js} +1 -1
  52. package/bundle/{chunk-fa8pwdwv.js → chunk-6mnk5sg3.js} +1 -1
  53. package/bundle/chunk-6th7vpwm.js +2 -0
  54. package/bundle/{chunk-8yzghzjq.js → chunk-6wjdhvdf.js} +1 -1
  55. package/bundle/{chunk-a8bjcvda.js → chunk-6y58jzak.js} +1 -1
  56. package/bundle/chunk-6ybh5smv.js +2 -0
  57. package/bundle/chunk-73kprndw.js +2 -0
  58. package/bundle/chunk-79fr19xf.js +2 -0
  59. package/bundle/{chunk-3va85mbe.js → chunk-7a3txs9f.js} +2 -2
  60. package/bundle/chunk-7ezr478e.js +2 -0
  61. package/bundle/chunk-7gj1vqyj.js +2 -0
  62. package/bundle/{chunk-eacpc64g.js → chunk-7hdb1fhq.js} +2 -2
  63. package/bundle/{chunk-t8fjgkp8.js → chunk-7rbg6mg9.js} +2 -2
  64. package/bundle/{chunk-59csnjc3.js → chunk-7s0nq2aa.js} +2 -2
  65. package/bundle/chunk-7ywfkwb4.js +2 -0
  66. package/bundle/chunk-819qr675.js +2 -0
  67. package/bundle/{chunk-g6y2c5az.js → chunk-81dvy370.js} +1 -1
  68. package/bundle/chunk-85fnnwm2.js +2 -0
  69. package/bundle/chunk-89fwh84w.js +2 -0
  70. package/bundle/chunk-8e724g3k.js +2 -0
  71. package/bundle/{chunk-k6981ysw.js → chunk-8gpjmj42.js} +3 -3
  72. package/bundle/{chunk-wtxh5m6j.js → chunk-8nnajdwf.js} +3 -3
  73. package/bundle/chunk-8peby2d1.js +2 -0
  74. package/bundle/{chunk-702bt91p.js → chunk-8rkszwxq.js} +6 -6
  75. package/bundle/{chunk-w0nc0gcx.js → chunk-8v60bqm0.js} +1 -1
  76. package/bundle/chunk-9894a2yn.js +2 -0
  77. package/bundle/chunk-98ye2nwt.js +2 -0
  78. package/bundle/{chunk-48gap82w.js → chunk-9bbwxp5d.js} +1 -1
  79. package/bundle/{chunk-z0kbyr00.js → chunk-9d0exvey.js} +2 -2
  80. package/bundle/{chunk-8ysp6vf8.js → chunk-9fjcgdea.js} +1 -1
  81. package/bundle/{chunk-jpn9zfj5.js → chunk-9nf5650d.js} +1 -1
  82. package/bundle/{chunk-n6tqtk6h.js → chunk-9pj10pgd.js} +2 -2
  83. package/bundle/chunk-9s4excg8.js +2 -0
  84. package/bundle/{chunk-t6zz47zk.js → chunk-9s5h0f1y.js} +2 -2
  85. package/bundle/{chunk-p8ak162p.js → chunk-9tz18e54.js} +1 -1
  86. package/bundle/{chunk-fs1vb39f.js → chunk-9zy5tsry.js} +3 -3
  87. package/bundle/{chunk-bc2krtaf.js → chunk-a70m6kyn.js} +1 -1
  88. package/bundle/{chunk-cr5tknvb.js → chunk-acsqvgdw.js} +1 -1
  89. package/bundle/chunk-aetgcegz.js +2 -0
  90. package/bundle/chunk-agas0nay.js +2 -0
  91. package/bundle/{chunk-vs3s49jw.js → chunk-ajnzv5jt.js} +2 -2
  92. package/bundle/{chunk-9cf2ktyh.js → chunk-asxmkyz2.js} +1 -1
  93. package/bundle/{chunk-0ffmwhw7.js → chunk-at4dge22.js} +1 -1
  94. package/bundle/{chunk-sa0rrreh.js → chunk-atacnspd.js} +2 -2
  95. package/bundle/chunk-ayknzc4m.js +2 -0
  96. package/bundle/chunk-azss4acq.js +3 -0
  97. package/bundle/chunk-b2ybst88.js +2 -0
  98. package/bundle/{chunk-cghz0855.js → chunk-b8rzn48q.js} +1 -1
  99. package/bundle/{chunk-dhvx9p54.js → chunk-b9f78x5g.js} +1 -1
  100. package/bundle/chunk-bd5vtjd7.js +2 -0
  101. package/bundle/chunk-bjqqk6jt.js +2 -0
  102. package/bundle/{chunk-mv7q6ach.js → chunk-brk1jca3.js} +1 -1
  103. package/bundle/{chunk-5r7c6vvx.js → chunk-by1kwg4r.js} +2 -2
  104. package/bundle/{chunk-1acn5me8.js → chunk-c1c8ch3g.js} +327 -313
  105. package/bundle/{chunk-2nheahmq.js → chunk-c2ns2csn.js} +1 -1
  106. package/bundle/{chunk-qk5vy2pr.js → chunk-c3ey896z.js} +1 -1
  107. package/bundle/{chunk-b7sr9rn3.js → chunk-c8080519.js} +1 -1
  108. package/bundle/{chunk-vd8cmdpv.js → chunk-c8yc8qcd.js} +1 -1
  109. package/bundle/{chunk-nas631g2.js → chunk-c9cngded.js} +1 -1
  110. package/bundle/{chunk-ejhhrece.js → chunk-ccdjzn2m.js} +3 -3
  111. package/bundle/{chunk-rk0fnvp5.js → chunk-cdenq7jb.js} +1 -1
  112. package/bundle/chunk-cpkcdykz.js +2 -0
  113. package/bundle/{chunk-56wq8cqj.js → chunk-cs825mxr.js} +1 -1
  114. package/bundle/{chunk-1bxfzd6r.js → chunk-cxtwavyf.js} +4 -4
  115. package/bundle/chunk-cyafm8d6.js +2 -0
  116. package/bundle/{chunk-eewe7tx1.js → chunk-d0dsgxk4.js} +2 -2
  117. package/bundle/{chunk-g3n465ee.js → chunk-d1fv2c7s.js} +2 -2
  118. package/bundle/{chunk-1p9s5jj1.js → chunk-d1xfv4d3.js} +1 -1
  119. package/bundle/chunk-d4316r53.js +2 -0
  120. package/bundle/chunk-d8ym7mcg.js +2 -0
  121. package/bundle/{chunk-53jstmdp.js → chunk-d9w2bn2e.js} +1 -1
  122. package/bundle/{chunk-g26redah.js → chunk-dd461rg3.js} +1 -1
  123. package/bundle/{chunk-e0vrxetq.js → chunk-djfrkbd5.js} +1 -1
  124. package/bundle/{chunk-mrq35ftw.js → chunk-dm447tgc.js} +2 -2
  125. package/bundle/{chunk-7pckez5z.js → chunk-dnjyepb2.js} +2 -2
  126. package/bundle/chunk-dnpjxjkp.js +2 -0
  127. package/bundle/{chunk-0a4pmkc9.js → chunk-dp6ms01y.js} +2 -2
  128. package/bundle/{chunk-rdreeyv0.js → chunk-dx7rexx3.js} +3 -3
  129. package/bundle/{chunk-kre93a89.js → chunk-dz3kcsb6.js} +2 -2
  130. package/bundle/{chunk-dcv6wj9x.js → chunk-dzma8zvf.js} +2 -2
  131. package/bundle/{chunk-e2wfj86b.js → chunk-e10c0crf.js} +1 -1
  132. package/bundle/{chunk-wn63q3xp.js → chunk-e1x1mp9m.js} +1 -1
  133. package/bundle/{chunk-tk4z6r09.js → chunk-e3mrw0k7.js} +1 -1
  134. package/bundle/chunk-e5gjqtby.js +2 -0
  135. package/bundle/{chunk-3z2zn8rj.js → chunk-e72jwbfc.js} +1 -1
  136. package/bundle/{chunk-85wh85pk.js → chunk-eabbrt1p.js} +1 -1
  137. package/bundle/{chunk-jr80q31w.js → chunk-ecz4h0a2.js} +1 -1
  138. package/bundle/chunk-ee3mqzms.js +2 -0
  139. package/bundle/chunk-eme9xmh3.js +2 -0
  140. package/bundle/{chunk-cf9m9m9q.js → chunk-eqpep2m2.js} +1 -1
  141. package/bundle/chunk-er5f61s5.js +2 -0
  142. package/bundle/chunk-er716522.js +2 -0
  143. package/bundle/{chunk-qgek59e6.js → chunk-ev6jwt7q.js} +1 -1
  144. package/bundle/chunk-ez3gacqe.js +2 -0
  145. package/bundle/{chunk-ax64ngf2.js → chunk-f0ab2f28.js} +1 -1
  146. package/bundle/{chunk-ggncq8w8.js → chunk-f17se3hh.js} +1 -1
  147. package/bundle/chunk-f3y5kr76.js +14 -0
  148. package/bundle/{chunk-vsqvnxbz.js → chunk-f6btedtt.js} +1 -1
  149. package/bundle/{chunk-nsp1za8t.js → chunk-f6vy70p6.js} +2 -2
  150. package/bundle/{chunk-0s4cp6q2.js → chunk-ff8q10gk.js} +2 -2
  151. package/bundle/chunk-fkc7wf1p.js +2 -0
  152. package/bundle/chunk-fm6z8nqb.js +2 -0
  153. package/bundle/{chunk-fw1f47de.js → chunk-fsndgr9a.js} +1 -1
  154. package/bundle/{chunk-pqg1wjb5.js → chunk-fvv1cret.js} +1 -1
  155. package/bundle/{chunk-j10a984e.js → chunk-g08qj9z3.js} +2 -2
  156. package/bundle/chunk-g0qwm23d.js +2 -0
  157. package/bundle/chunk-g4yn8cj8.js +2 -0
  158. package/bundle/{chunk-rwwvy89t.js → chunk-g52wmt1v.js} +1 -1
  159. package/bundle/{chunk-trstb8ee.js → chunk-gb51fn3r.js} +1 -1
  160. package/bundle/{chunk-kgv68cpb.js → chunk-gbnf7zf9.js} +1 -1
  161. package/bundle/{chunk-0w19vmd7.js → chunk-ge7csm6m.js} +2 -2
  162. package/bundle/{chunk-bkfafcbw.js → chunk-gksbv613.js} +2 -2
  163. package/bundle/{chunk-afr8m0q1.js → chunk-gmq1kwn0.js} +1 -1
  164. package/bundle/{chunk-b5ym419d.js → chunk-gq3zb4wv.js} +2 -2
  165. package/bundle/{chunk-tbx741en.js → chunk-gqgjybjc.js} +1 -1
  166. package/bundle/{chunk-bhg69t69.js → chunk-gx4v8z64.js} +2 -2
  167. package/bundle/{chunk-sm1g81cv.js → chunk-h0pvxre5.js} +1 -1
  168. package/bundle/chunk-h1spsy3y.js +2 -0
  169. package/bundle/{chunk-sbjymf20.js → chunk-h2p984qb.js} +2 -2
  170. package/bundle/{chunk-gznt3dv8.js → chunk-h6z86aay.js} +1 -1
  171. package/bundle/chunk-h8gkv40j.js +2 -0
  172. package/bundle/{chunk-zsg29gba.js → chunk-h91zmzs5.js} +1 -1
  173. package/bundle/{chunk-zrhw1szj.js → chunk-hgm8yfcb.js} +1 -1
  174. package/bundle/chunk-j59kmb49.js +2 -0
  175. package/bundle/chunk-j5z95b6f.js +3 -0
  176. package/bundle/{chunk-52xvhxek.js → chunk-j7637cwg.js} +2 -2
  177. package/bundle/{chunk-rwnwjm82.js → chunk-jbcqhw3x.js} +2 -2
  178. package/bundle/{chunk-maa21rh9.js → chunk-je8fcsa9.js} +1 -1
  179. package/bundle/{chunk-y0h3jfkj.js → chunk-jt6bvxtr.js} +1 -1
  180. package/bundle/chunk-jv37ghev.js +2 -0
  181. package/bundle/chunk-k10rtgsk.js +5 -0
  182. package/bundle/chunk-k3hcb6qf.js +2 -0
  183. package/bundle/chunk-k5d822n2.js +3 -0
  184. package/bundle/{chunk-2vaphpz0.js → chunk-kc8n5cgb.js} +1 -1
  185. package/bundle/chunk-kcqeh1e5.js +2 -0
  186. package/bundle/{chunk-5xkp27b1.js → chunk-kds2g7r2.js} +1 -1
  187. package/bundle/{chunk-scnbt714.js → chunk-kec1xw1n.js} +1 -1
  188. package/bundle/{chunk-13jq2ygc.js → chunk-kk850sdw.js} +2 -2
  189. package/bundle/{chunk-3bb4aqh9.js → chunk-m01h6kk1.js} +1 -1
  190. package/bundle/{chunk-e0hha3be.js → chunk-m4j6t713.js} +1 -1
  191. package/bundle/chunk-m8ytbq04.js +2 -0
  192. package/bundle/chunk-mf9nc4xz.js +2 -0
  193. package/bundle/{chunk-7thhd7ds.js → chunk-mmqyter3.js} +1 -1
  194. package/bundle/{chunk-y31f8k5f.js → chunk-mn0pshpv.js} +1 -1
  195. package/bundle/{chunk-s2tc3qs0.js → chunk-mn5cacf6.js} +2 -2
  196. package/bundle/{chunk-0egrckx0.js → chunk-mp1x10t5.js} +2 -2
  197. package/bundle/chunk-mxby91bj.js +2 -0
  198. package/bundle/chunk-mzv1gh6f.js +2 -0
  199. package/bundle/chunk-n0hsvvw8.js +2 -0
  200. package/bundle/{chunk-az3nss5m.js → chunk-ngyv4fhn.js} +2 -2
  201. package/bundle/{chunk-g9nwqwqp.js → chunk-nh4zk07t.js} +1 -1
  202. package/bundle/{chunk-8jmb5bd4.js → chunk-nk5vrenn.js} +2 -2
  203. package/bundle/chunk-nm1v9z14.js +2 -0
  204. package/bundle/chunk-nnkfdhh9.js +2 -0
  205. package/bundle/{chunk-jqj1ay7x.js → chunk-npdgfqaw.js} +1 -1
  206. package/bundle/{chunk-p2fte9vz.js → chunk-nq4x6792.js} +2 -2
  207. package/bundle/{chunk-wr6rnxr5.js → chunk-nqk8d62j.js} +1 -1
  208. package/bundle/{chunk-7jy53zqy.js → chunk-p506eydh.js} +1 -1
  209. package/bundle/{chunk-phpxxd48.js → chunk-p6jf1fyt.js} +1 -1
  210. package/bundle/chunk-p7nstcxa.js +2 -0
  211. package/bundle/{chunk-6ps30qax.js → chunk-pbanj1gk.js} +2 -2
  212. package/bundle/{chunk-vph4w4yy.js → chunk-pchv413c.js} +2 -2
  213. package/bundle/{chunk-qsme16gk.js → chunk-pf2vq6t1.js} +2 -2
  214. package/bundle/chunk-pfwkvv7g.js +2 -0
  215. package/bundle/{chunk-ntr0ezf2.js → chunk-pky8h8rh.js} +1 -1
  216. package/bundle/chunk-pn1jz8qj.js +2 -0
  217. package/bundle/chunk-pqvmtfk7.js +2 -0
  218. package/bundle/chunk-prgw26g3.js +2 -0
  219. package/bundle/{chunk-kckr30tf.js → chunk-psqtptrs.js} +1 -1
  220. package/bundle/chunk-pv9ty6v7.js +2 -0
  221. package/bundle/{chunk-060wbpz4.js → chunk-pwsajn96.js} +1 -1
  222. package/bundle/{chunk-vgt3artc.js → chunk-pxm0x3e0.js} +1 -1
  223. package/bundle/chunk-pyf649pz.js +2 -0
  224. package/bundle/{chunk-wd8f9r4k.js → chunk-q0xgxygw.js} +1 -1
  225. package/bundle/{chunk-rye1yjnr.js → chunk-q26s0wb5.js} +1 -1
  226. package/bundle/{chunk-a48mx917.js → chunk-q4mtwv1w.js} +2 -2
  227. package/bundle/chunk-q4rstre7.js +2 -0
  228. package/bundle/chunk-q6jk2v6g.js +2 -0
  229. package/bundle/{chunk-5wx962mw.js → chunk-q7s6z0nz.js} +1 -1
  230. package/bundle/{chunk-jmmtcr2r.js → chunk-q8fjktv4.js} +1 -1
  231. package/bundle/{chunk-m7tmgvh6.js → chunk-qbewhcsz.js} +1 -1
  232. package/bundle/chunk-qd43npx3.js +2 -0
  233. package/bundle/{chunk-ydgst3h8.js → chunk-qdafm7qg.js} +2 -2
  234. package/bundle/chunk-qdb21y83.js +2 -0
  235. package/bundle/{chunk-72crs18f.js → chunk-qdbx1qkr.js} +1 -1
  236. package/bundle/{chunk-6vnqbejg.js → chunk-qdh2dm62.js} +1 -1
  237. package/bundle/chunk-qeksaefy.js +2 -0
  238. package/bundle/{chunk-qk1jkc0n.js → chunk-qjw2zcq5.js} +1 -1
  239. package/bundle/{chunk-dt3bsmfe.js → chunk-qm9fm5ja.js} +2 -2
  240. package/bundle/{chunk-h8mfbbjh.js → chunk-qq9yc2tp.js} +2 -2
  241. package/bundle/{chunk-0tcggtwv.js → chunk-qtyapmy7.js} +1 -1
  242. package/bundle/{chunk-c987bemn.js → chunk-qyan69nb.js} +1 -1
  243. package/bundle/chunk-r7t9yb9d.js +2 -0
  244. package/bundle/{chunk-6tqbnxar.js → chunk-r81w6skn.js} +1 -1
  245. package/bundle/{chunk-f4mnp6xd.js → chunk-rk21wv4k.js} +1 -1
  246. package/bundle/{chunk-ccf4pgkr.js → chunk-rpdgn9z3.js} +2 -2
  247. package/bundle/chunk-rxnd79h7.js +7 -0
  248. package/bundle/chunk-s05hqtx1.js +3 -0
  249. package/bundle/chunk-s27cz24e.js +808 -0
  250. package/bundle/chunk-sdv3a4w3.js +2 -0
  251. package/bundle/{chunk-zwhmg9dj.js → chunk-se8d5xg9.js} +1 -1
  252. package/bundle/chunk-sk89becn.js +2 -0
  253. package/bundle/{chunk-sz0favtz.js → chunk-snf6ahg7.js} +1 -1
  254. package/bundle/{chunk-dgcannw0.js → chunk-t2r51r6v.js} +1 -1
  255. package/bundle/{chunk-rva2ekrt.js → chunk-t5wdstzv.js} +1 -1
  256. package/bundle/{chunk-vkkz40je.js → chunk-t9pq363q.js} +2 -2
  257. package/bundle/chunk-tc0996xz.js +2 -0
  258. package/bundle/chunk-td9hm9be.js +2 -0
  259. package/bundle/{chunk-xy8arehp.js → chunk-tdevq564.js} +1 -1
  260. package/bundle/chunk-te91d271.js +2 -0
  261. package/bundle/chunk-tfs50mgj.js +2 -0
  262. package/bundle/{chunk-5cw8235e.js → chunk-tg1f56s3.js} +1 -1
  263. package/bundle/chunk-thecq33z.js +3 -0
  264. package/bundle/{chunk-f2v4g7t1.js → chunk-tjfer79w.js} +1 -1
  265. package/bundle/chunk-tjvtp9d9.js +2 -0
  266. package/bundle/chunk-tkm9m3n0.js +2 -0
  267. package/bundle/{chunk-ynf17943.js → chunk-tm79yrf3.js} +2 -2
  268. package/bundle/{chunk-fv5mrdyc.js → chunk-v03xq38e.js} +2 -2
  269. package/bundle/chunk-v0hnn7nb.js +2 -0
  270. package/bundle/{chunk-ftvvm4r5.js → chunk-v16n1fep.js} +2 -2
  271. package/bundle/chunk-v1s1rcqx.js +2 -0
  272. package/bundle/chunk-v4dt4062.js +2 -0
  273. package/bundle/{chunk-makegrxs.js → chunk-v8bxj01h.js} +1 -1
  274. package/bundle/{chunk-ryrxgn6d.js → chunk-v8rqgt7h.js} +1 -1
  275. package/bundle/{chunk-m4r8sepw.js → chunk-vbb1jg02.js} +1 -1
  276. package/bundle/{chunk-2kh0tg92.js → chunk-vbfc0wgv.js} +2 -2
  277. package/bundle/{chunk-d839fr0w.js → chunk-vjt6mh10.js} +2 -2
  278. package/bundle/{chunk-gsg6zn7e.js → chunk-vk35g121.js} +2 -2
  279. package/bundle/{chunk-dwkrqtbc.js → chunk-vsfj16v9.js} +2 -2
  280. package/bundle/{chunk-zqdjk4rf.js → chunk-vy93mn7d.js} +2 -2
  281. package/bundle/{chunk-1har4t9a.js → chunk-waa781eh.js} +1 -1
  282. package/bundle/{chunk-wb47k8ah.js → chunk-wbt31xap.js} +2 -2
  283. package/bundle/{chunk-0tm6589k.js → chunk-wd2xmkdp.js} +2 -2
  284. package/bundle/{chunk-fej5x648.js → chunk-wecs14rz.js} +1 -1
  285. package/bundle/chunk-wgrq86kd.js +2 -0
  286. package/bundle/{chunk-4y9wbfd2.js → chunk-wh2qqhep.js} +2 -2
  287. package/bundle/{chunk-g878zd6e.js → chunk-x0hhw46n.js} +1 -1
  288. package/bundle/{chunk-w7a33cwa.js → chunk-x308f9j4.js} +2 -2
  289. package/bundle/{chunk-y3gy62q5.js → chunk-x50adh71.js} +1 -1
  290. package/bundle/chunk-x8ks2bn7.js +2 -0
  291. package/bundle/{chunk-s5aefff0.js → chunk-xcmbxny8.js} +1 -1
  292. package/bundle/{chunk-rmsqb6r4.js → chunk-xgf4k9q7.js} +1 -1
  293. package/bundle/{chunk-2caaqmec.js → chunk-xj0zc9za.js} +1 -1
  294. package/bundle/{chunk-27saej0r.js → chunk-xnxw5zz9.js} +2 -2
  295. package/bundle/{chunk-fjftb2sz.js → chunk-xqwk2zsx.js} +2 -2
  296. package/bundle/{chunk-d30k7dpf.js → chunk-xstxdw7v.js} +1 -1
  297. package/bundle/{chunk-dwqvcdmf.js → chunk-xv03hbgj.js} +1 -1
  298. package/bundle/{chunk-bwadggys.js → chunk-xvvt886p.js} +2 -2
  299. package/bundle/{chunk-bnw744ej.js → chunk-xy2ty5h5.js} +2 -2
  300. package/bundle/{chunk-wm9nh9nb.js → chunk-yce8ph5b.js} +2 -2
  301. package/bundle/{chunk-fh3d0wce.js → chunk-yexzxx6f.js} +1 -1
  302. package/bundle/{chunk-eyr5ymt8.js → chunk-yh1t6jrj.js} +1 -1
  303. package/bundle/chunk-yspstxkq.js +2 -0
  304. package/bundle/{chunk-ykpj10nz.js → chunk-yydqavgh.js} +2 -2
  305. package/bundle/{chunk-k3m7jfdh.js → chunk-yzd6cyep.js} +1 -1
  306. package/bundle/chunk-z023h7t8.js +2 -0
  307. package/bundle/chunk-z0383stv.js +2 -0
  308. package/bundle/{chunk-vbfej8ds.js → chunk-z0m1qm7j.js} +2 -2
  309. package/bundle/{chunk-bpfq8fz4.js → chunk-z69tt390.js} +1 -1
  310. package/bundle/chunk-zewrmk8x.js +2 -0
  311. package/bundle/{chunk-29gwtcey.js → chunk-zfqgh9h7.js} +1 -1
  312. package/bundle/{chunk-h1bvqstw.js → chunk-zskdxbbh.js} +1 -1
  313. package/bundle/{chunk-kveztc6k.js → chunk-ztvkzex1.js} +1 -1
  314. package/bundle/index.js +3 -3
  315. package/bundle/parser.worker.js +2 -2
  316. package/bundle/worker.js +1 -1
  317. package/package.json +1 -1
  318. package/bundle/chunk-03zpnwk2.js +0 -2
  319. package/bundle/chunk-0aqdzyar.js +0 -2
  320. package/bundle/chunk-0eh3yc6e.js +0 -2
  321. package/bundle/chunk-0mh600tv.js +0 -2
  322. package/bundle/chunk-1a6q1f5n.js +0 -7
  323. package/bundle/chunk-2a5gjgvp.js +0 -2
  324. package/bundle/chunk-2phyc1c0.js +0 -2
  325. package/bundle/chunk-2pkfphgb.js +0 -2
  326. package/bundle/chunk-30wp95w1.js +0 -2
  327. package/bundle/chunk-32fpqd0n.js +0 -2
  328. package/bundle/chunk-3f2cjzb4.js +0 -2
  329. package/bundle/chunk-3qvap1kv.js +0 -2
  330. package/bundle/chunk-42hvspe7.js +0 -2
  331. package/bundle/chunk-452tk6v3.js +0 -2
  332. package/bundle/chunk-4gqb1hps.js +0 -2
  333. package/bundle/chunk-50qgz5ka.js +0 -2
  334. package/bundle/chunk-539cw9r0.js +0 -2
  335. package/bundle/chunk-5b0xyq5z.js +0 -2
  336. package/bundle/chunk-5j4nxpdy.js +0 -2
  337. package/bundle/chunk-5nxgk6hw.js +0 -2
  338. package/bundle/chunk-5qkvhr6y.js +0 -2
  339. package/bundle/chunk-6dpdkzrk.js +0 -2
  340. package/bundle/chunk-6p6m5956.js +0 -3
  341. package/bundle/chunk-705qkpra.js +0 -28
  342. package/bundle/chunk-76c400ze.js +0 -2
  343. package/bundle/chunk-7bxxc4a3.js +0 -2
  344. package/bundle/chunk-7g59hc61.js +0 -2
  345. package/bundle/chunk-7p88j56s.js +0 -2
  346. package/bundle/chunk-7r92d7v9.js +0 -14
  347. package/bundle/chunk-7trngc9g.js +0 -2
  348. package/bundle/chunk-8cebbmtf.js +0 -2
  349. package/bundle/chunk-8j1xcdmd.js +0 -2
  350. package/bundle/chunk-90r2z49k.js +0 -2
  351. package/bundle/chunk-94mjwy22.js +0 -2
  352. package/bundle/chunk-9bw6bx5c.js +0 -2
  353. package/bundle/chunk-aenrd7dk.js +0 -2
  354. package/bundle/chunk-ahmy80vb.js +0 -2
  355. package/bundle/chunk-avn12jkt.js +0 -2
  356. package/bundle/chunk-brk6bge4.js +0 -3
  357. package/bundle/chunk-ce5e7j62.js +0 -2
  358. package/bundle/chunk-cw1gwjx9.js +0 -2
  359. package/bundle/chunk-czw30fjs.js +0 -2
  360. package/bundle/chunk-dtcvqrmn.js +0 -2
  361. package/bundle/chunk-dwhsvpag.js +0 -2
  362. package/bundle/chunk-e0hfpdje.js +0 -2
  363. package/bundle/chunk-e5jk67xh.js +0 -2
  364. package/bundle/chunk-eg4pq4hv.js +0 -2
  365. package/bundle/chunk-ew3yz97p.js +0 -2
  366. package/bundle/chunk-f2yfyhh8.js +0 -2
  367. package/bundle/chunk-fd8x2nb4.js +0 -2
  368. package/bundle/chunk-fveaq0pb.js +0 -2
  369. package/bundle/chunk-gbvm6dpv.js +0 -2
  370. package/bundle/chunk-gkbx6edf.js +0 -2
  371. package/bundle/chunk-gq9hb2e8.js +0 -2
  372. package/bundle/chunk-gswhjd1h.js +0 -3
  373. package/bundle/chunk-h5w91zr4.js +0 -2
  374. package/bundle/chunk-hmpb3c21.js +0 -2
  375. package/bundle/chunk-hq7s4f75.js +0 -2
  376. package/bundle/chunk-j1h64m65.js +0 -2
  377. package/bundle/chunk-j32rr7rt.js +0 -2
  378. package/bundle/chunk-j871xzr7.js +0 -2
  379. package/bundle/chunk-k1qd8ecm.js +0 -808
  380. package/bundle/chunk-kx88qekb.js +0 -2
  381. package/bundle/chunk-m4g4djss.js +0 -2
  382. package/bundle/chunk-mt2by7rx.js +0 -3
  383. package/bundle/chunk-mwkms65j.js +0 -3
  384. package/bundle/chunk-n61e0znt.js +0 -2
  385. package/bundle/chunk-ndd4cn3z.js +0 -2
  386. package/bundle/chunk-nr2j8ytn.js +0 -3
  387. package/bundle/chunk-nsw5x43k.js +0 -2
  388. package/bundle/chunk-p5b5ekhh.js +0 -2
  389. package/bundle/chunk-pf23nw4z.js +0 -2
  390. package/bundle/chunk-pw3cv89g.js +0 -2
  391. package/bundle/chunk-qwmae3vk.js +0 -5
  392. package/bundle/chunk-rdk62809.js +0 -2
  393. package/bundle/chunk-rew6r516.js +0 -2
  394. package/bundle/chunk-rjcz4kbm.js +0 -2
  395. package/bundle/chunk-skgr9ypq.js +0 -2
  396. package/bundle/chunk-sv40pwe2.js +0 -2
  397. package/bundle/chunk-tax3ecy5.js +0 -2
  398. package/bundle/chunk-tfhpjmny.js +0 -2
  399. package/bundle/chunk-tnete6ye.js +0 -2
  400. package/bundle/chunk-tpyq7ycb.js +0 -2
  401. package/bundle/chunk-tr0rm1ka.js +0 -2
  402. package/bundle/chunk-ty14zznd.js +0 -2
  403. package/bundle/chunk-v5h5wxw5.js +0 -2
  404. package/bundle/chunk-v6141yq1.js +0 -2
  405. package/bundle/chunk-vjs69r6x.js +0 -2
  406. package/bundle/chunk-vmhar83s.js +0 -2
  407. package/bundle/chunk-vpjyk76v.js +0 -2
  408. package/bundle/chunk-vqvnw12p.js +0 -2
  409. package/bundle/chunk-w0sztk4y.js +0 -2
  410. package/bundle/chunk-w6bb320d.js +0 -2
  411. package/bundle/chunk-wqw6yjrg.js +0 -2
  412. package/bundle/chunk-ws08rxge.js +0 -2
  413. package/bundle/chunk-wwvek9zf.js +0 -3
  414. package/bundle/chunk-wz3dvc3g.js +0 -2
  415. package/bundle/chunk-x2pmqvdc.js +0 -2
  416. package/bundle/chunk-x4wfq39v.js +0 -2
  417. package/bundle/chunk-x7a3kqe5.js +0 -2
  418. package/bundle/chunk-xb22grz6.js +0 -2
  419. package/bundle/chunk-y3eeva80.js +0 -2
  420. package/bundle/chunk-yb6m08zj.js +0 -2
  421. package/bundle/chunk-ybcqkgs7.js +0 -2
  422. package/bundle/chunk-zj1jc1xt.js +0 -2
  423. package/bundle/chunk-zm0m0504.js +0 -2
  424. package/bundle/chunk-zq32jhj1.js +0 -2
  425. package/bundle/chunk-zxwjxszn.js +0 -2
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{aq as U,cq as V}from"./chunk-az3nss5m.js";import{uO as R}from"./chunk-e0vrxetq.js";var E=R((M,Q)=>{var{defineProperty:H,getOwnPropertyDescriptor:W,getOwnPropertyNames:X}=Object,Y=Object.prototype.hasOwnProperty,Z=(z,q)=>{for(var B in q)H(z,B,{get:q[B],enumerable:!0})},$=(z,q,B,F)=>{if(q&&typeof q==="object"||typeof q==="function"){for(let v of X(q))if(!Y.call(z,v)&&v!==B)H(z,v,{get:()=>q[v],enumerable:!(F=W(q,v))||F.enumerable})}return z},A=(z)=>$(H({},"__esModule",{value:!0}),z),L={};Z(L,{refreshToken:()=>D});Q.exports=A(L);var K=U(),G=V();async function D(z){let q=z?.project,B=z?.team;if(!q&&!B){let v=(0,G.findProjectInfo)();q=v.projectId,B=v.teamId}else if(!q||!B){let v=(0,G.findProjectInfo)();q=q??v.projectId,B=B??v.teamId}if(!q)throw new K.VercelOidcTokenError("Failed to refresh OIDC token: No project specified. Try re-linking your project with `vc link`");let F=(0,G.loadToken)(q);if(!F||(0,G.isExpired)((0,G.getTokenPayload)(F.token),z?.expirationBufferMs)){let v=await(0,G.getVercelToken)({expirationBufferMs:z?.expirationBufferMs});if(F=await(0,G.getVercelOidcToken)(v,q,B),!F)throw new K.VercelOidcTokenError("Failed to refresh OIDC token");(0,G.saveToken)(F,q)}process.env.VERCEL_OIDC_TOKEN=F.token;return}});export default E();
2
+ import{$q as V,Zq as U}from"./chunk-ngyv4fhn.js";import{rP as R}from"./chunk-djfrkbd5.js";var E=R((M,Q)=>{var{defineProperty:H,getOwnPropertyDescriptor:W,getOwnPropertyNames:X}=Object,Y=Object.prototype.hasOwnProperty,Z=(z,q)=>{for(var B in q)H(z,B,{get:q[B],enumerable:!0})},$=(z,q,B,F)=>{if(q&&typeof q==="object"||typeof q==="function"){for(let v of X(q))if(!Y.call(z,v)&&v!==B)H(z,v,{get:()=>q[v],enumerable:!(F=W(q,v))||F.enumerable})}return z},A=(z)=>$(H({},"__esModule",{value:!0}),z),L={};Z(L,{refreshToken:()=>D});Q.exports=A(L);var K=U(),G=V();async function D(z){let q=z?.project,B=z?.team;if(!q&&!B){let v=(0,G.findProjectInfo)();q=v.projectId,B=v.teamId}else if(!q||!B){let v=(0,G.findProjectInfo)();q=q??v.projectId,B=B??v.teamId}if(!q)throw new K.VercelOidcTokenError("Failed to refresh OIDC token: No project specified. Try re-linking your project with `vc link`");let F=(0,G.loadToken)(q);if(!F||(0,G.isExpired)((0,G.getTokenPayload)(F.token),z?.expirationBufferMs)){let v=await(0,G.getVercelToken)({expirationBufferMs:z?.expirationBufferMs});if(F=await(0,G.getVercelOidcToken)(v,q,B),!F)throw new K.VercelOidcTokenError("Failed to refresh OIDC token");(0,G.saveToken)(F,q)}process.env.VERCEL_OIDC_TOKEN=F.token;return}});export default E();
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{$e as t,Se as I,Ue as r,We as l,_e as O,cf as e,ef as o,ff as NN,gf as QN,jf as _,kf as h,lf as m,mf as XN,nf as YN,pf as ZN,qf as $N,rf as C,tf as JN}from"./chunk-gsg6zn7e.js";import{Pp as q,Tp as u,Wp as v}from"./chunk-scnbt714.js";import"./chunk-cqtkxwd8.js";import"./chunk-y3gy62q5.js";import{Kt as N}from"./chunk-a48mx917.js";import"./chunk-3va85mbe.js";import"./chunk-e0vrxetq.js";function s(Q){var J,z,B,j;if(Q==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 $=(J=Q.prompt_tokens)!=null?J:0,X=(z=Q.completion_tokens)!=null?z:0,Y=(j=(B=Q.completion_tokens_details)==null?void 0:B.reasoning_tokens)!=null?j:void 0,Z=Y!=null?X-Y:X;return{inputTokens:{total:$,noCache:$,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:X,text:Z,reasoning:Y},raw:Q}}function BN(Q){var J;let z=[];for(let{role:B,content:j}of Q)switch(B){case"system":{z.push({role:"system",content:j});break}case"user":{if(j.length===1&&j[0].type==="text"){z.push({role:"user",content:j[0].text});break}z.push({role:"user",content:j.map(($)=>{switch($.type){case"text":return{type:"text",text:$.text};case"file":{if(!$.mediaType.startsWith("image/"))throw new v({functionality:"Non-image file content parts"});let X=$.mediaType==="image/*"?"image/jpeg":$.mediaType;return{type:"image_url",image_url:{url:$.data instanceof URL?$.data.toString():`data:${X};base64,${l($.data)}`}}}}})});break}case"assistant":{let $="",X="",Y=[];for(let Z of j)switch(Z.type){case"reasoning":{X+=Z.text;break}case"text":{$+=Z.text;break}case"tool-call":{Y.push({id:Z.toolCallId,type:"function",function:{name:Z.toolName,arguments:JSON.stringify(Z.input)}});break}}z.push({role:"assistant",content:$,...X.length>0?{reasoning:X}:null,...Y.length>0?{tool_calls:Y}:null});break}case"tool":{for(let $ of j){if($.type==="tool-approval-response")continue;let X=$.output,Y;switch(X.type){case"text":case"error-text":Y=X.value;break;case"execution-denied":Y=(J=X.reason)!=null?J:"Tool execution denied.";break;case"content":case"json":case"error-json":Y=JSON.stringify(X.value);break}z.push({role:"tool",tool_call_id:$.toolCallId,content:Y})}break}default:throw Error(`Unsupported role: ${B}`)}return z}function a({id:Q,model:J,created:z}){return{id:Q!=null?Q:void 0,modelId:J!=null?J:void 0,timestamp:z!=null?new Date(z*1000):void 0}}var GN=N.object({reasoningFormat:N.enum(["parsed","raw","hidden"]).optional(),reasoningEffort:N.enum(["none","default","low","medium","high"]).optional(),parallelToolCalls:N.boolean().optional(),user:N.string().optional(),structuredOutputs:N.boolean().optional(),strictJsonSchema:N.boolean().optional(),serviceTier:N.enum(["on_demand","flex","auto"]).optional()}),jN=N.object({error:N.object({message:N.string(),type:N.string()})}),g=ZN({errorSchema:jN,errorToMessage:(Q)=>Q.error.message}),zN=["openai/gpt-oss-20b","openai/gpt-oss-120b"];function KN(Q){return zN.includes(Q)}function UN(){return zN.join(", ")}function VN({tools:Q,toolChoice:J,modelId:z}){Q=(Q==null?void 0:Q.length)?Q:void 0;let B=[];if(Q==null)return{tools:void 0,toolChoice:void 0,toolWarnings:B};let j=[];for(let X of Q)if(X.type==="provider")if(X.id==="groq.browser_search")if(!KN(z))B.push({type:"unsupported",feature:`provider-defined tool ${X.id}`,details:`Browser search is only supported on the following models: ${UN()}. Current model: ${z}`});else j.push({type:"browser_search"});else B.push({type:"unsupported",feature:`provider-defined tool ${X.id}`});else j.push({type:"function",function:{name:X.name,description:X.description,parameters:X.inputSchema,...X.strict!=null?{strict:X.strict}:{}}});if(J==null)return{tools:j,toolChoice:void 0,toolWarnings:B};let $=J.type;switch($){case"auto":case"none":case"required":return{tools:j,toolChoice:$,toolWarnings:B};case"tool":return{tools:j,toolChoice:{type:"function",function:{name:J.toolName}},toolWarnings:B};default:throw new v({functionality:`tool choice type: ${$}`})}}function n(Q){switch(Q){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"other"}}var LN=class{constructor(Q,J){this.specificationVersion="v3",this.supportedUrls={"image/*":[/^https?:\/\/.*$/]},this.modelId=Q,this.config=J}get provider(){return this.config.provider}async getArgs({prompt:Q,maxOutputTokens:J,temperature:z,topP:B,topK:j,frequencyPenalty:$,presencePenalty:X,stopSequences:Y,responseFormat:Z,seed:K,stream:L,tools:V,toolChoice:W,providerOptions:U}){var G,E,S;let b=[],H=await h({provider:"groq",providerOptions:U,schema:GN}),F=(G=H==null?void 0:H.structuredOutputs)!=null?G:!0,f=(E=H==null?void 0:H.strictJsonSchema)!=null?E:!0;if(j!=null)b.push({type:"unsupported",feature:"topK"});if((Z==null?void 0:Z.type)==="json"&&Z.schema!=null&&!F)b.push({type:"unsupported",feature:"responseFormat",details:"JSON response format schema is only supported with structuredOutputs"});let{tools:k,toolChoice:D,toolWarnings:R}=VN({tools:V,toolChoice:W,modelId:this.modelId});return{args:{model:this.modelId,user:H==null?void 0:H.user,parallel_tool_calls:H==null?void 0:H.parallelToolCalls,max_tokens:J,temperature:z,top_p:B,frequency_penalty:$,presence_penalty:X,stop:Y,seed:K,response_format:(Z==null?void 0:Z.type)==="json"?F&&Z.schema!=null?{type:"json_schema",json_schema:{schema:Z.schema,strict:f,name:(S=Z.name)!=null?S:"response",description:Z.description}}:{type:"json_object"}:void 0,reasoning_format:H==null?void 0:H.reasoningFormat,reasoning_effort:H==null?void 0:H.reasoningEffort,service_tier:H==null?void 0:H.serviceTier,messages:BN(Q),tools:k,tool_choice:D},warnings:[...b,...R]}}async doGenerate(Q){var J,z;let{args:B,warnings:j}=await this.getArgs({...Q,stream:!1}),$=JSON.stringify(B),{responseHeaders:X,value:Y,rawValue:Z}=await m({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:I(this.config.headers(),Q.headers),body:B,failedResponseHandler:g,successfulResponseHandler:C(HN),abortSignal:Q.abortSignal,fetch:this.config.fetch}),K=Y.choices[0],L=[],V=K.message.content;if(V!=null&&V.length>0)L.push({type:"text",text:V});let W=K.message.reasoning;if(W!=null&&W.length>0)L.push({type:"reasoning",text:W});if(K.message.tool_calls!=null)for(let U of K.message.tool_calls)L.push({type:"tool-call",toolCallId:(J=U.id)!=null?J:O(),toolName:U.function.name,input:U.function.arguments});return{content:L,finishReason:{unified:n(K.finish_reason),raw:(z=K.finish_reason)!=null?z:void 0},usage:s(Y.usage),response:{...a(Y),headers:X,body:Z},warnings:j,request:{body:$}}}async doStream(Q){let{args:J,warnings:z}=await this.getArgs({...Q,stream:!0}),B=JSON.stringify({...J,stream:!0}),{responseHeaders:j,value:$}=await m({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:I(this.config.headers(),Q.headers),body:{...J,stream:!0},failedResponseHandler:g,successfulResponseHandler:$N(wN),abortSignal:Q.abortSignal,fetch:this.config.fetch}),X=[],Y={unified:"other",raw:void 0},Z=void 0,K=!0,L=!1,V=!1,W;return{stream:$.pipeThrough(new TransformStream({start(U){U.enqueue({type:"stream-start",warnings:z})},transform(U,G){var E,S,b,H,F,f,k,D,R,d,c,p,i;if(Q.includeRawChunks)G.enqueue({type:"raw",rawValue:U.rawValue});if(!U.success){Y={unified:"error",raw:void 0},G.enqueue({type:"error",error:U.error});return}let y=U.value;if("error"in y){Y={unified:"error",raw:void 0},G.enqueue({type:"error",error:y.error});return}if(K)K=!1,G.enqueue({type:"response-metadata",...a(y)});if(((E=y.x_groq)==null?void 0:E.usage)!=null)Z=y.x_groq.usage;let x=y.choices[0];if((x==null?void 0:x.finish_reason)!=null)Y={unified:n(x.finish_reason),raw:x.finish_reason};if((x==null?void 0:x.delta)==null)return;let M=x.delta;if(M.reasoning!=null&&M.reasoning.length>0){if(!V)G.enqueue({type:"reasoning-start",id:"reasoning-0"}),V=!0;G.enqueue({type:"reasoning-delta",id:"reasoning-0",delta:M.reasoning})}if(M.content!=null&&M.content.length>0){if(V)G.enqueue({type:"reasoning-end",id:"reasoning-0"}),V=!1;if(!L)G.enqueue({type:"text-start",id:"txt-0"}),L=!0;G.enqueue({type:"text-delta",id:"txt-0",delta:M.content})}if(M.tool_calls!=null){if(V)G.enqueue({type:"reasoning-end",id:"reasoning-0"}),V=!1;for(let w of M.tool_calls){let T=w.index;if(X[T]==null){if(w.type!=="function")throw new q({data:w,message:"Expected 'function' type."});if(w.id==null)throw new q({data:w,message:"Expected 'id' to be a string."});if(((S=w.function)==null?void 0:S.name)==null)throw new q({data:w,message:"Expected 'function.name' to be a string."});G.enqueue({type:"tool-input-start",id:w.id,toolName:w.function.name}),X[T]={id:w.id,type:"function",function:{name:w.function.name,arguments:(b=w.function.arguments)!=null?b:""},hasFinished:!1};let A=X[T];if(((H=A.function)==null?void 0:H.name)!=null&&((F=A.function)==null?void 0:F.arguments)!=null){if(A.function.arguments.length>0)G.enqueue({type:"tool-input-delta",id:A.id,delta:A.function.arguments});if(_(A.function.arguments))G.enqueue({type:"tool-input-end",id:A.id}),G.enqueue({type:"tool-call",toolCallId:(f=A.id)!=null?f:O(),toolName:A.function.name,input:A.function.arguments}),A.hasFinished=!0}continue}let P=X[T];if(P.hasFinished)continue;if(((k=w.function)==null?void 0:k.arguments)!=null)P.function.arguments+=(R=(D=w.function)==null?void 0:D.arguments)!=null?R:"";if(G.enqueue({type:"tool-input-delta",id:P.id,delta:(d=w.function.arguments)!=null?d:""}),((c=P.function)==null?void 0:c.name)!=null&&((p=P.function)==null?void 0:p.arguments)!=null&&_(P.function.arguments))G.enqueue({type:"tool-input-end",id:P.id}),G.enqueue({type:"tool-call",toolCallId:(i=P.id)!=null?i:O(),toolName:P.function.name,input:P.function.arguments}),P.hasFinished=!0}}},flush(U){if(V)U.enqueue({type:"reasoning-end",id:"reasoning-0"});if(L)U.enqueue({type:"text-end",id:"txt-0"});U.enqueue({type:"finish",finishReason:Y,usage:s(Z),...W!=null?{providerMetadata:W}:{}})}})),request:{body:B},response:{headers:j}}}},HN=N.object({id:N.string().nullish(),created:N.number().nullish(),model:N.string().nullish(),choices:N.array(N.object({message:N.object({content:N.string().nullish(),reasoning:N.string().nullish(),tool_calls:N.array(N.object({id:N.string().nullish(),type:N.literal("function"),function:N.object({name:N.string(),arguments:N.string()})})).nullish()}),index:N.number(),finish_reason:N.string().nullish()})),usage:N.object({prompt_tokens:N.number().nullish(),completion_tokens:N.number().nullish(),total_tokens:N.number().nullish(),prompt_tokens_details:N.object({cached_tokens:N.number().nullish()}).nullish(),completion_tokens_details:N.object({reasoning_tokens:N.number().nullish()}).nullish()}).nullish()}),wN=N.union([N.object({id:N.string().nullish(),created:N.number().nullish(),model:N.string().nullish(),choices:N.array(N.object({delta:N.object({content:N.string().nullish(),reasoning:N.string().nullish(),tool_calls:N.array(N.object({index:N.number(),id:N.string().nullish(),type:N.literal("function").optional(),function:N.object({name:N.string().nullish(),arguments:N.string().nullish()})})).nullish()}).nullish(),finish_reason:N.string().nullable().optional(),index:N.number()})),x_groq:N.object({usage:N.object({prompt_tokens:N.number().nullish(),completion_tokens:N.number().nullish(),total_tokens:N.number().nullish(),prompt_tokens_details:N.object({cached_tokens:N.number().nullish()}).nullish(),completion_tokens_details:N.object({reasoning_tokens:N.number().nullish()}).nullish()}).nullish()}).nullish()}),jN]),WN=NN(()=>QN(N.object({language:N.string().nullish(),prompt:N.string().nullish(),responseFormat:N.string().nullish(),temperature:N.number().min(0).max(1).nullish(),timestampGranularities:N.array(N.string()).nullish()}))),PN=class{constructor(Q,J){this.modelId=Q,this.config=J,this.specificationVersion="v3"}get provider(){return this.config.provider}async getArgs({audio:Q,mediaType:J,providerOptions:z}){var B,j,$,X,Y;let Z=[],K=await h({provider:"groq",providerOptions:z,schema:WN}),L=new FormData,V=Q instanceof Uint8Array?new Blob([Q]):new Blob([r(Q)]);L.append("model",this.modelId);let W=o(J);if(L.append("file",new File([V],"audio",{type:J}),`audio.${W}`),K){let U={language:(B=K.language)!=null?B:void 0,prompt:(j=K.prompt)!=null?j:void 0,response_format:($=K.responseFormat)!=null?$:void 0,temperature:(X=K.temperature)!=null?X:void 0,timestamp_granularities:(Y=K.timestampGranularities)!=null?Y:void 0};for(let G in U){let E=U[G];if(E!==void 0)if(Array.isArray(E))for(let S of E)L.append(`${G}[]`,String(S));else L.append(G,String(E))}}return{formData:L,warnings:Z}}async doGenerate(Q){var J,z,B,j,$,X,Y;let Z=(B=(z=(J=this.config._internal)==null?void 0:J.currentDate)==null?void 0:z.call(J))!=null?B:new Date,{formData:K,warnings:L}=await this.getArgs(Q),{value:V,responseHeaders:W,rawValue:U}=await XN({url:this.config.url({path:"/audio/transcriptions",modelId:this.modelId}),headers:I(this.config.headers(),Q.headers),formData:K,failedResponseHandler:g,successfulResponseHandler:C(AN),abortSignal:Q.abortSignal,fetch:this.config.fetch});return{text:V.text,segments:($=(j=V.segments)==null?void 0:j.map((G)=>({text:G.text,startSecond:G.start,endSecond:G.end})))!=null?$:[],language:(X=V.language)!=null?X:void 0,durationInSeconds:(Y=V.duration)!=null?Y:void 0,warnings:L,response:{timestamp:Z,modelId:this.modelId,headers:W,body:U}}}},AN=N.object({text:N.string(),x_groq:N.object({id:N.string()}),task:N.string().nullish(),language:N.string().nullish(),duration:N.number().nullish(),segments:N.array(N.object({id:N.number(),seek:N.number(),start:N.number(),end:N.number(),text:N.string(),tokens:N.array(N.number()),temperature:N.number(),avg_logprob:N.number(),compression_ratio:N.number(),no_speech_prob:N.number()})).nullish()}),EN=YN({id:"groq.browser_search",inputSchema:N.object({})}),MN={browserSearch:EN},SN="3.0.31";function xN(Q={}){var J;let z=(J=JN(Q.baseURL))!=null?J:"https://api.groq.com/openai/v1",B=()=>t({Authorization:`Bearer ${e({apiKey:Q.apiKey,environmentVariableName:"GROQ_API_KEY",description:"Groq"})}`,...Q.headers},`ai-sdk/groq/${SN}`),j=(Z)=>new LN(Z,{provider:"groq.chat",url:({path:K})=>`${z}${K}`,headers:B,fetch:Q.fetch}),$=(Z)=>{if(new.target)throw Error("The Groq model function cannot be called with the new keyword.");return j(Z)},X=(Z)=>{return new PN(Z,{provider:"groq.transcription",url:({path:K})=>`${z}${K}`,headers:B,fetch:Q.fetch})},Y=function(Z){return $(Z)};return Y.specificationVersion="v3",Y.languageModel=$,Y.chat=j,Y.embeddingModel=(Z)=>{throw new u({modelId:Z,modelType:"embeddingModel"})},Y.textEmbeddingModel=Y.embeddingModel,Y.imageModel=(Z)=>{throw new u({modelId:Z,modelType:"imageModel"})},Y.transcription=X,Y.transcriptionModel=X,Y.tools=MN,Y}var gN=xN();export{gN as groq,xN as createGroq,EN as browserSearch,SN as VERSION};
2
+ import{$e as O,Te as I,Ve as r,Xe as l,af as t,df as e,ff as o,gf as NN,hf as QN,kf as _,lf as h,mf as m,nf as XN,of as YN,qf as ZN,rf as $N,sf as C,uf as JN}from"./chunk-vk35g121.js";import{Mq as q,Qq as u,Tq as v}from"./chunk-kec1xw1n.js";import"./chunk-cqtkxwd8.js";import"./chunk-x50adh71.js";import{Hu as N}from"./chunk-q4mtwv1w.js";import"./chunk-7a3txs9f.js";import"./chunk-djfrkbd5.js";function s(Q){var J,z,B,j;if(Q==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 $=(J=Q.prompt_tokens)!=null?J:0,X=(z=Q.completion_tokens)!=null?z:0,Y=(j=(B=Q.completion_tokens_details)==null?void 0:B.reasoning_tokens)!=null?j:void 0,Z=Y!=null?X-Y:X;return{inputTokens:{total:$,noCache:$,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:X,text:Z,reasoning:Y},raw:Q}}function BN(Q){var J;let z=[];for(let{role:B,content:j}of Q)switch(B){case"system":{z.push({role:"system",content:j});break}case"user":{if(j.length===1&&j[0].type==="text"){z.push({role:"user",content:j[0].text});break}z.push({role:"user",content:j.map(($)=>{switch($.type){case"text":return{type:"text",text:$.text};case"file":{if(!$.mediaType.startsWith("image/"))throw new v({functionality:"Non-image file content parts"});let X=$.mediaType==="image/*"?"image/jpeg":$.mediaType;return{type:"image_url",image_url:{url:$.data instanceof URL?$.data.toString():`data:${X};base64,${l($.data)}`}}}}})});break}case"assistant":{let $="",X="",Y=[];for(let Z of j)switch(Z.type){case"reasoning":{X+=Z.text;break}case"text":{$+=Z.text;break}case"tool-call":{Y.push({id:Z.toolCallId,type:"function",function:{name:Z.toolName,arguments:JSON.stringify(Z.input)}});break}}z.push({role:"assistant",content:$,...X.length>0?{reasoning:X}:null,...Y.length>0?{tool_calls:Y}:null});break}case"tool":{for(let $ of j){if($.type==="tool-approval-response")continue;let X=$.output,Y;switch(X.type){case"text":case"error-text":Y=X.value;break;case"execution-denied":Y=(J=X.reason)!=null?J:"Tool execution denied.";break;case"content":case"json":case"error-json":Y=JSON.stringify(X.value);break}z.push({role:"tool",tool_call_id:$.toolCallId,content:Y})}break}default:throw Error(`Unsupported role: ${B}`)}return z}function a({id:Q,model:J,created:z}){return{id:Q!=null?Q:void 0,modelId:J!=null?J:void 0,timestamp:z!=null?new Date(z*1000):void 0}}var GN=N.object({reasoningFormat:N.enum(["parsed","raw","hidden"]).optional(),reasoningEffort:N.enum(["none","default","low","medium","high"]).optional(),parallelToolCalls:N.boolean().optional(),user:N.string().optional(),structuredOutputs:N.boolean().optional(),strictJsonSchema:N.boolean().optional(),serviceTier:N.enum(["on_demand","flex","auto"]).optional()}),jN=N.object({error:N.object({message:N.string(),type:N.string()})}),g=ZN({errorSchema:jN,errorToMessage:(Q)=>Q.error.message}),zN=["openai/gpt-oss-20b","openai/gpt-oss-120b"];function KN(Q){return zN.includes(Q)}function UN(){return zN.join(", ")}function VN({tools:Q,toolChoice:J,modelId:z}){Q=(Q==null?void 0:Q.length)?Q:void 0;let B=[];if(Q==null)return{tools:void 0,toolChoice:void 0,toolWarnings:B};let j=[];for(let X of Q)if(X.type==="provider")if(X.id==="groq.browser_search")if(!KN(z))B.push({type:"unsupported",feature:`provider-defined tool ${X.id}`,details:`Browser search is only supported on the following models: ${UN()}. Current model: ${z}`});else j.push({type:"browser_search"});else B.push({type:"unsupported",feature:`provider-defined tool ${X.id}`});else j.push({type:"function",function:{name:X.name,description:X.description,parameters:X.inputSchema,...X.strict!=null?{strict:X.strict}:{}}});if(J==null)return{tools:j,toolChoice:void 0,toolWarnings:B};let $=J.type;switch($){case"auto":case"none":case"required":return{tools:j,toolChoice:$,toolWarnings:B};case"tool":return{tools:j,toolChoice:{type:"function",function:{name:J.toolName}},toolWarnings:B};default:throw new v({functionality:`tool choice type: ${$}`})}}function n(Q){switch(Q){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"other"}}var LN=class{constructor(Q,J){this.specificationVersion="v3",this.supportedUrls={"image/*":[/^https?:\/\/.*$/]},this.modelId=Q,this.config=J}get provider(){return this.config.provider}async getArgs({prompt:Q,maxOutputTokens:J,temperature:z,topP:B,topK:j,frequencyPenalty:$,presencePenalty:X,stopSequences:Y,responseFormat:Z,seed:K,stream:L,tools:V,toolChoice:W,providerOptions:U}){var G,E,S;let b=[],H=await h({provider:"groq",providerOptions:U,schema:GN}),F=(G=H==null?void 0:H.structuredOutputs)!=null?G:!0,f=(E=H==null?void 0:H.strictJsonSchema)!=null?E:!0;if(j!=null)b.push({type:"unsupported",feature:"topK"});if((Z==null?void 0:Z.type)==="json"&&Z.schema!=null&&!F)b.push({type:"unsupported",feature:"responseFormat",details:"JSON response format schema is only supported with structuredOutputs"});let{tools:k,toolChoice:D,toolWarnings:R}=VN({tools:V,toolChoice:W,modelId:this.modelId});return{args:{model:this.modelId,user:H==null?void 0:H.user,parallel_tool_calls:H==null?void 0:H.parallelToolCalls,max_tokens:J,temperature:z,top_p:B,frequency_penalty:$,presence_penalty:X,stop:Y,seed:K,response_format:(Z==null?void 0:Z.type)==="json"?F&&Z.schema!=null?{type:"json_schema",json_schema:{schema:Z.schema,strict:f,name:(S=Z.name)!=null?S:"response",description:Z.description}}:{type:"json_object"}:void 0,reasoning_format:H==null?void 0:H.reasoningFormat,reasoning_effort:H==null?void 0:H.reasoningEffort,service_tier:H==null?void 0:H.serviceTier,messages:BN(Q),tools:k,tool_choice:D},warnings:[...b,...R]}}async doGenerate(Q){var J,z;let{args:B,warnings:j}=await this.getArgs({...Q,stream:!1}),$=JSON.stringify(B),{responseHeaders:X,value:Y,rawValue:Z}=await m({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:I(this.config.headers(),Q.headers),body:B,failedResponseHandler:g,successfulResponseHandler:C(HN),abortSignal:Q.abortSignal,fetch:this.config.fetch}),K=Y.choices[0],L=[],V=K.message.content;if(V!=null&&V.length>0)L.push({type:"text",text:V});let W=K.message.reasoning;if(W!=null&&W.length>0)L.push({type:"reasoning",text:W});if(K.message.tool_calls!=null)for(let U of K.message.tool_calls)L.push({type:"tool-call",toolCallId:(J=U.id)!=null?J:O(),toolName:U.function.name,input:U.function.arguments});return{content:L,finishReason:{unified:n(K.finish_reason),raw:(z=K.finish_reason)!=null?z:void 0},usage:s(Y.usage),response:{...a(Y),headers:X,body:Z},warnings:j,request:{body:$}}}async doStream(Q){let{args:J,warnings:z}=await this.getArgs({...Q,stream:!0}),B=JSON.stringify({...J,stream:!0}),{responseHeaders:j,value:$}=await m({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:I(this.config.headers(),Q.headers),body:{...J,stream:!0},failedResponseHandler:g,successfulResponseHandler:$N(wN),abortSignal:Q.abortSignal,fetch:this.config.fetch}),X=[],Y={unified:"other",raw:void 0},Z=void 0,K=!0,L=!1,V=!1,W;return{stream:$.pipeThrough(new TransformStream({start(U){U.enqueue({type:"stream-start",warnings:z})},transform(U,G){var E,S,b,H,F,f,k,D,R,d,c,p,i;if(Q.includeRawChunks)G.enqueue({type:"raw",rawValue:U.rawValue});if(!U.success){Y={unified:"error",raw:void 0},G.enqueue({type:"error",error:U.error});return}let y=U.value;if("error"in y){Y={unified:"error",raw:void 0},G.enqueue({type:"error",error:y.error});return}if(K)K=!1,G.enqueue({type:"response-metadata",...a(y)});if(((E=y.x_groq)==null?void 0:E.usage)!=null)Z=y.x_groq.usage;let x=y.choices[0];if((x==null?void 0:x.finish_reason)!=null)Y={unified:n(x.finish_reason),raw:x.finish_reason};if((x==null?void 0:x.delta)==null)return;let M=x.delta;if(M.reasoning!=null&&M.reasoning.length>0){if(!V)G.enqueue({type:"reasoning-start",id:"reasoning-0"}),V=!0;G.enqueue({type:"reasoning-delta",id:"reasoning-0",delta:M.reasoning})}if(M.content!=null&&M.content.length>0){if(V)G.enqueue({type:"reasoning-end",id:"reasoning-0"}),V=!1;if(!L)G.enqueue({type:"text-start",id:"txt-0"}),L=!0;G.enqueue({type:"text-delta",id:"txt-0",delta:M.content})}if(M.tool_calls!=null){if(V)G.enqueue({type:"reasoning-end",id:"reasoning-0"}),V=!1;for(let w of M.tool_calls){let T=w.index;if(X[T]==null){if(w.type!=="function")throw new q({data:w,message:"Expected 'function' type."});if(w.id==null)throw new q({data:w,message:"Expected 'id' to be a string."});if(((S=w.function)==null?void 0:S.name)==null)throw new q({data:w,message:"Expected 'function.name' to be a string."});G.enqueue({type:"tool-input-start",id:w.id,toolName:w.function.name}),X[T]={id:w.id,type:"function",function:{name:w.function.name,arguments:(b=w.function.arguments)!=null?b:""},hasFinished:!1};let A=X[T];if(((H=A.function)==null?void 0:H.name)!=null&&((F=A.function)==null?void 0:F.arguments)!=null){if(A.function.arguments.length>0)G.enqueue({type:"tool-input-delta",id:A.id,delta:A.function.arguments});if(_(A.function.arguments))G.enqueue({type:"tool-input-end",id:A.id}),G.enqueue({type:"tool-call",toolCallId:(f=A.id)!=null?f:O(),toolName:A.function.name,input:A.function.arguments}),A.hasFinished=!0}continue}let P=X[T];if(P.hasFinished)continue;if(((k=w.function)==null?void 0:k.arguments)!=null)P.function.arguments+=(R=(D=w.function)==null?void 0:D.arguments)!=null?R:"";if(G.enqueue({type:"tool-input-delta",id:P.id,delta:(d=w.function.arguments)!=null?d:""}),((c=P.function)==null?void 0:c.name)!=null&&((p=P.function)==null?void 0:p.arguments)!=null&&_(P.function.arguments))G.enqueue({type:"tool-input-end",id:P.id}),G.enqueue({type:"tool-call",toolCallId:(i=P.id)!=null?i:O(),toolName:P.function.name,input:P.function.arguments}),P.hasFinished=!0}}},flush(U){if(V)U.enqueue({type:"reasoning-end",id:"reasoning-0"});if(L)U.enqueue({type:"text-end",id:"txt-0"});U.enqueue({type:"finish",finishReason:Y,usage:s(Z),...W!=null?{providerMetadata:W}:{}})}})),request:{body:B},response:{headers:j}}}},HN=N.object({id:N.string().nullish(),created:N.number().nullish(),model:N.string().nullish(),choices:N.array(N.object({message:N.object({content:N.string().nullish(),reasoning:N.string().nullish(),tool_calls:N.array(N.object({id:N.string().nullish(),type:N.literal("function"),function:N.object({name:N.string(),arguments:N.string()})})).nullish()}),index:N.number(),finish_reason:N.string().nullish()})),usage:N.object({prompt_tokens:N.number().nullish(),completion_tokens:N.number().nullish(),total_tokens:N.number().nullish(),prompt_tokens_details:N.object({cached_tokens:N.number().nullish()}).nullish(),completion_tokens_details:N.object({reasoning_tokens:N.number().nullish()}).nullish()}).nullish()}),wN=N.union([N.object({id:N.string().nullish(),created:N.number().nullish(),model:N.string().nullish(),choices:N.array(N.object({delta:N.object({content:N.string().nullish(),reasoning:N.string().nullish(),tool_calls:N.array(N.object({index:N.number(),id:N.string().nullish(),type:N.literal("function").optional(),function:N.object({name:N.string().nullish(),arguments:N.string().nullish()})})).nullish()}).nullish(),finish_reason:N.string().nullable().optional(),index:N.number()})),x_groq:N.object({usage:N.object({prompt_tokens:N.number().nullish(),completion_tokens:N.number().nullish(),total_tokens:N.number().nullish(),prompt_tokens_details:N.object({cached_tokens:N.number().nullish()}).nullish(),completion_tokens_details:N.object({reasoning_tokens:N.number().nullish()}).nullish()}).nullish()}).nullish()}),jN]),WN=NN(()=>QN(N.object({language:N.string().nullish(),prompt:N.string().nullish(),responseFormat:N.string().nullish(),temperature:N.number().min(0).max(1).nullish(),timestampGranularities:N.array(N.string()).nullish()}))),PN=class{constructor(Q,J){this.modelId=Q,this.config=J,this.specificationVersion="v3"}get provider(){return this.config.provider}async getArgs({audio:Q,mediaType:J,providerOptions:z}){var B,j,$,X,Y;let Z=[],K=await h({provider:"groq",providerOptions:z,schema:WN}),L=new FormData,V=Q instanceof Uint8Array?new Blob([Q]):new Blob([r(Q)]);L.append("model",this.modelId);let W=o(J);if(L.append("file",new File([V],"audio",{type:J}),`audio.${W}`),K){let U={language:(B=K.language)!=null?B:void 0,prompt:(j=K.prompt)!=null?j:void 0,response_format:($=K.responseFormat)!=null?$:void 0,temperature:(X=K.temperature)!=null?X:void 0,timestamp_granularities:(Y=K.timestampGranularities)!=null?Y:void 0};for(let G in U){let E=U[G];if(E!==void 0)if(Array.isArray(E))for(let S of E)L.append(`${G}[]`,String(S));else L.append(G,String(E))}}return{formData:L,warnings:Z}}async doGenerate(Q){var J,z,B,j,$,X,Y;let Z=(B=(z=(J=this.config._internal)==null?void 0:J.currentDate)==null?void 0:z.call(J))!=null?B:new Date,{formData:K,warnings:L}=await this.getArgs(Q),{value:V,responseHeaders:W,rawValue:U}=await XN({url:this.config.url({path:"/audio/transcriptions",modelId:this.modelId}),headers:I(this.config.headers(),Q.headers),formData:K,failedResponseHandler:g,successfulResponseHandler:C(AN),abortSignal:Q.abortSignal,fetch:this.config.fetch});return{text:V.text,segments:($=(j=V.segments)==null?void 0:j.map((G)=>({text:G.text,startSecond:G.start,endSecond:G.end})))!=null?$:[],language:(X=V.language)!=null?X:void 0,durationInSeconds:(Y=V.duration)!=null?Y:void 0,warnings:L,response:{timestamp:Z,modelId:this.modelId,headers:W,body:U}}}},AN=N.object({text:N.string(),x_groq:N.object({id:N.string()}),task:N.string().nullish(),language:N.string().nullish(),duration:N.number().nullish(),segments:N.array(N.object({id:N.number(),seek:N.number(),start:N.number(),end:N.number(),text:N.string(),tokens:N.array(N.number()),temperature:N.number(),avg_logprob:N.number(),compression_ratio:N.number(),no_speech_prob:N.number()})).nullish()}),EN=YN({id:"groq.browser_search",inputSchema:N.object({})}),MN={browserSearch:EN},SN="3.0.31";function xN(Q={}){var J;let z=(J=JN(Q.baseURL))!=null?J:"https://api.groq.com/openai/v1",B=()=>t({Authorization:`Bearer ${e({apiKey:Q.apiKey,environmentVariableName:"GROQ_API_KEY",description:"Groq"})}`,...Q.headers},`ai-sdk/groq/${SN}`),j=(Z)=>new LN(Z,{provider:"groq.chat",url:({path:K})=>`${z}${K}`,headers:B,fetch:Q.fetch}),$=(Z)=>{if(new.target)throw Error("The Groq model function cannot be called with the new keyword.");return j(Z)},X=(Z)=>{return new PN(Z,{provider:"groq.transcription",url:({path:K})=>`${z}${K}`,headers:B,fetch:Q.fetch})},Y=function(Z){return $(Z)};return Y.specificationVersion="v3",Y.languageModel=$,Y.chat=j,Y.embeddingModel=(Z)=>{throw new u({modelId:Z,modelType:"embeddingModel"})},Y.textEmbeddingModel=Y.embeddingModel,Y.imageModel=(Z)=>{throw new u({modelId:Z,modelType:"imageModel"})},Y.transcription=X,Y.transcriptionModel=X,Y.tools=MN,Y}var gN=xN();export{gN as groq,xN as createGroq,EN as browserSearch,SN as VERSION};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{uf as j}from"./chunk-fs1vb39f.js";import{Mf as w,Nf as D}from"./chunk-d839fr0w.js";import{Ap as Z,Hp as $,gp as Q}from"./chunk-wm9nh9nb.js";import{Tp as P}from"./chunk-scnbt714.js";import"./chunk-cqtkxwd8.js";import"./chunk-y3gy62q5.js";import"./chunk-a48mx917.js";import"./chunk-3va85mbe.js";import{tO as G}from"./chunk-e0vrxetq.js";var y=G(j(),1);var K=null,Y=null;function E(f){if(!K||f!==Y)K=new y.GoogleAuth({scopes:["https://www.googleapis.com/auth/cloud-platform"],...f}),Y=f;return K}async function N(f){let q=await(await E(f||{}).getClient()).getAccessToken();return(q==null?void 0:q.token)||null}var b={bash_20241022:D.bash_20241022,bash_20250124:D.bash_20250124,textEditor_20241022:D.textEditor_20241022,textEditor_20250124:D.textEditor_20250124,textEditor_20250429:D.textEditor_20250429,textEditor_20250728:D.textEditor_20250728,computer_20241022:D.computer_20241022,webSearch_20250305:D.webSearch_20250305,toolSearchRegex_20251119:D.toolSearchRegex_20251119,toolSearchBm25_20251119:D.toolSearchBm25_20251119};function V(f={}){let W=()=>{var z;let F=Q({settingValue:f.location,environmentVariableName:"GOOGLE_VERTEX_LOCATION"}),J=Q({settingValue:f.project,environmentVariableName:"GOOGLE_VERTEX_PROJECT"});return(z=$(f.baseURL))!=null?z:`https://${F==="global"?"":F+"-"}aiplatform.googleapis.com/v1/projects/${J}/locations/${F}/publishers/anthropic/models`},H=(z)=>{var F;return new w(z,{provider:"vertex.anthropic.messages",baseURL:W(),headers:(F=f.headers)!=null?F:{},fetch:f.fetch,buildRequestUrl:(J,X)=>`${J}/${z}:${X?"streamRawPredict":"rawPredict"}`,transformRequestBody:(J)=>{let{model:X,...B}=J;return{...B,anthropic_version:"vertex-2023-10-16"}},supportedUrls:()=>({}),supportsNativeStructuredOutput:!1,supportsStrictTools:!1})},q=function(z){if(new.target)throw Error("The Anthropic model function cannot be called with the new keyword.");return H(z)};return q.specificationVersion="v3",q.languageModel=H,q.chat=H,q.messages=H,q.embeddingModel=(z)=>{throw new P({modelId:z,modelType:"embeddingModel"})},q.textEmbeddingModel=q.embeddingModel,q.imageModel=(z)=>{throw new P({modelId:z,modelType:"imageModel"})},q.tools=b,q}function C(f={}){return V({...f,headers:async()=>({Authorization:`Bearer ${await N(f.googleAuthOptions)}`,...await Z(f.headers)})})}var L=C();export{L as vertexAnthropic,C as createVertexAnthropic};
2
+ import{vf as j}from"./chunk-9zy5tsry.js";import{Hf as w,If as D}from"./chunk-vjt6mh10.js";import{Eq as $,dq as Q,xq as Z}from"./chunk-yce8ph5b.js";import{Qq as P}from"./chunk-kec1xw1n.js";import"./chunk-cqtkxwd8.js";import"./chunk-x50adh71.js";import"./chunk-q4mtwv1w.js";import"./chunk-7a3txs9f.js";import{qP as G}from"./chunk-djfrkbd5.js";var y=G(j(),1);var K=null,Y=null;function E(f){if(!K||f!==Y)K=new y.GoogleAuth({scopes:["https://www.googleapis.com/auth/cloud-platform"],...f}),Y=f;return K}async function N(f){let q=await(await E(f||{}).getClient()).getAccessToken();return(q==null?void 0:q.token)||null}var b={bash_20241022:D.bash_20241022,bash_20250124:D.bash_20250124,textEditor_20241022:D.textEditor_20241022,textEditor_20250124:D.textEditor_20250124,textEditor_20250429:D.textEditor_20250429,textEditor_20250728:D.textEditor_20250728,computer_20241022:D.computer_20241022,webSearch_20250305:D.webSearch_20250305,toolSearchRegex_20251119:D.toolSearchRegex_20251119,toolSearchBm25_20251119:D.toolSearchBm25_20251119};function V(f={}){let W=()=>{var z;let F=Q({settingValue:f.location,environmentVariableName:"GOOGLE_VERTEX_LOCATION"}),J=Q({settingValue:f.project,environmentVariableName:"GOOGLE_VERTEX_PROJECT"});return(z=$(f.baseURL))!=null?z:`https://${F==="global"?"":F+"-"}aiplatform.googleapis.com/v1/projects/${J}/locations/${F}/publishers/anthropic/models`},H=(z)=>{var F;return new w(z,{provider:"vertex.anthropic.messages",baseURL:W(),headers:(F=f.headers)!=null?F:{},fetch:f.fetch,buildRequestUrl:(J,X)=>`${J}/${z}:${X?"streamRawPredict":"rawPredict"}`,transformRequestBody:(J)=>{let{model:X,...B}=J;return{...B,anthropic_version:"vertex-2023-10-16"}},supportedUrls:()=>({}),supportsNativeStructuredOutput:!1,supportsStrictTools:!1})},q=function(z){if(new.target)throw Error("The Anthropic model function cannot be called with the new keyword.");return H(z)};return q.specificationVersion="v3",q.languageModel=H,q.chat=H,q.messages=H,q.embeddingModel=(z)=>{throw new P({modelId:z,modelType:"embeddingModel"})},q.textEmbeddingModel=q.embeddingModel,q.imageModel=(z)=>{throw new P({modelId:z,modelType:"imageModel"})},q.tools=b,q}function C(f={}){return V({...f,headers:async()=>({Authorization:`Bearer ${await N(f.googleAuthOptions)}`,...await Z(f.headers)})})}var L=C();export{L as vertexAnthropic,C as createVertexAnthropic};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{eg as X}from"./chunk-bwadggys.js";import{Eg as M,Ig as x}from"./chunk-nsp1za8t.js";import{yj as B}from"./chunk-k1qd8ecm.js";import{ho as G,lo as C,so as N,to as V,wo as L}from"./chunk-4y9wbfd2.js";import{fH as z}from"./chunk-g7v6sp3c.js";var Z="forgewise";function A(j){if(!j||j.type!=="api")return"skip";if(j.method==="api-key")return"skip";if(M(j.expiresAt))return"skip";return"probe"}function F(j){if(j===null)return"skipped";if(!j)return"revoked";return"valid"}function U(j){if(!j||j.type!=="api")return{kind:"skip"};if(j.method==="api-key")return{kind:"skip"};if(!M(j.expiresAt))return{kind:"skip"};if(j.refreshToken)return{kind:"refresh-token",refreshToken:j.refreshToken};return{kind:"browser"}}function T(j){if(j==="invalid_grant")return{kind:"revoked"};if(j===null)return{kind:"transient"};return{kind:"persist",credential:L(j,{rotateRefreshToken:!0})}}var b=1e4;function P(j){if(!j)return;if(j.type!=="api")return{type:j.type,expiresAt:0};return{type:j.type,method:j.metadata?.method,expiresAt:Number(j.metadata?.expires_at??0),refreshToken:j.metadata?.refresh_token}}function w(){if(process.platform==="linux")return Boolean(process.env.DISPLAY||process.env.WAYLAND_DISPLAY);return process.platform==="win32"||process.platform==="darwin"}var K=()=>z.gen(function*(){let j=yield*B.Service,D=yield*z.orElseSucceed(j.get(Z),()=>{return});if(A(P(D))==="skip")return"skipped";if(!D||D.type!=="api")return"skipped";let J=yield*z.orElseSucceed(z.tryPromise({try:()=>C(),catch:()=>{return}}).pipe(z.map((Q)=>Q.issuer)),()=>{return});if(!J)return"skipped";let $=yield*z.promise(()=>N(J,D.key)),H=F($);if(H==="revoked")yield*z.orElseSucceed(j.remove(Z),()=>{return});return H}).pipe(z.withSpan("forgewise.validateStoredToken")),W=()=>z.gen(function*(){let j=yield*B.Service,D=yield*z.orElseSucceed(j.get(Z),()=>{return}),J=U(P(D));if(J.kind==="skip")return"skipped";if(J.kind==="refresh-token"){let _=yield*z.promise(()=>V(J.refreshToken).catch(()=>null)),q=T(_);if(q.kind==="revoked")return yield*z.orElseSucceed(j.remove(Z),()=>{return}),"failed";if(q.kind==="persist")return(yield*j.set(Z,q.credential).pipe(z.map(()=>!0),z.catch(()=>z.succeed(!1))))?"ok":"failed"}if(!w())return"skipped";let $=new AbortController,H=setTimeout(()=>$.abort(),b),Q=yield*z.promise(()=>x({signal:$.signal}).catch(()=>null).finally(()=>clearTimeout(H)));if(!Q)return"failed";let Y=L(Q,{rotateRefreshToken:!1});return(yield*j.set(Z,Y).pipe(z.map(()=>!0),z.catch(()=>z.succeed(!1))))?"ok":"failed"}).pipe(z.withSpan("forgewise.refreshIfNeeded"));var E=()=>z.gen(function*(){if((yield*z.promise(()=>G()))?.method!=="sso")return"ok";if((yield*K())==="revoked")return yield*z.sync(()=>X.println(X.Style.TEXT_DANGER+"Your session was revoked (signed out from another device or by an admin action). Run `qitqode auth login` to sign in again."+X.Style.TEXT_NORMAL)),"revoked";if((yield*W())==="failed")yield*z.sync(()=>X.println(X.Style.TEXT_DIM+"(Session refresh failed \u2014 run `qitqode auth login` to re-authenticate)"+X.Style.TEXT_NORMAL));return"ok"});
2
+ import{$f as X}from"./chunk-xvvt886p.js";import{Dg as x,zg as M}from"./chunk-f6vy70p6.js";import{tj as B}from"./chunk-s27cz24e.js";import{_o as G,cp as C,jp as N,kp as V,np as L}from"./chunk-wh2qqhep.js";import{cI as z}from"./chunk-2zjet9tx.js";var Z="forgewise";function A(j){if(!j||j.type!=="api")return"skip";if(j.method==="api-key")return"skip";if(M(j.expiresAt))return"skip";return"probe"}function F(j){if(j===null)return"skipped";if(!j)return"revoked";return"valid"}function U(j){if(!j||j.type!=="api")return{kind:"skip"};if(j.method==="api-key")return{kind:"skip"};if(!M(j.expiresAt))return{kind:"skip"};if(j.refreshToken)return{kind:"refresh-token",refreshToken:j.refreshToken};return{kind:"browser"}}function T(j){if(j==="invalid_grant")return{kind:"revoked"};if(j===null)return{kind:"transient"};return{kind:"persist",credential:L(j,{rotateRefreshToken:!0})}}var b=1e4;function P(j){if(!j)return;if(j.type!=="api")return{type:j.type,expiresAt:0};return{type:j.type,method:j.metadata?.method,expiresAt:Number(j.metadata?.expires_at??0),refreshToken:j.metadata?.refresh_token}}function w(){if(process.platform==="linux")return Boolean(process.env.DISPLAY||process.env.WAYLAND_DISPLAY);return process.platform==="win32"||process.platform==="darwin"}var K=()=>z.gen(function*(){let j=yield*B.Service,D=yield*z.orElseSucceed(j.get(Z),()=>{return});if(A(P(D))==="skip")return"skipped";if(!D||D.type!=="api")return"skipped";let J=yield*z.orElseSucceed(z.tryPromise({try:()=>C(),catch:()=>{return}}).pipe(z.map((Q)=>Q.issuer)),()=>{return});if(!J)return"skipped";let $=yield*z.promise(()=>N(J,D.key)),H=F($);if(H==="revoked")yield*z.orElseSucceed(j.remove(Z),()=>{return});return H}).pipe(z.withSpan("forgewise.validateStoredToken")),W=()=>z.gen(function*(){let j=yield*B.Service,D=yield*z.orElseSucceed(j.get(Z),()=>{return}),J=U(P(D));if(J.kind==="skip")return"skipped";if(J.kind==="refresh-token"){let _=yield*z.promise(()=>V(J.refreshToken).catch(()=>null)),q=T(_);if(q.kind==="revoked")return yield*z.orElseSucceed(j.remove(Z),()=>{return}),"failed";if(q.kind==="persist")return(yield*j.set(Z,q.credential).pipe(z.map(()=>!0),z.catch(()=>z.succeed(!1))))?"ok":"failed"}if(!w())return"skipped";let $=new AbortController,H=setTimeout(()=>$.abort(),b),Q=yield*z.promise(()=>x({signal:$.signal}).catch(()=>null).finally(()=>clearTimeout(H)));if(!Q)return"failed";let Y=L(Q,{rotateRefreshToken:!1});return(yield*j.set(Z,Y).pipe(z.map(()=>!0),z.catch(()=>z.succeed(!1))))?"ok":"failed"}).pipe(z.withSpan("forgewise.refreshIfNeeded"));var E=()=>z.gen(function*(){if((yield*z.promise(()=>G()))?.method!=="sso")return"ok";if((yield*K())==="revoked")return yield*z.sync(()=>X.println(X.Style.TEXT_DANGER+"Your session was revoked (signed out from another device or by an admin action). Run `qitqode auth login` to sign in again."+X.Style.TEXT_NORMAL)),"revoked";if((yield*W())==="failed")yield*z.sync(()=>X.println(X.Style.TEXT_DIM+"(Session refresh failed \u2014 run `qitqode auth login` to re-authenticate)"+X.Style.TEXT_NORMAL));return"ok"});
3
3
  export{E as h};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{$d as J,Rd as y,Td as T,Ud as t,Vd as O,Wd as l,Yd as v,Zd as Q,_d as X}from"./chunk-2kh0tg92.js";import"./chunk-52xvhxek.js";import{be as w}from"./chunk-f4mnp6xd.js";import{eg as f}from"./chunk-bwadggys.js";import{Ch as q,Sg as Y,Tg as mt,Ug as pt,Vg as st,Wg as et,Xg as ft,Yg as E,kh as Mt}from"./chunk-1acn5me8.js";import"./chunk-vs3s49jw.js";import"./chunk-kre93a89.js";import"./chunk-060wbpz4.js";import"./chunk-zrhw1szj.js";import"./chunk-t8fjgkp8.js";import"./chunk-0egrckx0.js";import{Ej as L,el as F,xj as nt}from"./chunk-k1qd8ecm.js";import"./chunk-bhg69t69.js";import{Ol as $}from"./chunk-fv5mrdyc.js";import"./chunk-rdreeyv0.js";import"./chunk-rmsqb6r4.js";import"./chunk-7pckez5z.js";import{mn as P,nn as h}from"./chunk-k6981ysw.js";import"./chunk-sa0rrreh.js";import"./chunk-ydgst3h8.js";import"./chunk-6tqbnxar.js";import"./chunk-0w19vmd7.js";import"./chunk-eewe7tx1.js";import"./chunk-4y9wbfd2.js";import"./chunk-wm9nh9nb.js";import"./chunk-scnbt714.js";import"./chunk-cqtkxwd8.js";import"./chunk-y3gy62q5.js";import"./chunk-az3nss5m.js";import"./chunk-p2fte9vz.js";import"./chunk-ggncq8w8.js";import"./chunk-t3w43rft.js";import"./chunk-eacpc64g.js";import"./chunk-27saej0r.js";import"./chunk-b5ym419d.js";import"./chunk-29q89bge.js";import"./chunk-wqk1v8t0.js";import"./chunk-rwwvy89t.js";import"./chunk-z0kbyr00.js";import"./chunk-sbjymf20.js";import"./chunk-dt3bsmfe.js";import"./chunk-vbfej8ds.js";import"./chunk-0tm6589k.js";import"./chunk-fveaq0pb.js";import{es as g}from"./chunk-gswhjd1h.js";import"./chunk-wgkcyqn1.js";import"./chunk-59csnjc3.js";import{gt as D,lt as A}from"./chunk-1bxfzd6r.js";import"./chunk-6p6m5956.js";import"./chunk-a48mx917.js";import"./chunk-3va85mbe.js";import"./chunk-w7a33cwa.js";import{fH as a}from"./chunk-g7v6sp3c.js";import"./chunk-s2tc3qs0.js";import"./chunk-n6tqtk6h.js";import{tO as ut}from"./chunk-e0vrxetq.js";import W from"path";function G(o){switch(o){case"authenticated":return"\u2713";case"expired":return"\u26A0";case"not_authenticated":return"\u2717"}}function H(o){switch(o){case"authenticated":return"authenticated";case"expired":return"expired";case"not_authenticated":return"not authenticated"}}function N(o){return typeof o==="object"&&o!==null&&"type"in o}function k(o){return N(o)&&o.type==="remote"}function B(o){return Object.entries(o.mcp??{}).filter((e)=>N(e[1]))}function U(o,e){let r=o.mcp_origins?.[e];if(!r)return"qitqode";let i=A.Path.home,m=r.source===i?"~":r.source.startsWith(i+W.sep)?"~"+r.source.slice(i.length):r.source;return`${r.type}:${m}`}function C(o){return B(o).filter((e)=>k(e[1])&&e[1].oauth!==!1)}async function I(){return q.runPromise(a.gen(function*(){let o=yield*F.Service,e=yield*E.Service,r=yield*o.get(),i=yield*e.status(),m=yield*a.all(Object.fromEntries(B(r).map(([p])=>[p,e.hasStoredTokens(p)])),{concurrency:"unbounded"});return{config:r,statuses:i,stored:m}}))}async function S(){return q.runPromise(a.gen(function*(){let o=yield*F.Service,e=yield*E.Service,r=yield*o.get(),i=yield*a.all(Object.fromEntries(C(r).map(([m])=>[m,e.getAuthStatus(m)])),{concurrency:"unbounded"});return{config:r,auth:i}}))}async function V(o,e=!1){let r=[W.join(o,"qitqode.json"),W.join(o,"qitqode.jsonc")];if(!e)r.push(W.join(o,".qitqode","qitqode.json"),W.join(o,".qitqode","qitqode.jsonc"));for(let i of r)if(await D.exists(i))return i;return r[0]}async function R(o,e,r){let i="{}";if(await D.exists(r))i=await D.readText(r);let m=P(i,["mcp",o],e,{formattingOptions:{tabSize:2,insertSpaces:!0}});return await D.write(r,h(i,m)),r}var tt=ut(Mt(),1);function yt(o){let e=tt.parse(o);if(!e.every((r)=>typeof r==="string"))throw Error("Shell operators are not supported; enter only the command and its arguments");if(e.length===0)throw Error("Command is required");return e}var ot=w({command:"add",describe:"add an MCP server",async handler(){await $.provide({directory:process.cwd(),async fn(){f.empty(),O("Add MCP server");let o=$.project,[e,r]=await Promise.all([V($.worktree),V(A.Path.config,!0)]),i=r;if(o.vcs==="git"){let c=await X({message:"Location",options:[{label:"Current project",value:e,hint:e},{label:"Global",value:r,hint:r}]});if(y(c))throw new f.CancelledError;i=c}let m=await J({message:"Enter MCP server name",validate:(c)=>c&&c.length>0?void 0:"Required"});if(y(m))throw new f.CancelledError;let p=await X({message:"Select MCP server type",options:[{label:"Local",value:"local",hint:"Run a local command"},{label:"Remote",value:"remote",hint:"Connect to a remote URL"}]});if(y(p))throw new f.CancelledError;if(p==="local"){let c=await J({message:"Enter command to run",placeholder:"e.g., qitqode x @modelcontextprotocol/server-filesystem",validate:(s)=>s&&s.length>0?void 0:"Required"});if(y(c))throw new f.CancelledError;let u;try{u=yt(c)}catch(s){t.error(s instanceof Error?s.message:"Invalid command"),l("MCP server was not added");return}await R(m,{type:"local",command:u},i),t.success(`MCP server "${m}" added to ${i}`),l("MCP server added successfully");return}if(p==="remote"){let c=await J({message:"Enter MCP server URL",placeholder:"e.g., https://example.com/mcp",validate:(s)=>{if(!s)return"Required";if(s.length===0)return"Required";return URL.canParse(s)?void 0:"Invalid URL"}});if(y(c))throw new f.CancelledError;let u=await T({message:"Does this server require OAuth authentication?",initialValue:!1});if(y(u))throw new f.CancelledError;let n;if(u){let s=await T({message:"Do you have a pre-registered client ID?",initialValue:!1});if(y(s))throw new f.CancelledError;if(s){let d=await J({message:"Enter client ID",validate:(j)=>j&&j.length>0?void 0:"Required"});if(y(d))throw new f.CancelledError;let M=await T({message:"Do you have a client secret?",initialValue:!1});if(y(M))throw new f.CancelledError;let _;if(M){let j=await v({message:"Enter client secret"});if(y(j))throw new f.CancelledError;_=j}n={type:"remote",url:c,oauth:{clientId:d,..._&&{clientSecret:_}}}}else n={type:"remote",url:c,oauth:{}}}else n={type:"remote",url:c,oauth:!1};await R(m,n,i),t.success(`MCP server "${m}" added to ${i}`)}l("MCP server added successfully")}})}});var it=w({command:"list",aliases:["ls"],describe:"list MCP servers and their status",async handler(){await $.provide({directory:process.cwd(),async fn(){f.empty(),O("MCP Servers");let{config:o,statuses:e,stored:r}=await I(),i=B(o);if(i.length===0){t.warn("No MCP servers configured"),l("Add servers with: qitqode mcp add");return}for(let[m,p]of i){let c=e[m],u=k(p)&&p.oauth!==!1,n=r[m],s,d,M="";if(!c)s="\u25CB",d="not initialized";else if(c.status==="connected"){if(s="\u2713",d="connected",u&&n)M=" (OAuth)"}else if(c.status==="disabled")s="\u25CB",d="disabled";else if(c.status==="pending")s="\u25CB",d="pending approval";else if(c.status==="needs_auth")s="\u26A0",d="needs authentication";else if(c.status==="needs_client_registration")s="\u2717",d="needs client registration",M=`
2
+ import{$d as X,Sd as y,Ud as T,Vd as t,Wd as O,Xd as l,Zd as v,_d as Q,ae as J}from"./chunk-vbfc0wgv.js";import"./chunk-j7637cwg.js";import{ce as w}from"./chunk-rk21wv4k.js";import{$f as f}from"./chunk-xvvt886p.js";import{Ng as Y,Og as mt,Pg as pt,Qg as st,Rg as et,Sg as ft,Tg as E,fh as Mt,xh as q}from"./chunk-c1c8ch3g.js";import"./chunk-ajnzv5jt.js";import"./chunk-dz3kcsb6.js";import"./chunk-pwsajn96.js";import"./chunk-hgm8yfcb.js";import"./chunk-7rbg6mg9.js";import"./chunk-mp1x10t5.js";import{$k as F,sj as nt,zj as L}from"./chunk-s27cz24e.js";import"./chunk-gx4v8z64.js";import{Jl as $}from"./chunk-v03xq38e.js";import"./chunk-dx7rexx3.js";import"./chunk-xgf4k9q7.js";import"./chunk-dnjyepb2.js";import{hn as P,in as h}from"./chunk-8gpjmj42.js";import"./chunk-atacnspd.js";import"./chunk-qdafm7qg.js";import"./chunk-r81w6skn.js";import"./chunk-ge7csm6m.js";import"./chunk-d0dsgxk4.js";import"./chunk-1q10jyka.js";import"./chunk-wh2qqhep.js";import"./chunk-vy93mn7d.js";import"./chunk-yce8ph5b.js";import"./chunk-kec1xw1n.js";import"./chunk-cqtkxwd8.js";import"./chunk-x50adh71.js";import"./chunk-ngyv4fhn.js";import"./chunk-nq4x6792.js";import"./chunk-f17se3hh.js";import"./chunk-2y5bthrp.js";import"./chunk-7hdb1fhq.js";import"./chunk-xnxw5zz9.js";import"./chunk-gq3zb4wv.js";import"./chunk-2cvwrabw.js";import"./chunk-4sa9t0vx.js";import"./chunk-g52wmt1v.js";import"./chunk-9d0exvey.js";import"./chunk-h2p984qb.js";import"./chunk-qm9fm5ja.js";import"./chunk-z0m1qm7j.js";import"./chunk-wd2xmkdp.js";import"./chunk-8peby2d1.js";import{bt as g}from"./chunk-azss4acq.js";import"./chunk-0bhzhh7s.js";import"./chunk-7s0nq2aa.js";import{du as D,iu as A}from"./chunk-cxtwavyf.js";import"./chunk-15bjhfav.js";import"./chunk-q4mtwv1w.js";import"./chunk-7a3txs9f.js";import"./chunk-x308f9j4.js";import{cI as a}from"./chunk-2zjet9tx.js";import"./chunk-mn5cacf6.js";import"./chunk-9pj10pgd.js";import{qP as ut}from"./chunk-djfrkbd5.js";import W from"path";function G(o){switch(o){case"authenticated":return"\u2713";case"expired":return"\u26A0";case"not_authenticated":return"\u2717"}}function H(o){switch(o){case"authenticated":return"authenticated";case"expired":return"expired";case"not_authenticated":return"not authenticated"}}function N(o){return typeof o==="object"&&o!==null&&"type"in o}function k(o){return N(o)&&o.type==="remote"}function B(o){return Object.entries(o.mcp??{}).filter((e)=>N(e[1]))}function U(o,e){let r=o.mcp_origins?.[e];if(!r)return"qitqode";let i=A.Path.home,m=r.source===i?"~":r.source.startsWith(i+W.sep)?"~"+r.source.slice(i.length):r.source;return`${r.type}:${m}`}function C(o){return B(o).filter((e)=>k(e[1])&&e[1].oauth!==!1)}async function I(){return q.runPromise(a.gen(function*(){let o=yield*F.Service,e=yield*E.Service,r=yield*o.get(),i=yield*e.status(),m=yield*a.all(Object.fromEntries(B(r).map(([p])=>[p,e.hasStoredTokens(p)])),{concurrency:"unbounded"});return{config:r,statuses:i,stored:m}}))}async function S(){return q.runPromise(a.gen(function*(){let o=yield*F.Service,e=yield*E.Service,r=yield*o.get(),i=yield*a.all(Object.fromEntries(C(r).map(([m])=>[m,e.getAuthStatus(m)])),{concurrency:"unbounded"});return{config:r,auth:i}}))}async function V(o,e=!1){let r=[W.join(o,"qitqode.json"),W.join(o,"qitqode.jsonc")];if(!e)r.push(W.join(o,".qitqode","qitqode.json"),W.join(o,".qitqode","qitqode.jsonc"));for(let i of r)if(await D.exists(i))return i;return r[0]}async function R(o,e,r){let i="{}";if(await D.exists(r))i=await D.readText(r);let m=P(i,["mcp",o],e,{formattingOptions:{tabSize:2,insertSpaces:!0}});return await D.write(r,h(i,m)),r}var tt=ut(Mt(),1);function yt(o){let e=tt.parse(o);if(!e.every((r)=>typeof r==="string"))throw Error("Shell operators are not supported; enter only the command and its arguments");if(e.length===0)throw Error("Command is required");return e}var ot=w({command:"add",describe:"add an MCP server",async handler(){await $.provide({directory:process.cwd(),async fn(){f.empty(),O("Add MCP server");let o=$.project,[e,r]=await Promise.all([V($.worktree),V(A.Path.config,!0)]),i=r;if(o.vcs==="git"){let c=await X({message:"Location",options:[{label:"Current project",value:e,hint:e},{label:"Global",value:r,hint:r}]});if(y(c))throw new f.CancelledError;i=c}let m=await J({message:"Enter MCP server name",validate:(c)=>c&&c.length>0?void 0:"Required"});if(y(m))throw new f.CancelledError;let p=await X({message:"Select MCP server type",options:[{label:"Local",value:"local",hint:"Run a local command"},{label:"Remote",value:"remote",hint:"Connect to a remote URL"}]});if(y(p))throw new f.CancelledError;if(p==="local"){let c=await J({message:"Enter command to run",placeholder:"e.g., qitqode x @modelcontextprotocol/server-filesystem",validate:(s)=>s&&s.length>0?void 0:"Required"});if(y(c))throw new f.CancelledError;let u;try{u=yt(c)}catch(s){t.error(s instanceof Error?s.message:"Invalid command"),l("MCP server was not added");return}await R(m,{type:"local",command:u},i),t.success(`MCP server "${m}" added to ${i}`),l("MCP server added successfully");return}if(p==="remote"){let c=await J({message:"Enter MCP server URL",placeholder:"e.g., https://example.com/mcp",validate:(s)=>{if(!s)return"Required";if(s.length===0)return"Required";return URL.canParse(s)?void 0:"Invalid URL"}});if(y(c))throw new f.CancelledError;let u=await T({message:"Does this server require OAuth authentication?",initialValue:!1});if(y(u))throw new f.CancelledError;let n;if(u){let s=await T({message:"Do you have a pre-registered client ID?",initialValue:!1});if(y(s))throw new f.CancelledError;if(s){let d=await J({message:"Enter client ID",validate:(j)=>j&&j.length>0?void 0:"Required"});if(y(d))throw new f.CancelledError;let M=await T({message:"Do you have a client secret?",initialValue:!1});if(y(M))throw new f.CancelledError;let _;if(M){let j=await v({message:"Enter client secret"});if(y(j))throw new f.CancelledError;_=j}n={type:"remote",url:c,oauth:{clientId:d,..._&&{clientSecret:_}}}}else n={type:"remote",url:c,oauth:{}}}else n={type:"remote",url:c,oauth:!1};await R(m,n,i),t.success(`MCP server "${m}" added to ${i}`)}l("MCP server added successfully")}})}});var it=w({command:"list",aliases:["ls"],describe:"list MCP servers and their status",async handler(){await $.provide({directory:process.cwd(),async fn(){f.empty(),O("MCP Servers");let{config:o,statuses:e,stored:r}=await I(),i=B(o);if(i.length===0){t.warn("No MCP servers configured"),l("Add servers with: qitqode mcp add");return}for(let[m,p]of i){let c=e[m],u=k(p)&&p.oauth!==!1,n=r[m],s,d,M="";if(!c)s="\u25CB",d="not initialized";else if(c.status==="connected"){if(s="\u2713",d="connected",u&&n)M=" (OAuth)"}else if(c.status==="disabled")s="\u25CB",d="disabled";else if(c.status==="pending")s="\u25CB",d="pending approval";else if(c.status==="needs_auth")s="\u26A0",d="needs authentication";else if(c.status==="needs_client_registration")s="\u2717",d="needs client registration",M=`
3
3
  `+c.error;else s="\u2717",d="failed",M=`
4
4
  `+c.error;let _=p.type==="remote"?L.redactString(p.url):L.redactCommand(p.command).join(" ");t.info(`${s} ${m} ${f.Style.TEXT_DIM}${d} ${U(o,m)}${M}
5
5
  ${f.Style.TEXT_DIM}${_}`)}l(`${i.length} server(s)`)}})}});var dt=w({command:"auth [name]",describe:"authenticate with an OAuth-enabled MCP server",builder:(o)=>o.positional("name",{describe:"name of the MCP server",type:"string"}).command(ct),async handler(o){await $.provide({directory:process.cwd(),async fn(){f.empty(),O("MCP OAuth Authentication");let{config:e,auth:r}=await S(),i=e.mcp??{},m=C(e);if(m.length===0){t.warn("No OAuth-capable MCP servers configured"),t.info("Remote MCP servers support OAuth by default. Add a remote server in qitqode.json:"),t.info(`
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Oe as a}from"./chunk-0a4pmkc9.js";import{Ef as fK,Ff as yK,Hf as b_,If as hG,Jf as DG,Kf as DW}from"./chunk-35fj1sfm.js";import{uO as k,xO as N}from"./chunk-e0vrxetq.js";var k_=k((iW)=>{var qW=N("stream"),g=b_(),U=a(),i=DW(),L_=(_)=>_?.body instanceof qW.Readable||typeof ReadableStream<"u"&&_?.body instanceof ReadableStream,IW=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch"],TW=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],SW=["TimeoutError","RequestTimeout","RequestTimeoutException"],PW=[500,502,503,504],RW=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],AW=["EHOSTUNREACH","ENETUNREACH","ENOTFOUND","EAI_AGAIN"],n=(_)=>_?.$retryable!==void 0,Q_=(_)=>IW.includes(_.name),j_=(_)=>_.$metadata?.clockSkewCorrected,J_=(_)=>{let W=new Set(["Failed to fetch","NetworkError when attempting to fetch resource","The Internet connection appears to be offline","Load failed","Network request failed"]);if(!(_&&_ instanceof TypeError))return!1;return W.has(_.message)},q=(_)=>_.$metadata?.httpStatusCode===429||TW.includes(_.name)||_.$retryable?.throttling==!0,I=(_,W=0)=>n(_)||j_(_)||_.name==="InvalidSignatureException"&&_.message?.includes("Signature expired")||SW.includes(_.name)||RW.includes(_?.code||"")||AW.includes(_?.code||"")||PW.includes(_.$metadata?.httpStatusCode||0)||J_(_)||w_(_)||_.cause!==void 0&&W<=10&&I(_.cause,W+1),O_=(_)=>{if(_.$metadata?.httpStatusCode!==void 0){let W=_.$metadata.httpStatusCode;if(500<=W&&W<=599&&!I(_))return!0;return!1}return!1};function w_(_){return _.code==="ERR_HTTP2_STREAM_ERROR"&&_.message.includes("NGHTTP2_REFUSED_STREAM")}var B_=100,v=20000,H_=500,A=500,z_=5,F_=10,o=1,x="amz-sdk-invocation-id",f="amz-sdk-request";function M_(_,W){if(!U.HttpResponse.isInstance(_))return;for(let K of Object.keys(_.headers)){let G=K.toLowerCase();if(G==="retry-after"){let Y=_.headers[K],X=NaN;if(Y.endsWith("GMT"))try{X=(i.parseRfc7231DateTime(Y).getTime()-Date.now())/1000}catch($){W?.trace?.("Failed to parse retry-after header"),W?.trace?.($)}else if(Y.match(/ GMT, ((\d+)|(\d+\.\d+))$/))X=Number(Y.match(/ GMT, ([\d.]+)$/)?.[1]);else if(Y.match(/^((\d+)|(\d+\.\d+))$/))X=Number(Y);else if(Date.parse(Y)>=Date.now())X=(Date.parse(Y)-Date.now())/1000;if(isNaN(X))return;return new Date(Date.now()+X*1000)}else if(G==="x-amz-retry-after"){let Y=_.headers[K],X=Number(Y);if(isNaN(X)){W?.trace?.(`Failed to parse x-amz-retry-after=${Y}`);return}return new Date(Date.now()+X)}}}function kW(_,W){return M_(_,W)}var V_=(_)=>{if(_ instanceof Error)return _;if(_ instanceof Object)return Object.assign(Error(),_);if(typeof _==="string")return Error(_);return Error(`AWS SDK error wrapper for ${_}`)};function N_(_){return(W)=>(K,G)=>async(Y)=>{let X=await W.retryStrategy(),$=await W.maxAttempts();if(xW(X)){X=X;let Z=await X.acquireInitialRetryToken((G.partition_id??"")+(G.__retryLongPoll?":longpoll":"")),L=Error(),b=0,j=0,{request:Q}=Y,J=U.HttpRequest.isInstance(Q);if(J)Q.headers[x]=i.v4();while(!0)try{if(J)Q.headers[f]=`attempt=${b+1}; max=${$}`;let{response:w,output:F}=await K(Y);return X.recordSuccess(Z),F.$metadata.attempts=b+1,F.$metadata.totalRetryDelay=j,{response:w,output:F}}catch(w){let F=fW(w,W.logger);if(L=V_(w),J&&_(Q))throw(G.logger instanceof g.NoOpLogger?console:G.logger)?.warn("An error was encountered in a non-retryable streaming request."),L;try{Z=await X.refreshRetryTokenForRetry(Z,F)}catch(wX){if(!L.$metadata)L.$metadata={};throw L.$metadata.attempts=b+1,L.$metadata.totalRetryDelay=j,L}b=Z.getRetryCount();let h=Z.getRetryDelay();if(j+=(Z?.$retryLog?.acquisitionDelay??0)+h,h>0)await vW(h)}}else{if(X=X,X?.mode)G.userAgent=[...G.userAgent||[],["cfg/retry-mode",X.mode]];return X.retry(K,Y)}}}var vW=(_)=>new Promise((W)=>setTimeout(W,_)),xW=(_)=>typeof _.acquireInitialRetryToken<"u"&&typeof _.refreshRetryTokenForRetry<"u"&&typeof _.recordSuccess<"u",fW=(_,W)=>{let K={error:_,errorType:yW(_)},G=M_(_.$response,W);if(G)K.retryAfterHint=G;return K},yW=(_)=>{if(q(_))return"THROTTLING";if(I(_))return"TRANSIENT";if(O_(_))return"SERVER_ERROR";return"CLIENT_ERROR"},U_={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0};function lW(_){let W=N_(_);return(K)=>({applyToStack:(G)=>{G.add(W(K),U_)}})}class T{static setTimeoutFn=setTimeout;beta;minCapacity;minFillRate;scaleConstant;smooth;enabled=!1;availableTokens=0;lastMaxRate=0;measuredTxRate=0;requestCount=0;fillRate;lastThrottleTime;lastTimestamp=0;lastTxRateBucket;maxCapacity;timeWindow=0;constructor(_){this.beta=_?.beta??0.7,this.minCapacity=_?.minCapacity??1,this.minFillRate=_?.minFillRate??0.5,this.scaleConstant=_?.scaleConstant??0.4,this.smooth=_?.smooth??0.8,this.lastThrottleTime=this.getCurrentTimeInSeconds(),this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}async getSendToken(){return this.acquireTokenBucket(1)}updateClientSendingRate(_){let W;this.updateMeasuredRate();let K=_;if(K?.errorType==="THROTTLING"||q(K?.error??_)){let X=!this.enabled?this.measuredTxRate:Math.min(this.measuredTxRate,this.fillRate);this.lastMaxRate=X,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),W=this.cubicThrottle(X),this.enableTokenBucket()}else this.calculateTimeWindow(),W=this.cubicSuccess(this.getCurrentTimeInSeconds());let Y=Math.min(W,2*this.measuredTxRate);this.updateTokenBucketRate(Y)}getCurrentTimeInSeconds(){return Date.now()/1000}async acquireTokenBucket(_){if(!this.enabled)return;this.refillTokenBucket();while(_>this.availableTokens){let W=(_-this.availableTokens)/this.fillRate*1000;await new Promise((K)=>T.setTimeoutFn(K,W)),this.refillTokenBucket()}this.availableTokens=this.availableTokens-_}refillTokenBucket(){let _=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=_;return}let W=(_-this.lastTimestamp)*this.fillRate;this.availableTokens=Math.min(this.maxCapacity,this.availableTokens+W),this.lastTimestamp=_}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,0.3333333333333333))}cubicThrottle(_){return this.getPrecise(_*this.beta)}cubicSuccess(_){return this.getPrecise(this.scaleConstant*Math.pow(_-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(_){this.refillTokenBucket(),this.fillRate=Math.max(_,this.minFillRate),this.maxCapacity=Math.max(_,this.minCapacity),this.availableTokens=Math.min(this.availableTokens,this.maxCapacity)}updateMeasuredRate(){let _=this.getCurrentTimeInSeconds(),W=Math.floor(_*2)/2;if(this.requestCount++,W>this.lastTxRateBucket){let K=this.requestCount/(W-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(K*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=W}}getPrecise(_){return parseFloat(_.toFixed(8))}}class O{static v2026=typeof process<"u"&&process.env?.SMITHY_NEW_RETRIES_2026==="true";static delay(){return O.v2026?50:100}static throttlingDelay(){return O.v2026?1000:500}static cost(){return O.v2026?14:5}static throttlingCost(){return O.v2026?5:10}static modifiedCostType(){return O.v2026?"THROTTLING":"TRANSIENT"}}class E_{x=O.delay();computeNextBackoffDelay(_){let W=Math.random(),K=2,G=W*Math.min(this.x*2**_,v);return Math.floor(G)}setDelayBase(_){this.x=_}}class u{delay;count;cost;longPoll;$retryLog={acquisitionDelay:0};constructor(_,W,K,G){this.delay=_,this.count=W,this.cost=K,this.longPoll=G}getRetryCount(){return this.count}getRetryDelay(){return Math.min(v,this.delay)}getRetryCost(){return this.cost}isLongPoll(){return this.longPoll}}iW.RETRY_MODES=void 0;(function(_){_.STANDARD="standard",_.ADAPTIVE="adaptive"})(iW.RETRY_MODES||(iW.RETRY_MODES={}));var V=3,C_=iW.RETRY_MODES.STANDARD,R={incompatible:1,attempts:2,capacity:3},D=class{mode=iW.RETRY_MODES.STANDARD;retryBackoffStrategy;capacity=A;maxAttemptsProvider;baseDelay;constructor(W){if(typeof W==="number")this.maxAttemptsProvider=async()=>W;else if(typeof W==="function")this.maxAttemptsProvider=W;else if(W&&typeof W==="object")this.maxAttemptsProvider=async()=>W.maxAttempts,this.baseDelay=W.baseDelay,this.retryBackoffStrategy=W.backoff;this.maxAttemptsProvider??=async()=>V,this.baseDelay??=O.delay(),this.retryBackoffStrategy??=new E_}async acquireInitialRetryToken(W){return new u(O.delay(),0,void 0,O.v2026&&W.includes(":longpoll"))}async refreshRetryTokenForRetry(W,K){let G=await this.getMaxAttempts(),Y=this.retryCode(W,K,G),X=Y===0,$=W.isLongPoll?.();if(X||$){let Z=K.errorType;this.retryBackoffStrategy.setDelayBase(Z==="THROTTLING"?O.throttlingDelay():this.baseDelay);let L=this.retryBackoffStrategy.computeNextBackoffDelay(W.getRetryCount()),b=L;if(K.retryAfterHint instanceof Date)b=Math.max(L,Math.min(K.retryAfterHint.getTime()-Date.now(),L+5000));if(!X){let j=O.v2026&&Y===R.capacity&&$?b:0;if(j>0)await new Promise((Q)=>setTimeout(Q,j))}else{let j=this.getCapacityCost(Z);this.capacity-=j;let Q=new u(0,W.getRetryCount()+1,j,W.isLongPoll?.()??!1);return await new Promise((J)=>setTimeout(J,b)),Q.$retryLog.acquisitionDelay=b,Q}}throw Error("No retry token available")}recordSuccess(W){this.capacity=Math.min(A,this.capacity+(W.getRetryCost()??o))}getCapacity(){return this.capacity}async maxAttempts(){return this.maxAttemptsProvider()}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch(W){return console.warn(`Max attempts provider could not resolve. Using default of ${V}`),V}}retryCode(W,K,G){let Y=W.getRetryCount()+1,X=this.isRetryableError(K.errorType)?0:R.incompatible,$=Y<G?0:R.attempts,Z=this.capacity>=this.getCapacityCost(K.errorType)?0:R.capacity;return X||$||Z}getCapacityCost(W){return W===O.modifiedCostType()?O.throttlingCost():O.cost()}isRetryableError(W){return W==="THROTTLING"||W==="TRANSIENT"}},h_=class{mode=iW.RETRY_MODES.ADAPTIVE;rateLimiter;standardRetryStrategy;constructor(W,K){let{rateLimiter:G}=K??{};this.rateLimiter=G??new T,this.standardRetryStrategy=K?new D({maxAttempts:typeof W==="number"?W:3,...K}):new D(W)}async acquireInitialRetryToken(W){let K=await this.standardRetryStrategy.acquireInitialRetryToken(W);return await this.rateLimiter.getSendToken(),K}async refreshRetryTokenForRetry(W,K){this.rateLimiter.updateClientSendingRate(K);let G=await this.standardRetryStrategy.refreshRetryTokenForRetry(W,K);return await this.rateLimiter.getSendToken(),G}recordSuccess(W){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(W)}async maxAttemptsProvider(){return this.standardRetryStrategy.maxAttempts()}};class D_ extends D{computeNextBackoffDelay;constructor(_,W=O.delay()){super(typeof _==="function"?_:async()=>_);if(typeof W==="number")this.computeNextBackoffDelay=()=>W;else this.computeNextBackoffDelay=W;this.retryBackoffStrategy.computeNextBackoffDelay=(K)=>{let G=K+1;return this.computeNextBackoffDelay(G)}}}var cW=(_,W)=>{let K=_,G=o,Y=z_,X=F_,$=_,Z=(Q)=>Q.name==="TimeoutError"?X:Y,L=(Q)=>Z(Q)<=$;return Object.freeze({hasRetryTokens:L,retrieveRetryTokens:(Q)=>{if(!L(Q))throw Error("No retry token available");let J=Z(Q);return $-=J,J},releaseRetryTokens:(Q)=>{$+=Q??G,$=Math.min($,K)}})},q_=(_,W)=>Math.floor(Math.min(v,Math.random()*2**W*_)),I_=(_)=>{if(!_)return!1;return n(_)||Q_(_)||q(_)||I(_)};class t{maxAttemptsProvider;retryDecider;delayDecider;retryQuota;mode=iW.RETRY_MODES.STANDARD;constructor(_,W){this.maxAttemptsProvider=_,this.retryDecider=W?.retryDecider??I_,this.delayDecider=W?.delayDecider??q_,this.retryQuota=W?.retryQuota??cW(A)}shouldRetry(_,W,K){return W<K&&this.retryDecider(_)&&this.retryQuota.hasRetryTokens(_)}async getMaxAttempts(){let _;try{_=await this.maxAttemptsProvider()}catch(W){_=V}return _}async retry(_,W,K){let G,Y=0,X=0,$=await this.getMaxAttempts(),{request:Z}=W;if(U.HttpRequest.isInstance(Z))Z.headers[x]=i.v4();while(!0)try{if(U.HttpRequest.isInstance(Z))Z.headers[f]=`attempt=${Y+1}; max=${$}`;if(K?.beforeRequest)await K.beforeRequest();let{response:L,output:b}=await _(W);if(K?.afterRequest)K.afterRequest(L);return this.retryQuota.releaseRetryTokens(G),b.$metadata.attempts=Y+1,b.$metadata.totalRetryDelay=X,{response:L,output:b}}catch(L){let b=V_(L);if(Y++,this.shouldRetry(b,Y,$)){G=this.retryQuota.retrieveRetryTokens(b);let j=this.delayDecider(q(b)?H_:B_,Y),Q=dW(b.$response),J=Math.max(Q||0,j);X+=J,await new Promise((w)=>setTimeout(w,J));continue}if(!b.$metadata)b.$metadata={};throw b.$metadata.attempts=Y,b.$metadata.totalRetryDelay=X,b}}}var dW=(_)=>{if(!U.HttpResponse.isInstance(_))return;let W=Object.keys(_.headers).find((X)=>X.toLowerCase()==="retry-after");if(!W)return;let K=_.headers[W],G=Number(K);if(!Number.isNaN(G))return G*1000;return new Date(K).getTime()-Date.now()};class T_ extends t{rateLimiter;constructor(_,W){let{rateLimiter:K,...G}=W??{};super(_,G);this.rateLimiter=K??new T,this.mode=iW.RETRY_MODES.ADAPTIVE}async retry(_,W){return super.retry(_,W,{beforeRequest:async()=>{return this.rateLimiter.getSendToken()},afterRequest:(K)=>{this.rateLimiter.updateClientSendingRate(K)}})}}var p="AWS_MAX_ATTEMPTS",s="max_attempts",mW={environmentVariableSelector:(_)=>{let W=_[p];if(!W)return;let K=parseInt(W);if(Number.isNaN(K))throw Error(`Environment variable ${p} mast be a number, got "${W}"`);return K},configFileSelector:(_)=>{let W=_[s];if(!W)return;let K=parseInt(W);if(Number.isNaN(K))throw Error(`Shared config file entry ${s} mast be a number, got "${W}"`);return K},default:V},gW=(_,W)=>{let{retryStrategy:K,retryMode:G}=_,{defaultMaxAttempts:Y=V,defaultBaseDelay:X=O.delay()}=W??{},$=g.normalizeProvider(_.maxAttempts??Y),Z=K?Promise.resolve(K):void 0,L=async()=>{let b=await $();if(await g.normalizeProvider(G)()===iW.RETRY_MODES.ADAPTIVE)return new h_($,{maxAttempts:b,baseDelay:X});return new D({maxAttempts:b,baseDelay:X})};return Object.assign(_,{maxAttempts:$,retryStrategy:()=>Z??=L()})},S_="AWS_RETRY_MODE",P_="retry_mode",uW={environmentVariableSelector:(_)=>_[S_],configFileSelector:(_)=>_[P_],default:C_},R_=()=>(_)=>async(W)=>{let{request:K}=W;if(U.HttpRequest.isInstance(K))delete K.headers[x],delete K.headers[f];return _(W)},A_={name:"omitRetryHeadersMiddleware",tags:["RETRY","HEADERS","OMIT_RETRY_HEADERS"],relation:"before",toMiddleware:"awsAuthMiddleware",override:!0},pW=(_)=>({applyToStack:(W)=>{W.addRelativeTo(R_(),A_)}}),sW=N_(L_),aW=lW(L_);iW.AdaptiveRetryStrategy=h_;iW.CONFIG_MAX_ATTEMPTS=s;iW.CONFIG_RETRY_MODE=P_;iW.ConfiguredRetryStrategy=D_;iW.DEFAULT_MAX_ATTEMPTS=V;iW.DEFAULT_RETRY_DELAY_BASE=B_;iW.DEFAULT_RETRY_MODE=C_;iW.DefaultRateLimiter=T;iW.DeprecatedAdaptiveRetryStrategy=T_;iW.DeprecatedStandardRetryStrategy=t;iW.ENV_MAX_ATTEMPTS=p;iW.ENV_RETRY_MODE=S_;iW.INITIAL_RETRY_TOKENS=A;iW.INVOCATION_ID_HEADER=x;iW.MAXIMUM_RETRY_DELAY=v;iW.NODE_MAX_ATTEMPT_CONFIG_OPTIONS=mW;iW.NODE_RETRY_MODE_CONFIG_OPTIONS=uW;iW.NO_RETRY_INCREMENT=o;iW.REQUEST_HEADER=f;iW.RETRY_COST=z_;iW.Retry=O;iW.StandardRetryStrategy=D;iW.THROTTLING_RETRY_DELAY_BASE=H_;iW.TIMEOUT_RETRY_COST=F_;iW.defaultDelayDecider=q_;iW.defaultRetryDecider=I_;iW.getOmitRetryHeadersPlugin=pW;iW.getRetryAfterHint=kW;iW.getRetryPlugin=aW;iW.isBrowserNetworkError=J_;iW.isClockSkewCorrectedError=j_;iW.isClockSkewError=Q_;iW.isNodeJsHttp2TransientError=w_;iW.isRetryableByTrait=n;iW.isServerError=O_;iW.isThrottlingError=q;iW.isTransientError=I;iW.omitRetryHeadersMiddleware=R_;iW.omitRetryHeadersMiddlewareOptions=A_;iW.resolveRetryConfig=gW;iW.retryMiddleware=sW;iW.retryMiddlewareOptions=U_});var i_=k((_G)=>{var lK=yK(),y=a(),v_=fK(),x_=b_(),cK=(_,W)=>{if(!W||W.length===0)return _;let K=[];for(let G of W)for(let Y of _)if(Y.schemeId.split("#")[1]===G)K.push(Y);for(let G of _)if(!K.find(({schemeId:Y})=>Y===G.schemeId))K.push(G);return K};function dK(_){let W=new Map;for(let K of _)W.set(K.schemeId,K);return W}var r=(_,W)=>(K,G)=>async(Y)=>{let X=_.httpAuthSchemeProvider(await W.httpAuthSchemeParametersProvider(_,G,Y.input)),$=_.authSchemePreference?await _.authSchemePreference():[],Z=cK(X,$),L=dK(_.httpAuthSchemes),b=x_.getSmithyContext(G),j=[];for(let Q of Z){let J=L.get(Q.schemeId);if(!J){j.push(`HttpAuthScheme \`${Q.schemeId}\` was not enabled for this service.`);continue}let w=J.identityProvider(await W.identityProviderConfigProvider(_));if(!w){j.push(`HttpAuthScheme \`${Q.schemeId}\` did not have an IdentityProvider configured.`);continue}let{identityProperties:F={},signingProperties:h={}}=Q.propertiesExtractor?.(_,G)||{};Q.identityProperties=Object.assign(Q.identityProperties||{},F),Q.signingProperties=Object.assign(Q.signingProperties||{},h),b.selectedHttpAuthScheme={httpAuthOption:Q,identity:await w(Q.identityProperties),signer:J.signer};break}if(!b.selectedHttpAuthScheme)throw Error(j.join(`
2
+ import{Pe as a}from"./chunk-dp6ms01y.js";import{Af as yK,Cf as b_,Df as hG,Ef as DG,Ff as DW,zf as fK}from"./chunk-2fbkw84y.js";import{rP as k,uP as N}from"./chunk-djfrkbd5.js";var k_=k((iW)=>{var qW=N("stream"),g=b_(),U=a(),i=DW(),L_=(_)=>_?.body instanceof qW.Readable||typeof ReadableStream<"u"&&_?.body instanceof ReadableStream,IW=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch"],TW=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],SW=["TimeoutError","RequestTimeout","RequestTimeoutException"],PW=[500,502,503,504],RW=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],AW=["EHOSTUNREACH","ENETUNREACH","ENOTFOUND","EAI_AGAIN"],n=(_)=>_?.$retryable!==void 0,Q_=(_)=>IW.includes(_.name),j_=(_)=>_.$metadata?.clockSkewCorrected,J_=(_)=>{let W=new Set(["Failed to fetch","NetworkError when attempting to fetch resource","The Internet connection appears to be offline","Load failed","Network request failed"]);if(!(_&&_ instanceof TypeError))return!1;return W.has(_.message)},q=(_)=>_.$metadata?.httpStatusCode===429||TW.includes(_.name)||_.$retryable?.throttling==!0,I=(_,W=0)=>n(_)||j_(_)||_.name==="InvalidSignatureException"&&_.message?.includes("Signature expired")||SW.includes(_.name)||RW.includes(_?.code||"")||AW.includes(_?.code||"")||PW.includes(_.$metadata?.httpStatusCode||0)||J_(_)||w_(_)||_.cause!==void 0&&W<=10&&I(_.cause,W+1),O_=(_)=>{if(_.$metadata?.httpStatusCode!==void 0){let W=_.$metadata.httpStatusCode;if(500<=W&&W<=599&&!I(_))return!0;return!1}return!1};function w_(_){return _.code==="ERR_HTTP2_STREAM_ERROR"&&_.message.includes("NGHTTP2_REFUSED_STREAM")}var B_=100,v=20000,H_=500,A=500,z_=5,F_=10,o=1,x="amz-sdk-invocation-id",f="amz-sdk-request";function M_(_,W){if(!U.HttpResponse.isInstance(_))return;for(let K of Object.keys(_.headers)){let G=K.toLowerCase();if(G==="retry-after"){let Y=_.headers[K],X=NaN;if(Y.endsWith("GMT"))try{X=(i.parseRfc7231DateTime(Y).getTime()-Date.now())/1000}catch($){W?.trace?.("Failed to parse retry-after header"),W?.trace?.($)}else if(Y.match(/ GMT, ((\d+)|(\d+\.\d+))$/))X=Number(Y.match(/ GMT, ([\d.]+)$/)?.[1]);else if(Y.match(/^((\d+)|(\d+\.\d+))$/))X=Number(Y);else if(Date.parse(Y)>=Date.now())X=(Date.parse(Y)-Date.now())/1000;if(isNaN(X))return;return new Date(Date.now()+X*1000)}else if(G==="x-amz-retry-after"){let Y=_.headers[K],X=Number(Y);if(isNaN(X)){W?.trace?.(`Failed to parse x-amz-retry-after=${Y}`);return}return new Date(Date.now()+X)}}}function kW(_,W){return M_(_,W)}var V_=(_)=>{if(_ instanceof Error)return _;if(_ instanceof Object)return Object.assign(Error(),_);if(typeof _==="string")return Error(_);return Error(`AWS SDK error wrapper for ${_}`)};function N_(_){return(W)=>(K,G)=>async(Y)=>{let X=await W.retryStrategy(),$=await W.maxAttempts();if(xW(X)){X=X;let Z=await X.acquireInitialRetryToken((G.partition_id??"")+(G.__retryLongPoll?":longpoll":"")),L=Error(),b=0,j=0,{request:Q}=Y,J=U.HttpRequest.isInstance(Q);if(J)Q.headers[x]=i.v4();while(!0)try{if(J)Q.headers[f]=`attempt=${b+1}; max=${$}`;let{response:w,output:F}=await K(Y);return X.recordSuccess(Z),F.$metadata.attempts=b+1,F.$metadata.totalRetryDelay=j,{response:w,output:F}}catch(w){let F=fW(w,W.logger);if(L=V_(w),J&&_(Q))throw(G.logger instanceof g.NoOpLogger?console:G.logger)?.warn("An error was encountered in a non-retryable streaming request."),L;try{Z=await X.refreshRetryTokenForRetry(Z,F)}catch(wX){if(!L.$metadata)L.$metadata={};throw L.$metadata.attempts=b+1,L.$metadata.totalRetryDelay=j,L}b=Z.getRetryCount();let h=Z.getRetryDelay();if(j+=(Z?.$retryLog?.acquisitionDelay??0)+h,h>0)await vW(h)}}else{if(X=X,X?.mode)G.userAgent=[...G.userAgent||[],["cfg/retry-mode",X.mode]];return X.retry(K,Y)}}}var vW=(_)=>new Promise((W)=>setTimeout(W,_)),xW=(_)=>typeof _.acquireInitialRetryToken<"u"&&typeof _.refreshRetryTokenForRetry<"u"&&typeof _.recordSuccess<"u",fW=(_,W)=>{let K={error:_,errorType:yW(_)},G=M_(_.$response,W);if(G)K.retryAfterHint=G;return K},yW=(_)=>{if(q(_))return"THROTTLING";if(I(_))return"TRANSIENT";if(O_(_))return"SERVER_ERROR";return"CLIENT_ERROR"},U_={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0};function lW(_){let W=N_(_);return(K)=>({applyToStack:(G)=>{G.add(W(K),U_)}})}class T{static setTimeoutFn=setTimeout;beta;minCapacity;minFillRate;scaleConstant;smooth;enabled=!1;availableTokens=0;lastMaxRate=0;measuredTxRate=0;requestCount=0;fillRate;lastThrottleTime;lastTimestamp=0;lastTxRateBucket;maxCapacity;timeWindow=0;constructor(_){this.beta=_?.beta??0.7,this.minCapacity=_?.minCapacity??1,this.minFillRate=_?.minFillRate??0.5,this.scaleConstant=_?.scaleConstant??0.4,this.smooth=_?.smooth??0.8,this.lastThrottleTime=this.getCurrentTimeInSeconds(),this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}async getSendToken(){return this.acquireTokenBucket(1)}updateClientSendingRate(_){let W;this.updateMeasuredRate();let K=_;if(K?.errorType==="THROTTLING"||q(K?.error??_)){let X=!this.enabled?this.measuredTxRate:Math.min(this.measuredTxRate,this.fillRate);this.lastMaxRate=X,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),W=this.cubicThrottle(X),this.enableTokenBucket()}else this.calculateTimeWindow(),W=this.cubicSuccess(this.getCurrentTimeInSeconds());let Y=Math.min(W,2*this.measuredTxRate);this.updateTokenBucketRate(Y)}getCurrentTimeInSeconds(){return Date.now()/1000}async acquireTokenBucket(_){if(!this.enabled)return;this.refillTokenBucket();while(_>this.availableTokens){let W=(_-this.availableTokens)/this.fillRate*1000;await new Promise((K)=>T.setTimeoutFn(K,W)),this.refillTokenBucket()}this.availableTokens=this.availableTokens-_}refillTokenBucket(){let _=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=_;return}let W=(_-this.lastTimestamp)*this.fillRate;this.availableTokens=Math.min(this.maxCapacity,this.availableTokens+W),this.lastTimestamp=_}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,0.3333333333333333))}cubicThrottle(_){return this.getPrecise(_*this.beta)}cubicSuccess(_){return this.getPrecise(this.scaleConstant*Math.pow(_-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(_){this.refillTokenBucket(),this.fillRate=Math.max(_,this.minFillRate),this.maxCapacity=Math.max(_,this.minCapacity),this.availableTokens=Math.min(this.availableTokens,this.maxCapacity)}updateMeasuredRate(){let _=this.getCurrentTimeInSeconds(),W=Math.floor(_*2)/2;if(this.requestCount++,W>this.lastTxRateBucket){let K=this.requestCount/(W-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(K*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=W}}getPrecise(_){return parseFloat(_.toFixed(8))}}class O{static v2026=typeof process<"u"&&process.env?.SMITHY_NEW_RETRIES_2026==="true";static delay(){return O.v2026?50:100}static throttlingDelay(){return O.v2026?1000:500}static cost(){return O.v2026?14:5}static throttlingCost(){return O.v2026?5:10}static modifiedCostType(){return O.v2026?"THROTTLING":"TRANSIENT"}}class E_{x=O.delay();computeNextBackoffDelay(_){let W=Math.random(),K=2,G=W*Math.min(this.x*2**_,v);return Math.floor(G)}setDelayBase(_){this.x=_}}class u{delay;count;cost;longPoll;$retryLog={acquisitionDelay:0};constructor(_,W,K,G){this.delay=_,this.count=W,this.cost=K,this.longPoll=G}getRetryCount(){return this.count}getRetryDelay(){return Math.min(v,this.delay)}getRetryCost(){return this.cost}isLongPoll(){return this.longPoll}}iW.RETRY_MODES=void 0;(function(_){_.STANDARD="standard",_.ADAPTIVE="adaptive"})(iW.RETRY_MODES||(iW.RETRY_MODES={}));var V=3,C_=iW.RETRY_MODES.STANDARD,R={incompatible:1,attempts:2,capacity:3},D=class{mode=iW.RETRY_MODES.STANDARD;retryBackoffStrategy;capacity=A;maxAttemptsProvider;baseDelay;constructor(W){if(typeof W==="number")this.maxAttemptsProvider=async()=>W;else if(typeof W==="function")this.maxAttemptsProvider=W;else if(W&&typeof W==="object")this.maxAttemptsProvider=async()=>W.maxAttempts,this.baseDelay=W.baseDelay,this.retryBackoffStrategy=W.backoff;this.maxAttemptsProvider??=async()=>V,this.baseDelay??=O.delay(),this.retryBackoffStrategy??=new E_}async acquireInitialRetryToken(W){return new u(O.delay(),0,void 0,O.v2026&&W.includes(":longpoll"))}async refreshRetryTokenForRetry(W,K){let G=await this.getMaxAttempts(),Y=this.retryCode(W,K,G),X=Y===0,$=W.isLongPoll?.();if(X||$){let Z=K.errorType;this.retryBackoffStrategy.setDelayBase(Z==="THROTTLING"?O.throttlingDelay():this.baseDelay);let L=this.retryBackoffStrategy.computeNextBackoffDelay(W.getRetryCount()),b=L;if(K.retryAfterHint instanceof Date)b=Math.max(L,Math.min(K.retryAfterHint.getTime()-Date.now(),L+5000));if(!X){let j=O.v2026&&Y===R.capacity&&$?b:0;if(j>0)await new Promise((Q)=>setTimeout(Q,j))}else{let j=this.getCapacityCost(Z);this.capacity-=j;let Q=new u(0,W.getRetryCount()+1,j,W.isLongPoll?.()??!1);return await new Promise((J)=>setTimeout(J,b)),Q.$retryLog.acquisitionDelay=b,Q}}throw Error("No retry token available")}recordSuccess(W){this.capacity=Math.min(A,this.capacity+(W.getRetryCost()??o))}getCapacity(){return this.capacity}async maxAttempts(){return this.maxAttemptsProvider()}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch(W){return console.warn(`Max attempts provider could not resolve. Using default of ${V}`),V}}retryCode(W,K,G){let Y=W.getRetryCount()+1,X=this.isRetryableError(K.errorType)?0:R.incompatible,$=Y<G?0:R.attempts,Z=this.capacity>=this.getCapacityCost(K.errorType)?0:R.capacity;return X||$||Z}getCapacityCost(W){return W===O.modifiedCostType()?O.throttlingCost():O.cost()}isRetryableError(W){return W==="THROTTLING"||W==="TRANSIENT"}},h_=class{mode=iW.RETRY_MODES.ADAPTIVE;rateLimiter;standardRetryStrategy;constructor(W,K){let{rateLimiter:G}=K??{};this.rateLimiter=G??new T,this.standardRetryStrategy=K?new D({maxAttempts:typeof W==="number"?W:3,...K}):new D(W)}async acquireInitialRetryToken(W){let K=await this.standardRetryStrategy.acquireInitialRetryToken(W);return await this.rateLimiter.getSendToken(),K}async refreshRetryTokenForRetry(W,K){this.rateLimiter.updateClientSendingRate(K);let G=await this.standardRetryStrategy.refreshRetryTokenForRetry(W,K);return await this.rateLimiter.getSendToken(),G}recordSuccess(W){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(W)}async maxAttemptsProvider(){return this.standardRetryStrategy.maxAttempts()}};class D_ extends D{computeNextBackoffDelay;constructor(_,W=O.delay()){super(typeof _==="function"?_:async()=>_);if(typeof W==="number")this.computeNextBackoffDelay=()=>W;else this.computeNextBackoffDelay=W;this.retryBackoffStrategy.computeNextBackoffDelay=(K)=>{let G=K+1;return this.computeNextBackoffDelay(G)}}}var cW=(_,W)=>{let K=_,G=o,Y=z_,X=F_,$=_,Z=(Q)=>Q.name==="TimeoutError"?X:Y,L=(Q)=>Z(Q)<=$;return Object.freeze({hasRetryTokens:L,retrieveRetryTokens:(Q)=>{if(!L(Q))throw Error("No retry token available");let J=Z(Q);return $-=J,J},releaseRetryTokens:(Q)=>{$+=Q??G,$=Math.min($,K)}})},q_=(_,W)=>Math.floor(Math.min(v,Math.random()*2**W*_)),I_=(_)=>{if(!_)return!1;return n(_)||Q_(_)||q(_)||I(_)};class t{maxAttemptsProvider;retryDecider;delayDecider;retryQuota;mode=iW.RETRY_MODES.STANDARD;constructor(_,W){this.maxAttemptsProvider=_,this.retryDecider=W?.retryDecider??I_,this.delayDecider=W?.delayDecider??q_,this.retryQuota=W?.retryQuota??cW(A)}shouldRetry(_,W,K){return W<K&&this.retryDecider(_)&&this.retryQuota.hasRetryTokens(_)}async getMaxAttempts(){let _;try{_=await this.maxAttemptsProvider()}catch(W){_=V}return _}async retry(_,W,K){let G,Y=0,X=0,$=await this.getMaxAttempts(),{request:Z}=W;if(U.HttpRequest.isInstance(Z))Z.headers[x]=i.v4();while(!0)try{if(U.HttpRequest.isInstance(Z))Z.headers[f]=`attempt=${Y+1}; max=${$}`;if(K?.beforeRequest)await K.beforeRequest();let{response:L,output:b}=await _(W);if(K?.afterRequest)K.afterRequest(L);return this.retryQuota.releaseRetryTokens(G),b.$metadata.attempts=Y+1,b.$metadata.totalRetryDelay=X,{response:L,output:b}}catch(L){let b=V_(L);if(Y++,this.shouldRetry(b,Y,$)){G=this.retryQuota.retrieveRetryTokens(b);let j=this.delayDecider(q(b)?H_:B_,Y),Q=dW(b.$response),J=Math.max(Q||0,j);X+=J,await new Promise((w)=>setTimeout(w,J));continue}if(!b.$metadata)b.$metadata={};throw b.$metadata.attempts=Y,b.$metadata.totalRetryDelay=X,b}}}var dW=(_)=>{if(!U.HttpResponse.isInstance(_))return;let W=Object.keys(_.headers).find((X)=>X.toLowerCase()==="retry-after");if(!W)return;let K=_.headers[W],G=Number(K);if(!Number.isNaN(G))return G*1000;return new Date(K).getTime()-Date.now()};class T_ extends t{rateLimiter;constructor(_,W){let{rateLimiter:K,...G}=W??{};super(_,G);this.rateLimiter=K??new T,this.mode=iW.RETRY_MODES.ADAPTIVE}async retry(_,W){return super.retry(_,W,{beforeRequest:async()=>{return this.rateLimiter.getSendToken()},afterRequest:(K)=>{this.rateLimiter.updateClientSendingRate(K)}})}}var p="AWS_MAX_ATTEMPTS",s="max_attempts",mW={environmentVariableSelector:(_)=>{let W=_[p];if(!W)return;let K=parseInt(W);if(Number.isNaN(K))throw Error(`Environment variable ${p} mast be a number, got "${W}"`);return K},configFileSelector:(_)=>{let W=_[s];if(!W)return;let K=parseInt(W);if(Number.isNaN(K))throw Error(`Shared config file entry ${s} mast be a number, got "${W}"`);return K},default:V},gW=(_,W)=>{let{retryStrategy:K,retryMode:G}=_,{defaultMaxAttempts:Y=V,defaultBaseDelay:X=O.delay()}=W??{},$=g.normalizeProvider(_.maxAttempts??Y),Z=K?Promise.resolve(K):void 0,L=async()=>{let b=await $();if(await g.normalizeProvider(G)()===iW.RETRY_MODES.ADAPTIVE)return new h_($,{maxAttempts:b,baseDelay:X});return new D({maxAttempts:b,baseDelay:X})};return Object.assign(_,{maxAttempts:$,retryStrategy:()=>Z??=L()})},S_="AWS_RETRY_MODE",P_="retry_mode",uW={environmentVariableSelector:(_)=>_[S_],configFileSelector:(_)=>_[P_],default:C_},R_=()=>(_)=>async(W)=>{let{request:K}=W;if(U.HttpRequest.isInstance(K))delete K.headers[x],delete K.headers[f];return _(W)},A_={name:"omitRetryHeadersMiddleware",tags:["RETRY","HEADERS","OMIT_RETRY_HEADERS"],relation:"before",toMiddleware:"awsAuthMiddleware",override:!0},pW=(_)=>({applyToStack:(W)=>{W.addRelativeTo(R_(),A_)}}),sW=N_(L_),aW=lW(L_);iW.AdaptiveRetryStrategy=h_;iW.CONFIG_MAX_ATTEMPTS=s;iW.CONFIG_RETRY_MODE=P_;iW.ConfiguredRetryStrategy=D_;iW.DEFAULT_MAX_ATTEMPTS=V;iW.DEFAULT_RETRY_DELAY_BASE=B_;iW.DEFAULT_RETRY_MODE=C_;iW.DefaultRateLimiter=T;iW.DeprecatedAdaptiveRetryStrategy=T_;iW.DeprecatedStandardRetryStrategy=t;iW.ENV_MAX_ATTEMPTS=p;iW.ENV_RETRY_MODE=S_;iW.INITIAL_RETRY_TOKENS=A;iW.INVOCATION_ID_HEADER=x;iW.MAXIMUM_RETRY_DELAY=v;iW.NODE_MAX_ATTEMPT_CONFIG_OPTIONS=mW;iW.NODE_RETRY_MODE_CONFIG_OPTIONS=uW;iW.NO_RETRY_INCREMENT=o;iW.REQUEST_HEADER=f;iW.RETRY_COST=z_;iW.Retry=O;iW.StandardRetryStrategy=D;iW.THROTTLING_RETRY_DELAY_BASE=H_;iW.TIMEOUT_RETRY_COST=F_;iW.defaultDelayDecider=q_;iW.defaultRetryDecider=I_;iW.getOmitRetryHeadersPlugin=pW;iW.getRetryAfterHint=kW;iW.getRetryPlugin=aW;iW.isBrowserNetworkError=J_;iW.isClockSkewCorrectedError=j_;iW.isClockSkewError=Q_;iW.isNodeJsHttp2TransientError=w_;iW.isRetryableByTrait=n;iW.isServerError=O_;iW.isThrottlingError=q;iW.isTransientError=I;iW.omitRetryHeadersMiddleware=R_;iW.omitRetryHeadersMiddlewareOptions=A_;iW.resolveRetryConfig=gW;iW.retryMiddleware=sW;iW.retryMiddlewareOptions=U_});var i_=k((_G)=>{var lK=yK(),y=a(),v_=fK(),x_=b_(),cK=(_,W)=>{if(!W||W.length===0)return _;let K=[];for(let G of W)for(let Y of _)if(Y.schemeId.split("#")[1]===G)K.push(Y);for(let G of _)if(!K.find(({schemeId:Y})=>Y===G.schemeId))K.push(G);return K};function dK(_){let W=new Map;for(let K of _)W.set(K.schemeId,K);return W}var r=(_,W)=>(K,G)=>async(Y)=>{let X=_.httpAuthSchemeProvider(await W.httpAuthSchemeParametersProvider(_,G,Y.input)),$=_.authSchemePreference?await _.authSchemePreference():[],Z=cK(X,$),L=dK(_.httpAuthSchemes),b=x_.getSmithyContext(G),j=[];for(let Q of Z){let J=L.get(Q.schemeId);if(!J){j.push(`HttpAuthScheme \`${Q.schemeId}\` was not enabled for this service.`);continue}let w=J.identityProvider(await W.identityProviderConfigProvider(_));if(!w){j.push(`HttpAuthScheme \`${Q.schemeId}\` did not have an IdentityProvider configured.`);continue}let{identityProperties:F={},signingProperties:h={}}=Q.propertiesExtractor?.(_,G)||{};Q.identityProperties=Object.assign(Q.identityProperties||{},F),Q.signingProperties=Object.assign(Q.signingProperties||{},h),b.selectedHttpAuthScheme={httpAuthOption:Q,identity:await w(Q.identityProperties),signer:J.signer};break}if(!b.selectedHttpAuthScheme)throw Error(j.join(`
3
3
  `));return K(Y)},f_={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"},mK=(_,{httpAuthSchemeParametersProvider:W,identityProviderConfigProvider:K})=>({applyToStack:(G)=>{G.addRelativeTo(r(_,{httpAuthSchemeParametersProvider:W,identityProviderConfigProvider:K}),f_)}}),y_={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:"serializerMiddleware"},gK=(_,{httpAuthSchemeParametersProvider:W,identityProviderConfigProvider:K})=>({applyToStack:(G)=>{G.addRelativeTo(r(_,{httpAuthSchemeParametersProvider:W,identityProviderConfigProvider:K}),y_)}}),uK=(_)=>(W)=>{throw W},pK=(_,W)=>{},l_=(_)=>(W,K)=>async(G)=>{if(!y.HttpRequest.isInstance(G.request))return W(G);let X=x_.getSmithyContext(K).selectedHttpAuthScheme;if(!X)throw Error("No HttpAuthScheme was selected: unable to sign request");let{httpAuthOption:{signingProperties:$={}},identity:Z,signer:L}=X,b=await W({...G,request:await L.sign(G.request,Z,$)}).catch((L.errorHandler||uK)($));return(L.successHandler||pK)(b.response,$),b},c_={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:"retryMiddleware"},sK=(_)=>({applyToStack:(W)=>{W.addRelativeTo(l_(),c_)}}),aK=(_)=>{if(typeof _==="function")return _;let W=Promise.resolve(_);return()=>W},iK=async(_,W,K,G=(X)=>X,...Y)=>{let X=new _(K);return X=G(X)??X,await W.send(X,...Y)};function nK(_,W,K,G,Y){return async function*($,Z,...L){let b=Z,j=$.startingToken??b[K],Q=!0,J;while(Q){if(b[K]=j,Y)b[Y]=b[Y]??$.pageSize;if($.client instanceof _)J=await iK(W,$.client,Z,$.withCommand,...L);else throw Error(`Invalid client, expected instance of ${_.name}`);yield J;let w=j;j=oK(J,G),Q=!!(j&&(!$.stopOnSameToken||j!==w))}return}}var oK=(_,W)=>{let K=_,G=W.split(".");for(let Y of G){if(!K||typeof K!=="object")return;K=K[Y]}return K};function tK(_,W,K){if(!_.__smithy_context)_.__smithy_context={features:{}};else if(!_.__smithy_context.features)_.__smithy_context.features={};_.__smithy_context.features[W]=K}class d_{authSchemes=new Map;constructor(_){for(let W in _){let K=_[W];if(K!==void 0)this.authSchemes.set(W,K)}}getIdentityProvider(_){return this.authSchemes.get(_)}}class m_{async sign(_,W,K){if(!K)throw Error("request could not be signed with `apiKey` since the `name` and `in` signer properties are missing");if(!K.name)throw Error("request could not be signed with `apiKey` since the `name` signer property is missing");if(!K.in)throw Error("request could not be signed with `apiKey` since the `in` signer property is missing");if(!W.apiKey)throw Error("request could not be signed with `apiKey` since the `apiKey` is not defined");let G=y.HttpRequest.clone(_);if(K.in===v_.HttpApiKeyAuthLocation.QUERY)G.query[K.name]=W.apiKey;else if(K.in===v_.HttpApiKeyAuthLocation.HEADER)G.headers[K.name]=K.scheme?`${K.scheme} ${W.apiKey}`:W.apiKey;else throw Error("request can only be signed with `apiKey` locations `query` or `header`, but found: `"+K.in+"`");return G}}class g_{async sign(_,W,K){let G=y.HttpRequest.clone(_);if(!W.token)throw Error("request could not be signed with `token` since the `token` is not defined");return G.headers.Authorization=`Bearer ${W.token}`,G}}class u_{async sign(_,W,K){return _}}var p_=(_)=>function(K){return a_(K)&&K.expiration.getTime()-Date.now()<_},s_=300000,rK=p_(s_),a_=(_)=>_.expiration!==void 0,eK=(_,W,K)=>{if(_===void 0)return;let G=typeof _!=="function"?async()=>Promise.resolve(_):_,Y,X,$,Z=!1,L=async(b)=>{if(!X)X=G(b);try{Y=await X,$=!0,Z=!1}finally{X=void 0}return Y};if(W===void 0)return async(b)=>{if(!$||b?.forceRefresh)Y=await L(b);return Y};return async(b)=>{if(!$||b?.forceRefresh)Y=await L(b);if(Z)return Y;if(!K(Y))return Z=!0,Y;if(W(Y))return await L(b),Y;return Y}};_G.getSmithyContext=lK.getSmithyContext;_G.requestBuilder=y.requestBuilder;_G.DefaultIdentityProviderConfig=d_;_G.EXPIRATION_MS=s_;_G.HttpApiKeyAuthSigner=m_;_G.HttpBearerAuthSigner=g_;_G.NoAuthSigner=u_;_G.createIsIdentityExpiredFunction=p_;_G.createPaginator=nK;_G.doesIdentityRequireRefresh=a_;_G.getHttpAuthSchemeEndpointRuleSetPlugin=mK;_G.getHttpAuthSchemePlugin=gK;_G.getHttpSigningPlugin=sK;_G.httpAuthSchemeEndpointRuleSetMiddlewareOptions=f_;_G.httpAuthSchemeMiddleware=r;_G.httpAuthSchemeMiddlewareOptions=y_;_G.httpSigningMiddleware=l_;_G.httpSigningMiddlewareOptions=c_;_G.isIdentityExpired=rK;_G.memoizeIdentityProvider=eK;_G.normalizeProvider=aK;_G.setFeature=tK});var o_=k((EG)=>{var S={REQUEST_ID:Symbol.for("_AWS_LAMBDA_REQUEST_ID"),X_RAY_TRACE_ID:Symbol.for("_AWS_LAMBDA_X_RAY_TRACE_ID"),TENANT_ID:Symbol.for("_AWS_LAMBDA_TENANT_ID")},e=["true","1"].includes(process.env?.AWS_LAMBDA_NODEJS_NO_GLOBAL_AWSLAMBDA??"");if(!e)globalThis.awslambda=globalThis.awslambda||{};class l{static PROTECTED_KEYS=S;isProtectedKey(_){return Object.values(S).includes(_)}getRequestId(){return this.get(S.REQUEST_ID)??"-"}getXRayTraceId(){return this.get(S.X_RAY_TRACE_ID)}getTenantId(){return this.get(S.TENANT_ID)}}class n_ extends l{currentContext;getContext(){return this.currentContext}hasContext(){return this.currentContext!==void 0}get(_){return this.currentContext?.[_]}set(_,W){if(this.isProtectedKey(_))throw Error(`Cannot modify protected Lambda context field: ${String(_)}`);this.currentContext=this.currentContext||{},this.currentContext[_]=W}run(_,W){return this.currentContext=_,W()}}class W_ extends l{als;static async create(){let _=new W_,W=await import("async_hooks");return _.als=new W.AsyncLocalStorage,_}getContext(){return this.als.getStore()}hasContext(){return this.als.getStore()!==void 0}get(_){return this.als.getStore()?.[_]}set(_,W){if(this.isProtectedKey(_))throw Error(`Cannot modify protected Lambda context field: ${String(_)}`);let K=this.als.getStore();if(!K)throw Error("No context available");K[_]=W}run(_,W){return this.als.run(_,W)}}EG.InvokeStore=void 0;(function(_){let W=null;async function K(G){if(!W)W=(async()=>{let X=G===!0||"AWS_LAMBDA_MAX_CONCURRENCY"in process.env?await W_.create():new n_;if(!e&&globalThis.awslambda?.InvokeStore)return globalThis.awslambda.InvokeStore;else if(!e&&globalThis.awslambda)return globalThis.awslambda.InvokeStore=X,X;else return X})();return W}_.getInstanceAsync=K,_._testing=process.env.AWS_LAMBDA_BENCHMARK_MODE==="1"?{reset:()=>{if(W=null,globalThis.awslambda?.InvokeStore)delete globalThis.awslambda.InvokeStore;globalThis.awslambda={InvokeStore:void 0}}}:void 0})(EG.InvokeStore||(EG.InvokeStore={}));EG.InvokeStoreBase=l});var OX=k((H1)=>{var __dirname="/home/runner/workspace/products/qitqode/qode/node_modules/.bun/@aws-sdk+core@3.974.17/node_modules/@aws-sdk/core/dist-cjs/submodules/client",Y_=k_(),m=a(),qG=o_(),IG=i_(),t_=N("os"),P=N("process"),z=hG(),r_=N("fs/promises"),E=N("path"),C=DG(),d={warningEmitted:!1},TG=(_)=>{if(_&&!d.warningEmitted){if(process.env.AWS_SDK_JS_NODE_VERSION_SUPPORT_WARNING_DISABLED==="true"){d.warningEmitted=!0;return}let W=parseInt(_.substring(1,_.indexOf("."))),K=22;if(W<K)d.warningEmitted=!0,process.emitWarning(`NodeVersionSupportWarning: The AWS SDK for JavaScript (v3)
4
4
  versions published after the first week of January 2027
5
5
  will require node >=${K}. You are running node ${_}.
@@ -7,5 +7,5 @@ will require node >=${K}. You are running node ${_}.
7
7
  To continue receiving updates to AWS services, bug fixes,
8
8
  and security updates please upgrade to node >=${K}.
9
9
 
10
- More information can be found at: https://a.co/c895JFp`)}},SG=()=>(_,W)=>async(K)=>{return W.__retryLongPoll=!0,_(K)},PG={name:"longPollMiddleware",tags:["RETRY"],step:"initialize",override:!0},RG=(_)=>({applyToStack:(W)=>{W.add(SG(),PG)}});function AG(_,W,K){if(!_.$source)_.$source={};return _.$source[W]=K,_}Y_.Retry.v2026||=typeof process==="object"&&process.env?.AWS_NEW_RETRIES_2026==="true";function H(_,W,K){if(!_.__aws_sdk_context)_.__aws_sdk_context={features:{}};else if(!_.__aws_sdk_context.features)_.__aws_sdk_context.features={};_.__aws_sdk_context.features[W]=K}function kG(_,W,K){if(!_.$source)_.$source={};return _.$source[W]=K,_}function vG(_){return _}var GW=(_)=>(W)=>async(K)=>{if(!m.HttpRequest.isInstance(K.request))return W(K);let{request:G}=K,{handlerProtocol:Y=""}=_.requestHandler.metadata||{};if(Y.indexOf("h2")>=0&&!G.headers[":authority"])delete G.headers.host,G.headers[":authority"]=G.hostname+(G.port?":"+G.port:"");else if(!G.headers.host){let X=G.hostname;if(G.port!=null)X+=`:${G.port}`;G.headers.host=X}return W(K)},XW={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},xG=(_)=>({applyToStack:(W)=>{W.add(GW(_),XW)}}),YW=()=>(_,W)=>async(K)=>{try{let G=await _(K),{clientName:Y,commandName:X,logger:$,dynamoDbDocumentClientOptions:Z={}}=W,{overrideInputFilterSensitiveLog:L,overrideOutputFilterSensitiveLog:b}=Z,j=L??W.inputFilterSensitiveLog,Q=b??W.outputFilterSensitiveLog,{$metadata:J,...w}=G.output;return $?.info?.({clientName:Y,commandName:X,input:j(K.input),output:Q(w),metadata:J}),G}catch(G){let{clientName:Y,commandName:X,logger:$,dynamoDbDocumentClientOptions:Z={}}=W,{overrideInputFilterSensitiveLog:L}=Z,b=L??W.inputFilterSensitiveLog;throw $?.error?.({clientName:Y,commandName:X,input:b(K.input),error:G,metadata:G.$metadata}),G}},$W={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},fG=(_)=>({applyToStack:(W)=>{W.add(YW(),$W)}}),ZW={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},K_="X-Amzn-Trace-Id",yG="AWS_LAMBDA_FUNCTION_NAME",lG="_X_AMZN_TRACE_ID",bW=()=>(_)=>async(W)=>{let{request:K}=W;if(!m.HttpRequest.isInstance(K))return _(W);let G=Object.keys(K.headers??{}).find((j)=>j.toLowerCase()===K_.toLowerCase())??K_;if(K.headers.hasOwnProperty(G))return _(W);let Y=process.env[yG],X=process.env[lG],L=(await qG.InvokeStore.getInstanceAsync())?.getXRayTraceId()??X,b=(j)=>typeof j==="string"&&j.length>0;if(b(Y)&&b(L))K.headers[K_]=L;return _({...W,request:K})},cG=(_)=>({applyToStack:(W)=>{W.add(bW(),ZW)}}),$_=void 0;function dG(_){if(_===void 0)return!0;return typeof _==="string"&&_.length<=50}function mG(_){let W=IG.normalizeProvider(_.userAgentAppId??$_),{customUserAgent:K}=_;return Object.assign(_,{customUserAgent:typeof K==="string"?[[K]]:K,userAgentAppId:async()=>{let G=await W();if(!dG(G)){let Y=_.logger?.constructor?.name==="NoOpLogger"||!_.logger?console:_.logger;if(typeof G!=="string")Y?.warn("userAgentAppId must be a string or undefined.");else if(G.length>50)Y?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.")}return G}})}var LW={partitions:[{id:"aws",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-east-1",name:"aws",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$",regions:{"af-south-1":{description:"Africa (Cape Town)"},"ap-east-1":{description:"Asia Pacific (Hong Kong)"},"ap-east-2":{description:"Asia Pacific (Taipei)"},"ap-northeast-1":{description:"Asia Pacific (Tokyo)"},"ap-northeast-2":{description:"Asia Pacific (Seoul)"},"ap-northeast-3":{description:"Asia Pacific (Osaka)"},"ap-south-1":{description:"Asia Pacific (Mumbai)"},"ap-south-2":{description:"Asia Pacific (Hyderabad)"},"ap-southeast-1":{description:"Asia Pacific (Singapore)"},"ap-southeast-2":{description:"Asia Pacific (Sydney)"},"ap-southeast-3":{description:"Asia Pacific (Jakarta)"},"ap-southeast-4":{description:"Asia Pacific (Melbourne)"},"ap-southeast-5":{description:"Asia Pacific (Malaysia)"},"ap-southeast-6":{description:"Asia Pacific (New Zealand)"},"ap-southeast-7":{description:"Asia Pacific (Thailand)"},"aws-global":{description:"aws global region"},"ca-central-1":{description:"Canada (Central)"},"ca-west-1":{description:"Canada West (Calgary)"},"eu-central-1":{description:"Europe (Frankfurt)"},"eu-central-2":{description:"Europe (Zurich)"},"eu-north-1":{description:"Europe (Stockholm)"},"eu-south-1":{description:"Europe (Milan)"},"eu-south-2":{description:"Europe (Spain)"},"eu-west-1":{description:"Europe (Ireland)"},"eu-west-2":{description:"Europe (London)"},"eu-west-3":{description:"Europe (Paris)"},"il-central-1":{description:"Israel (Tel Aviv)"},"me-central-1":{description:"Middle East (UAE)"},"me-south-1":{description:"Middle East (Bahrain)"},"mx-central-1":{description:"Mexico (Central)"},"sa-east-1":{description:"South America (Sao Paulo)"},"us-east-1":{description:"US East (N. Virginia)"},"us-east-2":{description:"US East (Ohio)"},"us-west-1":{description:"US West (N. California)"},"us-west-2":{description:"US West (Oregon)"}}},{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn",dualStackDnsSuffix:"api.amazonwebservices.com.cn",implicitGlobalRegion:"cn-northwest-1",name:"aws-cn",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:{"aws-cn-global":{description:"aws-cn global region"},"cn-north-1":{description:"China (Beijing)"},"cn-northwest-1":{description:"China (Ningxia)"}}},{id:"aws-eusc",outputs:{dnsSuffix:"amazonaws.eu",dualStackDnsSuffix:"api.amazonwebservices.eu",implicitGlobalRegion:"eusc-de-east-1",name:"aws-eusc",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eusc\\-(de)\\-\\w+\\-\\d+$",regions:{"eusc-de-east-1":{description:"AWS European Sovereign Cloud (Germany)"}}},{id:"aws-iso",outputs:{dnsSuffix:"c2s.ic.gov",dualStackDnsSuffix:"api.aws.ic.gov",implicitGlobalRegion:"us-iso-east-1",name:"aws-iso",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-iso\\-\\w+\\-\\d+$",regions:{"aws-iso-global":{description:"aws-iso global region"},"us-iso-east-1":{description:"US ISO East"},"us-iso-west-1":{description:"US ISO WEST"}}},{id:"aws-iso-b",outputs:{dnsSuffix:"sc2s.sgov.gov",dualStackDnsSuffix:"api.aws.scloud",implicitGlobalRegion:"us-isob-east-1",name:"aws-iso-b",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isob\\-\\w+\\-\\d+$",regions:{"aws-iso-b-global":{description:"aws-iso-b global region"},"us-isob-east-1":{description:"US ISOB East (Ohio)"},"us-isob-west-1":{description:"US ISOB West"}}},{id:"aws-iso-e",outputs:{dnsSuffix:"cloud.adc-e.uk",dualStackDnsSuffix:"api.cloud-aws.adc-e.uk",implicitGlobalRegion:"eu-isoe-west-1",name:"aws-iso-e",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eu\\-isoe\\-\\w+\\-\\d+$",regions:{"aws-iso-e-global":{description:"aws-iso-e global region"},"eu-isoe-west-1":{description:"EU ISOE West"}}},{id:"aws-iso-f",outputs:{dnsSuffix:"csp.hci.ic.gov",dualStackDnsSuffix:"api.aws.hci.ic.gov",implicitGlobalRegion:"us-isof-south-1",name:"aws-iso-f",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isof\\-\\w+\\-\\d+$",regions:{"aws-iso-f-global":{description:"aws-iso-f global region"},"us-isof-east-1":{description:"US ISOF EAST"},"us-isof-south-1":{description:"US ISOF SOUTH"}}},{id:"aws-us-gov",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-gov-west-1",name:"aws-us-gov",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-gov\\-\\w+\\-\\d+$",regions:{"aws-us-gov-global":{description:"aws-us-gov global region"},"us-gov-east-1":{description:"AWS GovCloud (US-East)"},"us-gov-west-1":{description:"AWS GovCloud (US-West)"}}}],version:"1.1"},QW=LW,jW="",JW=(_)=>{let{partitions:W}=QW;for(let G of W){let{regions:Y,outputs:X}=G;for(let[$,Z]of Object.entries(Y))if($===_)return{...X,...Z}}for(let G of W){let{regionRegex:Y,outputs:X}=G;if(new RegExp(Y).test(_))return{...X}}let K=W.find((G)=>G.id==="aws");if(!K)throw Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...K.outputs}},OW=(_,W="")=>{QW=_,jW=W},gG=()=>{OW(LW,"")},wW=()=>jW,uG=/\d{12}\.ddb/;async function pG(_,W,K){if(K.request?.headers?.["smithy-protocol"]==="rpc-v2-cbor")H(_,"PROTOCOL_RPC_V2_CBOR","M");if(typeof W.retryStrategy==="function"){let X=await W.retryStrategy();if(typeof X.mode==="string")switch(X.mode){case Y_.RETRY_MODES.ADAPTIVE:H(_,"RETRY_MODE_ADAPTIVE","F");break;case Y_.RETRY_MODES.STANDARD:H(_,"RETRY_MODE_STANDARD","E");break}}if(typeof W.accountIdEndpointMode==="function"){let X=_.endpointV2;if(String(X?.url?.hostname).match(uG))H(_,"ACCOUNT_ID_ENDPOINT","O");switch(await W.accountIdEndpointMode?.()){case"disabled":H(_,"ACCOUNT_ID_MODE_DISABLED","Q");break;case"preferred":H(_,"ACCOUNT_ID_MODE_PREFERRED","P");break;case"required":H(_,"ACCOUNT_ID_MODE_REQUIRED","R");break}}let Y=_.__smithy_context?.selectedHttpAuthScheme?.identity;if(Y?.$source){let X=Y;if(X.accountId)H(_,"RESOLVED_ACCOUNT_ID","T");for(let[$,Z]of Object.entries(X.$source??{}))H(_,$,Z)}}var e_="user-agent",G_="x-amz-user-agent",_W=" ",X_="/",sG=/[^!$%&'*+\-.^_`|~\w]/g,aG=/[^!$%&'*+\-.^_`|~\w#]/g,WW="-",iG=1024;function nG(_){let W="";for(let K in _){let G=_[K];if(W.length+G.length+1<=iG){if(W.length)W+=","+G;else W+=G;continue}break}return W}var BW=(_)=>(W,K)=>async(G)=>{let{request:Y}=G;if(!m.HttpRequest.isInstance(Y))return W(G);let{headers:X}=Y,$=K?.userAgent?.map(c)||[],Z=(await _.defaultUserAgentProvider()).map(c);await pG(K,_,G);let L=K;Z.push(`m/${nG(Object.assign({},K.__smithy_context?.features,L.__aws_sdk_context?.features))}`);let b=_?.customUserAgent?.map(c)||[],j=await _.userAgentAppId();if(j)Z.push(c(["app",`${j}`]));let Q=wW(),J=(Q?[Q]:[]).concat([...Z,...$,...b]).join(_W),w=[...Z.filter((F)=>F.startsWith("aws-sdk-")),...b].join(_W);if(_.runtime!=="browser"){if(w)X[G_]=X[G_]?`${X[e_]} ${w}`:w;X[e_]=J}else X[G_]=J;return W({...G,request:Y})},c=(_)=>{let W=_[0].split(X_).map(($)=>$.replace(sG,WW)).join(X_),K=_[1]?.replace(aG,WW),G=W.indexOf(X_),Y=W.substring(0,G),X=W.substring(G+1);if(Y==="api")X=X.toLowerCase();return[Y,X,K].filter(($)=>$&&$.length>0).reduce(($,Z,L)=>{switch(L){case 0:return Z;case 1:return`${$}/${Z}`;default:return`${$}#${Z}`}},"")},HW={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},oG=(_)=>({applyToStack:(W)=>{W.add(BW(_),HW)}}),tG=()=>{let _=["deno","bun","llrt"];for(let W of _)if(P.versions[W])return[`md/${W}`,P.versions[W]];return["md/nodejs",P.versions.node]},rG=(_)=>{let W=process.cwd();if(!_)return[W];let K=E.normalize(_),G=K.split(E.sep),Y=G.indexOf("node_modules"),X=Y!==-1?G.slice(0,Y).join(E.sep):K;if(W===X)return[W];return[X,W]},eG=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$/,zW=(_="")=>{let W=_.match(eG);if(!W)return;let[K,G,Y,X]=[W[1],W[2],W[3],W[4]];return X?`${K}.${G}.${Y}-${X}`:`${K}.${G}.${Y}`},_1=["^","~",">=","<=",">","<"],W1=["latest","beta","dev","rc","insiders","next"],K1=(_="")=>{if(W1.includes(_))return _;let W=_1.find((G)=>_.startsWith(G))??"",K=zW(_.slice(W.length));if(!K)return;return`${W}${K}`},B,G1=E.join("node_modules","typescript","package.json"),X1=async()=>{if(B===null)return;else if(typeof B==="string")return["md/tsc",B];let _=!1;try{_=z.booleanSelector(process.env,"AWS_SDK_JS_TYPESCRIPT_DETECTION_DISABLED",z.SelectorType.ENV)||!1}catch{}if(_){B=null;return}let K=rG(typeof __dirname<"u"?__dirname:void 0),G;for(let $ of K)try{let Z=E.join($,"package.json"),L=await r_.readFile(Z,"utf-8"),{dependencies:b,devDependencies:j}=JSON.parse(L),Q=j?.typescript??b?.typescript;if(typeof Q!=="string")continue;G=Q;break}catch{}if(!G){B=null;return}let Y;for(let $ of K)try{let Z=E.join($,G1),L=await r_.readFile(Z,"utf-8"),{version:b}=JSON.parse(L),j=zW(b);if(typeof j!=="string")continue;Y=j;break}catch{}if(Y)return B=Y,["md/tsc",B];let X=K1(G);if(typeof X!=="string"){B=null;return}return B=`dev_${X}`,["md/tsc",B]},FW={isCrtAvailable:!1},Y1=()=>{if(FW.isCrtAvailable)return["md/crt-avail"];return null},MW=({serviceId:_,clientVersion:W})=>{let K=tG();return async(G)=>{let Y=[["aws-sdk-js",W],["ua","2.1"],[`os/${t_.platform()}`,t_.release()],["lang/js"],K],X=await X1();if(X)Y.push(X);let $=Y1();if($)Y.push($);if(_)Y.push([`api/${_}`,W]);if(P.env.AWS_EXECUTION_ENV)Y.push([`exec-env/${P.env.AWS_EXECUTION_ENV}`]);let Z=await G?.userAgentAppId?.();return Z?[...Y,[`app/${Z}`]]:[...Y]}},$1=MW,VW="AWS_SDK_UA_APP_ID",NW="sdk_ua_app_id",Z1="sdk-ua-app-id",b1={environmentVariableSelector:(_)=>_[VW],configFileSelector:(_)=>_[NW]??_[Z1],default:$_},L1=({serviceId:_,clientVersion:W})=>async(K)=>{let G=await import("./chunk-bc2krtaf.js"),Y=G.parse??G.default.parse??(()=>""),X=typeof window<"u"&&window?.navigator?.userAgent?Y(window.navigator.userAgent):void 0,$=[["aws-sdk-js",W],["ua","2.1"],[`os/${X?.os?.name||"other"}`,X?.os?.version],["lang/js"],["md/browser",`${X?.browser?.name??"unknown"}_${X?.browser?.version??"unknown"}`]];if(_)$.push([`api/${_}`,W]);let Z=await K?.userAgentAppId?.();if(Z)$.push([`app/${Z}`]);return $},Q1={os(_){if(/iPhone|iPad|iPod/.test(_))return"iOS";if(/Macintosh|Mac OS X/.test(_))return"macOS";if(/Windows NT/.test(_))return"Windows";if(/Android/.test(_))return"Android";if(/Linux/.test(_))return"Linux";return},browser(_){if(/EdgiOS|EdgA|Edg\//.test(_))return"Microsoft Edge";if(/Firefox\//.test(_))return"Firefox";if(/Chrome\//.test(_))return"Chrome";if(/Safari\//.test(_))return"Safari";return}},Z_=(_,W=!1)=>{if(W){for(let K of _.split("."))if(!Z_(K))return!1;return!0}if(!C.isValidHostLabel(_))return!1;if(_.length<3||_.length>63)return!1;if(_!==_.toLowerCase())return!1;if(C.isIpAddress(_))return!1;return!0},KW=":",j1="/",UW=(_)=>{let W=_.split(KW);if(W.length<6)return null;let[K,G,Y,X,$,...Z]=W;if(K!=="arn"||G===""||Y===""||Z.join(KW)==="")return null;let L=Z.map((b)=>b.split(j1)).flat();return{partition:G,service:Y,region:X,accountId:$,resourceId:L}},EW={isVirtualHostableS3Bucket:Z_,parseArn:UW,partition:JW};C.customEndpointFunctions.aws=EW;var J1=(_)=>{if(typeof _.endpointProvider!=="function")throw Error("@aws-sdk/util-endpoint - endpointProvider and endpoint missing in config for this client.");let{endpoint:W}=_;if(W===void 0)_.endpoint=async()=>{return CW(_.endpointProvider({Region:typeof _.region==="function"?await _.region():_.region,UseDualStack:typeof _.useDualstackEndpoint==="function"?await _.useDualstackEndpoint():_.useDualstackEndpoint,UseFIPS:typeof _.useFipsEndpoint==="function"?await _.useFipsEndpoint():_.useFipsEndpoint,Endpoint:void 0},{logger:_.logger}))};return _},CW=(_)=>m.parseUrl(_.url);function O1(_={}){return z.loadConfig({...z.NODE_REGION_CONFIG_OPTIONS,async default(){if(!hW.silence)console.warn("@aws-sdk - WARN - default STS region of us-east-1 used. See @aws-sdk/credential-providers README and set a region explicitly.");return"us-east-1"}},{...z.NODE_REGION_CONFIG_FILE_OPTIONS,..._})}var hW={silence:!1},w1=(_)=>{return{setRegion(W){_.region=W},region(){return _.region}}},B1=(_)=>{return{region:_.region()}};H1.NODE_REGION_CONFIG_FILE_OPTIONS=z.NODE_REGION_CONFIG_FILE_OPTIONS;H1.NODE_REGION_CONFIG_OPTIONS=z.NODE_REGION_CONFIG_OPTIONS;H1.REGION_ENV_NAME=z.REGION_ENV_NAME;H1.REGION_INI_NAME=z.REGION_INI_NAME;H1.resolveRegionConfig=z.resolveRegionConfig;H1.EndpointError=C.EndpointError;H1.isIpAddress=C.isIpAddress;H1.resolveEndpoint=C.resolveEndpoint;H1.DEFAULT_UA_APP_ID=$_;H1.NODE_APP_ID_CONFIG_OPTIONS=b1;H1.UA_APP_ID_ENV_NAME=VW;H1.UA_APP_ID_INI_NAME=NW;H1.awsEndpointFunctions=EW;H1.createDefaultUserAgentProvider=MW;H1.createUserAgentStringParsingProvider=L1;H1.crtAvailability=FW;H1.defaultUserAgent=$1;H1.emitWarningIfUnsupportedVersion=TG;H1.fallback=Q1;H1.getAwsRegionExtensionConfiguration=w1;H1.getHostHeaderPlugin=xG;H1.getLoggerPlugin=fG;H1.getLongPollPlugin=RG;H1.getRecursionDetectionPlugin=cG;H1.getUserAgentMiddlewareOptions=HW;H1.getUserAgentPlugin=oG;H1.getUserAgentPrefix=wW;H1.hostHeaderMiddleware=GW;H1.hostHeaderMiddlewareOptions=XW;H1.isVirtualHostableS3Bucket=Z_;H1.loggerMiddleware=YW;H1.loggerMiddlewareOptions=$W;H1.parseArn=UW;H1.partition=JW;H1.recursionDetectionMiddleware=bW;H1.recursionDetectionMiddlewareOptions=ZW;H1.resolveAwsRegionExtensionConfiguration=B1;H1.resolveDefaultAwsRegionalEndpointsConfig=J1;H1.resolveHostHeaderConfig=vG;H1.resolveUserAgentConfig=mG;H1.setCredentialFeature=AG;H1.setFeature=H;H1.setPartitionInfo=OW;H1.setTokenFeature=kG;H1.state=d;H1.stsRegionDefaultResolver=O1;H1.stsRegionWarning=hW;H1.toEndpointV1=CW;H1.useDefaultPartitionInfo=gG;H1.userAgentMiddleware=BW});
11
- export{k_ as Le,i_ as Me,OX as Ne};
10
+ More information can be found at: https://a.co/c895JFp`)}},SG=()=>(_,W)=>async(K)=>{return W.__retryLongPoll=!0,_(K)},PG={name:"longPollMiddleware",tags:["RETRY"],step:"initialize",override:!0},RG=(_)=>({applyToStack:(W)=>{W.add(SG(),PG)}});function AG(_,W,K){if(!_.$source)_.$source={};return _.$source[W]=K,_}Y_.Retry.v2026||=typeof process==="object"&&process.env?.AWS_NEW_RETRIES_2026==="true";function H(_,W,K){if(!_.__aws_sdk_context)_.__aws_sdk_context={features:{}};else if(!_.__aws_sdk_context.features)_.__aws_sdk_context.features={};_.__aws_sdk_context.features[W]=K}function kG(_,W,K){if(!_.$source)_.$source={};return _.$source[W]=K,_}function vG(_){return _}var GW=(_)=>(W)=>async(K)=>{if(!m.HttpRequest.isInstance(K.request))return W(K);let{request:G}=K,{handlerProtocol:Y=""}=_.requestHandler.metadata||{};if(Y.indexOf("h2")>=0&&!G.headers[":authority"])delete G.headers.host,G.headers[":authority"]=G.hostname+(G.port?":"+G.port:"");else if(!G.headers.host){let X=G.hostname;if(G.port!=null)X+=`:${G.port}`;G.headers.host=X}return W(K)},XW={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},xG=(_)=>({applyToStack:(W)=>{W.add(GW(_),XW)}}),YW=()=>(_,W)=>async(K)=>{try{let G=await _(K),{clientName:Y,commandName:X,logger:$,dynamoDbDocumentClientOptions:Z={}}=W,{overrideInputFilterSensitiveLog:L,overrideOutputFilterSensitiveLog:b}=Z,j=L??W.inputFilterSensitiveLog,Q=b??W.outputFilterSensitiveLog,{$metadata:J,...w}=G.output;return $?.info?.({clientName:Y,commandName:X,input:j(K.input),output:Q(w),metadata:J}),G}catch(G){let{clientName:Y,commandName:X,logger:$,dynamoDbDocumentClientOptions:Z={}}=W,{overrideInputFilterSensitiveLog:L}=Z,b=L??W.inputFilterSensitiveLog;throw $?.error?.({clientName:Y,commandName:X,input:b(K.input),error:G,metadata:G.$metadata}),G}},$W={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},fG=(_)=>({applyToStack:(W)=>{W.add(YW(),$W)}}),ZW={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},K_="X-Amzn-Trace-Id",yG="AWS_LAMBDA_FUNCTION_NAME",lG="_X_AMZN_TRACE_ID",bW=()=>(_)=>async(W)=>{let{request:K}=W;if(!m.HttpRequest.isInstance(K))return _(W);let G=Object.keys(K.headers??{}).find((j)=>j.toLowerCase()===K_.toLowerCase())??K_;if(K.headers.hasOwnProperty(G))return _(W);let Y=process.env[yG],X=process.env[lG],L=(await qG.InvokeStore.getInstanceAsync())?.getXRayTraceId()??X,b=(j)=>typeof j==="string"&&j.length>0;if(b(Y)&&b(L))K.headers[K_]=L;return _({...W,request:K})},cG=(_)=>({applyToStack:(W)=>{W.add(bW(),ZW)}}),$_=void 0;function dG(_){if(_===void 0)return!0;return typeof _==="string"&&_.length<=50}function mG(_){let W=IG.normalizeProvider(_.userAgentAppId??$_),{customUserAgent:K}=_;return Object.assign(_,{customUserAgent:typeof K==="string"?[[K]]:K,userAgentAppId:async()=>{let G=await W();if(!dG(G)){let Y=_.logger?.constructor?.name==="NoOpLogger"||!_.logger?console:_.logger;if(typeof G!=="string")Y?.warn("userAgentAppId must be a string or undefined.");else if(G.length>50)Y?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.")}return G}})}var LW={partitions:[{id:"aws",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-east-1",name:"aws",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$",regions:{"af-south-1":{description:"Africa (Cape Town)"},"ap-east-1":{description:"Asia Pacific (Hong Kong)"},"ap-east-2":{description:"Asia Pacific (Taipei)"},"ap-northeast-1":{description:"Asia Pacific (Tokyo)"},"ap-northeast-2":{description:"Asia Pacific (Seoul)"},"ap-northeast-3":{description:"Asia Pacific (Osaka)"},"ap-south-1":{description:"Asia Pacific (Mumbai)"},"ap-south-2":{description:"Asia Pacific (Hyderabad)"},"ap-southeast-1":{description:"Asia Pacific (Singapore)"},"ap-southeast-2":{description:"Asia Pacific (Sydney)"},"ap-southeast-3":{description:"Asia Pacific (Jakarta)"},"ap-southeast-4":{description:"Asia Pacific (Melbourne)"},"ap-southeast-5":{description:"Asia Pacific (Malaysia)"},"ap-southeast-6":{description:"Asia Pacific (New Zealand)"},"ap-southeast-7":{description:"Asia Pacific (Thailand)"},"aws-global":{description:"aws global region"},"ca-central-1":{description:"Canada (Central)"},"ca-west-1":{description:"Canada West (Calgary)"},"eu-central-1":{description:"Europe (Frankfurt)"},"eu-central-2":{description:"Europe (Zurich)"},"eu-north-1":{description:"Europe (Stockholm)"},"eu-south-1":{description:"Europe (Milan)"},"eu-south-2":{description:"Europe (Spain)"},"eu-west-1":{description:"Europe (Ireland)"},"eu-west-2":{description:"Europe (London)"},"eu-west-3":{description:"Europe (Paris)"},"il-central-1":{description:"Israel (Tel Aviv)"},"me-central-1":{description:"Middle East (UAE)"},"me-south-1":{description:"Middle East (Bahrain)"},"mx-central-1":{description:"Mexico (Central)"},"sa-east-1":{description:"South America (Sao Paulo)"},"us-east-1":{description:"US East (N. Virginia)"},"us-east-2":{description:"US East (Ohio)"},"us-west-1":{description:"US West (N. California)"},"us-west-2":{description:"US West (Oregon)"}}},{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn",dualStackDnsSuffix:"api.amazonwebservices.com.cn",implicitGlobalRegion:"cn-northwest-1",name:"aws-cn",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:{"aws-cn-global":{description:"aws-cn global region"},"cn-north-1":{description:"China (Beijing)"},"cn-northwest-1":{description:"China (Ningxia)"}}},{id:"aws-eusc",outputs:{dnsSuffix:"amazonaws.eu",dualStackDnsSuffix:"api.amazonwebservices.eu",implicitGlobalRegion:"eusc-de-east-1",name:"aws-eusc",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eusc\\-(de)\\-\\w+\\-\\d+$",regions:{"eusc-de-east-1":{description:"AWS European Sovereign Cloud (Germany)"}}},{id:"aws-iso",outputs:{dnsSuffix:"c2s.ic.gov",dualStackDnsSuffix:"api.aws.ic.gov",implicitGlobalRegion:"us-iso-east-1",name:"aws-iso",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-iso\\-\\w+\\-\\d+$",regions:{"aws-iso-global":{description:"aws-iso global region"},"us-iso-east-1":{description:"US ISO East"},"us-iso-west-1":{description:"US ISO WEST"}}},{id:"aws-iso-b",outputs:{dnsSuffix:"sc2s.sgov.gov",dualStackDnsSuffix:"api.aws.scloud",implicitGlobalRegion:"us-isob-east-1",name:"aws-iso-b",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isob\\-\\w+\\-\\d+$",regions:{"aws-iso-b-global":{description:"aws-iso-b global region"},"us-isob-east-1":{description:"US ISOB East (Ohio)"},"us-isob-west-1":{description:"US ISOB West"}}},{id:"aws-iso-e",outputs:{dnsSuffix:"cloud.adc-e.uk",dualStackDnsSuffix:"api.cloud-aws.adc-e.uk",implicitGlobalRegion:"eu-isoe-west-1",name:"aws-iso-e",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eu\\-isoe\\-\\w+\\-\\d+$",regions:{"aws-iso-e-global":{description:"aws-iso-e global region"},"eu-isoe-west-1":{description:"EU ISOE West"}}},{id:"aws-iso-f",outputs:{dnsSuffix:"csp.hci.ic.gov",dualStackDnsSuffix:"api.aws.hci.ic.gov",implicitGlobalRegion:"us-isof-south-1",name:"aws-iso-f",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isof\\-\\w+\\-\\d+$",regions:{"aws-iso-f-global":{description:"aws-iso-f global region"},"us-isof-east-1":{description:"US ISOF EAST"},"us-isof-south-1":{description:"US ISOF SOUTH"}}},{id:"aws-us-gov",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-gov-west-1",name:"aws-us-gov",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-gov\\-\\w+\\-\\d+$",regions:{"aws-us-gov-global":{description:"aws-us-gov global region"},"us-gov-east-1":{description:"AWS GovCloud (US-East)"},"us-gov-west-1":{description:"AWS GovCloud (US-West)"}}}],version:"1.1"},QW=LW,jW="",JW=(_)=>{let{partitions:W}=QW;for(let G of W){let{regions:Y,outputs:X}=G;for(let[$,Z]of Object.entries(Y))if($===_)return{...X,...Z}}for(let G of W){let{regionRegex:Y,outputs:X}=G;if(new RegExp(Y).test(_))return{...X}}let K=W.find((G)=>G.id==="aws");if(!K)throw Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...K.outputs}},OW=(_,W="")=>{QW=_,jW=W},gG=()=>{OW(LW,"")},wW=()=>jW,uG=/\d{12}\.ddb/;async function pG(_,W,K){if(K.request?.headers?.["smithy-protocol"]==="rpc-v2-cbor")H(_,"PROTOCOL_RPC_V2_CBOR","M");if(typeof W.retryStrategy==="function"){let X=await W.retryStrategy();if(typeof X.mode==="string")switch(X.mode){case Y_.RETRY_MODES.ADAPTIVE:H(_,"RETRY_MODE_ADAPTIVE","F");break;case Y_.RETRY_MODES.STANDARD:H(_,"RETRY_MODE_STANDARD","E");break}}if(typeof W.accountIdEndpointMode==="function"){let X=_.endpointV2;if(String(X?.url?.hostname).match(uG))H(_,"ACCOUNT_ID_ENDPOINT","O");switch(await W.accountIdEndpointMode?.()){case"disabled":H(_,"ACCOUNT_ID_MODE_DISABLED","Q");break;case"preferred":H(_,"ACCOUNT_ID_MODE_PREFERRED","P");break;case"required":H(_,"ACCOUNT_ID_MODE_REQUIRED","R");break}}let Y=_.__smithy_context?.selectedHttpAuthScheme?.identity;if(Y?.$source){let X=Y;if(X.accountId)H(_,"RESOLVED_ACCOUNT_ID","T");for(let[$,Z]of Object.entries(X.$source??{}))H(_,$,Z)}}var e_="user-agent",G_="x-amz-user-agent",_W=" ",X_="/",sG=/[^!$%&'*+\-.^_`|~\w]/g,aG=/[^!$%&'*+\-.^_`|~\w#]/g,WW="-",iG=1024;function nG(_){let W="";for(let K in _){let G=_[K];if(W.length+G.length+1<=iG){if(W.length)W+=","+G;else W+=G;continue}break}return W}var BW=(_)=>(W,K)=>async(G)=>{let{request:Y}=G;if(!m.HttpRequest.isInstance(Y))return W(G);let{headers:X}=Y,$=K?.userAgent?.map(c)||[],Z=(await _.defaultUserAgentProvider()).map(c);await pG(K,_,G);let L=K;Z.push(`m/${nG(Object.assign({},K.__smithy_context?.features,L.__aws_sdk_context?.features))}`);let b=_?.customUserAgent?.map(c)||[],j=await _.userAgentAppId();if(j)Z.push(c(["app",`${j}`]));let Q=wW(),J=(Q?[Q]:[]).concat([...Z,...$,...b]).join(_W),w=[...Z.filter((F)=>F.startsWith("aws-sdk-")),...b].join(_W);if(_.runtime!=="browser"){if(w)X[G_]=X[G_]?`${X[e_]} ${w}`:w;X[e_]=J}else X[G_]=J;return W({...G,request:Y})},c=(_)=>{let W=_[0].split(X_).map(($)=>$.replace(sG,WW)).join(X_),K=_[1]?.replace(aG,WW),G=W.indexOf(X_),Y=W.substring(0,G),X=W.substring(G+1);if(Y==="api")X=X.toLowerCase();return[Y,X,K].filter(($)=>$&&$.length>0).reduce(($,Z,L)=>{switch(L){case 0:return Z;case 1:return`${$}/${Z}`;default:return`${$}#${Z}`}},"")},HW={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},oG=(_)=>({applyToStack:(W)=>{W.add(BW(_),HW)}}),tG=()=>{let _=["deno","bun","llrt"];for(let W of _)if(P.versions[W])return[`md/${W}`,P.versions[W]];return["md/nodejs",P.versions.node]},rG=(_)=>{let W=process.cwd();if(!_)return[W];let K=E.normalize(_),G=K.split(E.sep),Y=G.indexOf("node_modules"),X=Y!==-1?G.slice(0,Y).join(E.sep):K;if(W===X)return[W];return[X,W]},eG=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$/,zW=(_="")=>{let W=_.match(eG);if(!W)return;let[K,G,Y,X]=[W[1],W[2],W[3],W[4]];return X?`${K}.${G}.${Y}-${X}`:`${K}.${G}.${Y}`},_1=["^","~",">=","<=",">","<"],W1=["latest","beta","dev","rc","insiders","next"],K1=(_="")=>{if(W1.includes(_))return _;let W=_1.find((G)=>_.startsWith(G))??"",K=zW(_.slice(W.length));if(!K)return;return`${W}${K}`},B,G1=E.join("node_modules","typescript","package.json"),X1=async()=>{if(B===null)return;else if(typeof B==="string")return["md/tsc",B];let _=!1;try{_=z.booleanSelector(process.env,"AWS_SDK_JS_TYPESCRIPT_DETECTION_DISABLED",z.SelectorType.ENV)||!1}catch{}if(_){B=null;return}let K=rG(typeof __dirname<"u"?__dirname:void 0),G;for(let $ of K)try{let Z=E.join($,"package.json"),L=await r_.readFile(Z,"utf-8"),{dependencies:b,devDependencies:j}=JSON.parse(L),Q=j?.typescript??b?.typescript;if(typeof Q!=="string")continue;G=Q;break}catch{}if(!G){B=null;return}let Y;for(let $ of K)try{let Z=E.join($,G1),L=await r_.readFile(Z,"utf-8"),{version:b}=JSON.parse(L),j=zW(b);if(typeof j!=="string")continue;Y=j;break}catch{}if(Y)return B=Y,["md/tsc",B];let X=K1(G);if(typeof X!=="string"){B=null;return}return B=`dev_${X}`,["md/tsc",B]},FW={isCrtAvailable:!1},Y1=()=>{if(FW.isCrtAvailable)return["md/crt-avail"];return null},MW=({serviceId:_,clientVersion:W})=>{let K=tG();return async(G)=>{let Y=[["aws-sdk-js",W],["ua","2.1"],[`os/${t_.platform()}`,t_.release()],["lang/js"],K],X=await X1();if(X)Y.push(X);let $=Y1();if($)Y.push($);if(_)Y.push([`api/${_}`,W]);if(P.env.AWS_EXECUTION_ENV)Y.push([`exec-env/${P.env.AWS_EXECUTION_ENV}`]);let Z=await G?.userAgentAppId?.();return Z?[...Y,[`app/${Z}`]]:[...Y]}},$1=MW,VW="AWS_SDK_UA_APP_ID",NW="sdk_ua_app_id",Z1="sdk-ua-app-id",b1={environmentVariableSelector:(_)=>_[VW],configFileSelector:(_)=>_[NW]??_[Z1],default:$_},L1=({serviceId:_,clientVersion:W})=>async(K)=>{let G=await import("./chunk-a70m6kyn.js"),Y=G.parse??G.default.parse??(()=>""),X=typeof window<"u"&&window?.navigator?.userAgent?Y(window.navigator.userAgent):void 0,$=[["aws-sdk-js",W],["ua","2.1"],[`os/${X?.os?.name||"other"}`,X?.os?.version],["lang/js"],["md/browser",`${X?.browser?.name??"unknown"}_${X?.browser?.version??"unknown"}`]];if(_)$.push([`api/${_}`,W]);let Z=await K?.userAgentAppId?.();if(Z)$.push([`app/${Z}`]);return $},Q1={os(_){if(/iPhone|iPad|iPod/.test(_))return"iOS";if(/Macintosh|Mac OS X/.test(_))return"macOS";if(/Windows NT/.test(_))return"Windows";if(/Android/.test(_))return"Android";if(/Linux/.test(_))return"Linux";return},browser(_){if(/EdgiOS|EdgA|Edg\//.test(_))return"Microsoft Edge";if(/Firefox\//.test(_))return"Firefox";if(/Chrome\//.test(_))return"Chrome";if(/Safari\//.test(_))return"Safari";return}},Z_=(_,W=!1)=>{if(W){for(let K of _.split("."))if(!Z_(K))return!1;return!0}if(!C.isValidHostLabel(_))return!1;if(_.length<3||_.length>63)return!1;if(_!==_.toLowerCase())return!1;if(C.isIpAddress(_))return!1;return!0},KW=":",j1="/",UW=(_)=>{let W=_.split(KW);if(W.length<6)return null;let[K,G,Y,X,$,...Z]=W;if(K!=="arn"||G===""||Y===""||Z.join(KW)==="")return null;let L=Z.map((b)=>b.split(j1)).flat();return{partition:G,service:Y,region:X,accountId:$,resourceId:L}},EW={isVirtualHostableS3Bucket:Z_,parseArn:UW,partition:JW};C.customEndpointFunctions.aws=EW;var J1=(_)=>{if(typeof _.endpointProvider!=="function")throw Error("@aws-sdk/util-endpoint - endpointProvider and endpoint missing in config for this client.");let{endpoint:W}=_;if(W===void 0)_.endpoint=async()=>{return CW(_.endpointProvider({Region:typeof _.region==="function"?await _.region():_.region,UseDualStack:typeof _.useDualstackEndpoint==="function"?await _.useDualstackEndpoint():_.useDualstackEndpoint,UseFIPS:typeof _.useFipsEndpoint==="function"?await _.useFipsEndpoint():_.useFipsEndpoint,Endpoint:void 0},{logger:_.logger}))};return _},CW=(_)=>m.parseUrl(_.url);function O1(_={}){return z.loadConfig({...z.NODE_REGION_CONFIG_OPTIONS,async default(){if(!hW.silence)console.warn("@aws-sdk - WARN - default STS region of us-east-1 used. See @aws-sdk/credential-providers README and set a region explicitly.");return"us-east-1"}},{...z.NODE_REGION_CONFIG_FILE_OPTIONS,..._})}var hW={silence:!1},w1=(_)=>{return{setRegion(W){_.region=W},region(){return _.region}}},B1=(_)=>{return{region:_.region()}};H1.NODE_REGION_CONFIG_FILE_OPTIONS=z.NODE_REGION_CONFIG_FILE_OPTIONS;H1.NODE_REGION_CONFIG_OPTIONS=z.NODE_REGION_CONFIG_OPTIONS;H1.REGION_ENV_NAME=z.REGION_ENV_NAME;H1.REGION_INI_NAME=z.REGION_INI_NAME;H1.resolveRegionConfig=z.resolveRegionConfig;H1.EndpointError=C.EndpointError;H1.isIpAddress=C.isIpAddress;H1.resolveEndpoint=C.resolveEndpoint;H1.DEFAULT_UA_APP_ID=$_;H1.NODE_APP_ID_CONFIG_OPTIONS=b1;H1.UA_APP_ID_ENV_NAME=VW;H1.UA_APP_ID_INI_NAME=NW;H1.awsEndpointFunctions=EW;H1.createDefaultUserAgentProvider=MW;H1.createUserAgentStringParsingProvider=L1;H1.crtAvailability=FW;H1.defaultUserAgent=$1;H1.emitWarningIfUnsupportedVersion=TG;H1.fallback=Q1;H1.getAwsRegionExtensionConfiguration=w1;H1.getHostHeaderPlugin=xG;H1.getLoggerPlugin=fG;H1.getLongPollPlugin=RG;H1.getRecursionDetectionPlugin=cG;H1.getUserAgentMiddlewareOptions=HW;H1.getUserAgentPlugin=oG;H1.getUserAgentPrefix=wW;H1.hostHeaderMiddleware=GW;H1.hostHeaderMiddlewareOptions=XW;H1.isVirtualHostableS3Bucket=Z_;H1.loggerMiddleware=YW;H1.loggerMiddlewareOptions=$W;H1.parseArn=UW;H1.partition=JW;H1.recursionDetectionMiddleware=bW;H1.recursionDetectionMiddlewareOptions=ZW;H1.resolveAwsRegionExtensionConfiguration=B1;H1.resolveDefaultAwsRegionalEndpointsConfig=J1;H1.resolveHostHeaderConfig=vG;H1.resolveUserAgentConfig=mG;H1.setCredentialFeature=AG;H1.setFeature=H;H1.setPartitionInfo=OW;H1.setTokenFeature=kG;H1.state=d;H1.stsRegionDefaultResolver=O1;H1.stsRegionWarning=hW;H1.toEndpointV1=CW;H1.useDefaultPartitionInfo=gG;H1.userAgentMiddleware=BW});
11
+ export{k_ as Me,i_ as Ne,OX as Oe};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
2
  var f={"language.en":"English","language.zh":"\u7B80\u4F53\u4E2D\u6587","language.zht":"\u7E41\u9AD4\u4E2D\u6587","language.ko":"\uD55C\uAD6D\uC5B4","language.de":"Deutsch","language.es":"Espa\xF1ol","language.fr":"Fran\xE7ais","language.da":"Dansk","language.ja":"\u65E5\u672C\u8A9E","language.pl":"Polski","language.ru":"\u0420\u0443\u0441\u0441\u043A\u0438\u0439","language.ar":"\u0627\u0644\u0639\u0631\u0628\u064A\u0629","language.no":"Norsk","language.br":"Portugu\xEAs (Brasil)","language.pt":"Portugu\xEAs","language.bs":"Bosanski","language.th":"\u0E44\u0E17\u0E22","language.tr":"T\xFCrk\xE7e","tui.prompt.placeholder.normal":"Type your message... (type / for commands)","tui.prompt.placeholder.shell":'Run a command... "{{example}}"',"tui.prompt.ghost":"{{prediction}} (Tab to accept)","tui.home.placeholder.example.todo":"Fix a TODO in the codebase","tui.home.placeholder.example.stack":"What is the tech stack of this project?","tui.home.placeholder.example.tests":"Fix broken tests","tui.home.agreement.prefix":"By using QitQode, you agree to our ","tui.home.agreement.terms":"Terms of Service","tui.home.agreement.separator":" and ","tui.home.agreement.privacy":"Privacy Policy","tui.home.agreement.suffix":"","tui.prompt.hint.attach_file":"attach file","tui.prompt.hint.subagent":"subagent","tui.prompt.hint.commands":"commands","tui.prompt.hint.switch_mode":"mode","tui.prompt.hint.settings":"settings","tui.tips.label":"Tip","tui.tips.plain_terminal":"QitQode looks best in iTerm2 or VS Code's integrated terminal","tui.tips.attach_file":"Hit {highlight}@{/highlight} and start typing to fuzzy-find and attach a file to your prompt","tui.tips.shell_prefix":"Prefix any message with {highlight}!{/highlight} to run it as a shell command \u2014 try {highlight}!git log{/highlight}","tui.tips.tab_agent":"{highlight}Tab{/highlight} and {highlight}Shift+Tab{/highlight} step through your Build, Plan, and Compose agents","tui.tips.theme_mode":"Switch between dark and light themes with {highlight}/dark{/highlight} or {highlight}/light{/highlight}","tui.tips.doc":"Pull up the full documentation anytime with {highlight}/doc{/highlight}","tui.tips.undo":"{highlight}/undo{/highlight} rolls back both the last message and any files it touched","tui.tips.redo":"Changed your mind? {highlight}/redo{/highlight} brings back what you just undid","tui.tips.drag_drop":"Drop images or PDFs straight into the terminal window to add them as context","tui.tips.paste_image":"Got something in your clipboard? {highlight}Ctrl+V{/highlight} pastes images directly into the prompt","tui.tips.editor":"Long prompt? Hit {highlight}Ctrl+X E{/highlight} or {highlight}/editor{/highlight} to write it in your editor of choice","tui.tips.init":"Let {highlight}/init{/highlight} read your project and generate a tailored rules file automatically","tui.tips.models":"Swap between Default, Fast, Economy, and Power with {highlight}/models{/highlight} or {highlight}Ctrl+X M{/highlight}","tui.tips.theme":`Lock your theme mode against your terminal's background \u2014 open the command palette ({highlight}Ctrl+P{/highlight}) and search for "lock"`,"tui.tips.new_session":"Start a clean slate with {highlight}Ctrl+X N{/highlight} or just type {highlight}/new{/highlight}","tui.tips.sessions":"Pick up where you left off \u2014 {highlight}/sessions{/highlight} or {highlight}Ctrl+X L{/highlight} lists all your past conversations","tui.tips.compact":"Running low on context? {highlight}/compact{/highlight} condenses the session into a concise summary","tui.tips.export":"Save any conversation as a Markdown file with {highlight}Ctrl+X X{/highlight} or {highlight}/export{/highlight}","tui.tips.copy_last":"{highlight}Ctrl+X Y{/highlight} copies QitQode's last response straight to your clipboard","tui.tips.command_palette":"Everything in one place \u2014 hit {highlight}Ctrl+P{/highlight} to open the full command palette","tui.tips.leader":"{highlight}Ctrl+X{/highlight} is your shortcut prefix \u2014 pair it with another key to trigger quick actions","tui.tips.f2":"Tap {highlight}F2{/highlight} to jump between your recently used models without opening the picker","tui.tips.sidebar":"Toggle the sidebar on or off with {highlight}Ctrl+X B{/highlight}","tui.tips.history":"Scroll through the conversation with {highlight}PageUp{/highlight} and {highlight}PageDown{/highlight}","tui.tips.jump_first":"Jump straight to the top of any conversation with {highlight}Ctrl+G{/highlight} or {highlight}Home{/highlight}","tui.tips.jump_last":"Skip to the latest message instantly with {highlight}Ctrl+Alt+G{/highlight} or {highlight}End{/highlight}","tui.tips.newline":"Need a line break in your prompt? {highlight}Shift+Enter{/highlight} or {highlight}Ctrl+J{/highlight} does it","tui.tips.clear_input":"Typed something you don't want? {highlight}Ctrl+C{/highlight} wipes the input field clean","tui.tips.escape":"Hit {highlight}Escape{/highlight} to interrupt QitQode and stop it mid-response","tui.tips.plan_agent":"The {highlight}Plan{/highlight} agent thinks through problems and proposes changes without touching any files","tui.tips.subagent":"Mention {highlight}@agent-name{/highlight} in your prompt to hand off to a specialized subagent","tui.tips.cycle_sessions":"Navigate between parent and child sessions with {highlight}Ctrl+X Right{/highlight} and {highlight}Ctrl+X Left{/highlight}","tui.tips.config_files":"{highlight}qitqode.json{/highlight} controls server behavior; {highlight}tui.json{/highlight} controls the terminal interface","tui.tips.global_config":"Your global TUI preferences live at {highlight}~/.config/qitqode/tui.json{/highlight}","tui.tips.schema":"Drop {highlight}$schema{/highlight} into your config file to unlock editor autocomplete","tui.tips.default_model":"Set the {highlight}model{/highlight} key in your config to lock in a preferred tier","tui.tips.keybinds":"Every keybind is overridable \u2014 drop it in the {highlight}keybinds{/highlight} section of {highlight}tui.json{/highlight}","tui.tips.disable_keybind":"Assign {highlight}none{/highlight} to any keybind to remove it entirely","tui.tips.mcp_config":"Wire up local or remote MCP servers through the {highlight}mcp{/highlight} section of your config","tui.tips.mcp_oauth":"Remote MCP servers that require OAuth? QitQode manages the auth flow for you","tui.tips.custom_command":"Save reusable prompts as {highlight}.md{/highlight} files in {highlight}.qitqode/command/{/highlight}","tui.tips.command_args":"Make commands dynamic with {highlight}$ARGUMENTS{/highlight}, {highlight}$1{/highlight}, and {highlight}$2{/highlight} placeholders","tui.tips.command_backticks":"Inject live shell output into any command using backticks \u2014 e.g. {highlight}`git diff`{/highlight}","tui.tips.custom_agent":"Drop a {highlight}.md{/highlight} file into {highlight}.qitqode/agent/{/highlight} to create a custom AI persona","tui.tips.agent_perms":"Each agent can have its own {highlight}edit{/highlight}, {highlight}bash{/highlight}, and {highlight}webfetch{/highlight} permission set","tui.tips.bash_allow":'Grant specific bash commands automatically \u2014 e.g. {highlight}"git *": "allow"{/highlight}',"tui.tips.bash_deny":'Block dangerous patterns outright \u2014 e.g. {highlight}"rm -rf *": "deny"{/highlight}',"tui.tips.bash_ask":'Require confirmation before certain commands run \u2014 e.g. {highlight}"git push": "ask"{/highlight}',"tui.tips.formatter":"QitQode runs prettier, gofmt, ruff, and other formatters on your files automatically","tui.tips.disable_formatter":'Turn off automatic formatting globally with {highlight}"formatter": false{/highlight} in your config',"tui.tips.custom_formatter":"Map any file extension to a custom formatter command in your config","tui.tips.lsp":"QitQode plugs into your LSP servers for deep, language-aware code understanding","tui.tips.custom_tool":"Give QitQode new capabilities by adding {highlight}.ts{/highlight} tool files to {highlight}.qitqode/tools/{/highlight}","tui.tips.tool_scripts":"Custom tools can shell out to scripts in any language \u2014 Python, Go, Bash, whatever","tui.tips.plugins":"Hook into QitQode's event lifecycle by adding {highlight}.ts{/highlight} files to {highlight}.qitqode/plugin/{/highlight}","tui.tips.plugin_notify":"Write a plugin to fire a desktop notification whenever a session finishes","tui.tips.plugin_protect":"A plugin can intercept file reads and block access to sensitive paths","tui.tips.run":"{highlight}qitqode run{/highlight} lets you drive QitQode from scripts without opening the TUI","tui.tips.continue":"Jump back into your last session from the CLI with {highlight}qitqode --continue{/highlight}","tui.tips.attach_cli":"Pass files into a non-interactive session with {highlight}qitqode run -f yourfile.ts{/highlight}","tui.tips.format_json":"Add {highlight}--format json{/highlight} to get structured output you can pipe into other tools","tui.tips.auth_list":"{highlight}qitqode auth status{/highlight} shows your current Forgewise sign-in status","tui.tips.agent_create":"Walk through building a new agent step by step with {highlight}qitqode agent create{/highlight}","tui.tips.theme_system":`Set {highlight}"theme": "system"{/highlight} to automatically follow your terminal's color scheme`,"tui.tips.theme_files":"Store custom JSON themes in {highlight}.qitqode/themes/{/highlight} to keep them project-local","tui.tips.theme_variants":"A single theme file can define both dark and light variants","tui.tips.theme_ansi":"Custom themes can reference any of the 256 ANSI terminal colors by number","tui.tips.env_var":"Pull in environment variables anywhere in your config with {highlight}{env:VAR_NAME}{/highlight}","tui.tips.file_var":"Embed the contents of any file into a config value using {highlight}{file:path}{/highlight}","tui.tips.instructions":"Point {highlight}instructions{/highlight} in your config to extra rules files to extend the agent's behavior","tui.tips.temperature":"Tune the agent's {highlight}temperature{/highlight} \u2014 lower for precision, higher for open-ended creativity","tui.tips.steps":"Cap how far the agent runs autonomously by setting a {highlight}steps{/highlight} limit in config","tui.tips.disable_tool":'Disable individual tools by setting them to {highlight}false{/highlight} under {highlight}"tools"{/highlight} in config',"tui.tips.disable_mcp_tools":`Silence an entire MCP server's toolset with {highlight}"mcp_*": false{/highlight}`,"tui.tips.tool_override":"Each agent config can override the global tool settings independently","tui.tips.doom_loop":"The {highlight}doom_loop{/highlight} permission guard stops the agent from getting stuck in runaway loops","tui.tips.external_dir":"{highlight}external_directory{/highlight} permission keeps the agent from modifying files outside your project","tui.tips.debug_config":"Something misconfigured? {highlight}qitqode debug config{/highlight} prints the resolved config for inspection","tui.tips.print_logs":"Pipe {highlight}--print-logs{/highlight} output to stderr for a full trace of what QitQode is doing","tui.tips.timeline":"Navigate directly to any message in the session with {highlight}Ctrl+X G{/highlight} or {highlight}/timeline{/highlight}","tui.tips.toggle_code":"Show or hide code blocks in the conversation with {highlight}Ctrl+X H{/highlight}","tui.tips.status":"Check what's running under the hood with {highlight}Ctrl+X S{/highlight} or {highlight}/status{/highlight}","tui.tips.scroll_accel":"Turn on {highlight}scroll_acceleration{/highlight} in {highlight}tui.json{/highlight} for fluid, physics-based scrolling","tui.tips.agents_md":"Share your project's AI rules with the whole team by committing {highlight}AGENTS.md{/highlight} to Git","tui.tips.review":"Ask QitQode to review your staged diff, branch, or open PR with {highlight}/review{/highlight}","tui.tips.help":"Lost? {highlight}/help{/highlight} or {highlight}Ctrl+X H{/highlight} surfaces the full keybind reference","tui.tips.rename":"Give your current session a proper name with {highlight}/rename{/highlight}","tui.tips.suspend.unix":"Need your shell back? {highlight}Ctrl+Z{/highlight} suspends QitQode and drops you back to the terminal","tui.tips.suspend.win":"Hit {highlight}Ctrl+Z{/highlight} to undo your last typed change in the prompt","tui.command.palette.title":"Commands","tui.command.palette.suggested":"Suggested","tui.command.category.session":"Session","tui.command.category.agent":"Agent","tui.command.category.provider":"Provider","tui.command.category.system":"System","tui.command.category.prompt":"Prompt","tui.command.category.internal":"Internal","tui.command.category.external":"External","tui.slash.init.description":"guided AGENTS.md setup","tui.slash.review.description":"review changes [commit|branch|pr], defaults to uncommitted","tui.slash.dream.description":"manually consolidate project memory from memory files and raw trajectory","tui.slash.distill.description":"find repeated workflows in recent work and package them into skills, subagents, or commands","tui.slash.goal.description":"set a stop-condition goal; runs until a judge says it's met. /goal clear to abort","tui.slash.deep-research.description":"deep multi-source, fact-checked research report (runs the deep-research workflow)","tui.command.language.switch.title":"Switch language","tui.command.language.switch.description":"Change the display language","tui.command.language.dialog.title":"Switch language","tui.language.auto":"Auto (system)","tui.language.current":"Current","tui.command.session.list.title":"Switch session","tui.command.session.new.title":"New session","tui.command.workflow.list.title":"Workflows","tui.command.model.list.title":"Switch model","tui.command.model.set_tier.title":"Switch to {{tier}}","tui.toast.model_tier_switched":"Switched to {{tier}}","tui.command.model.cycle_recent.title":"Model cycle","tui.command.model.cycle_recent_reverse.title":"Model cycle reverse","tui.command.model.cycle_favorite.title":"Favorite cycle","tui.command.model.cycle_favorite_reverse.title":"Favorite cycle reverse","tui.command.agent.list.title":"Switch agent","tui.command.mcp.list.title":"Toggle MCPs","tui.command.never_ask.title_on":"Never-ask: ON (auto-decide, permissions excluded) \u2014 click to turn off","tui.command.never_ask.title_off":"Never-ask: OFF \u2014 click to turn on (auto-decide, permissions excluded)","tui.command.never_ask.toast_on":"Never-ask ON \u2014 I won't prompt you; I'll pick the best option myself until you turn it off (/never-ask). Permission requests still need your approval.","tui.command.never_ask.toast_off":"Never-ask OFF \u2014 I'll ask you at decision points again.","tui.command.never_ask.title_on_fullauto":"Never-ask: ON (auto-decide; full-auto is also approving permissions) \u2014 click to turn off","tui.command.never_ask.title_off_fullauto":"Never-ask: OFF \u2014 click to turn on (auto-decide; full-auto is still approving permissions)","tui.command.never_ask.toast_on_fullauto":"Never-ask ON \u2014 I won't prompt you; I'll pick the best option myself until you turn it off (/never-ask). Full-auto is on, so tool permissions are being approved automatically too.","tui.command.agent.cycle.title":"Agent cycle","tui.command.variant.cycle.title":"Variant cycle","tui.command.variant.list.title":"Switch model variant","tui.command.agent.cycle.reverse.title":"Agent cycle reverse","tui.command.provider.login.title":"Login","tui.command.provider.logout.title":"Logout","tui.command.console.org.switch.title":"Switch org","tui.command.qitqode.status.title":"View status","tui.command.worktree.list.title":"Worktrees","tui.command.theme.switch.title":"Switch theme","tui.command.theme.switch_mode.to_light":"Switch to light mode","tui.command.theme.switch_mode.to_dark":"Switch to dark mode","tui.command.theme.mode.unlock":"Unlock theme mode","tui.command.theme.mode.lock":"Lock theme mode","tui.command.help.show.title":"Help","tui.dialog.help.close_hint":"esc/enter/space","tui.dialog.help.accessibility":"Accessibility: toggle animations and sound from the command list. Env vars: NO_COLOR, QITQODE_TUI_ACCESSIBLE, QITQODE_REDUCE_MOTION, QITQODE_TUI_SOUND.","tui.dialog.help.announcements":"Announcements: in accessible mode, choose how chatty screen-reader announcements are (quiet, normal, verbose) from the command list or with QITQODE_TUI_ANNOUNCEMENTS. Errors are always announced.","tui.dialog.help.dialog_keys":"Dialogs: every dialog works with the keyboard alone \u2014 Esc closes, Tab or arrow keys move focus, Enter or Space activates the focused control.","tui.command.app.announcements.cycle":"Announcements: {{level}} (select to change)","tui.announcements.level.quiet":"quiet","tui.announcements.level.normal":"normal","tui.announcements.level.verbose":"verbose","tui.app.terminal_too_small":"Terminal too small ({{width}}x{{height}}). Resize to at least 40x8.","tui.dialog.help.command_list":"Press {{keybind}} to see all available actions and commands in any context.","tui.dialog.help.ok":"ok","tui.dialog.close_hint":"esc","tui.dialog.document.scroll_hint":"\u2191/\u2193 scroll \xB7 PgUp/PgDn page \xB7 esc close","tui.dialog.ok":"ok","tui.dialog.confirm.cancel":"Cancel","tui.dialog.confirm.confirm":"Confirm","tui.dialog.agreement.title":"Terms & Privacy","tui.dialog.agreement.message":"Please review and agree to continue.","tui.dialog.agreement.confirm":"Agree & Continue","tui.command.docs.terms.title":"View Terms of Service","tui.command.docs.privacy.title":"View Privacy Policy","tui.command.consent.revoke.title":"Revoke free-model agreement","tui.consent.revoked":"Free-model agreement revoked \u2014 you'll be asked to agree again","tui.dialog.select.placeholder":"Search","tui.dialog.select.no_results":"No results found","tui.dialog.prompt.placeholder":"Enter text","tui.dialog.prompt.busy":"Working...","tui.dialog.prompt.processing":"processing...","tui.dialog.prompt.submit_key":"enter","tui.dialog.prompt.submit_action":"submit","tui.dialog.export.title":"Export Options","tui.dialog.export.filename":"Filename:","tui.dialog.export.filename_placeholder":"Enter filename","tui.dialog.export.include_thinking":"Include thinking","tui.dialog.export.include_tool_details":"Include tool details","tui.dialog.export.include_assistant_metadata":"Include assistant metadata","tui.dialog.export.open_without_saving":"Open without saving","tui.dialog.export.hint.toggle_prefix":"Press","tui.dialog.export.hint.toggle_action":"to toggle","tui.dialog.export.hint.confirm_action":"to confirm","tui.dialog.export.hint.options_action":"for options","tui.toast.copied_to_clipboard":"Copied to clipboard","tui.toast.instructions_loaded":"Loaded {{files}}","tui.toast.update_available.title":"Update Available","tui.toast.update_available.confirm":"A new release v{{version}} is available. Would you like to update now?","tui.toast.update_available.updating":"Updating to v{{version}}...","tui.toast.update_available.failed":"Update failed","tui.toast.update_available.success":"Successfully updated to QitQode v{{version}}. Please restart the application.","tui.toast.updated.title":"Auto-updated","tui.toast.updated.message":"Patch update applied: v{{version}}. Restart to use the new version. Disable via autoupdate: false in config.","tui.sidebar.instructions":"Instructions","tui.sidebar.cwd":"Working Directory","tui.toast.unknown_error":"An unknown error has occurred","tui.command.docs.open.title":"Open docs","tui.command.app.exit.title":"Exit the app","tui.command.app.debug.title":"Toggle debug panel","tui.command.app.console.title":"Toggle console","tui.command.app.heap_snapshot.title":"Write heap snapshot","tui.command.terminal.suspend.title":"Suspend terminal","tui.command.terminal.title.disable":"Disable terminal title","tui.command.terminal.title.enable":"Enable terminal title","tui.command.app.toggle.animations.disable":"Disable animations","tui.command.app.toggle.animations.enable":"Enable animations","tui.command.app.toggle.diffwrap.disable":"Disable diff wrapping","tui.command.app.toggle.diffwrap.enable":"Enable diff wrapping","tui.command.app.toggle.sound.disable":"Disable sound","tui.command.app.toggle.sound.enable":"Enable sound","tui.command.logout.toast":"Logged out","tui.command.session.share.title":"Share session","tui.command.session.share.copy_link":"Copy share link","tui.command.session.rename.title":"Rename session","tui.command.session.timeline.title":"Jump to message","tui.command.session.fork.title":"Fork session","tui.command.session.compact.title":"Compact session","tui.command.session.unshare.title":"Unshare session","tui.command.session.undo.title":"Undo previous message","tui.command.session.redo.title":"Redo","tui.command.session.sidebar.show":"Show sidebar","tui.command.session.sidebar.hide":"Hide sidebar","tui.command.session.conceal.disable":"Disable code concealment","tui.command.session.conceal.enable":"Enable code concealment","tui.command.session.timestamps.show":"Show timestamps","tui.command.session.timestamps.hide":"Hide timestamps","tui.command.session.thinking.expand":"Expand thinking","tui.command.session.thinking.collapse":"Collapse thinking","tui.command.session.tool_details.show":"Show tool details","tui.command.session.tool_details.hide":"Hide tool details","tui.command.session.scrollbar.toggle":"Toggle session scrollbar","tui.command.session.generic_tool_output.show":"Show generic tool output","tui.command.session.generic_tool_output.hide":"Hide generic tool output","tui.command.session.page_up.title":"Page up","tui.command.session.page_down.title":"Page down","tui.command.session.line_up.title":"Line up","tui.command.session.line_down.title":"Line down","tui.command.session.half_page_up.title":"Half page up","tui.command.session.half_page_down.title":"Half page down","tui.command.session.first.title":"First message","tui.command.session.last.title":"Last message","tui.command.session.last_user.title":"Jump to last user message","tui.command.session.message_next.title":"Next message","tui.command.session.message_previous.title":"Previous message","tui.command.messages.copy.title":"Copy last assistant message","tui.command.session.copy.title":"Copy session transcript","tui.command.session.export.title":"Export session transcript","tui.command.session.child_first.title":"Go to child session","tui.command.session.parent.title":"Go to parent session","tui.command.session.main.title":"Back to the main conversation","tui.command.session.child_next.title":"Next child session","tui.command.session.child_previous.title":"Previous child session","tui.command.prompt.clear.title":"Clear prompt","tui.command.prompt.submit.title":"Submit prompt","tui.command.prompt.paste.title":"Paste","tui.command.session.interrupt.title":"Interrupt session","tui.command.prompt.editor.title":"Open editor","tui.command.prompt.skills.title":"Skills","tui.command.voice.toggle.title":"Toggle voice input","tui.command.voice.toggle.title_on":"Voice input: ON \u2014 click to turn off","tui.command.voice.toggle.title_off":"Voice input: OFF \u2014 click to turn on","tui.command.voice.send.title":"Toggle voice send command","tui.command.voice.send.title_on":"Voice send: ON \u2014 click to turn off","tui.command.voice.send.title_off":"Voice send: OFF \u2014 click to turn on","tui.voice.enabled":"Voice input on (Chinese/English) \u2014 click [Voice] to record","tui.voice.disabled":"Voice input disabled","tui.voice.send.enabled":'Voice send enabled \u2014 after a pause, clearly say "send it" to submit',"tui.voice.send.disabled":"Voice send disabled","tui.voice.control.enabled":"Voice control enabled \u2014 using multimodal model for intelligent editing (slower)","tui.voice.control.disabled":"Voice control disabled \u2014 using fast ASR transcription","tui.command.voice.control.title":"Toggle voice control (multimodal)","tui.command.voice.control.title_on":"Voice control: ON (multimodal) \u2014 click to turn off","tui.command.voice.control.title_off":"Voice control: OFF (fast ASR) \u2014 click to turn on","tui.voice.error.no_auth":"Use /connect to sign in to QitQode, or configure voice.asr_model for another provider","tui.voice.error.no_auth_provider":'Voice provider "{{provider}}" is not authenticated, check its apiKey',"tui.voice.error.provider_not_found":'Provider "{{provider}}" not available \u2014 /connect to authenticate, or declare models in config for custom endpoints',"tui.voice.error.no_url":'Provider "{{provider}}" has no baseURL configured \u2014 set options.baseURL in the provider config',"tui.voice.error.no_device":"No microphone/audio device found \u2014 please check your system audio settings","tui.voice.error.recorder_failed":"Recording failed","tui.voice.error.no_recorder":"No recording tool found, please install sox","tui.voice.error.too_short":"Recording too short","tui.voice.error.network":"Transcription failed, please check your network","tui.voice.error.empty_send":"Nothing to send","tui.voice.error.unknown_agent":'Agent "{{name}}" not found',"tui.command.prompt.stash.title":"Stash prompt","tui.command.prompt.stash.pop.title":"Stash pop","tui.command.prompt.stash.list.title":"Stash list","tui.command.tips.toggle.show":"Show tips","tui.command.tips.toggle.hide":"Hide tips","tui.command.plugins.list.title":"Plugins","tui.command.plugins.install.title":"Install plugin","tui.dialog.login.title":"QitQode Sign In","cli.providers.select":"Select provider","cli.providers.other":"Other provider","tui.dialog.login.forgewise":"Sign in with Forgewise","tui.dialog.login.import_claude":"Import from Claude Code","tui.dialog.login.other":"Other Provider","tui.dialog.login.import_claude.no_key":"Claude Code API Key not found","tui.dialog.login.import_claude.read_failed":"Failed to read ~/.claude/settings.json","tui.dialog.login.import_claude.success":"Imported from Claude Code","tui.question.plan_enter.question":"Would you like to switch to plan mode for structured planning?","tui.question.plan_enter.header":"Plan","tui.question.plan_enter.option.0.label":"Yes","tui.question.plan_enter.option.0.description":"Switch to plan agent for read-only planning","tui.question.plan_enter.option.1.label":"No","tui.question.plan_enter.option.1.description":"Stay in current mode","tui.question.plan_exit.question":"Plan at {{plan}} is complete. Would you like to switch to the build agent and start implementing?","tui.question.plan_exit.header":"Plan","tui.question.plan_exit.option.0.label":"Yes","tui.question.plan_exit.option.0.description":"Switch to build agent and start implementing the plan","tui.question.plan_exit.option.1.label":"No","tui.question.plan_exit.option.1.description":"Stay with plan agent to continue refining the plan","tui.session.badge.auto":"Auto","tui.session.subagent.label":"Subagent","tui.session.subagent.child_label":"Child session","tui.session.subagent.back":"\u2190 Back to main","tui.session.subagent.previous":"Prev","tui.session.subagent.next":"Next","tui.session.subagent.prompt_badge":"Prompt \u2192 main","tui.session.subagent.prompt_hint":"what you type below goes to the main conversation","tui.session.subagent.legend_back":"back","tui.session.subagent.legend_cycle":"cycle","trust.title":"Accessing workspace:","trust.safety_check":"Quick safety check: Is this a project you created or one you trust? (Like your own code, a well-known open source project, or work from your team). If not, take a moment to review what's in this folder first.","trust.capabilities":"QitQode will be able to read, edit, and execute files here.","trust.plugin_warn":"If malicious plugins exist in this directory, they can execute arbitrary code, read, modify, or exfiltrate your files.","trust.option.yes":"Yes, I trust this folder","trust.option.no":"No, exit","trust.dangerous.title_home":"WARNING: You are about to open your HOME DIRECTORY.","trust.dangerous.title_root":"WARNING: You are about to open the FILESYSTEM ROOT.","trust.dangerous.body_home":"The model will have access to ALL your personal files \u2014 SSH keys, credentials, browser profiles, and everything else under your home folder.","trust.dangerous.body_root":"The model will have access to the ENTIRE filesystem \u2014 system files, all user data, credentials, and everything on this machine.","trust.dangerous.advice_home":"Unless you have a very specific reason, DO NOT trust your entire home directory.","trust.dangerous.advice_root":"Unless you have a very specific reason, DO NOT trust the filesystem root.","trust.dangerous.option.yes":"I understand the risks, trust for this session","trust.dangerous.option.no":"Exit (recommended)"};
3
- export{f as Md};
3
+ export{f as Nd};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ig as a}from"./chunk-dzma8zvf.js";import{Zg as t,xh as c}from"./chunk-c1c8ch3g.js";import"./chunk-ajnzv5jt.js";import"./chunk-dz3kcsb6.js";import"./chunk-pwsajn96.js";import"./chunk-hgm8yfcb.js";import"./chunk-7rbg6mg9.js";import"./chunk-mp1x10t5.js";import"./chunk-s27cz24e.js";import"./chunk-gx4v8z64.js";import"./chunk-v03xq38e.js";import"./chunk-dx7rexx3.js";import"./chunk-xgf4k9q7.js";import"./chunk-dnjyepb2.js";import"./chunk-8gpjmj42.js";import"./chunk-atacnspd.js";import"./chunk-qdafm7qg.js";import"./chunk-r81w6skn.js";import"./chunk-ge7csm6m.js";import"./chunk-d0dsgxk4.js";import"./chunk-1q10jyka.js";import"./chunk-wh2qqhep.js";import"./chunk-vy93mn7d.js";import"./chunk-yce8ph5b.js";import"./chunk-kec1xw1n.js";import"./chunk-cqtkxwd8.js";import"./chunk-x50adh71.js";import"./chunk-ngyv4fhn.js";import"./chunk-nq4x6792.js";import"./chunk-f17se3hh.js";import"./chunk-2y5bthrp.js";import"./chunk-7hdb1fhq.js";import"./chunk-xnxw5zz9.js";import"./chunk-gq3zb4wv.js";import"./chunk-2cvwrabw.js";import"./chunk-4sa9t0vx.js";import"./chunk-g52wmt1v.js";import"./chunk-9d0exvey.js";import"./chunk-h2p984qb.js";import"./chunk-qm9fm5ja.js";import"./chunk-z0m1qm7j.js";import"./chunk-wd2xmkdp.js";import"./chunk-8peby2d1.js";import"./chunk-azss4acq.js";import"./chunk-0bhzhh7s.js";import"./chunk-7s0nq2aa.js";import"./chunk-cxtwavyf.js";import{ju as i}from"./chunk-15bjhfav.js";import"./chunk-q4mtwv1w.js";import"./chunk-7a3txs9f.js";import"./chunk-x308f9j4.js";import"./chunk-2zjet9tx.js";import"./chunk-mn5cacf6.js";import"./chunk-9pj10pgd.js";import"./chunk-djfrkbd5.js";var n=i.object({name:a.shape.name,branch:a.shape.branch.unwrap(),directory:a.shape.directory.unwrap()}),d={name:"Worktree",description:"Create a git worktree",async configure(e){let r=await c.runPromise(t.Service.use((o)=>o.makeWorktreeInfo()));return{...e,name:r.name,branch:r.branch,directory:r.directory}},async create(e){let r=n.parse(e);await c.runPromise(t.Service.use((o)=>o.createFromInfo({name:r.name,directory:r.directory,branch:r.branch})))},async remove(e){let r=n.parse(e);await c.runPromise(t.Service.use((o)=>o.remove({directory:r.directory})))},target(e){return{type:"local",directory:n.parse(e).directory}}};export{d as WorktreeAdaptor};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{$e as m,Se as x,Ve as F,_e as v,cf as u,lf as R,pf as M,qf as _,rf as g,tf as d}from"./chunk-gsg6zn7e.js";import{Tp as C,Wp as h}from"./chunk-scnbt714.js";import"./chunk-cqtkxwd8.js";import"./chunk-y3gy62q5.js";import{Kt as z}from"./chunk-a48mx917.js";import"./chunk-3va85mbe.js";import"./chunk-e0vrxetq.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 v,Te as x,We as F,af as m,df as u,mf as R,qf as M,rf as _,sf as g,uf as d}from"./chunk-vk35g121.js";import{Qq as C,Tq as h}from"./chunk-kec1xw1n.js";import"./chunk-cqtkxwd8.js";import"./chunk-x50adh71.js";import{Hu as z}from"./chunk-q4mtwv1w.js";import"./chunk-7a3txs9f.js";import"./chunk-djfrkbd5.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};