@bkm016/basalt 0.1.13 → 0.1.15

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 (245) hide show
  1. package/README.md +3 -2
  2. package/{chunk-bng72094.js → chunk-03wzwnn6.js} +1 -1
  3. package/{chunk-9e8vhzy7.js → chunk-0crbhhna.js} +1 -1
  4. package/{chunk-h9zxqeqr.js → chunk-0rasqm8y.js} +2 -2
  5. package/{chunk-0x9netvr.js → chunk-1w4nh5t6.js} +1 -1
  6. package/{chunk-dk6fgprw.js → chunk-2eaehpp6.js} +1 -1
  7. package/{chunk-6sea12mw.js → chunk-30dxcr91.js} +1 -1
  8. package/{chunk-2zbj8ny6.js → chunk-343jsm46.js} +2 -2
  9. package/chunk-38g4jd6v.js +5 -0
  10. package/{chunk-zx75vnw8.js → chunk-39mh7h58.js} +22 -22
  11. package/chunk-44b9yx79.js +2 -0
  12. package/{chunk-r1jn77q6.js → chunk-4f6p4n7k.js} +2 -2
  13. package/{chunk-sgz87ht5.js → chunk-4w8j6n7z.js} +1 -1
  14. package/{chunk-szj85dqe.js → chunk-4yxd2kg1.js} +2 -2
  15. package/{chunk-bp61xdsc.js → chunk-59hg9a84.js} +1 -1
  16. package/{chunk-yy1f9jxc.js → chunk-5n1qra6k.js} +429 -310
  17. package/{chunk-bq54argx.js → chunk-62ebm0bn.js} +1 -1
  18. package/{chunk-6d9r9p91.js → chunk-6ef085c1.js} +4 -4
  19. package/{chunk-zk91579b.js → chunk-6hx9y86d.js} +2 -2
  20. package/chunk-73t051r6.js +2 -0
  21. package/{chunk-pryvvs96.js → chunk-7mgkpn94.js} +22 -22
  22. package/{chunk-2q56egb8.js → chunk-81x8r8w4.js} +1 -1
  23. package/{chunk-rn3jwyh1.js → chunk-8np9b2y8.js} +2 -2
  24. package/{chunk-1q6e3mj7.js → chunk-9ew8cap5.js} +2 -2
  25. package/chunk-9v3b7jjv.js +2 -0
  26. package/{chunk-tjg0gcks.js → chunk-9vam83py.js} +1 -1
  27. package/{chunk-ct77cdg7.js → chunk-9xjecw6c.js} +1 -1
  28. package/{chunk-8cgz8xv7.js → chunk-b2wpj81x.js} +2 -2
  29. package/{chunk-302n9g7p.js → chunk-bjvv3403.js} +1 -1
  30. package/{chunk-tfhze1vq.js → chunk-c8g9jjqs.js} +2 -2
  31. package/{chunk-0a7ft50x.js → chunk-cs91rmbf.js} +8 -8
  32. package/{chunk-gpnqmtbk.js → chunk-edcf97ka.js} +1 -1
  33. package/{chunk-74wwdx3y.js → chunk-en7z6ne5.js} +2 -2
  34. package/{chunk-f0h2bv11.js → chunk-evnqkyt7.js} +10 -10
  35. package/{chunk-4rnmxtpx.js → chunk-ge38dhv9.js} +2 -2
  36. package/chunk-hggam3je.js +2 -0
  37. package/{chunk-mf04h0yy.js → chunk-k38jaz6c.js} +4 -4
  38. package/{chunk-jjtt9aq8.js → chunk-kcn05erf.js} +3 -3
  39. package/{chunk-y23dpz5e.js → chunk-m5km74eq.js} +2 -2
  40. package/{chunk-095adzn5.js → chunk-mfb3dgs8.js} +2 -2
  41. package/{chunk-0nedq669.js → chunk-mh4bjtfs.js} +3 -3
  42. package/{chunk-bja7p3em.js → chunk-p886jr17.js} +13 -13
  43. package/{chunk-xvm0y99b.js → chunk-pdt65s31.js} +2 -2
  44. package/{chunk-ymg7mtcx.js → chunk-pjgt1bdx.js} +2 -2
  45. package/{chunk-959z9efn.js → chunk-pyj6avd5.js} +2 -2
  46. package/chunk-qd2enpr2.js +3 -0
  47. package/{chunk-tnj2kqb8.js → chunk-qe76naq9.js} +1 -1
  48. package/{chunk-z0c8ek0j.js → chunk-qjnx4fsn.js} +2 -2
  49. package/{chunk-2tf7qfbx.js → chunk-qs161f2q.js} +2 -2
  50. package/{chunk-nbjnwd54.js → chunk-rghqprav.js} +1 -1
  51. package/{chunk-7chv3knf.js → chunk-t33bm5aa.js} +1 -1
  52. package/chunk-tszctb17.js +482 -0
  53. package/chunk-vd5332ps.js +2 -0
  54. package/{chunk-22az84sh.js → chunk-w55cnj0f.js} +2 -2
  55. package/{chunk-4k9t9jvx.js → chunk-wnd3y4c0.js} +1 -1
  56. package/{chunk-snz19yc2.js → chunk-xafx1p7z.js} +2 -2
  57. package/{chunk-15ve3nmv.js → chunk-xf7zw32f.js} +12 -12
  58. package/{chunk-kbpbrr11.js → chunk-xq74x4gc.js} +2 -2
  59. package/{chunk-mdkfm1ak.js → chunk-y0274xr2.js} +3 -3
  60. package/{chunk-y4pvhes1.js → chunk-z9p6s986.js} +6 -6
  61. package/{chunk-41das1ty.js → chunk-zcwz44db.js} +1 -1
  62. package/{chunk-77c2cqp2.js → chunk-zhyzhekt.js} +1 -1
  63. package/compiled.js +12 -12
  64. package/package.json +1 -1
  65. package/ui-test-worker.js +51 -51
  66. package/web/chunk-00swes3c.js +1 -0
  67. package/web/{chunk-s935z8er.js → chunk-01nbc18z.js} +2 -2
  68. package/web/chunk-0e995hjg.js +1 -0
  69. package/web/{chunk-16jc5m0f.js → chunk-17wwzrp4.js} +1 -1
  70. package/web/{chunk-8j4tzff5.js → chunk-1bhpfsvr.js} +3 -3
  71. package/web/{chunk-qb8mbptk.js → chunk-1v6hhgc6.js} +1 -1
  72. package/web/chunk-1y387f45.js +1 -0
  73. package/web/{chunk-ddg8rz82.js → chunk-251yw6f2.js} +1 -1
  74. package/web/{chunk-mykrm8ba.js → chunk-25sn840r.js} +2 -2
  75. package/web/{chunk-b4gcpsbg.js → chunk-27cntdyk.js} +5 -5
  76. package/web/chunk-2tm4xe0j.js +2 -0
  77. package/web/chunk-3egthz5k.js +2 -0
  78. package/web/{chunk-p7pa02k9.js → chunk-3f8fjee5.js} +2 -2
  79. package/web/chunk-3fjzgpaw.js +1 -0
  80. package/web/{chunk-zqcg6frm.js → chunk-3hy2gsgf.js} +1 -1
  81. package/web/chunk-3mgzqbc8.js +1 -0
  82. package/web/chunk-3yvanftw.js +1 -0
  83. package/web/{chunk-xk1vkcj4.js → chunk-3zs2v6b4.js} +4 -4
  84. package/web/{chunk-9k7fkx80.js → chunk-43194184.js} +1 -1
  85. package/web/{chunk-vk7ch6fh.js → chunk-43bczb21.js} +2 -2
  86. package/web/{chunk-0rhx7qb8.js → chunk-4m9mgdaa.js} +1 -1
  87. package/web/{chunk-jpem3qvs.js → chunk-4q2jtvwn.js} +5 -5
  88. package/web/{chunk-w28dn4dw.js → chunk-4tbhxtnm.js} +1 -1
  89. package/web/{chunk-q4vy3dkk.js → chunk-50vgq2nk.js} +2 -2
  90. package/web/{chunk-atppv8fk.js → chunk-57b8j192.js} +1 -1
  91. package/web/{chunk-h6k1x096.js → chunk-5d9veaef.js} +2 -2
  92. package/web/chunk-5fzmk43v.js +1 -0
  93. package/web/{chunk-97t3ngqf.js → chunk-5rwg3qqd.js} +7 -7
  94. package/web/{chunk-xe121vg7.js → chunk-62gj74fq.js} +1 -1
  95. package/web/chunk-64h7k870.js +1 -0
  96. package/web/{chunk-3p9w8sg5.js → chunk-65ay0j1t.js} +3 -3
  97. package/web/{chunk-mkxeenph.js → chunk-66164wmv.js} +1 -1
  98. package/web/chunk-6ehecat3.js +1 -0
  99. package/web/{chunk-a6g3nqp0.js → chunk-6s1vjny7.js} +2 -2
  100. package/web/{chunk-ga07tv37.js → chunk-6x1hfjb9.js} +1 -1
  101. package/web/{chunk-dmha2y9c.js → chunk-6xfbh4z5.js} +18 -18
  102. package/web/chunk-73941p08.js +1 -0
  103. package/web/{chunk-t82sngk9.js → chunk-7frnjms9.js} +7 -7
  104. package/web/chunk-7jh6zxg3.js +1 -0
  105. package/web/chunk-7mgwejn4.js +1 -0
  106. package/web/chunk-7qq1ypvj.js +1 -0
  107. package/web/{chunk-awkdw9rw.js → chunk-7wzszsf5.js} +2 -2
  108. package/web/{chunk-c57f714b.js → chunk-7zfqppsx.js} +2 -2
  109. package/web/{chunk-wpxtkxjt.js → chunk-8nm0mghm.js} +2 -2
  110. package/web/{chunk-980zhtht.js → chunk-8qzsxg1q.js} +1 -1
  111. package/web/chunk-8zg89764.js +1 -0
  112. package/web/{chunk-sq75q603.js → chunk-937ndmh1.js} +6 -6
  113. package/web/chunk-95gbcs8j.js +1 -0
  114. package/web/{chunk-eqxy6535.js → chunk-a205cj09.js} +2 -2
  115. package/web/chunk-at0xtfhy.js +1 -0
  116. package/web/{chunk-jh3k7xex.js → chunk-aw6wg8fe.js} +3 -3
  117. package/web/{chunk-g0be12na.js → chunk-b323qea5.js} +1 -1
  118. package/web/{chunk-3ctmehg4.js → chunk-bcx7xges.js} +1 -1
  119. package/web/{chunk-ke8dffnk.js → chunk-bzdn9sxz.js} +2 -2
  120. package/web/{chunk-w4tfad6c.js → chunk-cq1f20k6.js} +1 -1
  121. package/web/{chunk-zb61mf0a.js → chunk-dde64qjd.js} +1 -1
  122. package/web/{chunk-a9er7a7c.js → chunk-dgepxev9.js} +19 -19
  123. package/web/{chunk-6rsr2cyw.js → chunk-djnq1w1e.js} +8 -8
  124. package/web/{chunk-2y1avvqj.js → chunk-ea6b8b50.js} +3 -3
  125. package/web/{chunk-xxmaqj1m.js → chunk-ed5xfgxb.js} +2 -2
  126. package/web/{chunk-0jbf73pr.js → chunk-ehz9m6g4.js} +3 -3
  127. package/web/chunk-evp6t44y.js +8 -0
  128. package/web/chunk-eyg28s83.js +1 -0
  129. package/web/{chunk-mnf4ngj9.js → chunk-fttdbcqv.js} +2 -2
  130. package/web/chunk-g7bcntpm.js +1 -0
  131. package/web/chunk-g9bqacq1.js +1 -0
  132. package/web/chunk-gh8kjzdj.js +1 -0
  133. package/web/{chunk-2sef2wft.js → chunk-hbwxtbq3.js} +2 -2
  134. package/web/{chunk-6e87m0nm.js → chunk-hdtvrh0f.js} +2 -2
  135. package/web/chunk-j031r08w.js +1 -0
  136. package/web/{chunk-zh7193nq.js → chunk-jab2p5zv.js} +2 -2
  137. package/web/{chunk-2x7vmhm0.js → chunk-jca9xbe0.js} +3 -3
  138. package/web/{chunk-jccz14ye.js → chunk-jdx7qp2w.js} +2 -2
  139. package/web/chunk-jpf8x9tm.js +1 -0
  140. package/web/{chunk-5cwxhhae.js → chunk-jx3z63tq.js} +2 -2
  141. package/web/chunk-jy448465.js +1142 -0
  142. package/web/chunk-jy8zat04.js +1 -0
  143. package/web/{chunk-b9jry5a3.js → chunk-k3ah0513.js} +1 -1
  144. package/web/{chunk-qq6m2my8.js → chunk-k4qrqmdk.js} +2 -2
  145. package/web/chunk-k8s7kye3.js +1 -0
  146. package/web/chunk-k9zn1n6d.js +1 -0
  147. package/web/{chunk-v4cqc9f9.js → chunk-ksnsfqrn.js} +1 -1
  148. package/web/{chunk-cr04125j.js → chunk-kxr473dw.js} +12 -12
  149. package/web/{chunk-3wpxymxa.js → chunk-m5psa69k.js} +3 -3
  150. package/web/chunk-md9j949p.js +1 -0
  151. package/web/{chunk-4py9sndw.js → chunk-mss6eg27.js} +6 -6
  152. package/web/{chunk-3jjksgze.js → chunk-mv9q8jrm.js} +1 -1
  153. package/web/{chunk-ze6azq7z.js → chunk-n0ezfa12.js} +4 -4
  154. package/web/chunk-nbcpbqq4.js +1 -0
  155. package/web/{chunk-qq06x2ce.js → chunk-p1bb9xp8.js} +2 -2
  156. package/web/{chunk-14vmr99v.js → chunk-pa82db2e.js} +3 -3
  157. package/web/{chunk-frnh4zqf.js → chunk-pafw34vg.js} +2 -2
  158. package/web/{chunk-1xm9x7d6.js → chunk-pdmcr6d4.js} +2 -2
  159. package/web/{chunk-ct90yf8z.js → chunk-pf65cank.js} +2 -2
  160. package/web/{chunk-jh33m2mq.js → chunk-phj4pcx4.js} +3 -3
  161. package/web/{chunk-fnvgdvrg.js → chunk-pma5pats.js} +4 -4
  162. package/web/{chunk-g7hqafb8.js → chunk-pmghe7rh.js} +1 -1
  163. package/web/{chunk-xcyqd7cn.js → chunk-ppfhtyxt.js} +1 -1
  164. package/web/chunk-pze2v3v1.js +2 -0
  165. package/web/{chunk-e57h40qa.js → chunk-q6j2e8a1.js} +2 -2
  166. package/web/chunk-q6jf3zc1.js +1 -0
  167. package/web/{chunk-9wz8jne3.js → chunk-qdn3hmfy.js} +1 -1
  168. package/web/{chunk-cr05dttm.js → chunk-qdsg8wp0.js} +1 -1
  169. package/web/{chunk-yn4t5s9r.js → chunk-qf2kb7zj.js} +1 -1
  170. package/web/{chunk-eqndhs21.js → chunk-qv1w36ja.js} +2 -2
  171. package/web/{chunk-k0cg4n2k.js → chunk-s0xy00v5.js} +2 -2
  172. package/web/{chunk-zxrbbbtp.js → chunk-s6bc73n3.js} +2 -2
  173. package/web/{chunk-qh62nkem.js → chunk-sd3cdqcm.js} +2 -2
  174. package/web/chunk-sdtesqbb.js +1 -0
  175. package/web/chunk-t0z8ygx4.js +1 -0
  176. package/web/chunk-t2v01k4z.js +1 -0
  177. package/web/{chunk-c6m4vfn5.js → chunk-t5ke9cyg.js} +68 -68
  178. package/web/{chunk-5ym5ffd5.js → chunk-t72z2ww3.js} +2 -2
  179. package/web/{chunk-0rvwj2wh.js → chunk-t78qm9gs.js} +2 -2
  180. package/web/{chunk-xvm66b7v.js → chunk-te15yhn5.js} +4 -4
  181. package/web/{chunk-et1rsgmp.js → chunk-tvaxyhh0.js} +2 -2
  182. package/web/{chunk-pzg25qqe.js → chunk-vvvd3grf.js} +2 -2
  183. package/web/{chunk-ss96cz1f.js → chunk-vwv6pqy7.js} +1 -1
  184. package/web/{chunk-p6e2vr51.js → chunk-vypfy030.js} +6 -6
  185. package/web/chunk-w7cyrbk2.js +1 -0
  186. package/web/chunk-w9nkvcjr.js +1 -0
  187. package/web/{chunk-20jxvmbw.js → chunk-wfgrdabk.js} +1 -1
  188. package/web/chunk-x2f8bwd2.js +1 -0
  189. package/web/chunk-xq8x7dvr.js +1 -0
  190. package/web/chunk-xtss82z2.js +1 -0
  191. package/web/{chunk-ba9qy65y.js → chunk-yeh77fvq.js} +1 -1
  192. package/web/{chunk-y9waq403.js → chunk-ymtq18z6.js} +2 -2
  193. package/web/{chunk-h1k2kqbs.js → chunk-yzmrbssn.js} +4 -4
  194. package/web/{chunk-ct7z7bea.js → chunk-z5h046zm.js} +3 -3
  195. package/web/{chunk-qbmtah1x.js → chunk-zf4b8jb9.js} +1 -1
  196. package/web/index.html +1 -1
  197. package/web/sw.js +17 -1
  198. package/chunk-1dbfmejf.js +0 -2
  199. package/chunk-4w9zqv0k.js +0 -2
  200. package/chunk-6f4ht2hw.js +0 -2
  201. package/chunk-edbq461k.js +0 -5
  202. package/chunk-m71pj3g1.js +0 -2
  203. package/chunk-n22vd4at.js +0 -2
  204. package/chunk-sgrrxsnz.js +0 -482
  205. package/chunk-ydzag81d.js +0 -3
  206. package/web/chunk-12qf1r6m.js +0 -1
  207. package/web/chunk-1m6fx2h7.js +0 -2
  208. package/web/chunk-2n5xbnrt.js +0 -1
  209. package/web/chunk-36s08nye.js +0 -1
  210. package/web/chunk-4swea9sn.js +0 -1
  211. package/web/chunk-4zz5a483.js +0 -1
  212. package/web/chunk-6y55gk1n.js +0 -1
  213. package/web/chunk-7aep7k4v.js +0 -1
  214. package/web/chunk-8tgavnwx.js +0 -1
  215. package/web/chunk-a00vg115.js +0 -1
  216. package/web/chunk-a4gbxnm3.js +0 -1
  217. package/web/chunk-bq6mep6p.js +0 -2
  218. package/web/chunk-bwy3e58v.js +0 -1
  219. package/web/chunk-de29pe57.js +0 -1
  220. package/web/chunk-eeesa5q1.js +0 -1
  221. package/web/chunk-f7jpakwh.js +0 -1
  222. package/web/chunk-fp62avjh.js +0 -1
  223. package/web/chunk-gr163fex.js +0 -1
  224. package/web/chunk-gx340asc.js +0 -1
  225. package/web/chunk-gxtz10wf.js +0 -1
  226. package/web/chunk-k9qnvx86.js +0 -2
  227. package/web/chunk-kcnj0gan.js +0 -1
  228. package/web/chunk-kpp5xqsb.js +0 -1
  229. package/web/chunk-m33yted6.js +0 -1
  230. package/web/chunk-me5jqqn6.js +0 -1
  231. package/web/chunk-mzqqwbmr.js +0 -1
  232. package/web/chunk-mzzaet63.js +0 -1
  233. package/web/chunk-q34as3v6.js +0 -1
  234. package/web/chunk-q6c8p73w.js +0 -1
  235. package/web/chunk-qn93we3a.js +0 -1
  236. package/web/chunk-r1f1egve.js +0 -1
  237. package/web/chunk-tt9410zw.js +0 -8
  238. package/web/chunk-ve8gy05p.js +0 -1142
  239. package/web/chunk-vg1ebkce.js +0 -1
  240. package/web/chunk-vnt34mkb.js +0 -1
  241. package/web/chunk-xh4xn1az.js +0 -1
  242. package/web/chunk-xrk5ewsn.js +0 -1
  243. package/web/chunk-xzwxcxb4.js +0 -1
  244. package/web/chunk-ydhnkws0.js +0 -1
  245. package/web/chunk-ys2tns0p.js +0 -1
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{B}from"./chunk-mh4bjtfs.js";import{v}from"./chunk-cs91rmbf.js";import{a}from"./chunk-qd2enpr2.js";var m=a(B()),t=a(v());import{readFileSync as _}from"fs";var c=(e)=>async(s)=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");let{roleArn:o,roleSessionName:r,webIdentityToken:i,providerId:n,policyArns:f,policy:g,durationSeconds:E}=e,{roleAssumerWithWebIdentity:l}=e;if(!l){let{getDefaultRoleAssumerWithWebIdentity:p}=await import("./chunk-zcwz44db.js");l=p({...e.clientConfig,credentialProviderLogger:e.logger,parentClientConfig:{...s?.callerClientConfig,...e.parentClientConfig}},e.clientPlugins)}return l({RoleArn:o,RoleSessionName:r??`aws-sdk-js-session-${Date.now()}`,WebIdentityToken:i,ProviderId:n,PolicyArns:f,Policy:g,DurationSeconds:E})};var d="AWS_WEB_IDENTITY_TOKEN_FILE",S="AWS_ROLE_ARN",T="AWS_ROLE_SESSION_NAME",N=(e={})=>async(s)=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile");let o=e?.webIdentityTokenFile??process.env[d],r=e?.roleArn??process.env[S],i=e?.roleSessionName??process.env[T];if(!o||!r)throw new t.CredentialsProviderError("Web identity configuration not specified",{logger:e.logger});let n=await c({...e,webIdentityToken:t.externalDataInterceptor?.getTokenRecord?.()[o]??_(o,{encoding:"ascii"}),roleArn:r,roleSessionName:i})(s);if(o===process.env[d])m.setCredentialFeature(n,"CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN","h");return n};export{N as fromTokenFile};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{v}from"./chunk-4rnmxtpx.js";var i="v1";function s(r){let e=new Map;if(!r)return e;for(let t of r.split(",")){let a=t.trim();if(!a)continue;let[n,o]=a.split("=",2);if(!n||!o)continue;e.set(n.trim(),o.trim())}return e}function Sr(r,e){if(e?.azureDeploymentName)return e.azureDeploymentName;return s(v("AZURE_OPENAI_DEPLOYMENT_NAME_MAP",e?.env)).get(r.id)||r.id}function m(r){let e=r.trim().replace(/\/+$/,""),t;try{t=new URL(e)}catch{throw Error(`Invalid Azure OpenAI base URL: ${r}`)}let a=t.hostname.endsWith(".openai.azure.com")||t.hostname.endsWith(".cognitiveservices.azure.com")||t.hostname.endsWith(".ai.azure.com"),n=t.pathname.replace(/\/+$/,"");if(a&&(n===""||n==="/"||n==="/openai"||n==="/openai/v1/responses"))t.pathname="/openai/v1",t.search="";return t.toString().replace(/\/+$/,"")}function u(r){return`https://${r}.openai.azure.com/openai/v1`}function ho(r,e){let t=e?.azureBaseUrl?.trim()||v("AZURE_OPENAI_BASE_URL",e?.env)?.trim()||void 0,a=e?.azureResourceName||v("AZURE_OPENAI_RESOURCE_NAME",e?.env),n=t;if(!n&&a)n=u(a);if(!n&&r.baseUrl)n=r.baseUrl;if(!n)throw Error("Azure OpenAI base URL is required. Set AZURE_OPENAI_BASE_URL or AZURE_OPENAI_RESOURCE_NAME, or pass azureBaseUrl, azureResourceName, or model.baseUrl.");return m(n)}function ai(r,e){return{baseUrl:ho(r,e),apiVersion:e?.azureApiVersion||v("AZURE_OPENAI_API_VERSION",e?.env)||i}}
3
- export{Sr,ho,ai};
2
+ import{_}from"./chunk-ge38dhv9.js";var i="v1";function s(r){let e=new Map;if(!r)return e;for(let t of r.split(",")){let a=t.trim();if(!a)continue;let[n,o]=a.split("=",2);if(!n||!o)continue;e.set(n.trim(),o.trim())}return e}function wr(r,e){if(e?.azureDeploymentName)return e.azureDeploymentName;return s(_("AZURE_OPENAI_DEPLOYMENT_NAME_MAP",e?.env)).get(r.id)||r.id}function m(r){let e=r.trim().replace(/\/+$/,""),t;try{t=new URL(e)}catch{throw Error(`Invalid Azure OpenAI base URL: ${r}`)}let a=t.hostname.endsWith(".openai.azure.com")||t.hostname.endsWith(".cognitiveservices.azure.com")||t.hostname.endsWith(".ai.azure.com"),n=t.pathname.replace(/\/+$/,"");if(a&&(n===""||n==="/"||n==="/openai"||n==="/openai/v1/responses"))t.pathname="/openai/v1",t.search="";return t.toString().replace(/\/+$/,"")}function u(r){return`https://${r}.openai.azure.com/openai/v1`}function ho(r,e){let t=e?.azureBaseUrl?.trim()||_("AZURE_OPENAI_BASE_URL",e?.env)?.trim()||void 0,a=e?.azureResourceName||_("AZURE_OPENAI_RESOURCE_NAME",e?.env),n=t;if(!n&&a)n=u(a);if(!n&&r.baseUrl)n=r.baseUrl;if(!n)throw Error("Azure OpenAI base URL is required. Set AZURE_OPENAI_BASE_URL or AZURE_OPENAI_RESOURCE_NAME, or pass azureBaseUrl, azureResourceName, or model.baseUrl.");return m(n)}function ai(r,e){return{baseUrl:ho(r,e),apiVersion:e?.azureApiVersion||_("AZURE_OPENAI_API_VERSION",e?.env)||i}}
3
+ export{wr,ho,ai};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{He,at}from"./chunk-6d9r9p91.js";import{qe}from"./chunk-0x9netvr.js";import{je,Te,U}from"./chunk-0nedq669.js";import{_e,Z,x,Ae,ee,Ye,z}from"./chunk-0a7ft50x.js";var{awsEndpointFunctions:Pe,emitWarningIfUnsupportedVersion:Ce,createDefaultUserAgentProvider:ye,NODE_APP_ID_CONFIG_OPTIONS:Oe,getAwsRegionExtensionConfiguration:we,resolveAwsRegionExtensionConfiguration:De,resolveUserAgentConfig:Re,resolveHostHeaderConfig:ke,getUserAgentPlugin:$e,getHostHeaderPlugin:Ne,getLoggerPlugin:be,getRecursionDetectionPlugin:Ue}=U(),{NoAuthSigner:Fe,getHttpAuthSchemeEndpointRuleSetPlugin:ze,DefaultIdentityProviderConfig:Ge,getHttpSigningPlugin:Me}=Te(),{normalizeProvider:V,getSmithyContext:Ke,ServiceException:Ve,NoOpLogger:Le,emitWarningIfUnsupportedVersion:Be,loadConfigsForDefaultMode:We,getDefaultExtensionConfiguration:Je,resolveDefaultRuntimeConfig:Xe,Client:L,makeBuilder:Qe,createAggregatedClient:Ze}=Z(),{Command:et}=Z();var Kr=et,Vr=L;var{resolveDefaultsModeConfig:tt,loadConfig:h,NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS:rt,NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS:ot,NODE_REGION_CONFIG_OPTIONS:nt,NODE_REGION_CONFIG_FILE_OPTIONS:st,resolveRegionConfig:it}=x(),{BinaryDecisionDiagram:ct,EndpointCache:dt,decideEndpoint:pt,customEndpointFunctions:ut,resolveEndpointConfig:lt,getEndpointPlugin:ht}=Ae(),{parseUrl:Et,getHttpHandlerExtensionConfiguration:gt,resolveHttpHandlerRuntimeConfig:_t,getContentLengthPlugin:mt}=z(),{DEFAULT_RETRY_MODE:xt,NODE_RETRY_MODE_CONFIG_OPTIONS:St,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:ft,resolveRetryConfig:It,getRetryPlugin:vt}=je(),{TypeRegistry:B,getSchemaSerdePlugin:Pt}=_e(),{resolveAwsSdkSigV4Config:Ct,AwsSdkSigV4Signer:At,NODE_AUTH_SCHEME_PREFERENCE_OPTIONS:yt}=He(),{toUtf8:Tt,fromUtf8:Ot,toBase64:wt,fromBase64:Dt,calculateBodyLength:Rt}=ee(),{streamCollector:kt,NodeHttpHandler:$t}=qe(),{AwsRestJsonProtocol:Nt}=at(),{Sha256:bt}=Ye(),Ut=async(e,t,n)=>({operation:Ke(t).operation,region:await V(e.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function Ft(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sso-oauth",region:e.region},propertiesExtractor:(t,n)=>({signingProperties:{config:t,context:n}})}}function qt(e){return{schemeId:"smithy.api#noAuth"}}var zt=(e)=>{let t=[];switch(e.operation){case"CreateToken":{t.push(qt());break}default:t.push(Ft(e))}return t},Ht=(e)=>{let t=Ct(e);return Object.assign(t,{authSchemePreference:V(e.authSchemePreference??[])})},Gt=(e)=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"sso-oauth"}),Mt={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},jt="3.997.47",Kt={version:jt},_="ref",E=-1,S=!0,G="isSet",W="PartitionResult",f="booleanEquals",N="getAttr",M={[_]:"Endpoint"},b={[_]:W},g={},j=[{[_]:"Region"}],K={conditions:[[G,[M]],[G,j],["aws.partition",j,W],[f,[{[_]:"UseFIPS"},S]],[f,[{[_]:"UseDualStack"},S]],[f,[{fn:N,argv:[b,"supportsDualStack"]},S]],[f,[{fn:N,argv:[b,"supportsFIPS"]},S]],["stringEquals",[{fn:N,argv:[b,"name"]},"aws-us-gov"]]],results:[[E],[E,"Invalid Configuration: FIPS and custom endpoint are not supported"],[E,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[M,g],["https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",g],[E,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://oidc.{Region}.amazonaws.com",g],["https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}",g],[E,"FIPS is enabled but this partition does not support FIPS"],["https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}",g],[E,"DualStack is enabled but this partition does not support DualStack"],["https://oidc.{Region}.{PartitionResult#dnsSuffix}",g],[E,"Invalid Configuration: Missing Region"]]},Vt=2,c=1e8,Lt=new Int32Array([-1,1,-1,0,13,3,1,4,c+12,2,5,c+12,3,8,6,4,7,c+11,5,c+9,c+10,4,11,9,6,10,c+8,7,c+6,c+7,5,12,c+5,6,c+4,c+5,3,c+1,14,4,c+2,c+3]),Bt=ct.from(Lt,Vt,K.conditions,K.results),Wt=new dt({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),Yt=(e,t={})=>Wt.get(e,()=>pt(Bt,{endpointParams:e,logger:t.logger}));ut.aws=Pe;class i extends Ve{static shapeId="smithy.ts.sdk.synthetic.com.amazonaws.ssooidc#SSOOIDCServiceException";constructor(e){super(e);Object.setPrototypeOf(this,i.prototype)}}class I extends i{static shapeId="com.amazonaws.ssooidc#AccessDeniedException";name="AccessDeniedException";$fault="client";error;reason;error_description;constructor(e){super({name:"AccessDeniedException",$fault:"client",...e});Object.setPrototypeOf(this,I.prototype),this.error=e.error,this.reason=e.reason,this.error_description=e.error_description}}class v extends i{static shapeId="com.amazonaws.ssooidc#AuthorizationPendingException";name="AuthorizationPendingException";$fault="client";error;error_description;constructor(e){super({name:"AuthorizationPendingException",$fault:"client",...e});Object.setPrototypeOf(this,v.prototype),this.error=e.error,this.error_description=e.error_description}}class P extends i{static shapeId="com.amazonaws.ssooidc#ExpiredTokenException";name="ExpiredTokenException";$fault="client";error;error_description;constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e});Object.setPrototypeOf(this,P.prototype),this.error=e.error,this.error_description=e.error_description}}class C extends i{static shapeId="com.amazonaws.ssooidc#InternalServerException";name="InternalServerException";$fault="server";error;error_description;constructor(e){super({name:"InternalServerException",$fault:"server",...e});Object.setPrototypeOf(this,C.prototype),this.error=e.error,this.error_description=e.error_description}}class A extends i{static shapeId="com.amazonaws.ssooidc#InvalidClientException";name="InvalidClientException";$fault="client";error;error_description;constructor(e){super({name:"InvalidClientException",$fault:"client",...e});Object.setPrototypeOf(this,A.prototype),this.error=e.error,this.error_description=e.error_description}}class y extends i{static shapeId="com.amazonaws.ssooidc#InvalidGrantException";name="InvalidGrantException";$fault="client";error;error_description;constructor(e){super({name:"InvalidGrantException",$fault:"client",...e});Object.setPrototypeOf(this,y.prototype),this.error=e.error,this.error_description=e.error_description}}class T extends i{static shapeId="com.amazonaws.ssooidc#InvalidRequestException";name="InvalidRequestException";$fault="client";error;reason;error_description;constructor(e){super({name:"InvalidRequestException",$fault:"client",...e});Object.setPrototypeOf(this,T.prototype),this.error=e.error,this.reason=e.reason,this.error_description=e.error_description}}class O extends i{static shapeId="com.amazonaws.ssooidc#InvalidScopeException";name="InvalidScopeException";$fault="client";error;error_description;constructor(e){super({name:"InvalidScopeException",$fault:"client",...e});Object.setPrototypeOf(this,O.prototype),this.error=e.error,this.error_description=e.error_description}}class w extends i{static shapeId="com.amazonaws.ssooidc#SlowDownException";name="SlowDownException";$fault="client";error;error_description;constructor(e){super({name:"SlowDownException",$fault:"client",...e});Object.setPrototypeOf(this,w.prototype),this.error=e.error,this.error_description=e.error_description}}class D extends i{static shapeId="com.amazonaws.ssooidc#UnauthorizedClientException";name="UnauthorizedClientException";$fault="client";error;error_description;constructor(e){super({name:"UnauthorizedClientException",$fault:"client",...e});Object.setPrototypeOf(this,D.prototype),this.error=e.error,this.error_description=e.error_description}}class R extends i{static shapeId="com.amazonaws.ssooidc#UnsupportedGrantTypeException";name="UnsupportedGrantTypeException";$fault="client";error;error_description;constructor(e){super({name:"UnsupportedGrantTypeException",$fault:"client",...e});Object.setPrototypeOf(this,R.prototype),this.error=e.error,this.error_description=e.error_description}}var Jt="AccessDeniedException",Xt="AuthorizationPendingException",Qt="AccessToken",Zt="ClientSecret",er="CreateToken",tr="CreateTokenRequest",rr="CreateTokenResponse",or="CodeVerifier",nr="ExpiredTokenException",sr="InvalidClientException",ir="InvalidGrantException",cr="InvalidRequestException",ar="InternalServerException",dr="InvalidScopeException",pr="IdToken",ur="RefreshToken",lr="SlowDownException",hr="UnauthorizedClientException",Er="UnsupportedGrantTypeException",gr="accessToken",l="client",_r="clientId",mr="clientSecret",xr="codeVerifier",Sr="code",fr="deviceCode",r="error",Ir="expiresIn",p="error_description",vr="grantType",Pr="http",u="httpError",Cr="idToken",Y="reason",J="refreshToken",Ar="redirectUri",X="smithy.ts.sdk.synthetic.com.amazonaws.ssooidc",yr="scope",Tr="server",Or="tokenType",o="com.amazonaws.ssooidc",Q=new B(X),te=[-3,X,"SSOOIDCServiceException",0,[],[]];Q.registerError(te,i);var a=new B(o),re=[-3,o,Jt,{[r]:l,[u]:400},[r,Y,p],[0,0,0]];a.registerError(re,I);var oe=[-3,o,Xt,{[r]:l,[u]:400},[r,p],[0,0]];a.registerError(oe,v);var ne=[-3,o,nr,{[r]:l,[u]:400},[r,p],[0,0]];a.registerError(ne,P);var se=[-3,o,ar,{[r]:Tr,[u]:500},[r,p],[0,0]];a.registerError(se,C);var ie=[-3,o,sr,{[r]:l,[u]:401},[r,p],[0,0]];a.registerError(ie,A);var ce=[-3,o,ir,{[r]:l,[u]:400},[r,p],[0,0]];a.registerError(ce,y);var ae=[-3,o,cr,{[r]:l,[u]:400},[r,Y,p],[0,0,0]];a.registerError(ae,T);var de=[-3,o,dr,{[r]:l,[u]:400},[r,p],[0,0]];a.registerError(de,O);var pe=[-3,o,lr,{[r]:l,[u]:400},[r,p],[0,0]];a.registerError(pe,w);var ue=[-3,o,hr,{[r]:l,[u]:400},[r,p],[0,0]];a.registerError(ue,D);var le=[-3,o,Er,{[r]:l,[u]:400},[r,p],[0,0]];a.registerError(le,R);var he=[Q,a],wr=[0,o,Qt,8,0],Dr=[0,o,Zt,8,0],Rr=[0,o,or,8,0],kr=[0,o,pr,8,0],Ee=[0,o,ur,8,0],ge=[3,o,tr,0,[_r,mr,vr,fr,Sr,J,yr,Ar,xr],[0,[()=>Dr,0],0,0,0,[()=>Ee,0],64,0,[()=>Rr,0]],3],me=[3,o,rr,0,[gr,Or,Ir,J,Cr],[[()=>wr,0],0,1,[()=>Ee,0],[()=>kr,0]]],xe=[9,o,er,{[Pr]:["POST","/token",200]},()=>ge,()=>me],$r=(e)=>({apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??Dt,base64Encoder:e?.base64Encoder??wt,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Yt,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??zt,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(t)=>t.getIdentityProvider("aws.auth#sigv4"),signer:new At},{schemeId:"smithy.api#noAuth",identityProvider:(t)=>t.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new Fe}],logger:e?.logger??new Le,protocol:e?.protocol??Nt,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.ssooidc",errorTypeRegistries:he,version:"2019-06-10",serviceTarget:"AWSSSOOIDCService"},serviceId:e?.serviceId??"SSO OIDC",sha256:e?.sha256??bt,urlParser:e?.urlParser??Et,utf8Decoder:e?.utf8Decoder??Ot,utf8Encoder:e?.utf8Encoder??Tt}),Nr=(e)=>{Be(process.version);let t=tt(e),n=()=>t().then(We),d=$r(e);Ce(process.version);let s={profile:e?.profile,logger:d.logger};return{...d,...e,runtime:"node",defaultsMode:t,authSchemePreference:e?.authSchemePreference??h(yt,s),bodyLengthChecker:e?.bodyLengthChecker??Rt,defaultUserAgentProvider:e?.defaultUserAgentProvider??ye({serviceId:d.serviceId,clientVersion:Kt.version}),maxAttempts:e?.maxAttempts??h(ft,e),region:e?.region??h(nt,{...st,...s}),requestHandler:$t.create(e?.requestHandler??n),retryMode:e?.retryMode??h({...St,default:async()=>(await n()).retryMode||xt},e),streamCollector:e?.streamCollector??kt,useDualstackEndpoint:e?.useDualstackEndpoint??h(ot,s),useFipsEndpoint:e?.useFipsEndpoint??h(rt,s),userAgentAppId:e?.userAgentAppId??h(Oe,s)}},br=(e)=>{let{httpAuthSchemes:t,httpAuthSchemeProvider:n,credentials:d}=e;return{setHttpAuthScheme(s){let m=t.findIndex((k)=>k.schemeId===s.schemeId);if(m===-1)t.push(s);else t.splice(m,1,s)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(s){n=s},httpAuthSchemeProvider(){return n},setCredentials(s){d=s},credentials(){return d}}},Ur=(e)=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}),Fr=(e,t)=>{let n=Object.assign(we(e),Je(e),gt(e),br(e));return t.forEach((d)=>d.configure(n)),Object.assign(e,De(n),Xe(n),_t(n),Ur(n))};class F extends L{config;constructor(...[e]){let t=Nr(e||{});super(t);this.initConfig=t;let n=Gt(t),d=Re(n),s=It(d),m=it(s),k=ke(m),Se=lt(k),fe=Ht(Se),Ie=Fr(fe,e?.extensions||[]);this.config=Ie,this.middlewareStack.use(Pt(this.config)),this.middlewareStack.use($e(this.config)),this.middlewareStack.use(vt(this.config)),this.middlewareStack.use(mt(this.config)),this.middlewareStack.use(Ne(this.config)),this.middlewareStack.use(be(this.config)),this.middlewareStack.use(Ue(this.config)),this.middlewareStack.use(ze(this.config,{httpAuthSchemeParametersProvider:Ut,identityProviderConfigProvider:async(ve)=>new Ge({"aws.auth#sigv4":ve.credentials})})),this.middlewareStack.use(Me(this.config))}destroy(){super.destroy()}}var qr=Qe(Mt,"AWSSSOOIDCService","SSOOIDCClient",ht),zr={},Hr=(e,t,n,d)=>[];class q extends qr(zr,Hr,"CreateToken",xe){}var Gr={CreateTokenCommand:q};class H extends F{}Ze(Gr,H);var Mr={KMS_ACCESS_DENIED:"KMS_AccessDeniedException"},jr={KMS_DISABLED_KEY:"KMS_DisabledException",KMS_INVALID_KEY_USAGE:"KMS_InvalidKeyUsageException",KMS_INVALID_STATE:"KMS_InvalidStateException",KMS_KEY_NOT_FOUND:"KMS_NotFoundException"};var Lr=I,Br=re,Wr=Mr,Yr=v,Jr=oe,Xr=xe,Qr=q,Zr=ge,eo=me,to=P,ro=ne,oo=C,no=se,so=A,io=ie,co=y,ao=ce,po=T,uo=ae,lo=jr,ho=O,Eo=de,go=H,_o=F,mo=i,xo=te,So=w,fo=pe,Io=D,vo=ue,Po=R,Co=le,Ao=he;export{Kr as $Command,Vr as __Client,Lr as AccessDeniedException,Br as AccessDeniedException$,Wr as AccessDeniedExceptionReason,Yr as AuthorizationPendingException,Jr as AuthorizationPendingException$,Xr as CreateToken$,Qr as CreateTokenCommand,Zr as CreateTokenRequest$,eo as CreateTokenResponse$,to as ExpiredTokenException,ro as ExpiredTokenException$,oo as InternalServerException,no as InternalServerException$,so as InvalidClientException,io as InvalidClientException$,co as InvalidGrantException,ao as InvalidGrantException$,po as InvalidRequestException,uo as InvalidRequestException$,lo as InvalidRequestExceptionReason,ho as InvalidScopeException,Eo as InvalidScopeException$,go as SSOOIDC,_o as SSOOIDCClient,mo as SSOOIDCServiceException,xo as SSOOIDCServiceException$,So as SlowDownException,fo as SlowDownException$,Io as UnauthorizedClientException,vo as UnauthorizedClientException$,Po as UnsupportedGrantTypeException,Co as UnsupportedGrantTypeException$,Ao as errorTypeRegistries};
2
+ import{He,at}from"./chunk-6ef085c1.js";import{qe}from"./chunk-1w4nh5t6.js";import{je,Pe,B}from"./chunk-mh4bjtfs.js";import{_e,Z,v,Ae,ee,Ye,z}from"./chunk-cs91rmbf.js";var{awsEndpointFunctions:Ce,emitWarningIfUnsupportedVersion:ye,createDefaultUserAgentProvider:Te,NODE_APP_ID_CONFIG_OPTIONS:Oe,getAwsRegionExtensionConfiguration:we,resolveAwsRegionExtensionConfiguration:De,resolveUserAgentConfig:Re,resolveHostHeaderConfig:ke,getUserAgentPlugin:$e,getHostHeaderPlugin:Ne,getLoggerPlugin:be,getRecursionDetectionPlugin:Ue}=B(),{NoAuthSigner:Fe,getHttpAuthSchemeEndpointRuleSetPlugin:ze,DefaultIdentityProviderConfig:Ge,getHttpSigningPlugin:Me}=Pe(),{normalizeProvider:K,getSmithyContext:Ke,ServiceException:Ve,NoOpLogger:Le,emitWarningIfUnsupportedVersion:Be,loadConfigsForDefaultMode:We,getDefaultExtensionConfiguration:Je,resolveDefaultRuntimeConfig:Xe,Client:V,makeBuilder:Qe,createAggregatedClient:Ze}=Z(),{Command:et}=Z();var Kr=et,Vr=V;var{resolveDefaultsModeConfig:tt,loadConfig:h,NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS:rt,NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS:ot,NODE_REGION_CONFIG_OPTIONS:nt,NODE_REGION_CONFIG_FILE_OPTIONS:st,resolveRegionConfig:it}=v(),{BinaryDecisionDiagram:ct,EndpointCache:dt,decideEndpoint:pt,customEndpointFunctions:ut,resolveEndpointConfig:lt,getEndpointPlugin:ht}=Ae(),{parseUrl:Et,getHttpHandlerExtensionConfiguration:gt,resolveHttpHandlerRuntimeConfig:_t,getContentLengthPlugin:mt}=z(),{DEFAULT_RETRY_MODE:xt,NODE_RETRY_MODE_CONFIG_OPTIONS:St,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:ft,resolveRetryConfig:It,getRetryPlugin:vt}=je(),{TypeRegistry:L,getSchemaSerdePlugin:Pt}=_e(),{resolveAwsSdkSigV4Config:Ct,AwsSdkSigV4Signer:At,NODE_AUTH_SCHEME_PREFERENCE_OPTIONS:yt}=He(),{toUtf8:Tt,fromUtf8:Ot,toBase64:wt,fromBase64:Dt,calculateBodyLength:Rt}=ee(),{streamCollector:kt,NodeHttpHandler:$t}=qe(),{AwsRestJsonProtocol:Nt}=at(),{Sha256:bt}=Ye(),Ut=async(e,t,n)=>({operation:Ke(t).operation,region:await K(e.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function Ft(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sso-oauth",region:e.region},propertiesExtractor:(t,n)=>({signingProperties:{config:t,context:n}})}}function qt(e){return{schemeId:"smithy.api#noAuth"}}var zt=(e)=>{let t=[];switch(e.operation){case"CreateToken":{t.push(qt());break}default:t.push(Ft(e))}return t},Ht=(e)=>{let t=Ct(e);return Object.assign(t,{authSchemePreference:K(e.authSchemePreference??[])})},Gt=(e)=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"sso-oauth"}),Mt={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},jt="3.997.47",Kt={version:jt},_="ref",E=-1,x=!0,H="isSet",W="PartitionResult",S="booleanEquals",N="getAttr",G={[_]:"Endpoint"},b={[_]:W},g={},M=[{[_]:"Region"}],j={conditions:[[H,[G]],[H,M],["aws.partition",M,W],[S,[{[_]:"UseFIPS"},x]],[S,[{[_]:"UseDualStack"},x]],[S,[{fn:N,argv:[b,"supportsDualStack"]},x]],[S,[{fn:N,argv:[b,"supportsFIPS"]},x]],["stringEquals",[{fn:N,argv:[b,"name"]},"aws-us-gov"]]],results:[[E],[E,"Invalid Configuration: FIPS and custom endpoint are not supported"],[E,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[G,g],["https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",g],[E,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://oidc.{Region}.amazonaws.com",g],["https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}",g],[E,"FIPS is enabled but this partition does not support FIPS"],["https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}",g],[E,"DualStack is enabled but this partition does not support DualStack"],["https://oidc.{Region}.{PartitionResult#dnsSuffix}",g],[E,"Invalid Configuration: Missing Region"]]},Vt=2,c=1e8,Lt=new Int32Array([-1,1,-1,0,13,3,1,4,c+12,2,5,c+12,3,8,6,4,7,c+11,5,c+9,c+10,4,11,9,6,10,c+8,7,c+6,c+7,5,12,c+5,6,c+4,c+5,3,c+1,14,4,c+2,c+3]),Bt=ct.from(Lt,Vt,j.conditions,j.results),Wt=new dt({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),Yt=(e,t={})=>Wt.get(e,()=>pt(Bt,{endpointParams:e,logger:t.logger}));ut.aws=Ce;class i extends Ve{static shapeId="smithy.ts.sdk.synthetic.com.amazonaws.ssooidc#SSOOIDCServiceException";constructor(e){super(e);Object.setPrototypeOf(this,i.prototype)}}class f extends i{static shapeId="com.amazonaws.ssooidc#AccessDeniedException";name="AccessDeniedException";$fault="client";error;reason;error_description;constructor(e){super({name:"AccessDeniedException",$fault:"client",...e});Object.setPrototypeOf(this,f.prototype),this.error=e.error,this.reason=e.reason,this.error_description=e.error_description}}class I extends i{static shapeId="com.amazonaws.ssooidc#AuthorizationPendingException";name="AuthorizationPendingException";$fault="client";error;error_description;constructor(e){super({name:"AuthorizationPendingException",$fault:"client",...e});Object.setPrototypeOf(this,I.prototype),this.error=e.error,this.error_description=e.error_description}}class P extends i{static shapeId="com.amazonaws.ssooidc#ExpiredTokenException";name="ExpiredTokenException";$fault="client";error;error_description;constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e});Object.setPrototypeOf(this,P.prototype),this.error=e.error,this.error_description=e.error_description}}class C extends i{static shapeId="com.amazonaws.ssooidc#InternalServerException";name="InternalServerException";$fault="server";error;error_description;constructor(e){super({name:"InternalServerException",$fault:"server",...e});Object.setPrototypeOf(this,C.prototype),this.error=e.error,this.error_description=e.error_description}}class A extends i{static shapeId="com.amazonaws.ssooidc#InvalidClientException";name="InvalidClientException";$fault="client";error;error_description;constructor(e){super({name:"InvalidClientException",$fault:"client",...e});Object.setPrototypeOf(this,A.prototype),this.error=e.error,this.error_description=e.error_description}}class y extends i{static shapeId="com.amazonaws.ssooidc#InvalidGrantException";name="InvalidGrantException";$fault="client";error;error_description;constructor(e){super({name:"InvalidGrantException",$fault:"client",...e});Object.setPrototypeOf(this,y.prototype),this.error=e.error,this.error_description=e.error_description}}class T extends i{static shapeId="com.amazonaws.ssooidc#InvalidRequestException";name="InvalidRequestException";$fault="client";error;reason;error_description;constructor(e){super({name:"InvalidRequestException",$fault:"client",...e});Object.setPrototypeOf(this,T.prototype),this.error=e.error,this.reason=e.reason,this.error_description=e.error_description}}class O extends i{static shapeId="com.amazonaws.ssooidc#InvalidScopeException";name="InvalidScopeException";$fault="client";error;error_description;constructor(e){super({name:"InvalidScopeException",$fault:"client",...e});Object.setPrototypeOf(this,O.prototype),this.error=e.error,this.error_description=e.error_description}}class w extends i{static shapeId="com.amazonaws.ssooidc#SlowDownException";name="SlowDownException";$fault="client";error;error_description;constructor(e){super({name:"SlowDownException",$fault:"client",...e});Object.setPrototypeOf(this,w.prototype),this.error=e.error,this.error_description=e.error_description}}class D extends i{static shapeId="com.amazonaws.ssooidc#UnauthorizedClientException";name="UnauthorizedClientException";$fault="client";error;error_description;constructor(e){super({name:"UnauthorizedClientException",$fault:"client",...e});Object.setPrototypeOf(this,D.prototype),this.error=e.error,this.error_description=e.error_description}}class R extends i{static shapeId="com.amazonaws.ssooidc#UnsupportedGrantTypeException";name="UnsupportedGrantTypeException";$fault="client";error;error_description;constructor(e){super({name:"UnsupportedGrantTypeException",$fault:"client",...e});Object.setPrototypeOf(this,R.prototype),this.error=e.error,this.error_description=e.error_description}}var Jt="AccessDeniedException",Xt="AuthorizationPendingException",Qt="AccessToken",Zt="ClientSecret",er="CreateToken",tr="CreateTokenRequest",rr="CreateTokenResponse",or="CodeVerifier",nr="ExpiredTokenException",sr="InvalidClientException",ir="InvalidGrantException",cr="InvalidRequestException",ar="InternalServerException",dr="InvalidScopeException",pr="IdToken",ur="RefreshToken",lr="SlowDownException",hr="UnauthorizedClientException",Er="UnsupportedGrantTypeException",gr="accessToken",l="client",_r="clientId",mr="clientSecret",xr="codeVerifier",Sr="code",fr="deviceCode",r="error",Ir="expiresIn",p="error_description",vr="grantType",Pr="http",u="httpError",Cr="idToken",Y="reason",J="refreshToken",Ar="redirectUri",X="smithy.ts.sdk.synthetic.com.amazonaws.ssooidc",yr="scope",Tr="server",Or="tokenType",o="com.amazonaws.ssooidc",Q=new L(X),te=[-3,X,"SSOOIDCServiceException",0,[],[]];Q.registerError(te,i);var a=new L(o),re=[-3,o,Jt,{[r]:l,[u]:400},[r,Y,p],[0,0,0]];a.registerError(re,f);var oe=[-3,o,Xt,{[r]:l,[u]:400},[r,p],[0,0]];a.registerError(oe,I);var ne=[-3,o,nr,{[r]:l,[u]:400},[r,p],[0,0]];a.registerError(ne,P);var se=[-3,o,ar,{[r]:Tr,[u]:500},[r,p],[0,0]];a.registerError(se,C);var ie=[-3,o,sr,{[r]:l,[u]:401},[r,p],[0,0]];a.registerError(ie,A);var ce=[-3,o,ir,{[r]:l,[u]:400},[r,p],[0,0]];a.registerError(ce,y);var ae=[-3,o,cr,{[r]:l,[u]:400},[r,Y,p],[0,0,0]];a.registerError(ae,T);var de=[-3,o,dr,{[r]:l,[u]:400},[r,p],[0,0]];a.registerError(de,O);var pe=[-3,o,lr,{[r]:l,[u]:400},[r,p],[0,0]];a.registerError(pe,w);var ue=[-3,o,hr,{[r]:l,[u]:400},[r,p],[0,0]];a.registerError(ue,D);var le=[-3,o,Er,{[r]:l,[u]:400},[r,p],[0,0]];a.registerError(le,R);var he=[Q,a],wr=[0,o,Qt,8,0],Dr=[0,o,Zt,8,0],Rr=[0,o,or,8,0],kr=[0,o,pr,8,0],Ee=[0,o,ur,8,0],ge=[3,o,tr,0,[_r,mr,vr,fr,Sr,J,yr,Ar,xr],[0,[()=>Dr,0],0,0,0,[()=>Ee,0],64,0,[()=>Rr,0]],3],me=[3,o,rr,0,[gr,Or,Ir,J,Cr],[[()=>wr,0],0,1,[()=>Ee,0],[()=>kr,0]]],xe=[9,o,er,{[Pr]:["POST","/token",200]},()=>ge,()=>me],$r=(e)=>({apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??Dt,base64Encoder:e?.base64Encoder??wt,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Yt,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??zt,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(t)=>t.getIdentityProvider("aws.auth#sigv4"),signer:new At},{schemeId:"smithy.api#noAuth",identityProvider:(t)=>t.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new Fe}],logger:e?.logger??new Le,protocol:e?.protocol??Nt,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.ssooidc",errorTypeRegistries:he,version:"2019-06-10",serviceTarget:"AWSSSOOIDCService"},serviceId:e?.serviceId??"SSO OIDC",sha256:e?.sha256??bt,urlParser:e?.urlParser??Et,utf8Decoder:e?.utf8Decoder??Ot,utf8Encoder:e?.utf8Encoder??Tt}),Nr=(e)=>{Be(process.version);let t=tt(e),n=()=>t().then(We),d=$r(e);ye(process.version);let s={profile:e?.profile,logger:d.logger};return{...d,...e,runtime:"node",defaultsMode:t,authSchemePreference:e?.authSchemePreference??h(yt,s),bodyLengthChecker:e?.bodyLengthChecker??Rt,defaultUserAgentProvider:e?.defaultUserAgentProvider??Te({serviceId:d.serviceId,clientVersion:Kt.version}),maxAttempts:e?.maxAttempts??h(ft,e),region:e?.region??h(nt,{...st,...s}),requestHandler:$t.create(e?.requestHandler??n),retryMode:e?.retryMode??h({...St,default:async()=>(await n()).retryMode||xt},e),streamCollector:e?.streamCollector??kt,useDualstackEndpoint:e?.useDualstackEndpoint??h(ot,s),useFipsEndpoint:e?.useFipsEndpoint??h(rt,s),userAgentAppId:e?.userAgentAppId??h(Oe,s)}},br=(e)=>{let{httpAuthSchemes:t,httpAuthSchemeProvider:n,credentials:d}=e;return{setHttpAuthScheme(s){let m=t.findIndex((k)=>k.schemeId===s.schemeId);if(m===-1)t.push(s);else t.splice(m,1,s)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(s){n=s},httpAuthSchemeProvider(){return n},setCredentials(s){d=s},credentials(){return d}}},Ur=(e)=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}),Fr=(e,t)=>{let n=Object.assign(we(e),Je(e),gt(e),br(e));return t.forEach((d)=>d.configure(n)),Object.assign(e,De(n),Xe(n),_t(n),Ur(n))};class U extends V{config;constructor(...[e]){let t=Nr(e||{});super(t);this.initConfig=t;let n=Gt(t),d=Re(n),s=It(d),m=it(s),k=ke(m),Se=lt(k),fe=Ht(Se),Ie=Fr(fe,e?.extensions||[]);this.config=Ie,this.middlewareStack.use(Pt(this.config)),this.middlewareStack.use($e(this.config)),this.middlewareStack.use(vt(this.config)),this.middlewareStack.use(mt(this.config)),this.middlewareStack.use(Ne(this.config)),this.middlewareStack.use(be(this.config)),this.middlewareStack.use(Ue(this.config)),this.middlewareStack.use(ze(this.config,{httpAuthSchemeParametersProvider:Ut,identityProviderConfigProvider:async(ve)=>new Ge({"aws.auth#sigv4":ve.credentials})})),this.middlewareStack.use(Me(this.config))}destroy(){super.destroy()}}var qr=Qe(Mt,"AWSSSOOIDCService","SSOOIDCClient",ht),zr={},Hr=(e,t,n,d)=>[];class F extends qr(zr,Hr,"CreateToken",xe){}var Gr={CreateTokenCommand:F};class q extends U{}Ze(Gr,q);var Mr={KMS_ACCESS_DENIED:"KMS_AccessDeniedException"},jr={KMS_DISABLED_KEY:"KMS_DisabledException",KMS_INVALID_KEY_USAGE:"KMS_InvalidKeyUsageException",KMS_INVALID_STATE:"KMS_InvalidStateException",KMS_KEY_NOT_FOUND:"KMS_NotFoundException"};var Lr=f,Br=re,Wr=Mr,Yr=I,Jr=oe,Xr=xe,Qr=F,Zr=ge,eo=me,to=P,ro=ne,oo=C,no=se,so=A,io=ie,co=y,ao=ce,po=T,uo=ae,lo=jr,ho=O,Eo=de,go=q,_o=U,mo=i,xo=te,So=w,fo=pe,Io=D,vo=ue,Po=R,Co=le,Ao=he;export{Kr as $Command,Vr as __Client,Lr as AccessDeniedException,Br as AccessDeniedException$,Wr as AccessDeniedExceptionReason,Yr as AuthorizationPendingException,Jr as AuthorizationPendingException$,Xr as CreateToken$,Qr as CreateTokenCommand,Zr as CreateTokenRequest$,eo as CreateTokenResponse$,to as ExpiredTokenException,ro as ExpiredTokenException$,oo as InternalServerException,no as InternalServerException$,so as InvalidClientException,io as InvalidClientException$,co as InvalidGrantException,ao as InvalidGrantException$,po as InvalidRequestException,uo as InvalidRequestException$,lo as InvalidRequestExceptionReason,ho as InvalidScopeException,Eo as InvalidScopeException$,go as SSOOIDC,_o as SSOOIDCClient,mo as SSOOIDCServiceException,xo as SSOOIDCServiceException$,So as SlowDownException,fo as SlowDownException$,Io as UnauthorizedClientException,vo as UnauthorizedClientException$,Po as UnsupportedGrantTypeException,Co as UnsupportedGrantTypeException$,Ao as errorTypeRegistries};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- class n{incoming=[];outgoing=[];get length(){return this.incoming.length+this.outgoing.length}enqueue(e){this.incoming.push(e)}dequeue(){if(this.outgoing.length===0)while(this.incoming.length>0)this.outgoing.push(this.incoming.pop());return this.outgoing.pop()}}class so{queue=new n;waiting=new n;done=!1;finalResultPromise;resolveFinalResult;isComplete;extractResult;constructor(e,t){this.isComplete=e,this.extractResult=t,this.finalResultPromise=new Promise((i)=>{this.resolveFinalResult=i})}push(e){if(this.done)return;if(this.isComplete(e))this.done=!0,this.resolveFinalResult(this.extractResult(e));let t=this.waiting.dequeue();if(t)t({value:e,done:!1});else this.queue.enqueue(e)}end(e){if(this.done=!0,e!==void 0)this.resolveFinalResult(e);while(this.waiting.length>0)this.waiting.dequeue()({value:void 0,done:!0})}async*[Symbol.asyncIterator](){while(!0)if(this.queue.length>0)yield this.queue.dequeue();else if(this.done)return;else{let e=await new Promise((t)=>this.waiting.enqueue(t));if(e.done)return;yield e.value}}result(){return this.finalResultPromise}}class D extends so{#t=Date.now();#i=performance.now();constructor(){super((e)=>e.type==="done"||e.type==="error",(e)=>{if(e.type==="done")return e.message;else if(e.type==="error")return e.error;throw Error("Unexpected event type for final result")})}push(e){if(e.type==="done")this.#e(e.message);else if(e.type==="error")this.#e(e.error);super.push(e)}end(e){if(e!==void 0)this.#e(e);super.end(e)}#e(e){if(this.done||e.durationMs!==void 0||e.timestamp<this.#t)return;e.durationMs=Math.max(0,Math.round(performance.now()-this.#i))}}function ao(){return new D}function Xe(e){if(e instanceof Error)return e.message||e.name;if(typeof e==="string")return e;return String(e)}function qi(e){if(!(e instanceof Error))return{name:"ThrownValue",message:Xe(e)};let t=e.code;return{name:e.name||void 0,message:e.message||e.name,stack:e.stack,code:typeof t==="string"||typeof t==="number"?t:void 0}}function jt(e,t,i){return{type:e,timestamp:Date.now(),error:qi(t),details:i}}function Ie(e,t){e.diagnostics=[...e.diagnostics??[],t]}
3
- export{so,D,ao,Xe,qi,jt,Ie};
2
+ class n{incoming=[];outgoing=[];get length(){return this.incoming.length+this.outgoing.length}enqueue(e){this.incoming.push(e)}dequeue(){if(this.outgoing.length===0)while(this.incoming.length>0)this.outgoing.push(this.incoming.pop());return this.outgoing.pop()}}class so{queue=new n;waiting=new n;done=!1;finalResultPromise;resolveFinalResult;isComplete;extractResult;constructor(e,t){this.isComplete=e,this.extractResult=t,this.finalResultPromise=new Promise((i)=>{this.resolveFinalResult=i})}push(e){if(this.done)return;if(this.isComplete(e))this.done=!0,this.resolveFinalResult(this.extractResult(e));let t=this.waiting.dequeue();if(t)t({value:e,done:!1});else this.queue.enqueue(e)}end(e){if(this.done=!0,e!==void 0)this.resolveFinalResult(e);while(this.waiting.length>0)this.waiting.dequeue()({value:void 0,done:!0})}async*[Symbol.asyncIterator](){while(!0)if(this.queue.length>0)yield this.queue.dequeue();else if(this.done)return;else{let e=await new Promise((t)=>this.waiting.enqueue(t));if(e.done)return;yield e.value}}result(){return this.finalResultPromise}}class U extends so{#t=Date.now();#i=performance.now();constructor(){super((e)=>e.type==="done"||e.type==="error",(e)=>{if(e.type==="done")return e.message;else if(e.type==="error")return e.error;throw Error("Unexpected event type for final result")})}push(e){if(e.type==="done")this.#e(e.message);else if(e.type==="error")this.#e(e.error);super.push(e)}end(e){if(e!==void 0)this.#e(e);super.end(e)}#e(e){if(this.done||e.durationMs!==void 0||e.timestamp<this.#t)return;e.durationMs=Math.max(0,Math.round(performance.now()-this.#i))}}function ao(){return new U}function Xe(e){if(e instanceof Error)return e.message||e.name;if(typeof e==="string")return e;return String(e)}function qi(e){if(!(e instanceof Error))return{name:"ThrownValue",message:Xe(e)};let t=e.code;return{name:e.name||void 0,message:e.message||e.name,stack:e.stack,code:typeof t==="string"||typeof t==="number"?t:void 0}}function jt(e,t,i){return{type:e,timestamp:Date.now(),error:qi(t),details:i}}function Ie(e,t){e.diagnostics=[...e.diagnostics??[],t]}
3
+ export{so,U,ao,Xe,qi,jt,Ie};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{It,Xt,Jt,Yt,Zt,vr,_r,Mt,Ar,Er,Pr,Tr,kr,Rr}from"./chunk-zx75vnw8.js";import{ne}from"./chunk-959z9efn.js";import{X}from"./chunk-2tf7qfbx.js";import{w}from"./chunk-b516bp7n.js";import{j,J}from"./chunk-rn3jwyh1.js";import{we}from"./chunk-tfhp09nj.js";import{W,ge,ae,Ue,Y,V}from"./chunk-y4pvhes1.js";import{D}from"./chunk-szj85dqe.js";var b=0,y=(n,a,t)=>{let o=new D,g=Ue(a);return(async()=>{let e={role:"assistant",content:[],api:"google-generative-ai",provider:n.provider,model:n.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"pending",timestamp:Date.now()};try{if(t?.fetch&&t.fetch!==globalThis.fetch)throw Error("Custom fetch is not supported by the Google Generative AI adapter");let l=t?.apiKey;if(!l)throw Error(`No API key for provider: ${n.provider}`);let c=T(n,l,t?.headers),h=S(n,g,t),k=await t?.onPayload?.(h,n);if(k!==void 0)h=k;let p=await Rr(()=>c.models.generateContentStream(h),t);o.push({type:"start",partial:e});let i=null,f=e.content,u=()=>f.length-1;for await(let s of p){await t?.onProviderStreamEvent?.(s,n),e.responseId||=s.responseId;let m=s.candidates?.[0];if(m?.content?.parts)for(let r of m.content.parts){if(r.text!==void 0){let d=_r(r);if(!i||d&&i.type!=="thinking"||!d&&i.type!=="text"){if(i)if(i.type==="text")o.push({type:"text_end",contentIndex:f.length-1,content:i.text,partial:e});else o.push({type:"thinking_end",contentIndex:u(),content:i.thinking,partial:e});if(d)i={type:"thinking",thinking:"",thinkingSignature:void 0},e.content.push(i),o.push({type:"thinking_start",contentIndex:u(),partial:e});else i={type:"text",text:""},e.content.push(i),o.push({type:"text_start",contentIndex:u(),partial:e})}if(i.type==="thinking")i.thinking+=r.text,i.thinkingSignature=Mt(i.thinkingSignature,r.thoughtSignature),o.push({type:"thinking_delta",contentIndex:u(),delta:r.text,partial:e});else i.text+=r.text,i.textSignature=Mt(i.textSignature,r.thoughtSignature),o.push({type:"text_delta",contentIndex:u(),delta:r.text,partial:e})}if(r.functionCall){if(i){if(i.type==="text")o.push({type:"text_end",contentIndex:u(),content:i.text,partial:e});else o.push({type:"thinking_end",contentIndex:u(),content:i.thinking,partial:e});i=null}let d=r.functionCall.id,C={type:"toolCall",id:!d||e.content.some((x)=>x.type==="toolCall"&&x.id===d)?`${r.functionCall.name}_${Date.now()}_${++b}`:d,name:r.functionCall.name||"",arguments:r.functionCall.args??{},...r.thoughtSignature&&{thoughtSignature:r.thoughtSignature}};e.content.push(C),o.push({type:"toolcall_start",contentIndex:u(),partial:e}),o.push({type:"toolcall_delta",contentIndex:u(),delta:JSON.stringify(C.arguments),partial:e}),o.push({type:"toolcall_end",contentIndex:u(),toolCall:C,partial:e})}}if(m?.finishReason){if(e.rawStopReason=m.finishReason,e.stopReason=kr(m.finishReason),e.content.some((r)=>r.type==="toolCall")&&e.stopReason==="stop")e.stopReason="toolUse"}if(s.usageMetadata)e.usage={input:(s.usageMetadata.promptTokenCount||0)-(s.usageMetadata.cachedContentTokenCount||0),output:(s.usageMetadata.candidatesTokenCount||0)+(s.usageMetadata.thoughtsTokenCount||0),cacheRead:s.usageMetadata.cachedContentTokenCount||0,cacheWrite:0,reasoning:s.usageMetadata.thoughtsTokenCount||0,totalTokens:s.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},Y(n,e.usage)}if(i)if(i.type==="text")o.push({type:"text_end",contentIndex:u(),content:i.text,partial:e});else o.push({type:"thinking_end",contentIndex:u(),content:i.thinking,partial:e});if(t?.signal?.aborted)throw Error("Request was aborted");if(e.stopReason==="pending")throw Error("Google stream ended without a finish reason");if(e.stopReason==="aborted"||e.stopReason==="error"){let s=e.rawStopReason?`Provider stopped with: ${e.rawStopReason}`:"An unknown error occurred";throw Error(s)}o.push({type:"done",reason:e.stopReason,message:e}),o.end()}catch(l){for(let c of e.content)if("index"in c)delete c.index;e.stopReason=t?.signal?.aborted?"aborted":"error",e.errorMessage=J(j(l)),o.push({type:"error",reason:e.stopReason,error:e}),o.end()}})(),o},K=(n,a,t)=>{let o=t?.apiKey;if(!o)throw Error(`No API key for provider: ${n.provider}`);let g={...X(n,a,t,o),toolChoice:t?.toolChoice};if(!t?.reasoning)return y(n,a,{...g,thinking:{enabled:!1}});let e=V(n,t.reasoning);if(e==="off")return y(n,a,{...g,thinking:{enabled:!1}});let l=Xt(n,e);if(Jt(n))return y(n,a,{...g,thinking:{enabled:!0,level:Yt(l)}});return y(n,a,{...g,thinking:{enabled:!0,budgetTokens:I(n,l,t.thinkingBudgets)}})};function T(n,a,t){let o={};if(n.baseUrl)o.baseUrl=n.baseUrl,o.apiVersion="";let g=we({"User-Agent":ne(),...n.headers,...t});if(g)o.headers=g;return new It({apiKey:a,httpOptions:Object.keys(o).length>0?o:void 0})}function S(n,a,t={}){let o=Ar(n,a),g=ge(a.messages),e=ae(a.messages),l={};if(t.temperature!==void 0)l.temperature=t.temperature;if(t.maxTokens!==void 0)l.maxOutputTokens=t.maxTokens;let c=Pr(n.id),h=e.length>0?Tr(e,t.toolChoice,c):void 0,k=g?W(g):"",p={...Object.keys(l).length>0&&l,...k&&{systemInstruction:w(k)},...e.length>0&&{tools:Er(e,!1,c)},...h!==void 0&&{toolConfig:{functionCallingConfig:{mode:h}}}};if(t.thinking?.enabled&&n.reasoning){let f={includeThoughts:!0};if(t.thinking.level!==void 0)f.thinkingLevel=Zt(t.thinking.level);else if(t.thinking.budgetTokens!==void 0)f.thinkingBudget=t.thinking.budgetTokens;p.thinkingConfig=f}else if(n.reasoning&&t.thinking&&!t.thinking.enabled)p.thinkingConfig=vr(n);if(t.signal){if(t.signal.aborted)throw Error("Request aborted");p.abortSignal=t.signal}return{model:n.id,contents:o,config:p}}function I(n,a,t){if(t?.[a]!==void 0)return t[a];if(n.id.includes("2.5-pro"))return{minimal:128,low:2048,medium:8192,high:32768}[a];if(n.id.includes("2.5-flash-lite"))return{minimal:512,low:2048,medium:8192,high:24576}[a];if(n.id.includes("2.5-flash"))return{minimal:128,low:2048,medium:8192,high:24576}[a];return-1}export{y as stream,K as streamSimple};
2
+ import{It,Xt,Jt,Yt,Zt,_r,Ar,Mt,Er,Tr,Pr,kr,Rr,Cr}from"./chunk-39mh7h58.js";import{oe}from"./chunk-pyj6avd5.js";import{X}from"./chunk-qs161f2q.js";import{w}from"./chunk-b516bp7n.js";import{V,J}from"./chunk-8np9b2y8.js";import{we}from"./chunk-tfhp09nj.js";import{W,ge,ae,Ue,Y,K}from"./chunk-z9p6s986.js";import{U}from"./chunk-4yxd2kg1.js";var b=0,y=(n,a,t)=>{let o=new U,g=Ue(a);return(async()=>{let e={role:"assistant",content:[],api:"google-generative-ai",provider:n.provider,model:n.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"pending",timestamp:Date.now()};try{if(t?.fetch&&t.fetch!==globalThis.fetch)throw Error("Custom fetch is not supported by the Google Generative AI adapter");let l=t?.apiKey;if(!l)throw Error(`No API key for provider: ${n.provider}`);let c=T(n,l,t?.headers),h=S(n,g,t),k=await t?.onPayload?.(h,n);if(k!==void 0)h=k;let p=await Cr(()=>c.models.generateContentStream(h),t);o.push({type:"start",partial:e});let i=null,f=e.content,u=()=>f.length-1;for await(let s of p){await t?.onProviderStreamEvent?.(s,n),e.responseId||=s.responseId;let m=s.candidates?.[0];if(m?.content?.parts)for(let r of m.content.parts){if(r.text!==void 0){let d=Ar(r);if(!i||d&&i.type!=="thinking"||!d&&i.type!=="text"){if(i)if(i.type==="text")o.push({type:"text_end",contentIndex:f.length-1,content:i.text,partial:e});else o.push({type:"thinking_end",contentIndex:u(),content:i.thinking,partial:e});if(d)i={type:"thinking",thinking:"",thinkingSignature:void 0},e.content.push(i),o.push({type:"thinking_start",contentIndex:u(),partial:e});else i={type:"text",text:""},e.content.push(i),o.push({type:"text_start",contentIndex:u(),partial:e})}if(i.type==="thinking")i.thinking+=r.text,i.thinkingSignature=Mt(i.thinkingSignature,r.thoughtSignature),o.push({type:"thinking_delta",contentIndex:u(),delta:r.text,partial:e});else i.text+=r.text,i.textSignature=Mt(i.textSignature,r.thoughtSignature),o.push({type:"text_delta",contentIndex:u(),delta:r.text,partial:e})}if(r.functionCall){if(i){if(i.type==="text")o.push({type:"text_end",contentIndex:u(),content:i.text,partial:e});else o.push({type:"thinking_end",contentIndex:u(),content:i.thinking,partial:e});i=null}let d=r.functionCall.id,C={type:"toolCall",id:!d||e.content.some((x)=>x.type==="toolCall"&&x.id===d)?`${r.functionCall.name}_${Date.now()}_${++b}`:d,name:r.functionCall.name||"",arguments:r.functionCall.args??{},...r.thoughtSignature&&{thoughtSignature:r.thoughtSignature}};e.content.push(C),o.push({type:"toolcall_start",contentIndex:u(),partial:e}),o.push({type:"toolcall_delta",contentIndex:u(),delta:JSON.stringify(C.arguments),partial:e}),o.push({type:"toolcall_end",contentIndex:u(),toolCall:C,partial:e})}}if(m?.finishReason){if(e.rawStopReason=m.finishReason,e.stopReason=Rr(m.finishReason),e.content.some((r)=>r.type==="toolCall")&&e.stopReason==="stop")e.stopReason="toolUse"}if(s.usageMetadata)e.usage={input:(s.usageMetadata.promptTokenCount||0)-(s.usageMetadata.cachedContentTokenCount||0),output:(s.usageMetadata.candidatesTokenCount||0)+(s.usageMetadata.thoughtsTokenCount||0),cacheRead:s.usageMetadata.cachedContentTokenCount||0,cacheWrite:0,reasoning:s.usageMetadata.thoughtsTokenCount||0,totalTokens:s.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},Y(n,e.usage)}if(i)if(i.type==="text")o.push({type:"text_end",contentIndex:u(),content:i.text,partial:e});else o.push({type:"thinking_end",contentIndex:u(),content:i.thinking,partial:e});if(t?.signal?.aborted)throw Error("Request was aborted");if(e.stopReason==="pending")throw Error("Google stream ended without a finish reason");if(e.stopReason==="aborted"||e.stopReason==="error"){let s=e.rawStopReason?`Provider stopped with: ${e.rawStopReason}`:"An unknown error occurred";throw Error(s)}o.push({type:"done",reason:e.stopReason,message:e}),o.end()}catch(l){for(let c of e.content)if("index"in c)delete c.index;e.stopReason=t?.signal?.aborted?"aborted":"error",e.errorMessage=J(V(l)),o.push({type:"error",reason:e.stopReason,error:e}),o.end()}})(),o},z=(n,a,t)=>{let o=t?.apiKey;if(!o)throw Error(`No API key for provider: ${n.provider}`);let g={...X(n,a,t,o),toolChoice:t?.toolChoice};if(!t?.reasoning)return y(n,a,{...g,thinking:{enabled:!1}});let e=K(n,t.reasoning);if(e==="off")return y(n,a,{...g,thinking:{enabled:!1}});let l=Xt(n,e);if(Jt(n))return y(n,a,{...g,thinking:{enabled:!0,level:Yt(l)}});return y(n,a,{...g,thinking:{enabled:!0,budgetTokens:I(n,l,t.thinkingBudgets)}})};function T(n,a,t){let o={};if(n.baseUrl)o.baseUrl=n.baseUrl,o.apiVersion="";let g=we({"User-Agent":oe(),...n.headers,...t});if(g)o.headers=g;return new It({apiKey:a,httpOptions:Object.keys(o).length>0?o:void 0})}function S(n,a,t={}){let o=Er(n,a),g=ge(a.messages),e=ae(a.messages),l={};if(t.temperature!==void 0)l.temperature=t.temperature;if(t.maxTokens!==void 0)l.maxOutputTokens=t.maxTokens;let c=Pr(n.id),h=e.length>0?kr(e,t.toolChoice,c):void 0,k=g?W(g):"",p={...Object.keys(l).length>0&&l,...k&&{systemInstruction:w(k)},...e.length>0&&{tools:Tr(e,!1,c)},...h!==void 0&&{toolConfig:{functionCallingConfig:{mode:h}}}};if(t.thinking?.enabled&&n.reasoning){let f={includeThoughts:!0};if(t.thinking.level!==void 0)f.thinkingLevel=Zt(t.thinking.level);else if(t.thinking.budgetTokens!==void 0)f.thinkingBudget=t.thinking.budgetTokens;p.thinkingConfig=f}else if(n.reasoning&&t.thinking&&!t.thinking.enabled)p.thinkingConfig=_r(n);if(t.signal){if(t.signal.aborted)throw Error("Request aborted");p.abortSignal=t.signal}return{model:n.id,contents:o,config:p}}function I(n,a,t){if(t?.[a]!==void 0)return t[a];if(n.id.includes("2.5-pro"))return{minimal:128,low:2048,medium:8192,high:32768}[a];if(n.id.includes("2.5-flash-lite"))return{minimal:512,low:2048,medium:8192,high:24576}[a];if(n.id.includes("2.5-flash"))return{minimal:128,low:2048,medium:8192,high:24576}[a];return-1}export{y as stream,z as streamSimple};