@muxcodecli/cli 1.15.16 → 1.15.18

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 (204) hide show
  1. package/dist/bip-bop-01-ga21wr3r.mp3 +0 -0
  2. package/dist/bip-bop-03-kgfd4rq4.mp3 +0 -0
  3. package/dist/chunk-0hqmdrjr.js +3 -0
  4. package/dist/chunk-0npjzye0.js +2 -0
  5. package/dist/chunk-0pe6y883.js +2 -0
  6. package/dist/chunk-0qqpjj2h.js +3 -0
  7. package/dist/chunk-0r3h8jgj.js +2 -0
  8. package/dist/chunk-11285jfy.js +3 -0
  9. package/dist/chunk-11ant2kk.js +3 -0
  10. package/dist/chunk-124qmktt.js +18 -0
  11. package/dist/chunk-138ntz3h.js +2 -0
  12. package/dist/chunk-1e73ypg5.js +3 -0
  13. package/dist/chunk-1evcc54z.js +3 -0
  14. package/dist/chunk-1mqsg5s7.js +75 -0
  15. package/dist/chunk-1pv2317e.js +7 -0
  16. package/dist/chunk-1y3ssxx6.js +2 -0
  17. package/dist/chunk-20x8vsdn.js +7 -0
  18. package/dist/chunk-21x3anp4.js +9 -0
  19. package/dist/chunk-22qpzg37.js +212 -0
  20. package/dist/chunk-2bt5mtgm.js +3 -0
  21. package/dist/chunk-2d95ene8.js +2 -0
  22. package/dist/chunk-2h2zq5cp.js +2 -0
  23. package/dist/chunk-2pc63est.js +2 -0
  24. package/dist/chunk-33gs9z8d.js +2 -0
  25. package/dist/chunk-33vwwxjk.js +2 -0
  26. package/dist/chunk-3dq7hfxc.js +9 -0
  27. package/dist/chunk-3jvft1k1.js +2 -0
  28. package/dist/chunk-4jqh4mpm.js +2 -0
  29. package/dist/chunk-4mgyaytc.js +672 -0
  30. package/dist/chunk-4va8fzq1.js +2 -0
  31. package/dist/chunk-4wkq9y2z.js +7 -0
  32. package/dist/chunk-526nbm9e.js +2 -0
  33. package/dist/chunk-5a6895cv.js +37 -0
  34. package/dist/chunk-5e9dq2av.js +2 -0
  35. package/dist/chunk-5jn2z3nf.js +3 -0
  36. package/dist/chunk-5npr1qyq.js +574 -0
  37. package/dist/chunk-5sfky0gz.js +8 -0
  38. package/dist/chunk-5t7xqdvk.js +3 -0
  39. package/dist/chunk-5tpqj6ag.js +10 -0
  40. package/dist/chunk-5v5015am.js +12 -0
  41. package/dist/chunk-5wawdxv2.js +7 -0
  42. package/dist/chunk-6btrg3ff.js +2 -0
  43. package/dist/chunk-6skbzman.js +6 -0
  44. package/dist/chunk-6sz698ew.js +11 -0
  45. package/dist/chunk-6xzrzmsr.js +2 -0
  46. package/dist/chunk-7848rf5q.js +63 -0
  47. package/dist/chunk-7ep2edcv.js +12 -0
  48. package/dist/chunk-7svw66kw.js +13 -0
  49. package/dist/chunk-7xgr8vx6.js +2 -0
  50. package/dist/chunk-7zjn6m1m.js +2 -0
  51. package/dist/chunk-8atqb297.js +12 -0
  52. package/dist/chunk-8ebkxjar.js +7 -0
  53. package/dist/chunk-8j3aw4qg.js +3 -0
  54. package/dist/chunk-8jy0dvcn.js +3 -0
  55. package/dist/chunk-8refh038.js +2 -0
  56. package/dist/chunk-93cszp8k.js +3 -0
  57. package/dist/chunk-93ze3gcb.js +2 -0
  58. package/dist/chunk-98yxzxtd.js +2 -0
  59. package/dist/chunk-9g64kggy.js +3 -0
  60. package/dist/chunk-9h1pwxb2.js +8 -0
  61. package/dist/chunk-9j4j9nrm.js +2 -0
  62. package/dist/chunk-9kzczwh0.js +3 -0
  63. package/dist/chunk-9n629gtn.js +3 -0
  64. package/dist/chunk-9y59sxde.js +2 -0
  65. package/dist/chunk-a2m5jyd8.js +2 -0
  66. package/dist/chunk-a595cp8s.js +2 -0
  67. package/dist/chunk-ak0k3m4q.js +3 -0
  68. package/dist/chunk-apksmrz9.js +3 -0
  69. package/dist/chunk-b05r09sj.js +10 -0
  70. package/dist/chunk-b47e563q.js +2 -0
  71. package/dist/chunk-b57avnse.js +2 -0
  72. package/dist/chunk-bfjq7w7k.js +2 -0
  73. package/dist/chunk-bhc70qet.js +3 -0
  74. package/dist/chunk-bvtscj68.js +2 -0
  75. package/dist/chunk-bw2cy5v0.js +8 -0
  76. package/dist/chunk-c7dvyh2x.js +2 -0
  77. package/dist/chunk-cbz8b7g5.js +3 -0
  78. package/dist/chunk-cw4vbnet.js +3 -0
  79. package/dist/chunk-czcj3j9y.js +2 -0
  80. package/dist/chunk-dg466kdp.js +2 -0
  81. package/dist/chunk-dmscgnhq.js +2 -0
  82. package/dist/chunk-dtk4m8rm.js +3 -0
  83. package/dist/chunk-dy7akyj3.js +2 -0
  84. package/dist/chunk-e2wv2sp4.js +2 -0
  85. package/dist/chunk-e8j03wnd.js +3 -0
  86. package/dist/chunk-egkp6tct.js +2 -0
  87. package/dist/chunk-emfc800a.js +2 -0
  88. package/dist/chunk-envnht72.js +4 -0
  89. package/dist/chunk-eskw1cj2.js +3 -0
  90. package/dist/chunk-ezz15tyg.js +2 -0
  91. package/dist/chunk-fkmzj0qt.js +16 -0
  92. package/dist/chunk-fqt3c3g5.js +4 -0
  93. package/dist/chunk-frbht418.js +19 -0
  94. package/dist/chunk-ftz8cqfq.js +2 -0
  95. package/dist/chunk-g4jxdrr6.js +2 -0
  96. package/dist/chunk-g52xzmrr.js +2 -0
  97. package/dist/chunk-gbtvkje9.js +4 -0
  98. package/dist/chunk-gm9msqq5.js +8 -0
  99. package/dist/chunk-gxat3dpd.js +3 -0
  100. package/dist/chunk-hfppq1w5.js +4 -0
  101. package/dist/chunk-jdg870gy.js +1683 -0
  102. package/dist/chunk-jfz77m78.js +3 -0
  103. package/dist/chunk-jg9r58pf.js +16 -0
  104. package/dist/chunk-jgzt4945.js +2 -0
  105. package/dist/chunk-jh2epywq.js +2 -0
  106. package/dist/chunk-jpj6a56k.js +2 -0
  107. package/dist/chunk-jw4sgq23.js +2 -0
  108. package/dist/chunk-jws11ngd.js +2 -0
  109. package/dist/chunk-jxhz82qt.js +2 -0
  110. package/dist/chunk-k19y2psf.js +4 -0
  111. package/dist/chunk-k6cj14zk.js +2 -0
  112. package/dist/chunk-kktm0pdc.js +3 -0
  113. package/dist/chunk-kmr27ake.js +160 -0
  114. package/dist/chunk-kyhwvbvq.js +2 -0
  115. package/dist/chunk-mgn5pejx.js +2 -0
  116. package/dist/chunk-mskyzxb3.js +3 -0
  117. package/dist/chunk-my9cfmvt.js +5 -0
  118. package/dist/chunk-n4vx7kvs.js +389 -0
  119. package/dist/chunk-nc44rvs7.js +23 -0
  120. package/dist/chunk-ng3vbpmy.js +3 -0
  121. package/dist/chunk-nmnp5g5p.js +228 -0
  122. package/dist/chunk-nn0t3xmn.js +2 -0
  123. package/dist/chunk-npr41z9a.js +19 -0
  124. package/dist/chunk-ntvr3177.js +25 -0
  125. package/dist/chunk-pkc5hkha.js +2 -0
  126. package/dist/chunk-ppg6zhae.js +3 -0
  127. package/dist/chunk-pqwm9zk1.js +6 -0
  128. package/dist/chunk-ptvjmfqx.js +2 -0
  129. package/dist/chunk-q1r48y0y.js +34 -0
  130. package/dist/chunk-q9yddd1r.js +3 -0
  131. package/dist/chunk-qavtgsrh.js +2 -0
  132. package/dist/chunk-qvh8ghjw.js +7 -0
  133. package/dist/chunk-qx6r187q.js +2 -0
  134. package/dist/chunk-r093mfa8.js +32 -0
  135. package/dist/chunk-rbaj9ktq.js +2 -0
  136. package/dist/chunk-rkf9ynkx.js +3 -0
  137. package/dist/chunk-rpp44jtx.js +3 -0
  138. package/dist/chunk-rrvwp351.js +2 -0
  139. package/dist/chunk-rs8fsgqt.js +81 -0
  140. package/dist/chunk-s4gy87ft.js +8 -0
  141. package/dist/chunk-s5qq2ch2.js +12 -0
  142. package/dist/chunk-s92578qx.js +71 -0
  143. package/dist/chunk-snsb760m.js +2 -0
  144. package/dist/chunk-sp1cvejp.js +2 -0
  145. package/dist/chunk-spb3tm25.js +4 -0
  146. package/dist/chunk-srnmswkj.js +2 -0
  147. package/dist/chunk-sxgbzwrs.js +2 -0
  148. package/dist/chunk-t2s6m9t2.js +35 -0
  149. package/dist/chunk-t98sdxty.js +2 -0
  150. package/dist/chunk-tbnxx5na.js +2 -0
  151. package/dist/chunk-tfxm3qz4.js +2 -0
  152. package/dist/chunk-treb38pz.js +3 -0
  153. package/dist/chunk-tvw8tfpr.js +6 -0
  154. package/dist/chunk-v107htgw.js +101 -0
  155. package/dist/chunk-v8at4gnt.js +2 -0
  156. package/dist/chunk-vmr3get8.js +2 -0
  157. package/dist/chunk-vqrnejgj.js +71 -0
  158. package/dist/chunk-vvwy955j.js +3 -0
  159. package/dist/chunk-w5jxffnq.js +2 -0
  160. package/dist/chunk-wcbh5jqy.js +3 -0
  161. package/dist/chunk-wfmrnep1.js +2 -0
  162. package/dist/chunk-wk11yy8h.js +3 -0
  163. package/dist/chunk-wn5f1tfj.js +2 -0
  164. package/dist/chunk-wpm2p1gq.js +3 -0
  165. package/dist/chunk-wxkyv5gj.js +2 -0
  166. package/dist/chunk-wyed730e.js +2 -0
  167. package/dist/chunk-x65zs89t.js +3 -0
  168. package/dist/chunk-x6zjq78z.js +2 -0
  169. package/dist/chunk-xedav0qx.js +3 -0
  170. package/dist/chunk-xmftb9ad.js +38 -0
  171. package/dist/chunk-xvtkw7hj.js +3 -0
  172. package/dist/chunk-xy0txg0n.js +2 -0
  173. package/dist/chunk-y7s5cpwr.js +34 -0
  174. package/dist/chunk-yg48tfvv.js +16 -0
  175. package/dist/chunk-ygpen625.js +3 -0
  176. package/dist/chunk-ymb45bt6.js +2 -0
  177. package/dist/chunk-yp2zfcvh.js +8 -0
  178. package/dist/chunk-z3mx7n44.js +3 -0
  179. package/dist/chunk-zaj612bw.js +3 -0
  180. package/dist/chunk-zb3179f9.js +3 -0
  181. package/dist/chunk-zhd8f4pc.js +759 -0
  182. package/dist/chunk-zjpnyah2.js +3 -0
  183. package/dist/cli/cmd/tui/worker.js +2 -0
  184. package/dist/highlights-eq9cgrbb.scm +604 -0
  185. package/dist/highlights-ghv9g403.scm +205 -0
  186. package/dist/highlights-hk7bwhj4.scm +284 -0
  187. package/dist/highlights-r812a2qc.scm +150 -0
  188. package/dist/highlights-x6tmsnaa.scm +115 -0
  189. package/dist/index.js +146 -5742
  190. package/dist/injections-73j83es3.scm +27 -0
  191. package/dist/muxcode-linux-x64 +0 -0
  192. package/dist/nope-03-2z8weyjw.mp3 +0 -0
  193. package/dist/photon_rs_bg-bq08arze.wasm +0 -0
  194. package/dist/staplebops-06-rz29m246.mp3 +0 -0
  195. package/dist/tree-sitter-3jzf13jk.wasm +0 -0
  196. package/dist/tree-sitter-bash-hq5s6fxb.wasm +0 -0
  197. package/dist/tree-sitter-javascript-nd0q4pe9.wasm +0 -0
  198. package/dist/tree-sitter-markdown-411r6y9b.wasm +0 -0
  199. package/dist/tree-sitter-markdown_inline-j5349f42.wasm +0 -0
  200. package/dist/tree-sitter-powershell-ryb2ffqs.wasm +0 -0
  201. package/dist/tree-sitter-typescript-zxjzwt75.wasm +0 -0
  202. package/dist/tree-sitter-zig-e78zbjpm.wasm +0 -0
  203. package/dist/yup-01-30ecpeh9.mp3 +0 -0
  204. package/package.json +8 -7
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Nf as a}from"./chunk-rbaj9ktq.js";import"./chunk-apksmrz9.js";import"./chunk-rkf9ynkx.js";import"./chunk-3dq7hfxc.js";import"./chunk-zaj612bw.js";import"./chunk-8j3aw4qg.js";export{a as fromProcess};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{bh as F}from"./chunk-7svw66kw.js";import{Oh as D,uh as z,xh as B}from"./chunk-yp2zfcvh.js";import{Xt as x}from"./chunk-21x3anp4.js";import{Du as q}from"./chunk-ntvr3177.js";import"./chunk-8j3aw4qg.js";var N="2.0.41",P=q.object({message:q.string(),type:q.string(),param:q.string(),code:q.string()}),Q={errorSchema:P,errorToMessage:(k)=>k.message};function T(k={}){var y;let G=D((y=k.baseURL)!=null?y:"https://api.cerebras.ai/v1"),J=()=>z({Authorization:`Bearer ${B({apiKey:k.apiKey,environmentVariableName:"CEREBRAS_API_KEY",description:"Cerebras API key"})}`,...k.headers},`ai-sdk/cerebras/${N}`),w=(j)=>{return new F(j,{provider:"cerebras.chat",url:({path:K})=>`${G}${K}`,headers:J,fetch:k.fetch,errorStructure:Q,supportsStructuredOutputs:!0})},f=(j)=>w(j);return f.specificationVersion="v3",f.languageModel=w,f.chat=w,f.embeddingModel=(j)=>{throw new x({modelId:j,modelType:"embeddingModel"})},f.textEmbeddingModel=f.embeddingModel,f.imageModel=(j)=>{throw new x({modelId:j,modelType:"imageModel"})},f}var Z=T();export{T as createCerebras,Z as cerebras,N as VERSION};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{fg as M,gg as _t}from"./chunk-9kzczwh0.js";import{hg as Eo,ig as Io,jg as Po,kg as Gr,lg as kt,mg as xo,ng as yo,og as Do,pg as cr,rg as eo,sg as ro,tg as to,ug as oo,xg as Ht,yg as bo}from"./chunk-nc44rvs7.js";import{Ag as Ar,Cg as dr,zg as er}from"./chunk-spb3tm25.js";import{Dg as gt}from"./chunk-kktm0pdc.js";import"./chunk-apksmrz9.js";import{Gg as hr,Hg as mt,Jg as Qt,Mg as Ue,Qg as f}from"./chunk-npr41z9a.js";import{Rg as So}from"./chunk-e8j03wnd.js";import{Sg as zt}from"./chunk-wk11yy8h.js";import"./chunk-rkf9ynkx.js";import{$g as Zt}from"./chunk-3dq7hfxc.js";import"./chunk-zaj612bw.js";import{Ks as Ct}from"./chunk-zjpnyah2.js";import{Os as Gt}from"./chunk-0hqmdrjr.js";import{RF as E}from"./chunk-8j3aw4qg.js";var A=E((oe)=>{Object.defineProperty(oe,"__esModule",{value:!0});oe.resolveHttpAuthSchemeConfig=oe.defaultSSOOIDCHttpAuthSchemeProvider=oe.defaultSSOOIDCHttpAuthSchemeParametersProvider=void 0;var Nr=M(),w=hr(),Rr=async(e,r,i)=>{return{operation:(0,w.getSmithyContext)(r).operation,region:await(0,w.normalizeProvider)(e.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()}};oe.defaultSSOOIDCHttpAuthSchemeParametersProvider=Rr;function fr(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sso-oauth",region:e.region},propertiesExtractor:(r,i)=>({signingProperties:{config:r,context:i}})}}function Fr(e){return{schemeId:"smithy.api#noAuth"}}var Ur=(e)=>{let r=[];switch(e.operation){case"CreateToken":{r.push(Fr(e));break}default:r.push(fr(e))}return r};oe.defaultSSOOIDCHttpAuthSchemeProvider=Ur;var $r=(e)=>{let r=(0,Nr.resolveAwsSdkSigV4Config)(e);return Object.assign(r,{authSchemePreference:(0,w.normalizeProvider)(e.authSchemePreference??[])})};oe.resolveHttpAuthSchemeConfig=$r});var De=E((xe)=>{Object.defineProperty(xe,"__esModule",{value:!0});xe.ruleSet=void 0;var Se="required",p="fn",d="argv",q="ref",se=!0,ne="isSet",h="booleanEquals",D="error",b="endpoint",I="tree",G="PartitionResult",m="getAttr",pe={[Se]:!1,type:"string"},de={[Se]:!0,default:!1,type:"boolean"},ce={[q]:"Endpoint"},Ee={[p]:h,[d]:[{[q]:"UseFIPS"},!0]},Ie={[p]:h,[d]:[{[q]:"UseDualStack"},!0]},n={},ae={[p]:m,[d]:[{[q]:G},"supportsFIPS"]},Pe={[q]:G},le={[p]:h,[d]:[!0,{[p]:m,[d]:[Pe,"supportsDualStack"]}]},ue=[Ee],Oe=[Ie],ve=[{[q]:"Region"}],Mr={version:"1.0",parameters:{Region:pe,UseDualStack:de,UseFIPS:de,Endpoint:pe},rules:[{conditions:[{[p]:ne,[d]:[ce]}],rules:[{conditions:ue,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:D},{conditions:Oe,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:D},{endpoint:{url:ce,properties:n,headers:n},type:b}],type:I},{conditions:[{[p]:ne,[d]:ve}],rules:[{conditions:[{[p]:"aws.partition",[d]:ve,assign:G}],rules:[{conditions:[Ee,Ie],rules:[{conditions:[{[p]:h,[d]:[se,ae]},le],rules:[{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:n,headers:n},type:b}],type:I},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:D}],type:I},{conditions:ue,rules:[{conditions:[{[p]:h,[d]:[ae,se]}],rules:[{conditions:[{[p]:"stringEquals",[d]:[{[p]:m,[d]:[Pe,"name"]},"aws-us-gov"]}],endpoint:{url:"https://oidc.{Region}.amazonaws.com",properties:n,headers:n},type:b},{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}",properties:n,headers:n},type:b}],type:I},{error:"FIPS is enabled but this partition does not support FIPS",type:D}],type:I},{conditions:Oe,rules:[{conditions:[le],rules:[{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:n,headers:n},type:b}],type:I},{error:"DualStack is enabled but this partition does not support DualStack",type:D}],type:I},{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dnsSuffix}",properties:n,headers:n},type:b}],type:I}],type:I},{error:"Invalid Configuration: Missing Region",type:D}]};xe.ruleSet=Mr});var he=E((be)=>{Object.defineProperty(be,"__esModule",{value:!0});be.defaultEndpointResolver=void 0;var mr=Gr(),z=Ar(),zr=De(),Hr=new z.EndpointCache({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),Lr=(e,r={})=>{return Hr.get(e,()=>(0,z.resolveEndpoint)(zr.ruleSet,{endpointParams:e,logger:r.logger}))};be.defaultEndpointResolver=Lr;z.customEndpointFunctions.aws=mr.awsEndpointFunctions});var F=E((L)=>{Object.defineProperty(L,"__esModule",{value:!0});L.SSOOIDCServiceException=L.__ServiceException=void 0;var Ne=f();Object.defineProperty(L,"__ServiceException",{enumerable:!0,get:function(){return Ne.ServiceException}});class H extends Ne.ServiceException{constructor(e){super(e);Object.setPrototypeOf(this,H.prototype)}}L.SSOOIDCServiceException=H});var k=E((fe)=>{Object.defineProperty(fe,"__esModule",{value:!0});fe.UnsupportedGrantTypeException=fe.UnauthorizedClientException=fe.SlowDownException=fe.InvalidScopeException=fe.InvalidRequestException=fe.InvalidGrantException=fe.InvalidClientException=fe.InternalServerException=fe.ExpiredTokenException=fe.AuthorizationPendingException=fe.AccessDeniedException=void 0;var l=F();class T extends l.SSOOIDCServiceException{name="AccessDeniedException";$fault="client";error;reason;error_description;constructor(e){super({name:"AccessDeniedException",$fault:"client",...e});Object.setPrototypeOf(this,T.prototype),this.error=e.error,this.reason=e.reason,this.error_description=e.error_description}}fe.AccessDeniedException=T;class B extends l.SSOOIDCServiceException{name="AuthorizationPendingException";$fault="client";error;error_description;constructor(e){super({name:"AuthorizationPendingException",$fault:"client",...e});Object.setPrototypeOf(this,B.prototype),this.error=e.error,this.error_description=e.error_description}}fe.AuthorizationPendingException=B;class V extends l.SSOOIDCServiceException{name="ExpiredTokenException";$fault="client";error;error_description;constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e});Object.setPrototypeOf(this,V.prototype),this.error=e.error,this.error_description=e.error_description}}fe.ExpiredTokenException=V;class W extends l.SSOOIDCServiceException{name="InternalServerException";$fault="server";error;error_description;constructor(e){super({name:"InternalServerException",$fault:"server",...e});Object.setPrototypeOf(this,W.prototype),this.error=e.error,this.error_description=e.error_description}}fe.InternalServerException=W;class Y extends l.SSOOIDCServiceException{name="InvalidClientException";$fault="client";error;error_description;constructor(e){super({name:"InvalidClientException",$fault:"client",...e});Object.setPrototypeOf(this,Y.prototype),this.error=e.error,this.error_description=e.error_description}}fe.InvalidClientException=Y;class J extends l.SSOOIDCServiceException{name="InvalidGrantException";$fault="client";error;error_description;constructor(e){super({name:"InvalidGrantException",$fault:"client",...e});Object.setPrototypeOf(this,J.prototype),this.error=e.error,this.error_description=e.error_description}}fe.InvalidGrantException=J;class K extends l.SSOOIDCServiceException{name="InvalidRequestException";$fault="client";error;reason;error_description;constructor(e){super({name:"InvalidRequestException",$fault:"client",...e});Object.setPrototypeOf(this,K.prototype),this.error=e.error,this.reason=e.reason,this.error_description=e.error_description}}fe.InvalidRequestException=K;class X extends l.SSOOIDCServiceException{name="InvalidScopeException";$fault="client";error;error_description;constructor(e){super({name:"InvalidScopeException",$fault:"client",...e});Object.setPrototypeOf(this,X.prototype),this.error=e.error,this.error_description=e.error_description}}fe.InvalidScopeException=X;class C extends l.SSOOIDCServiceException{name="SlowDownException";$fault="client";error;error_description;constructor(e){super({name:"SlowDownException",$fault:"client",...e});Object.setPrototypeOf(this,C.prototype),this.error=e.error,this.error_description=e.error_description}}fe.SlowDownException=C;class Q extends l.SSOOIDCServiceException{name="UnauthorizedClientException";$fault="client";error;error_description;constructor(e){super({name:"UnauthorizedClientException",$fault:"client",...e});Object.setPrototypeOf(this,Q.prototype),this.error=e.error,this.error_description=e.error_description}}fe.UnauthorizedClientException=Q;class Z extends l.SSOOIDCServiceException{name="UnsupportedGrantTypeException";$fault="client";error;error_description;constructor(e){super({name:"UnsupportedGrantTypeException",$fault:"client",...e});Object.setPrototypeOf(this,Z.prototype),this.error=e.error,this.error_description=e.error_description}}fe.UnsupportedGrantTypeException=Z});var g=E((me)=>{Object.defineProperty(me,"__esModule",{value:!0});me.CreateToken$=me.CreateTokenResponse$=me.CreateTokenRequest$=me.errorTypeRegistries=me.UnsupportedGrantTypeException$=me.UnauthorizedClientException$=me.SlowDownException$=me.InvalidScopeException$=me.InvalidRequestException$=me.InvalidGrantException$=me.InvalidClientException$=me.InternalServerException$=me.ExpiredTokenException$=me.AuthorizationPendingException$=me.AccessDeniedException$=me.SSOOIDCServiceException$=void 0;var Zr="AccessDeniedException",kr="AuthorizationPendingException",gr="AccessToken",_r="ClientSecret",et="CreateToken",rt="CreateTokenRequest",tt="CreateTokenResponse",ot="CodeVerifier",it="ExpiredTokenException",st="InvalidClientException",nt="InvalidGrantException",pt="InvalidRequestException",dt="InternalServerException",ct="InvalidScopeException",at="IdToken",lt="RefreshToken",ut="SlowDownException",Ot="UnauthorizedClientException",vt="UnsupportedGrantTypeException",St="accessToken",S="client",Et="clientId",It="clientSecret",Pt="codeVerifier",xt="code",yt="deviceCode",t="error",Dt="expiresIn",u="error_description",bt="grantType",qt="http",O="httpError",ht="idToken",$e="reason",je="refreshToken",Nt="redirectUri",we="smithy.ts.sdk.synthetic.com.amazonaws.ssooidc",Rt="scope",ft="server",Ft="tokenType",o="com.amazonaws.ssooidc",Me=Ue(),v=k(),Ut=F(),Ae=Me.TypeRegistry.for(we);me.SSOOIDCServiceException$=[-3,we,"SSOOIDCServiceException",0,[],[]];Ae.registerError(me.SSOOIDCServiceException$,Ut.SSOOIDCServiceException);var c=Me.TypeRegistry.for(o);me.AccessDeniedException$=[-3,o,Zr,{[t]:S,[O]:400},[t,$e,u],[0,0,0]];c.registerError(me.AccessDeniedException$,v.AccessDeniedException);me.AuthorizationPendingException$=[-3,o,kr,{[t]:S,[O]:400},[t,u],[0,0]];c.registerError(me.AuthorizationPendingException$,v.AuthorizationPendingException);me.ExpiredTokenException$=[-3,o,it,{[t]:S,[O]:400},[t,u],[0,0]];c.registerError(me.ExpiredTokenException$,v.ExpiredTokenException);me.InternalServerException$=[-3,o,dt,{[t]:ft,[O]:500},[t,u],[0,0]];c.registerError(me.InternalServerException$,v.InternalServerException);me.InvalidClientException$=[-3,o,st,{[t]:S,[O]:401},[t,u],[0,0]];c.registerError(me.InvalidClientException$,v.InvalidClientException);me.InvalidGrantException$=[-3,o,nt,{[t]:S,[O]:400},[t,u],[0,0]];c.registerError(me.InvalidGrantException$,v.InvalidGrantException);me.InvalidRequestException$=[-3,o,pt,{[t]:S,[O]:400},[t,$e,u],[0,0,0]];c.registerError(me.InvalidRequestException$,v.InvalidRequestException);me.InvalidScopeException$=[-3,o,ct,{[t]:S,[O]:400},[t,u],[0,0]];c.registerError(me.InvalidScopeException$,v.InvalidScopeException);me.SlowDownException$=[-3,o,ut,{[t]:S,[O]:400},[t,u],[0,0]];c.registerError(me.SlowDownException$,v.SlowDownException);me.UnauthorizedClientException$=[-3,o,Ot,{[t]:S,[O]:400},[t,u],[0,0]];c.registerError(me.UnauthorizedClientException$,v.UnauthorizedClientException);me.UnsupportedGrantTypeException$=[-3,o,vt,{[t]:S,[O]:400},[t,u],[0,0]];c.registerError(me.UnsupportedGrantTypeException$,v.UnsupportedGrantTypeException);me.errorTypeRegistries=[Ae,c];var $t=[0,o,gr,8,0],jt=[0,o,_r,8,0],wt=[0,o,ot,8,0],Mt=[0,o,at,8,0],Ge=[0,o,lt,8,0];me.CreateTokenRequest$=[3,o,rt,0,[Et,It,bt,yt,xt,je,Rt,Nt,Pt],[0,[()=>jt,0],0,0,0,[()=>Ge,0],64,0,[()=>wt,0]],3];me.CreateTokenResponse$=[3,o,tt,0,[St,Ft,Dt,je,ht],[[()=>$t,0],0,1,[()=>Ge,0],[()=>Mt,0]]];me.CreateToken$=[9,o,et,{[qt]:["POST","/token",200]},()=>me.CreateTokenRequest$,()=>me.CreateTokenResponse$]});var or=E((rr)=>{Object.defineProperty(rr,"__esModule",{value:!0});rr.getRuntimeConfig=void 0;var Lt=M(),Tt=Ht(),Bt=er(),Vt=f(),Wt=zt(),ge=mt(),_e=Gt(),Yt=A(),Jt=he(),Kt=g(),Xt=(e)=>{return{apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??ge.fromBase64,base64Encoder:e?.base64Encoder??ge.toBase64,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Jt.defaultEndpointResolver,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??Yt.defaultSSOOIDCHttpAuthSchemeProvider,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(r)=>r.getIdentityProvider("aws.auth#sigv4"),signer:new Lt.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(r)=>r.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new Bt.NoAuthSigner}],logger:e?.logger??new Vt.NoOpLogger,protocol:e?.protocol??Tt.AwsRestJsonProtocol,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.ssooidc",errorTypeRegistries:Kt.errorTypeRegistries,version:"2019-06-10",serviceTarget:"AWSSSOOIDCService"},serviceId:e?.serviceId??"SSO OIDC",urlParser:e?.urlParser??Wt.parseUrl,utf8Decoder:e?.utf8Decoder??_e.fromUtf8,utf8Encoder:e?.utf8Encoder??_e.toUtf8}};rr.getRuntimeConfig=Xt});var ur=E((ar)=>{Object.defineProperty(ar,"__esModule",{value:!0});ar.getRuntimeConfig=void 0;var io=Ct(),so=io.__importDefault(_t()),no=Zt(),po=M(),ir=eo(),U=dr(),co=ro(),sr=cr(),x=gt(),nr=Qt(),pr=f(),ao=to(),lo=oo(),uo=kt(),Oo=or(),vo=(e)=>{(0,pr.emitWarningIfUnsupportedVersion)(process.version);let r=(0,lo.resolveDefaultsModeConfig)(e),i=()=>r().then(pr.loadConfigsForDefaultMode),a=(0,Oo.getRuntimeConfig)(e);(0,no.emitWarningIfUnsupportedVersion)(process.version);let s={profile:e?.profile,logger:a.logger};return{...a,...e,runtime:"node",defaultsMode:r,authSchemePreference:e?.authSchemePreference??(0,x.loadConfig)(po.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS,s),bodyLengthChecker:e?.bodyLengthChecker??ao.calculateBodyLength,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,ir.createDefaultUserAgentProvider)({serviceId:a.serviceId,clientVersion:so.default.version}),maxAttempts:e?.maxAttempts??(0,x.loadConfig)(sr.NODE_MAX_ATTEMPT_CONFIG_OPTIONS,e),region:e?.region??(0,x.loadConfig)(U.NODE_REGION_CONFIG_OPTIONS,{...U.NODE_REGION_CONFIG_FILE_OPTIONS,...s}),requestHandler:nr.NodeHttpHandler.create(e?.requestHandler??i),retryMode:e?.retryMode??(0,x.loadConfig)({...sr.NODE_RETRY_MODE_CONFIG_OPTIONS,default:async()=>(await i()).retryMode||uo.DEFAULT_RETRY_MODE},e),sha256:e?.sha256??co.Hash.bind(null,"sha256"),streamCollector:e?.streamCollector??nr.streamCollector,useDualstackEndpoint:e?.useDualstackEndpoint??(0,x.loadConfig)(U.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,s),useFipsEndpoint:e?.useFipsEndpoint??(0,x.loadConfig)(U.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,s),userAgentAppId:e?.userAgentAppId??(0,x.loadConfig)(ir.NODE_APP_ID_CONFIG_OPTIONS,s)}};ar.getRuntimeConfig=vo});var Ko=E((P)=>{var Or=Eo(),qo=Io(),ho=Po(),vr=xo(),No=dr(),_=er(),Ro=Ue(),fo=yo(),xr=Do(),Sr=cr(),y=f(),Er=A(),Fo=ur(),Ir=bo(),Pr=So(),N=g(),$=k(),Uo=F(),$o=(e)=>{return Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"sso-oauth"})},jo={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},wo=(e)=>{let{httpAuthSchemes:r,httpAuthSchemeProvider:i,credentials:a}=e;return{setHttpAuthScheme(s){let R=r.findIndex((j)=>j.schemeId===s.schemeId);if(R===-1)r.push(s);else r.splice(R,1,s)},httpAuthSchemes(){return r},setHttpAuthSchemeProvider(s){i=s},httpAuthSchemeProvider(){return i},setCredentials(s){a=s},credentials(){return a}}},Mo=(e)=>{return{httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}},Ao=(e,r)=>{let i=Object.assign(Ir.getAwsRegionExtensionConfiguration(e),y.getDefaultExtensionConfiguration(e),Pr.getHttpHandlerExtensionConfiguration(e),wo(e));return r.forEach((a)=>a.configure(i)),Object.assign(e,Ir.resolveAwsRegionExtensionConfiguration(i),y.resolveDefaultRuntimeConfig(i),Pr.resolveHttpHandlerRuntimeConfig(i),Mo(i))};class ee extends y.Client{config;constructor(...[e]){let r=Fo.getRuntimeConfig(e||{});super(r);this.initConfig=r;let i=$o(r),a=vr.resolveUserAgentConfig(i),s=Sr.resolveRetryConfig(a),R=No.resolveRegionConfig(s),j=Or.resolveHostHeaderConfig(R),yr=xr.resolveEndpointConfig(j),Dr=Er.resolveHttpAuthSchemeConfig(yr),br=Ao(Dr,e?.extensions||[]);this.config=br,this.middlewareStack.use(Ro.getSchemaSerdePlugin(this.config)),this.middlewareStack.use(vr.getUserAgentPlugin(this.config)),this.middlewareStack.use(Sr.getRetryPlugin(this.config)),this.middlewareStack.use(fo.getContentLengthPlugin(this.config)),this.middlewareStack.use(Or.getHostHeaderPlugin(this.config)),this.middlewareStack.use(qo.getLoggerPlugin(this.config)),this.middlewareStack.use(ho.getRecursionDetectionPlugin(this.config)),this.middlewareStack.use(_.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:Er.defaultSSOOIDCHttpAuthSchemeParametersProvider,identityProviderConfigProvider:async(qr)=>new _.DefaultIdentityProviderConfig({"aws.auth#sigv4":qr.credentials})})),this.middlewareStack.use(_.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}class re extends y.Command.classBuilder().ep(jo).m(function(e,r,i,a){return[xr.getEndpointPlugin(i,e.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","CreateToken",{}).n("SSOOIDCClient","CreateTokenCommand").sc(N.CreateToken$).build(){}var Go={CreateTokenCommand:re};class te extends ee{}y.createAggregatedClient(Go,te);var mo={KMS_ACCESS_DENIED:"KMS_AccessDeniedException"},zo={KMS_DISABLED_KEY:"KMS_DisabledException",KMS_INVALID_KEY_USAGE:"KMS_InvalidKeyUsageException",KMS_INVALID_STATE:"KMS_InvalidStateException",KMS_KEY_NOT_FOUND:"KMS_NotFoundException"};P.$Command=y.Command;P.__Client=y.Client;P.SSOOIDCServiceException=Uo.SSOOIDCServiceException;P.AccessDeniedExceptionReason=mo;P.CreateTokenCommand=re;P.InvalidRequestExceptionReason=zo;P.SSOOIDC=te;P.SSOOIDCClient=ee;Object.prototype.hasOwnProperty.call(N,"__proto__")&&!Object.prototype.hasOwnProperty.call(P,"__proto__")&&Object.defineProperty(P,"__proto__",{enumerable:!0,value:N.__proto__});Object.keys(N).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(P,e))P[e]=N[e]});Object.prototype.hasOwnProperty.call($,"__proto__")&&!Object.prototype.hasOwnProperty.call(P,"__proto__")&&Object.defineProperty(P,"__proto__",{enumerable:!0,value:$.__proto__});Object.keys($).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(P,e))P[e]=$[e]})});export default Ko();
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{fg as X,gg as ls}from"./chunk-9kzczwh0.js";import{hg as Ws,ig as ws,jg as Us,kg as Vo,lg as as,mg as Ms,ng as ks,og as Eo,pg as Yt,rg as Es,sg as Ps,tg as ys,ug as _s,xg as Cr,yg as so}from"./chunk-nc44rvs7.js";import{Ag as Ko,Cg as Qt,zg as Se}from"./chunk-spb3tm25.js";import{Dg as ps}from"./chunk-kktm0pdc.js";import"./chunk-apksmrz9.js";import{Gg as bo,Hg as Xr,Jg as us,Mg as ct,Qg as k}from"./chunk-npr41z9a.js";import{Rg as qs}from"./chunk-e8j03wnd.js";import{Sg as Zr}from"./chunk-wk11yy8h.js";import"./chunk-rkf9ynkx.js";import{$g as gt}from"./chunk-3dq7hfxc.js";import"./chunk-zaj612bw.js";import{Ks as ds}from"./chunk-zjpnyah2.js";import{Os as Jr}from"./chunk-0hqmdrjr.js";import{RF as y}from"./chunk-8j3aw4qg.js";var Z=y((Ae)=>{Object.defineProperty(Ae,"__esModule",{value:!0});Ae.resolveHttpAuthSchemeConfig=Ae.resolveStsAuthConfig=Ae.defaultSTSHttpAuthSchemeProvider=Ae.defaultSTSHttpAuthSchemeParametersProvider=void 0;var ho=X(),J=bo(),No=C(),qo=async(e,t,r)=>{return{operation:(0,J.getSmithyContext)(t).operation,region:await(0,J.normalizeProvider)(e.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()}};Ae.defaultSTSHttpAuthSchemeParametersProvider=qo;function Fo(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sts",region:e.region},propertiesExtractor:(t,r)=>({signingProperties:{config:t,context:r}})}}function Wo(e){return{schemeId:"smithy.api#noAuth"}}var wo=(e)=>{let t=[];switch(e.operation){case"AssumeRoleWithWebIdentity":{t.push(Wo(e));break}default:t.push(Fo(e))}return t};Ae.defaultSTSHttpAuthSchemeProvider=wo;var Uo=(e)=>Object.assign(e,{stsClientCtor:No.STSClient});Ae.resolveStsAuthConfig=Uo;var Mo=(e)=>{let t=Ae.resolveStsAuthConfig(e),r=(0,ho.resolveAwsSdkSigV4Config)(t);return Object.assign(r,{authSchemePreference:(0,J.normalizeProvider)(e.authSchemePreference??[])})};Ae.resolveHttpAuthSchemeConfig=Mo});var f=y((he)=>{Object.defineProperty(he,"__esModule",{value:!0});he.commonParams=he.resolveClientEndpointParameters=void 0;var jo=(e)=>{return Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,useGlobalEndpoint:e.useGlobalEndpoint??!1,defaultSigningName:"sts"})};he.resolveClientEndpointParameters=jo;he.commonParams={UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}});var fe=y((Ze)=>{Object.defineProperty(Ze,"__esModule",{value:!0});Ze.ruleSet=void 0;var Ke="required",o="type",n="fn",i="argv",v="ref",qe=!1,ee=!0,S="booleanEquals",p="stringEquals",Ve="sigv4",ze="sts",Be="us-east-1",c="endpoint",Fe="https://sts.{Region}.{PartitionResult#dnsSuffix}",R="tree",M="error",oe="getAttr",We={[Ke]:!1,[o]:"string"},te={[Ke]:!0,default:!1,[o]:"boolean"},ge={[v]:"Endpoint"},we={[n]:"isSet",[i]:[{[v]:"Region"}]},l={[v]:"Region"},Ue={[n]:"aws.partition",[i]:[l],assign:"PartitionResult"},Qe={[v]:"UseFIPS"},Ye={[v]:"UseDualStack"},P={url:"https://sts.amazonaws.com",properties:{authSchemes:[{name:Ve,signingName:ze,signingRegion:Be}]},headers:{}},_={},Me={conditions:[{[n]:p,[i]:[l,"aws-global"]}],[c]:P,[o]:c},He={[n]:S,[i]:[Qe,!0]},Je={[n]:S,[i]:[Ye,!0]},ke={[n]:oe,[i]:[{[v]:"PartitionResult"},"supportsFIPS"]},Xe={[v]:"PartitionResult"},Le={[n]:S,[i]:[!0,{[n]:oe,[i]:[Xe,"supportsDualStack"]}]},je=[{[n]:"isSet",[i]:[ge]}],Ge=[He],Oe=[Je],Oo={version:"1.0",parameters:{Region:We,UseDualStack:te,UseFIPS:te,Endpoint:We,UseGlobalEndpoint:te},rules:[{conditions:[{[n]:S,[i]:[{[v]:"UseGlobalEndpoint"},ee]},{[n]:"not",[i]:je},we,Ue,{[n]:S,[i]:[Qe,qe]},{[n]:S,[i]:[Ye,qe]}],rules:[{conditions:[{[n]:p,[i]:[l,"ap-northeast-1"]}],endpoint:P,[o]:c},{conditions:[{[n]:p,[i]:[l,"ap-south-1"]}],endpoint:P,[o]:c},{conditions:[{[n]:p,[i]:[l,"ap-southeast-1"]}],endpoint:P,[o]:c},{conditions:[{[n]:p,[i]:[l,"ap-southeast-2"]}],endpoint:P,[o]:c},Me,{conditions:[{[n]:p,[i]:[l,"ca-central-1"]}],endpoint:P,[o]:c},{conditions:[{[n]:p,[i]:[l,"eu-central-1"]}],endpoint:P,[o]:c},{conditions:[{[n]:p,[i]:[l,"eu-north-1"]}],endpoint:P,[o]:c},{conditions:[{[n]:p,[i]:[l,"eu-west-1"]}],endpoint:P,[o]:c},{conditions:[{[n]:p,[i]:[l,"eu-west-2"]}],endpoint:P,[o]:c},{conditions:[{[n]:p,[i]:[l,"eu-west-3"]}],endpoint:P,[o]:c},{conditions:[{[n]:p,[i]:[l,"sa-east-1"]}],endpoint:P,[o]:c},{conditions:[{[n]:p,[i]:[l,Be]}],endpoint:P,[o]:c},{conditions:[{[n]:p,[i]:[l,"us-east-2"]}],endpoint:P,[o]:c},{conditions:[{[n]:p,[i]:[l,"us-west-1"]}],endpoint:P,[o]:c},{conditions:[{[n]:p,[i]:[l,"us-west-2"]}],endpoint:P,[o]:c},{endpoint:{url:Fe,properties:{authSchemes:[{name:Ve,signingName:ze,signingRegion:"{Region}"}]},headers:_},[o]:c}],[o]:R},{conditions:je,rules:[{conditions:Ge,error:"Invalid Configuration: FIPS and custom endpoint are not supported",[o]:M},{conditions:Oe,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",[o]:M},{endpoint:{url:ge,properties:_,headers:_},[o]:c}],[o]:R},{conditions:[we],rules:[{conditions:[Ue],rules:[{conditions:[He,Je],rules:[{conditions:[{[n]:S,[i]:[ee,ke]},Le],rules:[{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:_,headers:_},[o]:c}],[o]:R},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",[o]:M}],[o]:R},{conditions:Ge,rules:[{conditions:[{[n]:S,[i]:[ke,ee]}],rules:[{conditions:[{[n]:p,[i]:[{[n]:oe,[i]:[Xe,"name"]},"aws-us-gov"]}],endpoint:{url:"https://sts.{Region}.amazonaws.com",properties:_,headers:_},[o]:c},{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dnsSuffix}",properties:_,headers:_},[o]:c}],[o]:R},{error:"FIPS is enabled but this partition does not support FIPS",[o]:M}],[o]:R},{conditions:Oe,rules:[{conditions:[Le],rules:[{endpoint:{url:"https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:_,headers:_},[o]:c}],[o]:R},{error:"DualStack is enabled but this partition does not support DualStack",[o]:M}],[o]:R},Me,{endpoint:{url:Fe,properties:_,headers:_},[o]:c}],[o]:R}],[o]:R},{error:"Invalid Configuration: Missing Region",[o]:M}]};Ze.ruleSet=Oo});var ot=y((et)=>{Object.defineProperty(et,"__esModule",{value:!0});et.defaultEndpointResolver=void 0;var zo=Vo(),re=Ko(),Bo=fe(),go=new re.EndpointCache({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS","UseGlobalEndpoint"]}),Qo=(e,t={})=>{return go.get(e,()=>(0,re.resolveEndpoint)(Bo.ruleSet,{endpointParams:e,logger:t.logger}))};et.defaultEndpointResolver=Qo;re.customEndpointFunctions.aws=zo.awsEndpointFunctions});var O=y((ne)=>{Object.defineProperty(ne,"__esModule",{value:!0});ne.STSServiceException=ne.__ServiceException=void 0;var rt=k();Object.defineProperty(ne,"__ServiceException",{enumerable:!0,get:function(){return rt.ServiceException}});class se extends rt.ServiceException{constructor(e){super(e);Object.setPrototypeOf(this,se.prototype)}}ne.STSServiceException=se});var Ee=y((nt)=>{Object.defineProperty(nt,"__esModule",{value:!0});nt.IDPCommunicationErrorException=nt.InvalidIdentityTokenException=nt.IDPRejectedClaimException=nt.RegionDisabledException=nt.PackedPolicyTooLargeException=nt.MalformedPolicyDocumentException=nt.ExpiredTokenException=void 0;var A=O();class ie extends A.STSServiceException{name="ExpiredTokenException";$fault="client";constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e});Object.setPrototypeOf(this,ie.prototype)}}nt.ExpiredTokenException=ie;class ce extends A.STSServiceException{name="MalformedPolicyDocumentException";$fault="client";constructor(e){super({name:"MalformedPolicyDocumentException",$fault:"client",...e});Object.setPrototypeOf(this,ce.prototype)}}nt.MalformedPolicyDocumentException=ce;class de extends A.STSServiceException{name="PackedPolicyTooLargeException";$fault="client";constructor(e){super({name:"PackedPolicyTooLargeException",$fault:"client",...e});Object.setPrototypeOf(this,de.prototype)}}nt.PackedPolicyTooLargeException=de;class ue extends A.STSServiceException{name="RegionDisabledException";$fault="client";constructor(e){super({name:"RegionDisabledException",$fault:"client",...e});Object.setPrototypeOf(this,ue.prototype)}}nt.RegionDisabledException=ue;class ae extends A.STSServiceException{name="IDPRejectedClaimException";$fault="client";constructor(e){super({name:"IDPRejectedClaimException",$fault:"client",...e});Object.setPrototypeOf(this,ae.prototype)}}nt.IDPRejectedClaimException=ae;class pe extends A.STSServiceException{name="InvalidIdentityTokenException";$fault="client";constructor(e){super({name:"InvalidIdentityTokenException",$fault:"client",...e});Object.setPrototypeOf(this,pe.prototype)}}nt.InvalidIdentityTokenException=pe;class le extends A.STSServiceException{name="IDPCommunicationErrorException";$fault="client";constructor(e){super({name:"IDPCommunicationErrorException",$fault:"client",...e});Object.setPrototypeOf(this,le.prototype)}}nt.IDPCommunicationErrorException=le});var Te=y((Rt)=>{Object.defineProperty(Rt,"__esModule",{value:!0});Rt.AssumeRoleWithWebIdentity$=Rt.AssumeRole$=Rt.Tag$=Rt.ProvidedContext$=Rt.PolicyDescriptorType$=Rt.Credentials$=Rt.AssumeRoleWithWebIdentityResponse$=Rt.AssumeRoleWithWebIdentityRequest$=Rt.AssumeRoleResponse$=Rt.AssumeRoleRequest$=Rt.AssumedRoleUser$=Rt.errorTypeRegistries=Rt.RegionDisabledException$=Rt.PackedPolicyTooLargeException$=Rt.MalformedPolicyDocumentException$=Rt.InvalidIdentityTokenException$=Rt.IDPRejectedClaimException$=Rt.IDPCommunicationErrorException$=Rt.ExpiredTokenException$=Rt.STSServiceException$=void 0;var fo="Arn",er="AccessKeyId",tr="AssumeRole",or="AssumedRoleId",rr="AssumeRoleRequest",sr="AssumeRoleResponse",Pe="AssumedRoleUser",nr="AssumeRoleWithWebIdentity",ir="AssumeRoleWithWebIdentityRequest",cr="AssumeRoleWithWebIdentityResponse",dr="Audience",ye="Credentials",ur="ContextAssertion",dt="DurationSeconds",ar="Expiration",pr="ExternalId",lr="ExpiredTokenException",Er="IDPCommunicationErrorException",Pr="IDPRejectedClaimException",yr="InvalidIdentityTokenException",_r="Key",Ir="MalformedPolicyDocumentException",ut="Policy",at="PolicyArns",Rr="ProviderArn",Tr="ProvidedContexts",Sr="ProvidedContextsListType",vr="ProvidedContext",xr="PolicyDescriptorType",Dr="ProviderId",pt="PackedPolicySize",mr="PackedPolicyTooLargeException",Ar="Provider",lt="RoleArn",$r="RegionDisabledException",Et="RoleSessionName",br="SecretAccessKey",hr="SubjectFromWebIdentityToken",_e="SourceIdentity",Nr="SerialNumber",qr="SessionToken",Fr="Tags",Wr="TokenCode",wr="TransitiveTagKeys",Ur="Tag",Mr="Value",kr="WebIdentityToken",Lr="arn",jr="accessKeySecretType",$="awsQueryError",b="client",Gr="clientTokenType",h="error",N="httpError",q="message",Or="policyDescriptorListType",Pt="smithy.ts.sdk.synthetic.com.amazonaws.sts",Kr="tagListType",d="com.amazonaws.sts",yt=ct(),F=Ee(),Vr=O(),_t=yt.TypeRegistry.for(Pt);Rt.STSServiceException$=[-3,Pt,"STSServiceException",0,[],[]];_t.registerError(Rt.STSServiceException$,Vr.STSServiceException);var x=yt.TypeRegistry.for(d);Rt.ExpiredTokenException$=[-3,d,lr,{[$]:["ExpiredTokenException",400],[h]:b,[N]:400},[q],[0]];x.registerError(Rt.ExpiredTokenException$,F.ExpiredTokenException);Rt.IDPCommunicationErrorException$=[-3,d,Er,{[$]:["IDPCommunicationError",400],[h]:b,[N]:400},[q],[0]];x.registerError(Rt.IDPCommunicationErrorException$,F.IDPCommunicationErrorException);Rt.IDPRejectedClaimException$=[-3,d,Pr,{[$]:["IDPRejectedClaim",403],[h]:b,[N]:403},[q],[0]];x.registerError(Rt.IDPRejectedClaimException$,F.IDPRejectedClaimException);Rt.InvalidIdentityTokenException$=[-3,d,yr,{[$]:["InvalidIdentityToken",400],[h]:b,[N]:400},[q],[0]];x.registerError(Rt.InvalidIdentityTokenException$,F.InvalidIdentityTokenException);Rt.MalformedPolicyDocumentException$=[-3,d,Ir,{[$]:["MalformedPolicyDocument",400],[h]:b,[N]:400},[q],[0]];x.registerError(Rt.MalformedPolicyDocumentException$,F.MalformedPolicyDocumentException);Rt.PackedPolicyTooLargeException$=[-3,d,mr,{[$]:["PackedPolicyTooLarge",400],[h]:b,[N]:400},[q],[0]];x.registerError(Rt.PackedPolicyTooLargeException$,F.PackedPolicyTooLargeException);Rt.RegionDisabledException$=[-3,d,$r,{[$]:["RegionDisabledException",403],[h]:b,[N]:403},[q],[0]];x.registerError(Rt.RegionDisabledException$,F.RegionDisabledException);Rt.errorTypeRegistries=[_t,x];var zr=[0,d,jr,8,0],Br=[0,d,Gr,8,0];Rt.AssumedRoleUser$=[3,d,Pe,0,[or,fo],[0,0],2];Rt.AssumeRoleRequest$=[3,d,rr,0,[lt,Et,at,ut,dt,Fr,wr,pr,Nr,Wr,_e,Tr],[0,0,()=>It,0,1,()=>Qr,64,0,0,0,0,()=>gr],2];Rt.AssumeRoleResponse$=[3,d,sr,0,[ye,Pe,pt,_e],[[()=>Rt.Credentials$,0],()=>Rt.AssumedRoleUser$,1,0]];Rt.AssumeRoleWithWebIdentityRequest$=[3,d,ir,0,[lt,Et,kr,Dr,at,ut,dt],[0,0,[()=>Br,0],0,()=>It,0,1],3];Rt.AssumeRoleWithWebIdentityResponse$=[3,d,cr,0,[ye,hr,Pe,pt,Ar,dr,_e],[[()=>Rt.Credentials$,0],0,()=>Rt.AssumedRoleUser$,1,0,0,0]];Rt.Credentials$=[3,d,ye,0,[er,br,qr,ar],[0,[()=>zr,0],0,4],4];Rt.PolicyDescriptorType$=[3,d,xr,0,[Lr],[0]];Rt.ProvidedContext$=[3,d,vr,0,[Rr,ur],[0,0]];Rt.Tag$=[3,d,Ur,0,[_r,Mr],[0,0],2];var It=[1,d,Or,0,()=>Rt.PolicyDescriptorType$],gr=[1,d,Sr,0,()=>Rt.ProvidedContext$],Qr=[1,d,Kr,0,()=>Rt.Tag$];Rt.AssumeRole$=[9,d,tr,0,()=>Rt.AssumeRoleRequest$,()=>Rt.AssumeRoleResponse$];Rt.AssumeRoleWithWebIdentity$=[9,d,nr,0,()=>Rt.AssumeRoleWithWebIdentityRequest$,()=>Rt.AssumeRoleWithWebIdentityResponse$]});var Gt=y((Lt)=>{Object.defineProperty(Lt,"__esModule",{value:!0});Lt.getRuntimeConfig=void 0;var fr=X(),es=Cr(),ts=Se(),os=k(),rs=Zr(),Mt=Xr(),kt=Jr(),ss=Z(),ns=ot(),is=Te(),cs=(e)=>{return{apiVersion:"2011-06-15",base64Decoder:e?.base64Decoder??Mt.fromBase64,base64Encoder:e?.base64Encoder??Mt.toBase64,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??ns.defaultEndpointResolver,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??ss.defaultSTSHttpAuthSchemeProvider,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(t)=>t.getIdentityProvider("aws.auth#sigv4"),signer:new fr.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(t)=>t.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new ts.NoAuthSigner}],logger:e?.logger??new os.NoOpLogger,protocol:e?.protocol??es.AwsQueryProtocol,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.sts",errorTypeRegistries:is.errorTypeRegistries,xmlNamespace:"https://sts.amazonaws.com/doc/2011-06-15/",version:"2011-06-15",serviceTarget:"AWSSecurityTokenServiceV20110615"},serviceId:e?.serviceId??"STS",urlParser:e?.urlParser??rs.parseUrl,utf8Decoder:e?.utf8Decoder??kt.fromUtf8,utf8Encoder:e?.utf8Encoder??kt.toUtf8}};Lt.getRuntimeConfig=cs});var Xt=y((Ht)=>{Object.defineProperty(Ht,"__esModule",{value:!0});Ht.getRuntimeConfig=void 0;var Is=ds(),Rs=Is.__importDefault(ls()),Ts=gt(),Ot=X(),Kt=Es(),K=Qt(),Ss=Se(),vs=Ps(),Vt=Yt(),W=ps(),zt=us(),Bt=k(),xs=ys(),Ds=_s(),ms=as(),As=Gt(),$s=(e)=>{(0,Bt.emitWarningIfUnsupportedVersion)(process.version);let t=(0,Ds.resolveDefaultsModeConfig)(e),r=()=>t().then(Bt.loadConfigsForDefaultMode),u=(0,As.getRuntimeConfig)(e);(0,Ts.emitWarningIfUnsupportedVersion)(process.version);let s={profile:e?.profile,logger:u.logger};return{...u,...e,runtime:"node",defaultsMode:t,authSchemePreference:e?.authSchemePreference??(0,W.loadConfig)(Ot.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS,s),bodyLengthChecker:e?.bodyLengthChecker??xs.calculateBodyLength,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,Kt.createDefaultUserAgentProvider)({serviceId:u.serviceId,clientVersion:Rs.default.version}),httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(E)=>E.getIdentityProvider("aws.auth#sigv4")||(async(a)=>await e.credentialDefaultProvider(a?.__config||{})()),signer:new Ot.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(E)=>E.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new Ss.NoAuthSigner}],maxAttempts:e?.maxAttempts??(0,W.loadConfig)(Vt.NODE_MAX_ATTEMPT_CONFIG_OPTIONS,e),region:e?.region??(0,W.loadConfig)(K.NODE_REGION_CONFIG_OPTIONS,{...K.NODE_REGION_CONFIG_FILE_OPTIONS,...s}),requestHandler:zt.NodeHttpHandler.create(e?.requestHandler??r),retryMode:e?.retryMode??(0,W.loadConfig)({...Vt.NODE_RETRY_MODE_CONFIG_OPTIONS,default:async()=>(await r()).retryMode||ms.DEFAULT_RETRY_MODE},e),sha256:e?.sha256??vs.Hash.bind(null,"sha256"),streamCollector:e?.streamCollector??zt.streamCollector,useDualstackEndpoint:e?.useDualstackEndpoint??(0,W.loadConfig)(K.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,s),useFipsEndpoint:e?.useFipsEndpoint??(0,W.loadConfig)(K.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,s),userAgentAppId:e?.userAgentAppId??(0,W.loadConfig)(Kt.NODE_APP_ID_CONFIG_OPTIONS,s)}};Ht.getRuntimeConfig=$s});var ft=y((Zt)=>{Object.defineProperty(Zt,"__esModule",{value:!0});Zt.resolveHttpAuthRuntimeConfig=Zt.getHttpAuthExtensionConfiguration=void 0;var bs=(e)=>{let{httpAuthSchemes:t,httpAuthSchemeProvider:r,credentials:u}=e;return{setHttpAuthScheme(s){let E=t.findIndex((a)=>a.schemeId===s.schemeId);if(E===-1)t.push(s);else t.splice(E,1,s)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(s){r=s},httpAuthSchemeProvider(){return r},setCredentials(s){u=s},credentials(){return u}}};Zt.getHttpAuthExtensionConfiguration=bs;var hs=(e)=>{return{httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}};Zt.resolveHttpAuthRuntimeConfig=hs});var co=y((no)=>{Object.defineProperty(no,"__esModule",{value:!0});no.resolveRuntimeExtensions=void 0;var eo=so(),to=qs(),oo=k(),ro=ft(),Fs=(e,t)=>{let r=Object.assign((0,eo.getAwsRegionExtensionConfiguration)(e),(0,oo.getDefaultExtensionConfiguration)(e),(0,to.getHttpHandlerExtensionConfiguration)(e),(0,ro.getHttpAuthExtensionConfiguration)(e));return t.forEach((u)=>u.configure(r)),Object.assign(e,(0,eo.resolveAwsRegionExtensionConfiguration)(r),(0,oo.resolveDefaultRuntimeConfig)(r),(0,to.resolveHttpHandlerRuntimeConfig)(r),(0,ro.resolveHttpAuthRuntimeConfig)(r))};no.resolveRuntimeExtensions=Fs});var C=y((xe)=>{Object.defineProperty(xe,"__esModule",{value:!0});xe.STSClient=xe.__Client=void 0;var uo=Ws(),Ls=ws(),js=Us(),ao=Ms(),Gs=Qt(),ve=Se(),Os=ct(),Ks=ks(),Vs=Eo(),po=Yt(),Po=k();Object.defineProperty(xe,"__Client",{enumerable:!0,get:function(){return Po.Client}});var lo=Z(),zs=f(),Bs=Xt(),gs=co();class yo extends Po.Client{config;constructor(...[e]){let t=(0,Bs.getRuntimeConfig)(e||{});super(t);this.initConfig=t;let r=(0,zs.resolveClientEndpointParameters)(t),u=(0,ao.resolveUserAgentConfig)(r),s=(0,po.resolveRetryConfig)(u),E=(0,Gs.resolveRegionConfig)(s),a=(0,uo.resolveHostHeaderConfig)(E),T=(0,Vs.resolveEndpointConfig)(a),D=(0,lo.resolveHttpAuthSchemeConfig)(T),m=(0,gs.resolveRuntimeExtensions)(D,e?.extensions||[]);this.config=m,this.middlewareStack.use((0,Os.getSchemaSerdePlugin)(this.config)),this.middlewareStack.use((0,ao.getUserAgentPlugin)(this.config)),this.middlewareStack.use((0,po.getRetryPlugin)(this.config)),this.middlewareStack.use((0,Ks.getContentLengthPlugin)(this.config)),this.middlewareStack.use((0,uo.getHostHeaderPlugin)(this.config)),this.middlewareStack.use((0,Ls.getLoggerPlugin)(this.config)),this.middlewareStack.use((0,js.getRecursionDetectionPlugin)(this.config)),this.middlewareStack.use((0,ve.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config,{httpAuthSchemeParametersProvider:lo.defaultSTSHttpAuthSchemeParametersProvider,identityProviderConfigProvider:async(U)=>new ve.DefaultIdentityProviderConfig({"aws.auth#sigv4":U.credentials})})),this.middlewareStack.use((0,ve.getHttpSigningPlugin)(this.config))}destroy(){super.destroy()}}xe.STSClient=yo});var cn=y((I)=>{var w=C(),z=k(),Io=Eo(),Ro=f(),L=Te(),V=Ee(),De=gt(),Qs=so(),Ys=O();class B extends z.Command.classBuilder().ep(Ro.commonParams).m(function(e,t,r,u){return[Io.getEndpointPlugin(r,e.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRole",{}).n("STSClient","AssumeRoleCommand").sc(L.AssumeRole$).build(){}class g extends z.Command.classBuilder().ep(Ro.commonParams).m(function(e,t,r,u){return[Io.getEndpointPlugin(r,e.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRoleWithWebIdentity",{}).n("STSClient","AssumeRoleWithWebIdentityCommand").sc(L.AssumeRoleWithWebIdentity$).build(){}var Hs={AssumeRoleCommand:B,AssumeRoleWithWebIdentityCommand:g};class me extends w.STSClient{}z.createAggregatedClient(Hs,me);var To=(e)=>{if(typeof e?.Arn==="string"){let t=e.Arn.split(":");if(t.length>4&&t[4]!=="")return t[4]}return},So=async(e,t,r,u={})=>{let s=typeof e==="function"?await e():e,E=typeof t==="function"?await t():t,a="",T=s??E??(a=await Qs.stsRegionDefaultResolver(u)());return r?.debug?.("@aws-sdk/client-sts::resolveRegion","accepting first of:",`${s} (credential provider clientConfig)`,`${E} (contextual client)`,`${a} (STS default: AWS_REGION, profile region, or us-east-1)`),T},Js=(e,t)=>{let r,u;return async(s,E)=>{if(u=s,!r){let{logger:U=e?.parentClientConfig?.logger,profile:j=e?.parentClientConfig?.profile,region:Q,requestHandler:G=e?.parentClientConfig?.requestHandler,credentialProviderLogger:Y,userAgentAppId:H=e?.parentClientConfig?.userAgentAppId}=e,Ao=await So(Q,e?.parentClientConfig?.region,Y,{logger:U,profile:j}),$o=!vo(G);r=new t({...e,userAgentAppId:H,profile:j,credentialDefaultProvider:()=>async()=>u,region:Ao,requestHandler:$o?G:void 0,logger:U})}let{Credentials:a,AssumedRoleUser:T}=await r.send(new B(E));if(!a||!a.AccessKeyId||!a.SecretAccessKey)throw Error(`Invalid response from STS.assumeRole call with role ${E.RoleArn}`);let D=To(T),m={accessKeyId:a.AccessKeyId,secretAccessKey:a.SecretAccessKey,sessionToken:a.SessionToken,expiration:a.Expiration,...a.CredentialScope&&{credentialScope:a.CredentialScope},...D&&{accountId:D}};return De.setCredentialFeature(m,"CREDENTIALS_STS_ASSUME_ROLE","i"),m}},Xs=(e,t)=>{let r;return async(u)=>{if(!r){let{logger:D=e?.parentClientConfig?.logger,profile:m=e?.parentClientConfig?.profile,region:U,requestHandler:j=e?.parentClientConfig?.requestHandler,credentialProviderLogger:Q,userAgentAppId:G=e?.parentClientConfig?.userAgentAppId}=e,Y=await So(U,e?.parentClientConfig?.region,Q,{logger:D,profile:m}),H=!vo(j);r=new t({...e,userAgentAppId:G,profile:m,region:Y,requestHandler:H?j:void 0,logger:D})}let{Credentials:s,AssumedRoleUser:E}=await r.send(new g(u));if(!s||!s.AccessKeyId||!s.SecretAccessKey)throw Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${u.RoleArn}`);let a=To(E),T={accessKeyId:s.AccessKeyId,secretAccessKey:s.SecretAccessKey,sessionToken:s.SessionToken,expiration:s.Expiration,...s.CredentialScope&&{credentialScope:s.CredentialScope},...a&&{accountId:a}};if(a)De.setCredentialFeature(T,"RESOLVED_ACCOUNT_ID","T");return De.setCredentialFeature(T,"CREDENTIALS_STS_ASSUME_ROLE_WEB_ID","k"),T}},vo=(e)=>{return e?.metadata?.handlerProtocol==="h2"},xo=(e,t)=>{if(!t)return e;else return class extends e{constructor(u){super(u);for(let s of t)this.middlewareStack.use(s)}}},Do=(e={},t)=>Js(e,xo(w.STSClient,t)),mo=(e={},t)=>Xs(e,xo(w.STSClient,t)),Zs=(e)=>(t)=>e({roleAssumer:Do(t),roleAssumerWithWebIdentity:mo(t),...t});I.$Command=z.Command;I.STSServiceException=Ys.STSServiceException;I.AssumeRoleCommand=B;I.AssumeRoleWithWebIdentityCommand=g;I.STS=me;I.decorateDefaultCredentialProvider=Zs;I.getDefaultRoleAssumer=Do;I.getDefaultRoleAssumerWithWebIdentity=mo;Object.prototype.hasOwnProperty.call(w,"__proto__")&&!Object.prototype.hasOwnProperty.call(I,"__proto__")&&Object.defineProperty(I,"__proto__",{enumerable:!0,value:w.__proto__});Object.keys(w).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(I,e))I[e]=w[e]});Object.prototype.hasOwnProperty.call(L,"__proto__")&&!Object.prototype.hasOwnProperty.call(I,"__proto__")&&Object.defineProperty(I,"__proto__",{enumerable:!0,value:L.__proto__});Object.keys(L).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(I,e))I[e]=L[e]});Object.prototype.hasOwnProperty.call(V,"__proto__")&&!Object.prototype.hasOwnProperty.call(I,"__proto__")&&Object.defineProperty(I,"__proto__",{enumerable:!0,value:V.__proto__});Object.keys(V).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(I,e))I[e]=V[e]})});export default cn();
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ah as M,Bh as W,Fh as F,Gh as S,Kh as T,Lh as _,Mh as H,Oh as C,lh as E,th as O,uh as b,xh as k}from"./chunk-yp2zfcvh.js";import{Xt as I,Yt as R,_t as P}from"./chunk-21x3anp4.js";import{Du as j}from"./chunk-ntvr3177.js";import"./chunk-8j3aw4qg.js";var u=j.object({thinking:j.object({type:j.enum(["enabled","disabled"]).optional(),tokenBudget:j.number().optional()}).optional()}),d=j.object({message:j.string()}),w=T({errorSchema:d,errorToMessage:(z)=>z.message});function c({tools:z,toolChoice:X}){z=(z==null?void 0:z.length)?z:void 0;let Y=[];if(z==null)return{tools:void 0,toolChoice:void 0,toolWarnings:Y};let $=[];for(let J of z)if(J.type==="provider")Y.push({type:"unsupported",feature:`provider-defined tool ${J.id}`});else $.push({type:"function",function:{name:J.name,description:J.description,parameters:J.inputSchema}});if(X==null)return{tools:$,toolChoice:void 0,toolWarnings:Y};let D=X.type;switch(D){case"auto":return{tools:$,toolChoice:void 0,toolWarnings:Y};case"none":return{tools:$,toolChoice:"NONE",toolWarnings:Y};case"required":return{tools:$,toolChoice:"REQUIRED",toolWarnings:Y};case"tool":return{tools:$.filter((J)=>J.function.name===X.toolName),toolChoice:"REQUIRED",toolWarnings:Y};default:throw new P({functionality:`tool choice type: ${D}`})}}function y(z){if(z==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{input_tokens:X,output_tokens:Y}=z;return{inputTokens:{total:X,noCache:X,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:Y,text:Y,reasoning:void 0},raw:z}}function p(z){let X=[],Y=[],$=[];for(let{role:D,content:J}of z)switch(D){case"system":{X.push({role:"system",content:J});break}case"user":{X.push({role:"user",content:J.map((Q)=>{var B;switch(Q.type){case"text":return Q.text;case"file":{let G;if(typeof Q.data==="string")G=Q.data;else if(Q.data instanceof Uint8Array){if(!(((B=Q.mediaType)==null?void 0:B.startsWith("text/"))||Q.mediaType==="application/json"))throw new P({functionality:`document media type: ${Q.mediaType}`,message:`Media type '${Q.mediaType}' is not supported. Supported media types are: text/* and application/json.`});G=new TextDecoder().decode(Q.data)}else throw new P({functionality:"File URL data",message:"URLs should be downloaded by the AI SDK and not reach this point. This indicates a configuration issue."});return Y.push({data:{text:G,title:Q.filename}}),""}}}).join("")});break}case"assistant":{let Q="",B=[];for(let G of J)switch(G.type){case"text":{Q+=G.text;break}case"tool-call":{B.push({id:G.toolCallId,type:"function",function:{name:G.toolName,arguments:JSON.stringify(G.input)}});break}}X.push({role:"assistant",content:B.length>0?void 0:Q,tool_calls:B.length>0?B:void 0,tool_plan:void 0});break}case"tool":{X.push(...J.filter((Q)=>Q.type!=="tool-approval-response").map((Q)=>{var B;let G=Q.output,K;switch(G.type){case"text":case"error-text":K=G.value;break;case"execution-denied":K=(B=G.reason)!=null?B:"Tool execution denied.";break;case"content":case"json":case"error-json":K=JSON.stringify(G.value);break}return{role:"tool",content:K,tool_call_id:Q.toolCallId}}));break}default:throw Error(`Unsupported role: ${D}`)}return{messages:X,documents:Y,warnings:$}}function f(z){switch(z){case"COMPLETE":case"STOP_SEQUENCE":return"stop";case"MAX_TOKENS":return"length";case"ERROR":return"error";case"TOOL_CALL":return"tool-calls";default:return"other"}}var i=class{constructor(z,X){this.specificationVersion="v3",this.supportedUrls={},this.modelId=z,this.config=X}get provider(){return this.config.provider}async getArgs({prompt:z,maxOutputTokens:X,temperature:Y,topP:$,topK:D,frequencyPenalty:J,presencePenalty:Q,stopSequences:B,responseFormat:G,seed:K,tools:U,toolChoice:N,providerOptions:q}){var Z,L;let A=(Z=await F({provider:"cohere",providerOptions:q,schema:u}))!=null?Z:{},{messages:V,documents:x,warnings:h}=p(z),{tools:v,toolChoice:m,toolWarnings:g}=c({tools:U,toolChoice:N});return{args:{model:this.modelId,frequency_penalty:J,presence_penalty:Q,max_tokens:X,temperature:Y,p:$,k:D,seed:K,stop_sequences:B,response_format:(G==null?void 0:G.type)==="json"?{type:"json_object",json_schema:G.schema}:void 0,messages:V,tools:v,tool_choice:m,...x.length>0&&{documents:x},...A.thinking&&{thinking:{type:(L=A.thinking.type)!=null?L:"enabled",token_budget:A.thinking.tokenBudget}}},warnings:[...g,...h]}}async doGenerate(z){var X,Y,$,D,J,Q,B;let{args:G,warnings:K}=await this.getArgs(z),{responseHeaders:U,value:N,rawValue:q}=await S({url:`${this.config.baseURL}/chat`,headers:E(this.config.headers(),z.headers),body:G,failedResponseHandler:w,successfulResponseHandler:H(a),abortSignal:z.abortSignal,fetch:this.config.fetch}),Z=[];for(let L of(X=N.message.content)!=null?X:[]){if(L.type==="text"&&L.text.length>0){Z.push({type:"text",text:L.text});continue}if(L.type==="thinking"&&L.thinking.length>0){Z.push({type:"reasoning",text:L.thinking});continue}}for(let L of(Y=N.message.citations)!=null?Y:[])Z.push({type:"source",sourceType:"document",id:this.config.generateId(),mediaType:"text/plain",title:((D=($=L.sources[0])==null?void 0:$.document)==null?void 0:D.title)||"Document",providerMetadata:{cohere:{start:L.start,end:L.end,text:L.text,sources:L.sources,...L.type&&{citationType:L.type}}}});for(let L of(J=N.message.tool_calls)!=null?J:[])Z.push({type:"tool-call",toolCallId:L.id,toolName:L.function.name,input:L.function.arguments.replace(/^null$/,"{}")});return{content:Z,finishReason:{unified:f(N.finish_reason),raw:(Q=N.finish_reason)!=null?Q:void 0},usage:y(N.usage.tokens),request:{body:G},response:{id:(B=N.generation_id)!=null?B:void 0,headers:U,body:q},warnings:K}}async doStream(z){let{args:X,warnings:Y}=await this.getArgs(z),{responseHeaders:$,value:D}=await S({url:`${this.config.baseURL}/chat`,headers:E(this.config.headers(),z.headers),body:{...X,stream:!0},failedResponseHandler:w,successfulResponseHandler:_(s),abortSignal:z.abortSignal,fetch:this.config.fetch}),J={unified:"other",raw:void 0},Q=void 0,B=null,G=!1;return{stream:D.pipeThrough(new TransformStream({start(K){K.enqueue({type:"stream-start",warnings:Y})},transform(K,U){var N,q;if(z.includeRawChunks)U.enqueue({type:"raw",rawValue:K.rawValue});if(!K.success){J={unified:"error",raw:void 0},U.enqueue({type:"error",error:K.error});return}let Z=K.value;switch(Z.type){case"content-start":{if(Z.delta.message.content.type==="thinking"){U.enqueue({type:"reasoning-start",id:String(Z.index)}),G=!0;return}U.enqueue({type:"text-start",id:String(Z.index)});return}case"content-delta":{if("thinking"in Z.delta.message.content){U.enqueue({type:"reasoning-delta",id:String(Z.index),delta:Z.delta.message.content.thinking});return}U.enqueue({type:"text-delta",id:String(Z.index),delta:Z.delta.message.content.text});return}case"content-end":{if(G){U.enqueue({type:"reasoning-end",id:String(Z.index)}),G=!1;return}U.enqueue({type:"text-end",id:String(Z.index)});return}case"tool-call-start":{let A=Z.delta.message.tool_calls.id,V=Z.delta.message.tool_calls.function.name,x=Z.delta.message.tool_calls.function.arguments;if(B={id:A,name:V,arguments:x,hasFinished:!1},U.enqueue({type:"tool-input-start",id:A,toolName:V}),x.length>0)U.enqueue({type:"tool-input-delta",id:A,delta:x});return}case"tool-call-delta":{if(B&&!B.hasFinished){let A=Z.delta.message.tool_calls.function.arguments;B.arguments+=A,U.enqueue({type:"tool-input-delta",id:B.id,delta:A})}return}case"tool-call-end":{if(B&&!B.hasFinished)U.enqueue({type:"tool-input-end",id:B.id}),U.enqueue({type:"tool-call",toolCallId:B.id,toolName:B.name,input:JSON.stringify(JSON.parse(((N=B.arguments)==null?void 0:N.trim())||"{}"))}),B.hasFinished=!0,B=null;return}case"message-start":{U.enqueue({type:"response-metadata",id:(q=Z.id)!=null?q:void 0});return}case"message-end":{J={unified:f(Z.delta.finish_reason),raw:Z.delta.finish_reason},Q=Z.delta.usage.tokens;return}default:return}},flush(K){K.enqueue({type:"finish",finishReason:J,usage:y(Q)})}})),request:{body:{...X,stream:!0}},response:{headers:$}}}},a=j.object({generation_id:j.string().nullish(),message:j.object({role:j.string(),content:j.array(j.union([j.object({type:j.literal("text"),text:j.string()}),j.object({type:j.literal("thinking"),thinking:j.string()})])).nullish(),tool_plan:j.string().nullish(),tool_calls:j.array(j.object({id:j.string(),type:j.literal("function"),function:j.object({name:j.string(),arguments:j.string()})})).nullish(),citations:j.array(j.object({start:j.number(),end:j.number(),text:j.string(),sources:j.array(j.object({type:j.string().optional(),id:j.string().optional(),document:j.object({id:j.string().optional(),text:j.string(),title:j.string()})})),type:j.string().optional()})).nullish()}),finish_reason:j.string(),usage:j.object({billed_units:j.object({input_tokens:j.number(),output_tokens:j.number()}),tokens:j.object({input_tokens:j.number(),output_tokens:j.number()})})}),s=j.discriminatedUnion("type",[j.object({type:j.literal("citation-start")}),j.object({type:j.literal("citation-end")}),j.object({type:j.literal("content-start"),index:j.number(),delta:j.object({message:j.object({content:j.union([j.object({type:j.literal("text"),text:j.string()}),j.object({type:j.literal("thinking"),thinking:j.string()})])})})}),j.object({type:j.literal("content-delta"),index:j.number(),delta:j.object({message:j.object({content:j.union([j.object({text:j.string()}),j.object({thinking:j.string()})])})})}),j.object({type:j.literal("content-end"),index:j.number()}),j.object({type:j.literal("message-start"),id:j.string().nullish()}),j.object({type:j.literal("message-end"),delta:j.object({finish_reason:j.string(),usage:j.object({tokens:j.object({input_tokens:j.number(),output_tokens:j.number()})})})}),j.object({type:j.literal("tool-plan-delta"),delta:j.object({message:j.object({tool_plan:j.string()})})}),j.object({type:j.literal("tool-call-start"),delta:j.object({message:j.object({tool_calls:j.object({id:j.string(),type:j.literal("function"),function:j.object({name:j.string(),arguments:j.string()})})})})}),j.object({type:j.literal("tool-call-delta"),delta:j.object({message:j.object({tool_calls:j.object({function:j.object({arguments:j.string()})})})})}),j.object({type:j.literal("tool-call-end")})]),r=j.object({inputType:j.enum(["search_document","search_query","classification","clustering"]).optional(),truncate:j.enum(["NONE","START","END"]).optional(),outputDimension:j.union([j.literal(256),j.literal(512),j.literal(1024),j.literal(1536)]).optional()}),l=class{constructor(z,X){this.specificationVersion="v3",this.maxEmbeddingsPerCall=96,this.supportsParallelCalls=!0,this.modelId=z,this.config=X}get provider(){return this.config.provider}async doEmbed({values:z,headers:X,abortSignal:Y,providerOptions:$}){var D;let J=await F({provider:"cohere",providerOptions:$,schema:r});if(z.length>this.maxEmbeddingsPerCall)throw new R({provider:this.provider,modelId:this.modelId,maxEmbeddingsPerCall:this.maxEmbeddingsPerCall,values:z});let{responseHeaders:Q,value:B,rawValue:G}=await S({url:`${this.config.baseURL}/embed`,headers:E(this.config.headers(),X),body:{model:this.modelId,embedding_types:["float"],texts:z,input_type:(D=J==null?void 0:J.inputType)!=null?D:"search_query",truncate:J==null?void 0:J.truncate,output_dimension:J==null?void 0:J.outputDimension},failedResponseHandler:w,successfulResponseHandler:H(n),abortSignal:Y,fetch:this.config.fetch});return{warnings:[],embeddings:B.embeddings.float,usage:{tokens:B.meta.billed_units.input_tokens},response:{headers:Q,body:G}}}},n=j.object({embeddings:j.object({float:j.array(j.array(j.number()))}),meta:j.object({billed_units:j.object({input_tokens:j.number()})})}),t=M(()=>W(j.object({id:j.string().nullish(),results:j.array(j.object({index:j.number(),relevance_score:j.number()})),meta:j.any()}))),e=M(()=>W(j.object({maxTokensPerDoc:j.number().optional(),priority:j.number().optional()}))),o=class{constructor(z,X){this.specificationVersion="v3",this.modelId=z,this.config=X}get provider(){return this.config.provider}async doRerank({documents:z,headers:X,query:Y,topN:$,abortSignal:D,providerOptions:J}){var Q;let B=await F({provider:"cohere",providerOptions:J,schema:e}),G=[];if(z.type==="object")G.push({type:"compatibility",feature:"object documents",details:"Object documents are converted to strings."});let{responseHeaders:K,value:U,rawValue:N}=await S({url:`${this.config.baseURL}/rerank`,headers:E(this.config.headers(),X),body:{model:this.modelId,query:Y,documents:z.type==="text"?z.values:z.values.map((q)=>JSON.stringify(q)),top_n:$,max_tokens_per_doc:B==null?void 0:B.maxTokensPerDoc,priority:B==null?void 0:B.priority},failedResponseHandler:w,successfulResponseHandler:H(t),abortSignal:D,fetch:this.config.fetch});return{ranking:U.results.map((q)=>({index:q.index,relevanceScore:q.relevance_score})),warnings:G,response:{id:(Q=U.id)!=null?Q:void 0,headers:K,body:N}}}},jj="3.0.27";function zj(z={}){var X;let Y=(X=C(z.baseURL))!=null?X:"https://api.cohere.com/v2",$=()=>b({Authorization:`Bearer ${k({apiKey:z.apiKey,environmentVariableName:"COHERE_API_KEY",description:"Cohere"})}`,...z.headers},`ai-sdk/cohere/${jj}`),D=(G)=>{var K;return new i(G,{provider:"cohere.chat",baseURL:Y,headers:$,fetch:z.fetch,generateId:(K=z.generateId)!=null?K:O})},J=(G)=>new l(G,{provider:"cohere.textEmbedding",baseURL:Y,headers:$,fetch:z.fetch}),Q=(G)=>new o(G,{provider:"cohere.reranking",baseURL:Y,headers:$,fetch:z.fetch}),B=function(G){if(new.target)throw Error("The Cohere model function cannot be called with the new keyword.");return D(G)};return B.specificationVersion="v3",B.languageModel=D,B.embedding=J,B.embeddingModel=J,B.textEmbedding=J,B.textEmbeddingModel=J,B.reranking=Q,B.rerankingModel=Q,B.imageModel=(G)=>{throw new I({modelId:G,modelType:"imageModel"})},B}var Fj=zj();export{zj as createCohere,Fj as cohere,jj as VERSION};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Eg as _}from"./chunk-apksmrz9.js";import{Rg as ue}from"./chunk-e8j03wnd.js";import{$g as w}from"./chunk-3dq7hfxc.js";import{ah as l}from"./chunk-zaj612bw.js";import{QF as o,UF as d}from"./chunk-8j3aw4qg.js";var g=o(_(),1);var ie=o(l(),1);var O=o(w(),1),R=o(l(),1),J=o(_(),1);var j=o(w(),1),E=o(l(),1),U=(e,s,t)=>{let n={EcsContainer:async(r)=>{let{fromHttp:a}=await import("./chunk-a595cp8s.js"),{fromContainerMetadata:c}=await import("./chunk-b57avnse.js");return t?.debug("@aws-sdk/credential-provider-ini - credential_source is EcsContainer"),async()=>E.chain(a(r??{}),c(r))().then(L)},Ec2InstanceMetadata:async(r)=>{t?.debug("@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata");let{fromInstanceMetadata:a}=await import("./chunk-b57avnse.js");return async()=>a(r)().then(L)},Environment:async(r)=>{t?.debug("@aws-sdk/credential-provider-ini - credential_source is Environment");let{fromEnv:a}=await import("./chunk-dg466kdp.js");return async()=>a(r)().then(L)}};if(e in n)return n[e];else throw new E.CredentialsProviderError(`Unsupported credential source in profile ${s}. Got ${e}, expected EcsContainer or Ec2InstanceMetadata or Environment.`,{logger:t})},L=(e)=>j.setCredentialFeature(e,"CREDENTIALS_PROFILE_NAMED_PROVIDER","p");var N=(e,{profile:s="default",logger:t}={})=>{return Boolean(e)&&typeof e==="object"&&typeof e.role_arn==="string"&&["undefined","string"].indexOf(typeof e.role_session_name)>-1&&["undefined","string"].indexOf(typeof e.external_id)>-1&&["undefined","string"].indexOf(typeof e.mfa_serial)>-1&&(he(e,{profile:s,logger:t})||ye(e,{profile:s,logger:t}))},he=(e,{profile:s,logger:t})=>{let n=typeof e.source_profile==="string"&&typeof e.credential_source>"u";if(n)t?.debug?.(` ${s} isAssumeRoleWithSourceProfile source_profile=${e.source_profile}`);return n},ye=(e,{profile:s,logger:t})=>{let n=typeof e.credential_source==="string"&&typeof e.source_profile>"u";if(n)t?.debug?.(` ${s} isCredentialSourceProfile credential_source=${e.credential_source}`);return n},v=async(e,s,t,n,r={},a)=>{t.logger?.debug("@aws-sdk/credential-provider-ini - resolveAssumeRoleCredentials (STS)");let c=s[e],{source_profile:h,region:I}=c;if(!t.roleAssumer){let{getDefaultRoleAssumer:i}=await import("./chunk-jw4sgq23.js").then((m)=>o(m.default,1));t.roleAssumer=i({...t.clientConfig,credentialProviderLogger:t.logger,parentClientConfig:{...n,...t?.parentClientConfig,region:I??t?.parentClientConfig?.region??n?.region}},t.clientPlugins)}if(h&&h in r)throw new R.CredentialsProviderError(`Detected a cycle attempting to resolve credentials for profile ${J.getProfileName(t)}. Profiles visited: `+Object.keys(r).join(", "),{logger:t.logger});t.logger?.debug(`@aws-sdk/credential-provider-ini - finding credential resolver using ${h?`source_profile=[${h}]`:`profile=[${e}]`}`);let T=h?a(h,s,t,n,{...r,[h]:!0},G(s[h]??{})):(await U(c.credential_source,e,t.logger)(t))();if(G(c))return T.then((i)=>O.setCredentialFeature(i,"CREDENTIALS_PROFILE_SOURCE_PROFILE","o"));else{let i={RoleArn:c.role_arn,RoleSessionName:c.role_session_name||`aws-sdk-js-${Date.now()}`,ExternalId:c.external_id,DurationSeconds:parseInt(c.duration_seconds||"3600",10)},{mfa_serial:u}=c;if(u){if(!t.mfaCodeProvider)throw new R.CredentialsProviderError(`Profile ${e} requires multi-factor authentication, but no MFA code callback was provided.`,{logger:t.logger,tryNextLink:!1});i.SerialNumber=u,i.TokenCode=await t.mfaCodeProvider(u)}let y=await T;return t.roleAssumer(y,i).then((m)=>O.setCredentialFeature(m,"CREDENTIALS_PROFILE_SOURCE_PROFILE","o"))}},G=(e)=>{return!e.role_arn&&!!e.credential_source};var V=o(w(),1);var C=o(w(),1),X=o(l(),1),K=o(_(),1);var k=o(l(),1),W=o(ue(),1),z=o(_(),1);import{createHash as de,createPrivateKey as we,createPublicKey as ke,sign as me}from"crypto";import{promises as D}from"fs";import{homedir as fe}from"os";import{dirname as Ie,join as Y}from"path";class b{profileData;init;callerClientConfig;static REFRESH_THRESHOLD=300000;constructor(e,s,t){this.profileData=e,this.init=s,this.callerClientConfig=t}async loadCredentials(){let e=await this.loadToken();if(!e)throw new k.CredentialsProviderError(`Failed to load a token for session ${this.loginSession}, please re-authenticate using aws login`,{tryNextLink:!1,logger:this.logger});let s=e.accessToken,t=Date.now();if(new Date(s.expiresAt).getTime()-t<=b.REFRESH_THRESHOLD)return this.refresh(e);return{accessKeyId:s.accessKeyId,secretAccessKey:s.secretAccessKey,sessionToken:s.sessionToken,accountId:s.accountId,expiration:new Date(s.expiresAt)}}get logger(){return this.init?.logger}get loginSession(){return this.profileData.login_session}async refresh(e){let{SigninClient:s,CreateOAuth2TokenCommand:t}=await import("./chunk-b47e563q.js").then((m)=>o(m.default,1)),{logger:n,userAgentAppId:r}=this.callerClientConfig??{},c=((i)=>{return i?.metadata?.handlerProtocol==="h2"})(this.callerClientConfig?.requestHandler)?void 0:this.callerClientConfig?.requestHandler,h=this.profileData.region??await this.callerClientConfig?.region?.()??process.env.AWS_REGION,I=new s({credentials:{accessKeyId:"",secretAccessKey:""},region:h,requestHandler:c,logger:n,userAgentAppId:r,...this.init?.clientConfig});this.createDPoPInterceptor(I.middlewareStack);let T={tokenInput:{clientId:e.clientId,refreshToken:e.refreshToken,grantType:"refresh_token"}};try{let i=await I.send(new t(T)),{accessKeyId:u,secretAccessKey:y,sessionToken:m}=i.tokenOutput?.accessToken??{},{refreshToken:x,expiresIn:H}=i.tokenOutput??{};if(!u||!y||!m||!x)throw new k.CredentialsProviderError("Token refresh response missing required fields",{logger:this.logger,tryNextLink:!1});let A=(H??900)*1000,f=new Date(Date.now()+A),q={...e,accessToken:{...e.accessToken,accessKeyId:u,secretAccessKey:y,sessionToken:m,expiresAt:f.toISOString()},refreshToken:x};await this.saveToken(q);let S=q.accessToken;return{accessKeyId:S.accessKeyId,secretAccessKey:S.secretAccessKey,sessionToken:S.sessionToken,accountId:S.accountId,expiration:f}}catch(i){if(i.name==="AccessDeniedException"){let u=i.error,y;switch(u){case"TOKEN_EXPIRED":y="Your session has expired. Please reauthenticate.";break;case"USER_CREDENTIALS_CHANGED":y="Unable to refresh credentials because of a change in your password. Please reauthenticate with your new password.";break;case"INSUFFICIENT_PERMISSIONS":y="Unable to refresh credentials due to insufficient permissions. You may be missing permission for the 'CreateOAuth2Token' action.";break;default:y=`Failed to refresh token: ${String(i)}. Please re-authenticate using \`aws login\``}throw new k.CredentialsProviderError(y,{logger:this.logger,tryNextLink:!1})}throw new k.CredentialsProviderError(`Failed to refresh token: ${String(i)}. Please re-authenticate using aws login`,{logger:this.logger})}}async loadToken(){let e=this.getTokenFilePath();try{let s;try{s=await z.readFile(e,{ignoreCache:this.init?.ignoreCache})}catch{s=await D.readFile(e,"utf8")}let t=JSON.parse(s),n=["accessToken","clientId","refreshToken","dpopKey"].filter((r)=>!t[r]);if(!t.accessToken?.accountId)n.push("accountId");if(n.length>0)throw new k.CredentialsProviderError(`Token validation failed, missing fields: ${n.join(", ")}`,{logger:this.logger,tryNextLink:!1});return t}catch(s){throw new k.CredentialsProviderError(`Failed to load token from ${e}: ${String(s)}`,{logger:this.logger,tryNextLink:!1})}}async saveToken(e){let s=this.getTokenFilePath(),t=Ie(s);try{await D.mkdir(t,{recursive:!0})}catch(n){}await D.writeFile(s,JSON.stringify(e,null,2),"utf8")}getTokenFilePath(){let e=process.env.AWS_LOGIN_CACHE_DIRECTORY??Y(fe(),".aws","login","cache"),s=Buffer.from(this.loginSession,"utf8"),t=de("sha256").update(s).digest("hex");return Y(e,`${t}.json`)}derToRawSignature(e){let s=2;if(e[s]!==2)throw Error("Invalid DER signature");s++;let t=e[s++],n=e.subarray(s,s+t);if(s+=t,e[s]!==2)throw Error("Invalid DER signature");s++;let r=e[s++],a=e.subarray(s,s+r);n=n[0]===0?n.subarray(1):n,a=a[0]===0?a.subarray(1):a;let c=Buffer.concat([Buffer.alloc(32-n.length),n]),h=Buffer.concat([Buffer.alloc(32-a.length),a]);return Buffer.concat([c,h])}createDPoPInterceptor(e){e.add((s)=>async(t)=>{if(W.HttpRequest.isInstance(t.request)){let n=t.request,r=`${n.protocol}//${n.hostname}${n.port?`:${n.port}`:""}${n.path}`,a=await this.generateDpop(n.method,r);n.headers={...n.headers,DPoP:a}}return s(t)},{step:"finalizeRequest",name:"dpopInterceptor",override:!0})}async generateDpop(e="POST",s){let t=await this.loadToken();try{let n=we({key:t.dpopKey,format:"pem",type:"sec1"}),a=ke(n).export({format:"der",type:"spki"}),c=-1;for(let f=0;f<a.length;f++)if(a[f]===4){c=f;break}let h=a.slice(c+1,c+33),I=a.slice(c+33,c+65),T={alg:"ES256",typ:"dpop+jwt",jwk:{kty:"EC",crv:"P-256",x:h.toString("base64url"),y:I.toString("base64url")}},i={jti:crypto.randomUUID(),htm:e,htu:s,iat:Math.floor(Date.now()/1000)},u=Buffer.from(JSON.stringify(T)).toString("base64url"),y=Buffer.from(JSON.stringify(i)).toString("base64url"),m=`${u}.${y}`,x=me("sha256",Buffer.from(m),n),A=this.derToRawSignature(x).toString("base64url");return`${m}.${A}`}catch(n){throw new k.CredentialsProviderError(`Failed to generate Dpop proof: ${n instanceof Error?n.message:String(n)}`,{logger:this.logger,tryNextLink:!1})}}}var Q=(e)=>async({callerClientConfig:s}={})=>{e?.logger?.debug?.("@aws-sdk/credential-providers - fromLoginCredentials");let t=await K.parseKnownFiles(e||{}),n=K.getProfileName({profile:e?.profile??s?.profile}),r=t[n];if(!r?.login_session)throw new X.CredentialsProviderError(`Profile ${n} does not contain login_session.`,{tryNextLink:!0,logger:e?.logger});let c=await new b(r,e,s).loadCredentials();return C.setCredentialFeature(c,"CREDENTIALS_LOGIN","AD")};var Z=(e)=>{return Boolean(e&&e.login_session)},M=async(e,s,t)=>{let n=await Q({...s,profile:e})({callerClientConfig:t});return V.setCredentialFeature(n,"CREDENTIALS_PROFILE_LOGIN","AC")};var p=o(w(),1),ee=(e)=>Boolean(e)&&typeof e==="object"&&typeof e.credential_process==="string",te=async(e,s)=>import("./chunk-jgzt4945.js").then(({fromProcess:t})=>t({...e,profile:s})().then((n)=>p.setCredentialFeature(n,"CREDENTIALS_PROFILE_PROCESS","v")));var $=o(w(),1),se=async(e,s,t={},n)=>{let{fromSSO:r}=await import("./chunk-qavtgsrh.js");return r({profile:e,logger:t.logger,parentClientConfig:t.parentClientConfig,clientConfig:t.clientConfig})({callerClientConfig:n}).then((a)=>{if(s.sso_session)return $.setCredentialFeature(a,"CREDENTIALS_PROFILE_SSO","r");else return $.setCredentialFeature(a,"CREDENTIALS_PROFILE_SSO_LEGACY","t")})},ne=(e)=>e&&(typeof e.sso_start_url==="string"||typeof e.sso_account_id==="string"||typeof e.sso_session==="string"||typeof e.sso_region==="string"||typeof e.sso_role_name==="string");var ce=o(w(),1),P=(e)=>Boolean(e)&&typeof e==="object"&&typeof e.aws_access_key_id==="string"&&typeof e.aws_secret_access_key==="string"&&["undefined","string"].indexOf(typeof e.aws_session_token)>-1&&["undefined","string"].indexOf(typeof e.aws_account_id)>-1,F=async(e,s)=>{s?.logger?.debug("@aws-sdk/credential-provider-ini - resolveStaticCredentials");let t={accessKeyId:e.aws_access_key_id,secretAccessKey:e.aws_secret_access_key,sessionToken:e.aws_session_token,...e.aws_credential_scope&&{credentialScope:e.aws_credential_scope},...e.aws_account_id&&{accountId:e.aws_account_id}};return ce.setCredentialFeature(t,"CREDENTIALS_PROFILE","n")};var re=o(w(),1),ae=(e)=>Boolean(e)&&typeof e==="object"&&typeof e.web_identity_token_file==="string"&&typeof e.role_arn==="string"&&["undefined","string"].indexOf(typeof e.role_session_name)>-1,oe=async(e,s,t)=>import("./chunk-bfjq7w7k.js").then(({fromTokenFile:n})=>n({webIdentityTokenFile:e.web_identity_token_file,roleArn:e.role_arn,roleSessionName:e.role_session_name,roleAssumerWithWebIdentity:s.roleAssumerWithWebIdentity,logger:s.logger,parentClientConfig:s.parentClientConfig})({callerClientConfig:t}).then((r)=>re.setCredentialFeature(r,"CREDENTIALS_PROFILE_STS_WEB_ID_TOKEN","q")));var B=async(e,s,t,n,r={},a=!1)=>{let c=s[e];if(Object.keys(r).length>0&&P(c))return F(c,t);if(a||N(c,{profile:e,logger:t.logger}))return v(e,s,t,n,r,B);if(P(c))return F(c,t);if(ae(c))return oe(c,t,n);if(ee(c))return te(t,e);if(ne(c))return await se(e,c,t,n);if(Z(c))return M(e,t,n);throw new ie.CredentialsProviderError(`Could not resolve credentials using profile: [${e}] in configuration/credentials file(s).`,{logger:t.logger})};var Ne=(e={})=>async({callerClientConfig:s}={})=>{e.logger?.debug("@aws-sdk/credential-provider-ini - fromIni");let t=await g.parseKnownFiles(e);return B(g.getProfileName({profile:e.profile??s?.profile}),t,e,s)};export{Q as Tf,Ne as Uf};
@@ -0,0 +1,4 @@
1
+ // @bun
2
+ function A(t,p,r){let u=(a)=>Object.defineProperty(t,p,{value:a,enumerable:!0,writable:!0});return Object.defineProperty(t,p,{configurable:!0,enumerable:!0,get(){let a=r();return u(a),a},set(a){u(a)}}),t}import{promisify as Q}from"util";import O from"process";import{execFile as R}from"child_process";import{promisify as C}from"util";import E from"process";import{execFile as L}from"child_process";var $=C(L);async function m(){if(E.platform!=="darwin")throw Error("macOS only");let{stdout:t}=await $("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]),r=/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(t)?.groups.id??"com.apple.Safari";if(r==="com.apple.safari")return"com.apple.Safari";return r}import e from"process";import{promisify as q}from"util";import{execFile as G,execFileSync as k}from"child_process";var J=q(G);async function g(t,{humanReadableOutput:p=!0,signal:r}={}){if(e.platform!=="darwin")throw Error("macOS only");let u=p?[]:["-ss"],a={};if(r)a.signal=r;let{stdout:f}=await J("osascript",["-e",t,u],a);return f.trim()}async function l(t){return g(`tell application "Finder" to set app_path to application file id "${t}" as string
3
+ tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}import{promisify as K}from"util";import{execFile as M}from"child_process";var N=K(M),n={MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},MSEdgeBHTML:{name:"Edge Beta",id:"com.microsoft.edge.beta"},MSEdgeDHTML:{name:"Edge Dev",id:"com.microsoft.edge.dev"},AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},ChromeBHTML:{name:"Chrome Beta",id:"com.google.chrome.beta"},ChromeDHTML:{name:"Chrome Dev",id:"com.google.chrome.dev"},ChromiumHTM:{name:"Chromium",id:"org.chromium.Chromium"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveDHTML:{name:"Brave Dev",id:"com.brave.Browser.dev"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},OperaStable:{name:"Opera",id:"com.operasoftware.Opera"},VivaldiHTM:{name:"Vivaldi",id:"com.vivaldi.Vivaldi"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"}},b=new Map(Object.entries(n));class o extends Error{}async function S(t=N){let{stdout:p}=await t("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),r=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(p);if(!r)throw new o(`Cannot find Windows browser in stdout: ${JSON.stringify(p)}`);let{id:u}=r.groups,a=u.lastIndexOf("."),f=u.lastIndexOf("-"),c=a===-1?void 0:u.slice(0,a),v=f===-1?void 0:u.slice(0,f);return n[u]??n[c]??n[v]??{name:u,id:u}}var V=Q(R),W=(t)=>t.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,(p)=>p.toUpperCase());async function X(){if(O.platform==="darwin"){let t=await m();return{name:await l(t),id:t}}if(O.platform==="linux"){let{stdout:t}=await V("xdg-mime",["query","default","x-scheme-handler/http"]),p=t.trim();return{name:W(p.replace(/.desktop$/,"").replace("-"," ")),id:p}}if(O.platform==="win32")return S();throw Error("Only macOS, Linux, and Windows are supported")}
4
+ export{A as jv,X as kv};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Gh as R,Kh as M,Lh as _,Mh as g,Oh as d,lh as x,oh as F,th as v,uh as m,xh as u}from"./chunk-yp2zfcvh.js";import{Xt as C,_t as h}from"./chunk-21x3anp4.js";import{Du as z}from"./chunk-ntvr3177.js";import"./chunk-8j3aw4qg.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};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import{Eg as F}from"./chunk-apksmrz9.js";import{ah as w}from"./chunk-zaj612bw.js";import{RF as h}from"./chunk-8j3aw4qg.js";var P=h((p)=>{var t=w(),l=F();function d(e){try{let o=new Set(Array.from(e.match(/([A-Z_]){3,}/g)??[]));return o.delete("CONFIG"),o.delete("CONFIG_PREFIX_SEPARATOR"),o.delete("ENV"),[...o].join(", ")}catch(o){return e}}var u=(e,o)=>async()=>{try{let r=e(process.env,o);if(r===void 0)throw Error();return r}catch(r){throw new t.CredentialsProviderError(r.message||`Not found in ENV: ${d(e.toString())}`,{logger:o?.logger})}},C=(e,{preferredFile:o="config",...r}={})=>async()=>{let n=l.getProfileName(r),{configFile:i,credentialsFile:c}=await l.loadSharedConfigFiles(r),s=c[n]||{},g=i[n]||{},m=o==="config"?{...s,...g}:{...g,...s};try{let f=e(m,o==="config"?i:c);if(f===void 0)throw Error();return f}catch(a){throw new t.CredentialsProviderError(a.message||`Not found in config files w/ profile [${n}]: ${d(e.toString())}`,{logger:r.logger})}},y=(e)=>typeof e==="function",E=(e)=>y(e)?async()=>await e():t.fromStatic(e),N=({environmentVariableSelector:e,configFileSelector:o,default:r},n={})=>{let{signingName:i,logger:c}=n,s={signingName:i,logger:c};return t.memoize(t.chain(u(e,s),C(o,n),E(r)))};p.loadConfig=N});
3
+ export{P as Dg};