@bkm016/basalt 0.1.8 → 0.1.9
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.
- package/{chunk-0039s4jt.js → chunk-02d3x4mj.js} +3 -3
- package/{chunk-ky55taar.js → chunk-0xd9mnc2.js} +327 -316
- package/{chunk-ckjw3b61.js → chunk-13gvs0ax.js} +2 -2
- package/{chunk-0d51ggzj.js → chunk-1n7dat03.js} +4 -4
- package/{chunk-ppxv5q7y.js → chunk-1zj3zvw5.js} +3 -3
- package/{chunk-2ek3wq4b.js → chunk-29qrxygd.js} +1 -1
- package/{chunk-7p6e2f5s.js → chunk-30rjf7my.js} +3 -3
- package/{chunk-v2srrqcv.js → chunk-38g3gctw.js} +2 -2
- package/{chunk-3j2kkgsc.js → chunk-4dw43syb.js} +1 -1
- package/{chunk-t66jqz12.js → chunk-4gtgqcct.js} +2 -2
- package/chunk-66h5qpc6.js +479 -0
- package/{chunk-qmdpgbg3.js → chunk-755sy11p.js} +1 -1
- package/{chunk-n015c8nx.js → chunk-7zkswxvk.js} +1 -1
- package/{chunk-91r5nvth.js → chunk-82v8jh1h.js} +2 -2
- package/{chunk-12trygzx.js → chunk-95964592.js} +16 -16
- package/{chunk-nmtk9xra.js → chunk-9as0p561.js} +2 -2
- package/{chunk-pn413hjw.js → chunk-a1352w87.js} +1 -1
- package/{chunk-rnt1ckk9.js → chunk-a1rb1a48.js} +5 -5
- package/{chunk-fzcmzbsq.js → chunk-a98wma9j.js} +1 -1
- package/{chunk-kgkrccr1.js → chunk-asyr3gnq.js} +2 -2
- package/{chunk-5gxj9560.js → chunk-ax04trym.js} +1 -1
- package/chunk-b2bxqeb4.js +2 -0
- package/{chunk-xjw78yey.js → chunk-bdjr0kfr.js} +4 -4
- package/{chunk-7kjr9gdx.js → chunk-bk4rpnm8.js} +2 -2
- package/{chunk-47vf66t6.js → chunk-c0zfefq8.js} +1 -1
- package/{chunk-kpvaqb7c.js → chunk-c6q04xrd.js} +2 -2
- package/chunk-c71173py.js +25 -0
- package/{chunk-adys4qq4.js → chunk-cmwdjes8.js} +5 -5
- package/{chunk-dcwdmpw2.js → chunk-d0a1jxk5.js} +1 -1
- package/{chunk-2nrkqq45.js → chunk-d5j74pcp.js} +7 -7
- package/{chunk-pkpj7s2k.js → chunk-dfh9m9n7.js} +1 -1
- package/{chunk-26cz8et8.js → chunk-dq01v5eq.js} +1 -1
- package/{chunk-fpxc6qjr.js → chunk-e1x629v0.js} +2 -2
- package/{chunk-86xhmz7k.js → chunk-en218k4y.js} +1 -1
- package/{chunk-3hg7yn1t.js → chunk-fgwda4m0.js} +1 -1
- package/chunk-gbjn6d81.js +2 -0
- package/{chunk-x496kg3v.js → chunk-gkf5jwvj.js} +1 -1
- package/{chunk-k3q5jqjj.js → chunk-hb4f2v34.js} +2 -2
- package/{chunk-mr807v9n.js → chunk-hbnmymaq.js} +1 -1
- package/{chunk-818nd6s1.js → chunk-jj4hqbrx.js} +2 -2
- package/{chunk-jyv9cae6.js → chunk-jn5pqy5v.js} +1 -1
- package/{chunk-yyy2yp6f.js → chunk-jtsve11b.js} +9 -9
- package/chunk-m1eam0s5.js +2 -0
- package/{chunk-6vnjg5x9.js → chunk-mbpb5c7w.js} +1 -1
- package/{chunk-t40fag3z.js → chunk-msm9hmk9.js} +1 -1
- package/{chunk-j781n7ca.js → chunk-n0ybj4h9.js} +2 -2
- package/{chunk-jp5afrwm.js → chunk-n2jcx65v.js} +2 -2
- package/{chunk-2ks2tnac.js → chunk-nrsd810j.js} +2 -2
- package/chunk-pnspvnyd.js +2 -0
- package/chunk-pz2afna8.js +2 -0
- package/{chunk-d37gemt2.js → chunk-q9f4xb0w.js} +3 -3
- package/{chunk-hd3x1w46.js → chunk-qaeyhe65.js} +1 -1
- package/chunk-qnkrrwmg.js +2 -0
- package/{chunk-e6c2mzxc.js → chunk-r4ttdkrz.js} +2 -2
- package/{chunk-r9aatvwm.js → chunk-stj493dn.js} +2 -2
- package/{chunk-g3ed130w.js → chunk-tevejprz.js} +4 -4
- package/{chunk-k3rmjrf1.js → chunk-v3ee9z3f.js} +1 -1
- package/{chunk-4n49ptbz.js → chunk-vtqr7dm8.js} +2 -2
- package/{chunk-z3ch1wg6.js → chunk-xh444pfn.js} +14 -14
- package/{chunk-pehyqj8k.js → chunk-zc9ar0r4.js} +1 -1
- package/{chunk-ef9yhnk3.js → chunk-zyyzk5ha.js} +1 -1
- package/compiled.js +9 -9
- package/package.json +1 -1
- package/ui-test-worker.js +8 -8
- package/web/chunk-08sq3cwm.js +1 -0
- package/web/chunk-0pghpg4y.js +2 -0
- package/web/chunk-12qf1r6m.js +1 -0
- package/web/chunk-24fjnnee.js +1 -0
- package/web/chunk-24jhbz82.js +24 -0
- package/web/{chunk-v14s4vgc.js → chunk-2dvbeqt0.js} +1 -1
- package/web/chunk-2hrswh3d.js +2 -0
- package/web/chunk-2j2atyjw.js +1 -0
- package/web/{chunk-s7e93552.js → chunk-2x4g9t37.js} +4 -4
- package/web/{chunk-hstbgb83.js → chunk-3ak5dg10.js} +5 -5
- package/web/chunk-3ecrkvr3.js +106 -0
- package/web/chunk-3h3g3ca3.js +1 -0
- package/web/chunk-3hr3ew9w.js +1 -0
- package/web/chunk-3pcrxg6m.js +1 -0
- package/web/{chunk-7a4xk6j9.js → chunk-3pd0qt83.js} +5 -5
- package/web/chunk-3txxt0a7.js +1 -0
- package/web/chunk-43g4wd7a.js +1 -0
- package/web/{chunk-nky3bqfg.js → chunk-4a6gdrbs.js} +1 -1
- package/web/{chunk-d0m0h0eb.js → chunk-5a4mj3qz.js} +1 -1
- package/web/{chunk-rkjkynm3.js → chunk-5baeh8q7.js} +11 -11
- package/web/{chunk-qq2v8h6d.js → chunk-5dr4tkem.js} +4 -4
- package/web/chunk-5jdrev9p.js +36 -0
- package/web/{chunk-p0cjvjdx.js → chunk-5v2c0aqk.js} +1 -1
- package/web/chunk-5z2n4z9x.css +1 -0
- package/web/{chunk-6e38yf3a.js → chunk-601k823s.js} +4 -4
- package/web/{chunk-8dp7h6w8.js → chunk-60axh4sa.js} +16 -16
- package/web/chunk-66wb0p6e.js +62 -0
- package/web/{chunk-qcge7d6s.js → chunk-6e87m0nm.js} +2 -2
- package/web/chunk-6y55gk1n.js +1 -0
- package/web/{chunk-8wg44w91.js → chunk-79e08rk1.js} +2 -2
- package/web/{chunk-svh2gkx8.js → chunk-7qkav30b.js} +1 -1
- package/web/chunk-814kkkmq.js +8 -0
- package/web/chunk-8jcvdd5d.js +2 -0
- package/web/{chunk-rbdvc8x7.js → chunk-8w7fyb3v.js} +1 -1
- package/web/chunk-8w8atrdh.js +1 -0
- package/web/{chunk-sda7cyrt.js → chunk-8z0r0wtk.js} +21 -21
- package/web/chunk-935mjq1c.js +39 -0
- package/web/chunk-942g3eqn.js +1 -0
- package/web/{chunk-1gx0zpmp.js → chunk-98y92vmh.js} +9 -9
- package/web/chunk-9ctg0f30.js +3 -0
- package/web/chunk-9fnr00kv.js +4 -0
- package/web/{chunk-fe31sv6t.js → chunk-9yfftz38.js} +1 -1
- package/web/chunk-a0ryzdnp.js +7 -0
- package/web/chunk-a61zrp66.js +1 -0
- package/web/{chunk-dtg5yhhs.js → chunk-af9evdza.js} +1 -1
- package/web/chunk-arnzrqnm.js +1 -0
- package/web/chunk-avxk6jpc.js +2 -0
- package/web/{chunk-c01176kn.js → chunk-awkdw9rw.js} +2 -2
- package/web/{chunk-tkp72r9b.js → chunk-b5h52neg.js} +1 -1
- package/web/chunk-bwy3e58v.js +1 -0
- package/web/{chunk-ja7w629n.js → chunk-c57f714b.js} +2 -2
- package/web/chunk-c6yacwbc.js +30 -0
- package/web/{chunk-823b7866.js → chunk-ctzkqx2g.js} +18 -18
- package/web/{chunk-w37n09px.js → chunk-db3twjvk.js} +10 -10
- package/web/{chunk-hbkasy6c.js → chunk-ddyyc20r.js} +22 -22
- package/web/{chunk-z0zrp8n8.js → chunk-dnv8dx72.js} +1 -1
- package/web/{chunk-jzte2phh.js → chunk-dwjmr0zj.js} +1 -1
- package/web/chunk-dz7g1gnv.js +2 -0
- package/web/{chunk-cez1k71m.js → chunk-eadfxfkw.js} +1 -1
- package/web/{chunk-d9wdsjkk.js → chunk-eqndhs21.js} +2 -2
- package/web/{chunk-cyjnert7.js → chunk-ewx42c11.js} +16 -16
- package/web/chunk-f7jpakwh.js +1 -0
- package/web/{chunk-r4ffr96e.js → chunk-ff1pmd3g.js} +1 -1
- package/web/chunk-fjb3ksfd.js +78 -0
- package/web/chunk-fpb2dd2d.js +2 -0
- package/web/{chunk-fv6vm14n.js → chunk-frnh4zqf.js} +2 -2
- package/web/{chunk-0j9a7811.js → chunk-gn8kyz76.js} +6 -6
- package/web/chunk-gv99c8zv.js +1 -0
- package/web/chunk-h0767tjv.js +1 -0
- package/web/chunk-hqynf99g.js +1 -0
- package/web/{chunk-jam45rqg.js → chunk-jccz14ye.js} +2 -2
- package/web/{chunk-33w36n91.js → chunk-kcjz03h5.js} +2 -2
- package/web/chunk-ket6g0yd.js +1 -0
- package/web/chunk-m9q5nr8f.js +1 -0
- package/web/chunk-mdfksj61.js +1 -0
- package/web/chunk-me7dza1c.js +1 -0
- package/web/{chunk-8773nwdc.js → chunk-myd6sc76.js} +1 -1
- package/web/{chunk-sf101c23.js → chunk-mykrm8ba.js} +2 -2
- package/web/chunk-mzzaet63.js +1 -0
- package/web/chunk-n0wazxgz.js +1 -0
- package/web/{chunk-1s8zg6fb.js → chunk-nnyc889n.js} +5 -5
- package/web/{chunk-xabcx3ry.js → chunk-nvpp0ghj.js} +3 -3
- package/web/chunk-nvt9tkt4.js +1139 -0
- package/web/{chunk-dgwkqcz6.js → chunk-p9hfcamx.js} +2 -2
- package/web/chunk-ph1dgffm.js +1 -0
- package/web/chunk-q34as3v6.js +1 -0
- package/web/{chunk-sd3cdqcm.js → chunk-qh62nkem.js} +2 -2
- package/web/{chunk-j1bw5v1g.js → chunk-qq6m2my8.js} +2 -2
- package/web/{chunk-f93pe4kb.js → chunk-qsqtwf34.js} +4 -4
- package/web/{chunk-85gdsmt4.js → chunk-qz6r9v1z.js} +1 -1
- package/web/chunk-rad2s9ha.js +1 -0
- package/web/{chunk-8nv7q5ac.js → chunk-rasjtvsb.js} +15 -15
- package/web/{chunk-s38s9ff9.js → chunk-rayf24gy.js} +28 -28
- package/web/{chunk-cn0tmwjs.js → chunk-rrpn5r5w.js} +2 -2
- package/web/{chunk-m5y2d4zv.js → chunk-s37beysw.js} +1 -1
- package/web/chunk-s60s09mb.js +1 -0
- package/web/chunk-sk1wkgjw.js +4 -0
- package/web/{chunk-xqyazzm7.js → chunk-spbs56wz.js} +5 -5
- package/web/{chunk-h5cfg3vv.js → chunk-t893141g.js} +2 -2
- package/web/chunk-tftc5v89.js +24 -0
- package/web/chunk-tfvcs2xx.js +1 -0
- package/web/{chunk-q1xxs319.js → chunk-ts6jsfdk.js} +4 -4
- package/web/{chunk-xsz1dfm2.js → chunk-v1exk5wd.js} +20 -20
- package/web/{chunk-3q0v8w45.js → chunk-veam6vk4.js} +79 -79
- package/web/{chunk-xb9m0092.js → chunk-vqmj6peg.js} +1 -1
- package/web/{chunk-cn1xpg3q.js → chunk-vsjpnwsr.js} +2 -2
- package/web/{chunk-et8q775x.js → chunk-w3w18stt.js} +5 -5
- package/web/chunk-wdq2tp9e.js +1 -0
- package/web/chunk-wkf5xfyr.js +1 -0
- package/web/{chunk-fx4mackk.js → chunk-wzd2a4k5.js} +4 -4
- package/web/{chunk-jjjtv2r1.js → chunk-xa43ndfj.js} +2 -2
- package/web/chunk-xh4xn1az.js +1 -0
- package/web/{chunk-2axwda8c.js → chunk-xx11yv61.js} +7 -7
- package/web/chunk-xzwxcxb4.js +1 -0
- package/web/chunk-y1qty77a.js +1 -0
- package/web/{chunk-4anjs6yp.js → chunk-y2rzeb4v.js} +2 -2
- package/web/chunk-ys2tns0p.js +1 -0
- package/web/chunk-z05x9cbm.js +1 -0
- package/web/{chunk-mf6xng5b.js → chunk-zb2bkr7f.js} +2 -2
- package/web/{chunk-wj3ymejj.js → chunk-zdyys4ar.js} +3 -3
- package/web/chunk-zgavhnt8.js +1 -0
- package/web/index.html +1 -1
- package/worker.js +1 -1
- package/chunk-2gcp3xdc.js +0 -2
- package/chunk-320174qe.js +0 -2
- package/chunk-dvb5nd2x.js +0 -2
- package/chunk-frt9k18g.js +0 -480
- package/chunk-ndt6rjt9.js +0 -2
- package/chunk-xy2bxwq8.js +0 -2
- package/chunk-yzevjkms.js +0 -25
- package/chunk-zdyd8hbn.js +0 -2
- package/web/chunk-0jfda4jw.js +0 -2
- package/web/chunk-2p3fkhy8.js +0 -1
- package/web/chunk-3sz5qcwj.js +0 -1
- package/web/chunk-433c80pc.js +0 -1
- package/web/chunk-48cnmhvd.js +0 -106
- package/web/chunk-5r37rwq1.js +0 -4
- package/web/chunk-6bwgdvf6.js +0 -1
- package/web/chunk-7f1t7z72.js +0 -2
- package/web/chunk-7x35g67d.js +0 -78
- package/web/chunk-8pzg8qw4.js +0 -1
- package/web/chunk-8r0s8tx7.js +0 -1
- package/web/chunk-9p5dfvav.js +0 -1
- package/web/chunk-9q9w9pay.js +0 -1
- package/web/chunk-a3teqvz2.js +0 -39
- package/web/chunk-ahztazsg.js +0 -1
- package/web/chunk-bd8ftfxn.js +0 -3
- package/web/chunk-c03bt2pz.js +0 -1
- package/web/chunk-c1ha2xg6.js +0 -8
- package/web/chunk-cgng31df.js +0 -1
- package/web/chunk-cvd4f51j.js +0 -1
- package/web/chunk-cybvxssy.js +0 -1
- package/web/chunk-d22wq71s.js +0 -1
- package/web/chunk-dynajx8x.js +0 -2
- package/web/chunk-f3vv7n52.js +0 -1
- package/web/chunk-fpa81dv7.js +0 -62
- package/web/chunk-g17n6asp.js +0 -1
- package/web/chunk-g9dzaw9e.js +0 -30
- package/web/chunk-gcwhx3av.js +0 -1139
- package/web/chunk-gf8vm6b5.js +0 -1
- package/web/chunk-gnmeyy4h.js +0 -1
- package/web/chunk-hn7mhsbg.js +0 -1
- package/web/chunk-jfvxxp5c.js +0 -1
- package/web/chunk-k8h8zx6r.js +0 -24
- package/web/chunk-m3ajw575.js +0 -1
- package/web/chunk-mz9b5bsa.js +0 -1
- package/web/chunk-np33kmn4.js +0 -1
- package/web/chunk-nvk8mazs.js +0 -1
- package/web/chunk-nyw5ewgv.js +0 -1
- package/web/chunk-p56dcqpr.js +0 -1
- package/web/chunk-pdn4r8x4.js +0 -1
- package/web/chunk-qpt34d8d.js +0 -1
- package/web/chunk-qskt3tqa.js +0 -1
- package/web/chunk-qt3n897m.js +0 -4
- package/web/chunk-r1rt48h9.js +0 -1
- package/web/chunk-r7tgd2fm.js +0 -7
- package/web/chunk-rznszqmy.js +0 -1
- package/web/chunk-s1pefd34.js +0 -1
- package/web/chunk-sc29azev.js +0 -1
- package/web/chunk-t4jc4nac.js +0 -1
- package/web/chunk-t7g366a5.js +0 -24
- package/web/chunk-thbqwq6b.js +0 -1
- package/web/chunk-v94v68xg.js +0 -36
- package/web/chunk-wcphswcx.js +0 -2
- package/web/chunk-wwcnvyjh.css +0 -1
- package/web/chunk-xce8n339.js +0 -1
- package/web/chunk-xfd3b01q.js +0 -1
- package/web/chunk-xtss82z2.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Be,it}from"./chunk-rnt1ckk9.js";import{Fe}from"./chunk-fpxc6qjr.js";import{qe,_e,L}from"./chunk-g3ed130w.js";import{Se,X,b,we,J,Qe,H}from"./chunk-adys4qq4.js";var{awsEndpointFunctions:Ve,emitWarningIfUnsupportedVersion:ze,createDefaultUserAgentProvider:We,NODE_APP_ID_CONFIG_OPTIONS:Le,getAwsRegionExtensionConfiguration:je,resolveAwsRegionExtensionConfiguration:Ge,resolveUserAgentConfig:Ke,resolveHostHeaderConfig:Xe,getUserAgentPlugin:Ye,getHostHeaderPlugin:Je,getLoggerPlugin:Ze,getRecursionDetectionPlugin:et}=L(),{NoAuthSigner:tt,getHttpAuthSchemeEndpointRuleSetPlugin:st,DefaultIdentityProviderConfig:nt,getHttpSigningPlugin:ot}=_e(),{normalizeProvider:ae,getSmithyContext:rt,ServiceException:at,NoOpLogger:ct,emitWarningIfUnsupportedVersion:ut,loadConfigsForDefaultMode:pt,getDefaultExtensionConfiguration:dt,resolveDefaultRuntimeConfig:ht,Client:ce,makeBuilder:gt,createAggregatedClient:lt}=X(),{Command:mt}=X();var Ls=mt,Bs=ce;var{resolveDefaultsModeConfig:Et,loadConfig:m,NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS:At,NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS:_t,NODE_REGION_CONFIG_OPTIONS:It,NODE_REGION_CONFIG_FILE_OPTIONS:St,resolveRegionConfig:Ot}=b(),{BinaryDecisionDiagram:Ct,EndpointCache:Rt,decideEndpoint:vt,customEndpointFunctions:Pt,resolveEndpointConfig:Tt,getEndpointPlugin:ft}=we(),{parseUrl:kt,getHttpHandlerExtensionConfiguration:xt,resolveHttpHandlerRuntimeConfig:yt,getContentLengthPlugin:Dt}=H(),{DEFAULT_RETRY_MODE:wt,NODE_RETRY_MODE_CONFIG_OPTIONS:Nt,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:$t,resolveRetryConfig:Ut,getRetryPlugin:Ft}=qe(),{TypeRegistry:ue,getSchemaSerdePlugin:bt}=Se(),{resolveAwsSdkSigV4Config:qt,AwsSdkSigV4Signer:Mt,NODE_AUTH_SCHEME_PREFERENCE_OPTIONS:Ht}=Be(),{toUtf8:Vt,fromUtf8:zt,toBase64:Wt,fromBase64:Lt,calculateBodyLength:Bt}=J(),{streamCollector:jt,NodeHttpHandler:Gt}=Fe(),{AwsRestJsonProtocol:Kt}=it(),{Sha256:Xt}=Qe(),Qt=async(e,s,n)=>({operation:rt(s).operation,region:await ae(e.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function Yt(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"signin",region:e.region},propertiesExtractor:(s,n)=>({signingProperties:{config:s,context:n}})}}function Jt(e){return{schemeId:"smithy.api#noAuth"}}var Zt=(e)=>{let s=[];switch(e.operation){case"CreateOAuth2Token":{s.push(Jt());break}default:s.push(Yt(e))}return s},es=(e)=>{let s=qt(e);return Object.assign(s,{authSchemePreference:ae(e.authSchemePreference??[])})},ts=(e)=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"signin"}),ss={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},ns="3.997.47",os={version:ns},h="ref",p=-1,W=!1,E=!0,B="isSet",A="booleanEquals",j="coalesce",N="PartitionResult",u="stringEquals",k="getAttr",G="https://signin.{Region}.{PartitionResult#dualStackDnsSuffix}",K={[h]:"Endpoint"},d={fn:k,argv:[{[h]:N},"name"]},pe={[h]:"Region"},Q={[h]:N},S={authSchemes:[{name:"sigv4",signingName:"signin",signingRegion:"{Region}"}]},r={},Y=[pe],Z={conditions:[[B,Y],[A,[{fn:j,argv:[{[h]:"IsControlPlane"},W]},E]],[B,[K]],["aws.partition",Y,N],[A,[{[h]:"UseFIPS"},E]],[u,[d,"aws"]],[A,[{fn:j,argv:[{[h]:"IsOAuthEndpoint"},W]},E]],[A,[{[h]:"UseDualStack"},E]],[u,[d,"aws-cn"]],[u,[pe,"us-gov-west-1"]],[u,[d,"aws-us-gov"]],[A,[{fn:k,argv:[Q,"supportsFIPS"]},E]],[u,[d,"aws-iso"]],[u,[d,"aws-iso-b"]],[u,[d,"aws-iso-f"]],[u,[d,"aws-iso-e"]],[u,[d,"aws-eusc"]],[A,[{fn:k,argv:[Q,"supportsDualStack"]},E]]],results:[[p],["https://signin.{Region}.api.aws",S],["https://signin.{Region}.api.amazonwebservices.com.cn",S],[G,S],[p,"FIPS endpoints are not supported for OAuth operations. Disable FIPS or use a non-OAuth operation."],["https://{Region}.oauth.signin.aws",S],["https://{Region}.signin.aws.amazon.com",r],["https://{Region}.signin.amazonaws.cn",r],["https://{Region}.signin.amazonaws-us-gov.com",r],["https://{Region}.signin.c2shome.ic.gov",r],["https://{Region}.signin.sc2shome.sgov.gov",r],["https://{Region}.signin.csphome.hci.ic.gov",r],["https://{Region}.signin.csphome.adc-e.uk",r],["https://{Region}.signin.amazonaws-eusc.eu",r],["https://signin-fips.amazonaws-us-gov.com",r],["https://{Region}.signin-fips.amazonaws-us-gov.com",r],["https://{Region}.signin.{PartitionResult#dnsSuffix}",r],[p,"Invalid Configuration: FIPS and custom endpoint are not supported"],[p,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[K,r],["https://signin-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",r],[p,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://signin-fips.{Region}.{PartitionResult#dnsSuffix}",r],[p,"FIPS is enabled but this partition does not support FIPS"],[G,r],[p,"DualStack is enabled but this partition does not support DualStack"],["https://signin.{Region}.{PartitionResult#dnsSuffix}",r],[p,"Invalid Configuration: Missing Region"]]},rs=2,t=1e8,is=new Int32Array([-1,1,-1,0,6,3,2,36,4,4,5,t+27,6,t+4,t+27,1,29,7,2,36,8,3,9,31,4,22,10,5,19,11,7,21,12,8,t+7,13,10,t+8,14,12,t+9,15,13,t+10,16,14,t+11,17,15,t+12,18,16,t+13,t+16,6,t+5,20,7,21,t+6,17,t+24,t+25,6,t+4,23,7,27,24,9,t+14,25,10,t+15,26,11,t+22,t+23,11,28,t+21,17,t+20,t+21,2,35,30,3,39,31,4,32,t+27,6,t+4,33,7,t+27,34,9,t+14,t+27,3,39,36,4,38,37,7,t+18,t+19,6,t+4,t+17,5,t+1,40,8,t+2,t+3]),as=Ct.from(is,rs,Z.conditions,Z.results),cs=new Rt({size:50,params:["Endpoint","IsControlPlane","IsOAuthEndpoint","Region","UseDualStack","UseFIPS"]}),us=(e,s={})=>cs.get(e,()=>vt(as,{endpointParams:e,logger:s.logger}));Pt.aws=Ve;class l extends at{static shapeId="smithy.ts.sdk.synthetic.com.amazonaws.signin#SigninServiceException";constructor(e){super(e);Object.setPrototypeOf(this,l.prototype)}}class C extends l{static shapeId="com.amazonaws.signin#AccessDeniedException";name="AccessDeniedException";$fault="client";error;constructor(e){super({name:"AccessDeniedException",$fault:"client",...e});Object.setPrototypeOf(this,C.prototype),this.error=e.error}}class R extends l{static shapeId="com.amazonaws.signin#InternalServerException";name="InternalServerException";$fault="server";error;constructor(e){super({name:"InternalServerException",$fault:"server",...e});Object.setPrototypeOf(this,R.prototype),this.error=e.error}}class v extends l{static shapeId="com.amazonaws.signin#TooManyRequestsError";name="TooManyRequestsError";$fault="client";error;constructor(e){super({name:"TooManyRequestsError",$fault:"client",...e});Object.setPrototypeOf(this,v.prototype),this.error=e.error}}class P extends l{static shapeId="com.amazonaws.signin#ValidationException";name="ValidationException";$fault="client";error;constructor(e){super({name:"ValidationException",$fault:"client",...e});Object.setPrototypeOf(this,P.prototype),this.error=e.error}}var ps="AccessDeniedException",ds="AccessToken",hs="CreateOAuth2Token",gs="CreateOAuth2TokenRequest",ls="CreateOAuth2TokenRequestBody",ms="CreateOAuth2TokenResponseBody",Es="CreateOAuth2TokenResponse",As="CreateOAuth2TokenWithIAM",_s="CreateOAuth2TokenWithIAMRequest",Is="CreateOAuth2TokenWithIAMResponse",Ss="InternalServerException",Os="OAuthAccessToken",Cs="RefreshToken",Rs="TooManyRequestsError",vs="ValidationException",ee="accessKeyId",x="accessToken",Ps="access_token",U="client",te="clientId",se="codeVerifier",Ts="code",g="error",y="expiresIn",fs="expires_in",D="grantType",ks="grant_type",de="http",F="httpError",ne="idToken",o="jsonName",T="message",xs="resource",O="refreshToken",oe="redirectUri",he="smithy.ts.sdk.synthetic.com.amazonaws.signin",re="secretAccessKey",ie="sessionToken",ys="server",Ds="tokenInput",ws="tokenOutput",w="tokenType",Ns="token_type",i="com.amazonaws.signin",ge=new ue(he),le=[-3,he,"SigninServiceException",0,[],[]];ge.registerError(le,l);var _=new ue(i),me=[-3,i,ps,{[g]:U},[g,T],[0,0],2];_.registerError(me,C);var Ee=[-3,i,Ss,{[g]:ys,[F]:500},[g,T],[0,0],2];_.registerError(Ee,R);var Ae=[-3,i,Rs,{[g]:U,[F]:429},[g,T],[0,0],2];_.registerError(Ae,v);var Ie=[-3,i,vs,{[g]:U,[F]:400},[g,T],[0,0],2];_.registerError(Ie,P);var Oe=[ge,_],$s=[0,i,Os,8,0],Ce=[0,i,Cs,8,0],Re=[3,i,ds,8,[ee,re,ie],[[0,{[o]:ee}],[0,{[o]:re}],[0,{[o]:ie}]],3],ve=[3,i,gs,0,[Ds],[[()=>Pe,16]],1],Pe=[3,i,ls,0,[te,D,Ts,oe,se,O],[[0,{[o]:te}],[0,{[o]:D}],0,[0,{[o]:oe}],[0,{[o]:se}],[()=>Ce,{[o]:O}]],2],Te=[3,i,Es,0,[ws],[[()=>fe,16]],1],fe=[3,i,ms,0,[x,w,y,O,ne],[[()=>Re,{[o]:x}],[0,{[o]:w}],[1,{[o]:y}],[()=>Ce,{[o]:O}],[0,{[o]:ne}]],4],ke=[3,i,_s,0,[D,xs],[[0,{[o]:ks}],0],2],xe=[3,i,Is,0,[x,w,y],[[()=>$s,{[o]:Ps}],[0,{[o]:Ns}],[1,{[o]:fs}]],3],ye=[9,i,hs,{[de]:["POST","/v1/token",200]},()=>ve,()=>Te],De=[9,i,As,{[de]:["POST","/v1/token?x-amz-client-auth-method=iam",200]},()=>ke,()=>xe],Us=(e)=>({apiVersion:"2023-01-01",base64Decoder:e?.base64Decoder??Lt,base64Encoder:e?.base64Encoder??Wt,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??us,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??Zt,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4"),signer:new Mt},{schemeId:"smithy.api#noAuth",identityProvider:(s)=>s.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new tt}],logger:e?.logger??new ct,protocol:e?.protocol??Kt,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.signin",errorTypeRegistries:Oe,version:"2023-01-01",serviceTarget:"Signin"},serviceId:e?.serviceId??"Signin",sha256:e?.sha256??Xt,urlParser:e?.urlParser??kt,utf8Decoder:e?.utf8Decoder??zt,utf8Encoder:e?.utf8Encoder??Vt}),Fs=(e)=>{ut(process.version);let s=Et(e),n=()=>s().then(pt),c=Us(e);ze(process.version);let a={profile:e?.profile,logger:c.logger};return{...c,...e,runtime:"node",defaultsMode:s,authSchemePreference:e?.authSchemePreference??m(Ht,a),bodyLengthChecker:e?.bodyLengthChecker??Bt,defaultUserAgentProvider:e?.defaultUserAgentProvider??We({serviceId:c.serviceId,clientVersion:os.version}),maxAttempts:e?.maxAttempts??m($t,e),region:e?.region??m(It,{...St,...a}),requestHandler:Gt.create(e?.requestHandler??n),retryMode:e?.retryMode??m({...Nt,default:async()=>(await n()).retryMode||wt},e),streamCollector:e?.streamCollector??jt,useDualstackEndpoint:e?.useDualstackEndpoint??m(_t,a),useFipsEndpoint:e?.useFipsEndpoint??m(At,a),userAgentAppId:e?.userAgentAppId??m(Le,a)}},bs=(e)=>{let{httpAuthSchemes:s,httpAuthSchemeProvider:n,credentials:c}=e;return{setHttpAuthScheme(a){let I=s.findIndex((f)=>f.schemeId===a.schemeId);if(I===-1)s.push(a);else s.splice(I,1,a)},httpAuthSchemes(){return s},setHttpAuthSchemeProvider(a){n=a},httpAuthSchemeProvider(){return n},setCredentials(a){c=a},credentials(){return c}}},qs=(e)=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}),Ms=(e,s)=>{let n=Object.assign(je(e),dt(e),xt(e),bs(e));return s.forEach((c)=>c.configure(n)),Object.assign(e,Ge(n),ht(n),yt(n),qs(n))};class q extends ce{config;constructor(...[e]){let s=Fs(e||{});super(s);this.initConfig=s;let n=ts(s),c=Ke(n),a=Ut(c),I=Ot(a),f=Xe(I),Ue=Tt(f),be=es(Ue),Me=Ms(be,e?.extensions||[]);this.config=Me,this.middlewareStack.use(bt(this.config)),this.middlewareStack.use(Ye(this.config)),this.middlewareStack.use(Ft(this.config)),this.middlewareStack.use(Dt(this.config)),this.middlewareStack.use(Je(this.config)),this.middlewareStack.use(Ze(this.config)),this.middlewareStack.use(et(this.config)),this.middlewareStack.use(st(this.config,{httpAuthSchemeParametersProvider:Qt,identityProviderConfigProvider:async(He)=>new nt({"aws.auth#sigv4":He.credentials})})),this.middlewareStack.use(ot(this.config))}destroy(){super.destroy()}}var Ne=gt(ss,"Signin","SigninClient",ft),Hs={IsControlPlane:{type:"staticContextParams",value:!1}},Vs={IsOAuthEndpoint:{type:"staticContextParams",value:!0}},$e=(e,s,n,c)=>[];class M extends Ne(Hs,$e,"CreateOAuth2Token",ye){}class V extends Ne(Vs,$e,"CreateOAuth2TokenWithIAM",De){}var zs={CreateOAuth2TokenCommand:M,CreateOAuth2TokenWithIAMCommand:V};class z extends q{}lt(zs,z);var Ws={AUTHCODE_EXPIRED:"AUTHCODE_EXPIRED",CONFLICT:"CONFLICT",INSUFFICIENT_PERMISSIONS:"INSUFFICIENT_PERMISSIONS",INVALID_REQUEST:"INVALID_REQUEST",RESOURCE_NOT_FOUND:"RESOURCE_NOT_FOUND",SERVER_ERROR:"server_error",SERVICE_QUOTA_EXCEEDED:"SERVICE_QUOTA_EXCEEDED",TOKEN_EXPIRED:"TOKEN_EXPIRED",USER_CREDENTIALS_CHANGED:"USER_CREDENTIALS_CHANGED"};var js=C,Gs=me,Ks=Re,Xs=ye,Qs=M,Ys=ve,Js=Pe,Zs=Te,en=fe,tn=De,sn=V,nn=ke,on=xe,rn=R,an=Ee,cn=Ws,un=z,pn=q,dn=l,hn=le,gn=v,ln=Ae,mn=P,En=Ie,An=Oe;export{Ls as $Command,Bs as __Client,js as AccessDeniedException,Gs as AccessDeniedException$,Ks as AccessToken$,Xs as CreateOAuth2Token$,Qs as CreateOAuth2TokenCommand,Ys as CreateOAuth2TokenRequest$,Js as CreateOAuth2TokenRequestBody$,Zs as CreateOAuth2TokenResponse$,en as CreateOAuth2TokenResponseBody$,tn as CreateOAuth2TokenWithIAM$,sn as CreateOAuth2TokenWithIAMCommand,nn as CreateOAuth2TokenWithIAMRequest$,on as CreateOAuth2TokenWithIAMResponse$,rn as InternalServerException,an as InternalServerException$,cn as OAuth2ErrorCode,un as Signin,pn as SigninClient,dn as SigninServiceException,hn as SigninServiceException$,gn as TooManyRequestsError,ln as TooManyRequestsError$,mn as ValidationException,En as ValidationException$,An as errorTypeRegistries};
|
|
2
|
+
import{Fe,ot}from"./chunk-a1rb1a48.js";import{We}from"./chunk-e1x629v0.js";import{qe,Ae,L}from"./chunk-tevejprz.js";import{we,X,b,xe,J,Qe,H}from"./chunk-cmwdjes8.js";var{awsEndpointFunctions:Ve,emitWarningIfUnsupportedVersion:ze,createDefaultUserAgentProvider:Le,NODE_APP_ID_CONFIG_OPTIONS:Be,getAwsRegionExtensionConfiguration:je,resolveAwsRegionExtensionConfiguration:Ge,resolveUserAgentConfig:Ke,resolveHostHeaderConfig:Xe,getUserAgentPlugin:Ye,getHostHeaderPlugin:Je,getLoggerPlugin:Ze,getRecursionDetectionPlugin:et}=L(),{NoAuthSigner:tt,getHttpAuthSchemeEndpointRuleSetPlugin:st,DefaultIdentityProviderConfig:nt,getHttpSigningPlugin:rt}=Ae(),{normalizeProvider:ae,getSmithyContext:it,ServiceException:at,NoOpLogger:ct,emitWarningIfUnsupportedVersion:ut,loadConfigsForDefaultMode:pt,getDefaultExtensionConfiguration:dt,resolveDefaultRuntimeConfig:ht,Client:ce,makeBuilder:gt,createAggregatedClient:lt}=X(),{Command:mt}=X();var Ls=mt,Bs=ce;var{resolveDefaultsModeConfig:Et,loadConfig:m,NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS:At,NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS:_t,NODE_REGION_CONFIG_OPTIONS:It,NODE_REGION_CONFIG_FILE_OPTIONS:St,resolveRegionConfig:Ot}=b(),{BinaryDecisionDiagram:Ct,EndpointCache:Rt,decideEndpoint:vt,customEndpointFunctions:Pt,resolveEndpointConfig:Tt,getEndpointPlugin:ft}=xe(),{parseUrl:kt,getHttpHandlerExtensionConfiguration:xt,resolveHttpHandlerRuntimeConfig:yt,getContentLengthPlugin:Dt}=H(),{DEFAULT_RETRY_MODE:wt,NODE_RETRY_MODE_CONFIG_OPTIONS:Nt,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:$t,resolveRetryConfig:Ut,getRetryPlugin:Ft}=qe(),{TypeRegistry:ue,getSchemaSerdePlugin:bt}=we(),{resolveAwsSdkSigV4Config:qt,AwsSdkSigV4Signer:Mt,NODE_AUTH_SCHEME_PREFERENCE_OPTIONS:Ht}=Fe(),{toUtf8:Vt,fromUtf8:zt,toBase64:Wt,fromBase64:Lt,calculateBodyLength:Bt}=J(),{streamCollector:jt,NodeHttpHandler:Gt}=We(),{AwsRestJsonProtocol:Kt}=ot(),{Sha256:Xt}=Qe(),Qt=async(e,s,n)=>({operation:it(s).operation,region:await ae(e.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function Yt(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"signin",region:e.region},propertiesExtractor:(s,n)=>({signingProperties:{config:s,context:n}})}}function Jt(e){return{schemeId:"smithy.api#noAuth"}}var Zt=(e)=>{let s=[];switch(e.operation){case"CreateOAuth2Token":{s.push(Jt());break}default:s.push(Yt(e))}return s},es=(e)=>{let s=qt(e);return Object.assign(s,{authSchemePreference:ae(e.authSchemePreference??[])})},ts=(e)=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"signin"}),ss={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},ns="3.997.47",os={version:ns},h="ref",p=-1,W=!1,E=!0,B="isSet",A="booleanEquals",j="coalesce",N="PartitionResult",u="stringEquals",k="getAttr",G="https://signin.{Region}.{PartitionResult#dualStackDnsSuffix}",K={[h]:"Endpoint"},d={fn:k,argv:[{[h]:N},"name"]},pe={[h]:"Region"},Q={[h]:N},S={authSchemes:[{name:"sigv4",signingName:"signin",signingRegion:"{Region}"}]},r={},Y=[pe],Z={conditions:[[B,Y],[A,[{fn:j,argv:[{[h]:"IsControlPlane"},W]},E]],[B,[K]],["aws.partition",Y,N],[A,[{[h]:"UseFIPS"},E]],[u,[d,"aws"]],[A,[{fn:j,argv:[{[h]:"IsOAuthEndpoint"},W]},E]],[A,[{[h]:"UseDualStack"},E]],[u,[d,"aws-cn"]],[u,[pe,"us-gov-west-1"]],[u,[d,"aws-us-gov"]],[A,[{fn:k,argv:[Q,"supportsFIPS"]},E]],[u,[d,"aws-iso"]],[u,[d,"aws-iso-b"]],[u,[d,"aws-iso-f"]],[u,[d,"aws-iso-e"]],[u,[d,"aws-eusc"]],[A,[{fn:k,argv:[Q,"supportsDualStack"]},E]]],results:[[p],["https://signin.{Region}.api.aws",S],["https://signin.{Region}.api.amazonwebservices.com.cn",S],[G,S],[p,"FIPS endpoints are not supported for OAuth operations. Disable FIPS or use a non-OAuth operation."],["https://{Region}.oauth.signin.aws",S],["https://{Region}.signin.aws.amazon.com",r],["https://{Region}.signin.amazonaws.cn",r],["https://{Region}.signin.amazonaws-us-gov.com",r],["https://{Region}.signin.c2shome.ic.gov",r],["https://{Region}.signin.sc2shome.sgov.gov",r],["https://{Region}.signin.csphome.hci.ic.gov",r],["https://{Region}.signin.csphome.adc-e.uk",r],["https://{Region}.signin.amazonaws-eusc.eu",r],["https://signin-fips.amazonaws-us-gov.com",r],["https://{Region}.signin-fips.amazonaws-us-gov.com",r],["https://{Region}.signin.{PartitionResult#dnsSuffix}",r],[p,"Invalid Configuration: FIPS and custom endpoint are not supported"],[p,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[K,r],["https://signin-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",r],[p,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://signin-fips.{Region}.{PartitionResult#dnsSuffix}",r],[p,"FIPS is enabled but this partition does not support FIPS"],[G,r],[p,"DualStack is enabled but this partition does not support DualStack"],["https://signin.{Region}.{PartitionResult#dnsSuffix}",r],[p,"Invalid Configuration: Missing Region"]]},rs=2,t=1e8,is=new Int32Array([-1,1,-1,0,6,3,2,36,4,4,5,t+27,6,t+4,t+27,1,29,7,2,36,8,3,9,31,4,22,10,5,19,11,7,21,12,8,t+7,13,10,t+8,14,12,t+9,15,13,t+10,16,14,t+11,17,15,t+12,18,16,t+13,t+16,6,t+5,20,7,21,t+6,17,t+24,t+25,6,t+4,23,7,27,24,9,t+14,25,10,t+15,26,11,t+22,t+23,11,28,t+21,17,t+20,t+21,2,35,30,3,39,31,4,32,t+27,6,t+4,33,7,t+27,34,9,t+14,t+27,3,39,36,4,38,37,7,t+18,t+19,6,t+4,t+17,5,t+1,40,8,t+2,t+3]),as=Ct.from(is,rs,Z.conditions,Z.results),cs=new Rt({size:50,params:["Endpoint","IsControlPlane","IsOAuthEndpoint","Region","UseDualStack","UseFIPS"]}),us=(e,s={})=>cs.get(e,()=>vt(as,{endpointParams:e,logger:s.logger}));Pt.aws=Ve;class l extends at{static shapeId="smithy.ts.sdk.synthetic.com.amazonaws.signin#SigninServiceException";constructor(e){super(e);Object.setPrototypeOf(this,l.prototype)}}class C extends l{static shapeId="com.amazonaws.signin#AccessDeniedException";name="AccessDeniedException";$fault="client";error;constructor(e){super({name:"AccessDeniedException",$fault:"client",...e});Object.setPrototypeOf(this,C.prototype),this.error=e.error}}class R extends l{static shapeId="com.amazonaws.signin#InternalServerException";name="InternalServerException";$fault="server";error;constructor(e){super({name:"InternalServerException",$fault:"server",...e});Object.setPrototypeOf(this,R.prototype),this.error=e.error}}class v extends l{static shapeId="com.amazonaws.signin#TooManyRequestsError";name="TooManyRequestsError";$fault="client";error;constructor(e){super({name:"TooManyRequestsError",$fault:"client",...e});Object.setPrototypeOf(this,v.prototype),this.error=e.error}}class P extends l{static shapeId="com.amazonaws.signin#ValidationException";name="ValidationException";$fault="client";error;constructor(e){super({name:"ValidationException",$fault:"client",...e});Object.setPrototypeOf(this,P.prototype),this.error=e.error}}var ps="AccessDeniedException",ds="AccessToken",hs="CreateOAuth2Token",gs="CreateOAuth2TokenRequest",ls="CreateOAuth2TokenRequestBody",ms="CreateOAuth2TokenResponseBody",Es="CreateOAuth2TokenResponse",As="CreateOAuth2TokenWithIAM",_s="CreateOAuth2TokenWithIAMRequest",Is="CreateOAuth2TokenWithIAMResponse",Ss="InternalServerException",Os="OAuthAccessToken",Cs="RefreshToken",Rs="TooManyRequestsError",vs="ValidationException",ee="accessKeyId",x="accessToken",Ps="access_token",U="client",te="clientId",se="codeVerifier",Ts="code",g="error",y="expiresIn",fs="expires_in",D="grantType",ks="grant_type",de="http",F="httpError",ne="idToken",o="jsonName",T="message",xs="resource",O="refreshToken",oe="redirectUri",he="smithy.ts.sdk.synthetic.com.amazonaws.signin",re="secretAccessKey",ie="sessionToken",ys="server",Ds="tokenInput",ws="tokenOutput",w="tokenType",Ns="token_type",i="com.amazonaws.signin",ge=new ue(he),le=[-3,he,"SigninServiceException",0,[],[]];ge.registerError(le,l);var _=new ue(i),me=[-3,i,ps,{[g]:U},[g,T],[0,0],2];_.registerError(me,C);var Ee=[-3,i,Ss,{[g]:ys,[F]:500},[g,T],[0,0],2];_.registerError(Ee,R);var _e=[-3,i,Rs,{[g]:U,[F]:429},[g,T],[0,0],2];_.registerError(_e,v);var Ie=[-3,i,vs,{[g]:U,[F]:400},[g,T],[0,0],2];_.registerError(Ie,P);var Se=[ge,_],$s=[0,i,Os,8,0],Oe=[0,i,Cs,8,0],Ce=[3,i,ds,8,[ee,re,ie],[[0,{[o]:ee}],[0,{[o]:re}],[0,{[o]:ie}]],3],Re=[3,i,gs,0,[Ds],[[()=>ve,16]],1],ve=[3,i,ls,0,[te,D,Ts,oe,se,O],[[0,{[o]:te}],[0,{[o]:D}],0,[0,{[o]:oe}],[0,{[o]:se}],[()=>Oe,{[o]:O}]],2],Pe=[3,i,Es,0,[ws],[[()=>Te,16]],1],Te=[3,i,ms,0,[x,w,y,O,ne],[[()=>Ce,{[o]:x}],[0,{[o]:w}],[1,{[o]:y}],[()=>Oe,{[o]:O}],[0,{[o]:ne}]],4],fe=[3,i,_s,0,[D,xs],[[0,{[o]:ks}],0],2],ke=[3,i,Is,0,[x,w,y],[[()=>$s,{[o]:Ps}],[0,{[o]:Ns}],[1,{[o]:fs}]],3],ye=[9,i,hs,{[de]:["POST","/v1/token",200]},()=>Re,()=>Pe],De=[9,i,As,{[de]:["POST","/v1/token?x-amz-client-auth-method=iam",200]},()=>fe,()=>ke],Us=(e)=>({apiVersion:"2023-01-01",base64Decoder:e?.base64Decoder??Lt,base64Encoder:e?.base64Encoder??Wt,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??us,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??Zt,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4"),signer:new Mt},{schemeId:"smithy.api#noAuth",identityProvider:(s)=>s.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new tt}],logger:e?.logger??new ct,protocol:e?.protocol??Kt,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.signin",errorTypeRegistries:Se,version:"2023-01-01",serviceTarget:"Signin"},serviceId:e?.serviceId??"Signin",sha256:e?.sha256??Xt,urlParser:e?.urlParser??kt,utf8Decoder:e?.utf8Decoder??zt,utf8Encoder:e?.utf8Encoder??Vt}),Fs=(e)=>{ut(process.version);let s=Et(e),n=()=>s().then(pt),c=Us(e);ze(process.version);let a={profile:e?.profile,logger:c.logger};return{...c,...e,runtime:"node",defaultsMode:s,authSchemePreference:e?.authSchemePreference??m(Ht,a),bodyLengthChecker:e?.bodyLengthChecker??Bt,defaultUserAgentProvider:e?.defaultUserAgentProvider??Le({serviceId:c.serviceId,clientVersion:os.version}),maxAttempts:e?.maxAttempts??m($t,e),region:e?.region??m(It,{...St,...a}),requestHandler:Gt.create(e?.requestHandler??n),retryMode:e?.retryMode??m({...Nt,default:async()=>(await n()).retryMode||wt},e),streamCollector:e?.streamCollector??jt,useDualstackEndpoint:e?.useDualstackEndpoint??m(_t,a),useFipsEndpoint:e?.useFipsEndpoint??m(At,a),userAgentAppId:e?.userAgentAppId??m(Be,a)}},bs=(e)=>{let{httpAuthSchemes:s,httpAuthSchemeProvider:n,credentials:c}=e;return{setHttpAuthScheme(a){let I=s.findIndex((f)=>f.schemeId===a.schemeId);if(I===-1)s.push(a);else s.splice(I,1,a)},httpAuthSchemes(){return s},setHttpAuthSchemeProvider(a){n=a},httpAuthSchemeProvider(){return n},setCredentials(a){c=a},credentials(){return c}}},qs=(e)=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}),Ms=(e,s)=>{let n=Object.assign(je(e),dt(e),xt(e),bs(e));return s.forEach((c)=>c.configure(n)),Object.assign(e,Ge(n),ht(n),yt(n),qs(n))};class q extends ce{config;constructor(...[e]){let s=Fs(e||{});super(s);this.initConfig=s;let n=ts(s),c=Ke(n),a=Ut(c),I=Ot(a),f=Xe(I),Ue=Tt(f),be=es(Ue),Me=Ms(be,e?.extensions||[]);this.config=Me,this.middlewareStack.use(bt(this.config)),this.middlewareStack.use(Ye(this.config)),this.middlewareStack.use(Ft(this.config)),this.middlewareStack.use(Dt(this.config)),this.middlewareStack.use(Je(this.config)),this.middlewareStack.use(Ze(this.config)),this.middlewareStack.use(et(this.config)),this.middlewareStack.use(st(this.config,{httpAuthSchemeParametersProvider:Qt,identityProviderConfigProvider:async(He)=>new nt({"aws.auth#sigv4":He.credentials})})),this.middlewareStack.use(rt(this.config))}destroy(){super.destroy()}}var Ne=gt(ss,"Signin","SigninClient",ft),Hs={IsControlPlane:{type:"staticContextParams",value:!1}},Vs={IsOAuthEndpoint:{type:"staticContextParams",value:!0}},$e=(e,s,n,c)=>[];class M extends Ne(Hs,$e,"CreateOAuth2Token",ye){}class V extends Ne(Vs,$e,"CreateOAuth2TokenWithIAM",De){}var zs={CreateOAuth2TokenCommand:M,CreateOAuth2TokenWithIAMCommand:V};class z extends q{}lt(zs,z);var Ws={AUTHCODE_EXPIRED:"AUTHCODE_EXPIRED",CONFLICT:"CONFLICT",INSUFFICIENT_PERMISSIONS:"INSUFFICIENT_PERMISSIONS",INVALID_REQUEST:"INVALID_REQUEST",RESOURCE_NOT_FOUND:"RESOURCE_NOT_FOUND",SERVER_ERROR:"server_error",SERVICE_QUOTA_EXCEEDED:"SERVICE_QUOTA_EXCEEDED",TOKEN_EXPIRED:"TOKEN_EXPIRED",USER_CREDENTIALS_CHANGED:"USER_CREDENTIALS_CHANGED"};var js=C,Gs=me,Ks=Ce,Xs=ye,Qs=M,Ys=Re,Js=ve,Zs=Pe,en=Te,tn=De,sn=V,nn=fe,on=ke,rn=R,an=Ee,cn=Ws,un=z,pn=q,dn=l,hn=le,gn=v,ln=_e,mn=P,En=Ie,An=Se;export{Ls as $Command,Bs as __Client,js as AccessDeniedException,Gs as AccessDeniedException$,Ks as AccessToken$,Xs as CreateOAuth2Token$,Qs as CreateOAuth2TokenCommand,Ys as CreateOAuth2TokenRequest$,Js as CreateOAuth2TokenRequestBody$,Zs as CreateOAuth2TokenResponse$,en as CreateOAuth2TokenResponseBody$,tn as CreateOAuth2TokenWithIAM$,sn as CreateOAuth2TokenWithIAMCommand,nn as CreateOAuth2TokenWithIAMRequest$,on as CreateOAuth2TokenWithIAMResponse$,rn as InternalServerException,an as InternalServerException$,cn as OAuth2ErrorCode,un as Signin,pn as SigninClient,dn as SigninServiceException,hn as SigninServiceException$,gn as TooManyRequestsError,ln as TooManyRequestsError$,mn as ValidationException,En as ValidationException$,An as errorTypeRegistries};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ae,Ue,Ar,Er}from"./chunk-
|
|
2
|
+
import{ae,Ue,Ar,Er}from"./chunk-29qrxygd.js";import{q,V}from"./chunk-ypqjfv3a.js";var o="OpenAI Decisions",a=128;function f(r){let t=[r.criteria.true?`True means: ${r.criteria.true}`:"",r.criteria.false?`False means: ${r.criteria.false}`:""].filter(Boolean);return t.length>0?`${r.instructions}
|
|
3
3
|
|
|
4
4
|
${t.join(`
|
|
5
5
|
`)}`:r.instructions}function u(r,t){if(t.type==="choice")return{type:"choice",name:r,instructions:t.instructions,choices:Object.entries(t.criteria).map(([e,i])=>i?{value:e,description:i}:{value:e})};if(t.type==="score")return{type:"score",name:r,instructions:t.instructions,levels:t.criteria.map((e)=>({label:e}))};return{type:"predicate",name:r,instructions:f(t)}}function y(r){let t=JSON.stringify(r.state),e=r.images??[];if(e.length===0)return t;if(e.length>a)throw Error(`${o} accepts at most ${a} images, got ${e.length}`);return[{role:"user",content:[{type:"input_text",text:t},...e.map((i)=>({type:"input_image",image_url:`data:${i.mimeType};base64,${i.data}`}))]}]}function b(r,t){if(!Array.isArray(r))throw Error(`${o} returned invalid probabilities for ${t}`);return Object.fromEntries(r.map((e)=>{if(!ae(e)||typeof e.value!=="string")throw Error(`${o} returned invalid probabilities for ${t}`);return[e.value,Ue(o,e.probability,`probability for ${t}.${e.value}`)]}))}function l(r,t,e){if(e.type==="refusal")throw Error(`${o} refused to answer ${r}`);if(t.type==="choice"){if(e.type!=="choice"||typeof e.choice!=="string")throw Error(`${o} did not return a choice answer for ${r}`);return{type:"choice",choice:e.choice,probabilities:b(e.probabilities,r),confidence:Ue(o,e.confidence,`confidence for ${r}`)}}if(t.type==="score"){if(e.type!=="score")throw Error(`${o} did not return a score answer for ${r}`);return{type:"score",score:Ue(o,e.score,`score for ${r}`),confidence:Ue(o,e.confidence,`confidence for ${r}`)}}if(e.type!=="predicate")throw Error(`${o} did not return a predicate answer for ${r}`);return{type:"bool",probability:Ue(o,e.probability,`probability for ${r}`)}}function w(r,t){if(!Array.isArray(r))throw Error(`${o} returned an unexpected response`);let e=new Map;for(let i of r)if(ae(i)&&typeof i.name==="string")e.set(i.name,i);return Object.fromEntries(Object.entries(t.questions).map(([i,n])=>{let s=e.get(i);if(!s)throw Error(`${o} did not return an answer for ${i}`);return[i,l(i,n,s)]}))}var h=[504];function d(r){if(r.status===504)return`${o} error (504): the request timed out at the gateway. Very large inputs (above roughly 600K tokens) currently exceed its time limit.`;return V(q(r),`${o} error`)}var E=async(r,t,e)=>{let i={api:r.api,provider:r.provider,model:r.id,answers:{},stopReason:"stop",timestamp:Date.now()};try{if(r.api!=="openai-decisions")throw Error(`Unsupported classifier API: ${r.api}`);let n=await Ar(o,new URL("decisions",`${r.baseUrl.replace(/\/+$/u,"")}/`),r,{model:r.id,input:y(t),questions:Object.entries(t.questions).map(([c,p])=>u(c,p))},e,h);if(!ae(n))throw Error(`${o} returned an unexpected response`);let s=Er(n.usage,r);if(s)i.usage=s;return i.answers=w(n.answers,t),i}catch(n){return i.answers={},i.stopReason=e?.signal?.aborted?"aborted":"error",i.errorMessage=d(n),i}};export{E as classify};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var f=new Set;function
|
|
3
|
-
export{
|
|
2
|
+
var f=new Set;function Gn(r){return f.add(r),()=>{f.delete(r)}}function Ci(r){let t=[];for(let s of f)try{s(r)}catch(e){t.push(e)}if(t.length>0)throw AggregateError(t,"Failed to cleanup session resources")}var a=(1n<<41n)-1n,u=-1,n;function Kr(r){let t=r??Date.now();if(!Number.isInteger(t)||t<0||t>281474976710655)throw RangeError("UUIDv7 timestamp must be an integer between 0 and 281474976710655");let s=r===void 0?Math.max(t,u):r;if(r===void 0)u=s;let e=new Uint8Array(16);if(globalThis.crypto.getRandomValues(e),n===void 0)n=BigInt(e[1])<<32n|BigInt(e[2])<<24n|BigInt(e[3])<<16n|BigInt(e[4])<<8n|BigInt(e[5]);else{if(n===a)throw RangeError("UUIDv7 generator sequence exhausted");n++}let c=BigInt(s);for(let o=5;o>=0;o--)e[o]=Number(c>>BigInt((5-o)*8))&255;e[6]=112|Number(n>>37n&0x0fn),e[7]=Number(n>>29n&0xffn),e[8]=128|Number(n>>23n&0x3fn),e[9]=Number(n>>15n&0xffn),e[10]=Number(n>>7n&0xffn),e[11]=Number((n&0x7fn)<<1n)|e[11]&1;let i=Array.from(e,(o)=>o.toString(16).padStart(2,"0"));return`${i.slice(0,4).join("")}-${i.slice(4,6).join("")}-${i.slice(6,8).join("")}-${i.slice(8,10).join("")}-${i.slice(10).join("")}`}
|
|
3
|
+
export{Gn,Ci,Kr};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
class n{incoming=[];outgoing=[];get length(){return this.incoming.length+this.outgoing.length}enqueue(e){this.incoming.push(e)}dequeue(){if(this.outgoing.length===0)while(this.incoming.length>0)this.outgoing.push(this.incoming.pop());return this.outgoing.pop()}}class
|
|
3
|
-
export{
|
|
2
|
+
class n{incoming=[];outgoing=[];get length(){return this.incoming.length+this.outgoing.length}enqueue(e){this.incoming.push(e)}dequeue(){if(this.outgoing.length===0)while(this.incoming.length>0)this.outgoing.push(this.incoming.pop());return this.outgoing.pop()}}class Xn{queue=new n;waiting=new n;done=!1;finalResultPromise;resolveFinalResult;isComplete;extractResult;constructor(e,t){this.isComplete=e,this.extractResult=t,this.finalResultPromise=new Promise((i)=>{this.resolveFinalResult=i})}push(e){if(this.done)return;if(this.isComplete(e))this.done=!0,this.resolveFinalResult(this.extractResult(e));let t=this.waiting.dequeue();if(t)t({value:e,done:!1});else this.queue.enqueue(e)}end(e){if(this.done=!0,e!==void 0)this.resolveFinalResult(e);while(this.waiting.length>0)this.waiting.dequeue()({value:void 0,done:!0})}async*[Symbol.asyncIterator](){while(!0)if(this.queue.length>0)yield this.queue.dequeue();else if(this.done)return;else{let e=await new Promise((t)=>this.waiting.enqueue(t));if(e.done)return;yield e.value}}result(){return this.finalResultPromise}}class M extends Xn{#t=Date.now();#i=performance.now();constructor(){super((e)=>e.type==="done"||e.type==="error",(e)=>{if(e.type==="done")return e.message;else if(e.type==="error")return e.error;throw Error("Unexpected event type for final result")})}push(e){if(e.type==="done")this.#e(e.message);else if(e.type==="error")this.#e(e.error);super.push(e)}end(e){if(e!==void 0)this.#e(e);super.end(e)}#e(e){if(this.done||e.durationMs!==void 0||e.timestamp<this.#t)return;e.durationMs=Math.max(0,Math.round(performance.now()-this.#i))}}function Jn(){return new M}function Ve(e){if(e instanceof Error)return e.message||e.name;if(typeof e==="string")return e;return String(e)}function bi(e){if(!(e instanceof Error))return{name:"ThrownValue",message:Ve(e)};let t=e.code;return{name:e.name||void 0,message:e.message||e.name,stack:e.stack,code:typeof t==="string"||typeof t==="number"?t:void 0}}function Ht(e,t,i){return{type:e,timestamp:Date.now(),error:bi(t),details:i}}function ke(e,t){e.diagnostics=[...e.diagnostics??[],t]}
|
|
3
|
+
export{Xn,M,Jn,Ve,bi,Ht,ke};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
function j(r){let e={};for(let[n,o]of r.entries())e[n]=o;return e}function
|
|
3
|
-
export{j,
|
|
2
|
+
function j(r){let e={};for(let[n,o]of r.entries())e[n]=o;return e}function ye(...r){let e=new Map;for(let n of r)for(let[o,t]of Object.entries(n??{})){let s=o.toLowerCase();if(e.delete(s),t!==null)e.set(s,[o,t])}return e.size>0?Object.fromEntries(e.values()):void 0}
|
|
3
|
+
export{j,ye};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{W}from"./chunk-
|
|
3
|
-
`).trim();if(!e)return;if(e==="[DONE]")return b;let n=JSON.parse(e);if(!w(n)||!Array.isArray(n.choices))throw Error("Invalid Mistral streaming event");return{data:n}}function se(t,e,n,r){let o={model:t.id,stream:!0,messages:le(n,t.input.includes("image"))},s=oe(e.messages);if(s.length>0)o.tools=ce(s);if(r?.temperature!==void 0)o.temperature=r.temperature;if(r?.maxTokens!==void 0)o.maxTokens=r.maxTokens;if(r?.toolChoice)o.toolChoice=
|
|
2
|
+
import{W}from"./chunk-4gtgqcct.js";import{Pr}from"./chunk-wnzvnskb.js";import{Ye}from"./chunk-7jezts2n.js";import{ee}from"./chunk-tvm4zmgj.js";import{fe,pe,K,ge}from"./chunk-r4ttdkrz.js";import{y}from"./chunk-3k627vf2.js";import{j}from"./chunk-nrsd810j.js";import{U,Le,oe,re,Q,G}from"./chunk-1n7dat03.js";import{M}from"./chunk-n2jcx65v.js";var S=9,D=4000,B=(t,e,n)=>{let r=new M,o=re(e,t.compat?.supportsMidConvoSystemMessages);return(async()=>{let s=J(t);try{let l=n?.apiKey;if(!l)throw Error(`No API key for provider: ${t.provider}`);let f=z(),u=ge(o.messages,t,(d)=>f(d)),a=se(t,o,u,n),i=await n?.onPayload?.(a,t);if(i!==void 0)a=i;let c=await Z(t,a,l,n);if(r.push({type:"start",partial:s}),await ie(t,s,r,c,n?.onProviderStreamEvent),n?.signal?.aborted)throw Error("Request was aborted");if(s.stopReason==="pending")throw Error("Mistral stream ended without a finish reason");if(s.stopReason==="aborted"||s.stopReason==="error")throw Error(s.errorMessage||"An unknown error occurred");r.push({type:"done",reason:s.stopReason,message:s}),r.end()}catch(l){for(let f of s.content)delete f.partialArgs;s.stopReason=n?.signal?.aborted?"aborted":"error",s.errorMessage=H(l),r.push({type:"error",reason:s.stopReason,error:s}),r.end()}})(),r},Ie=(t,e,n)=>{let r=n?.apiKey;if(!r)throw Error(`No API key for provider: ${t.provider}`);let o={...K(t,e,n,r),toolChoice:n?.toolChoice},s=n?.reasoning?G(t,n.reasoning):void 0,l=s==="off"?void 0:s,f=t.reasoning?t.thinkingLevelMap:void 0,u=f?l?f[l]??"high":f.off??void 0:void 0;return B(t,e,{...o,promptMode:t.reasoning&&!f&&l?"reasoning":void 0,reasoningEffort:u})};function J(t){return{role:"assistant",content:[],api:t.api,provider:t.provider,model:t.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"pending",timestamp:Date.now()}}function z(){let t=new Map,e=new Map;return(n)=>{let r=t.get(n);if(r)return r;let o=0;while(!0){let s=P(n,o),l=e.get(s);if(!l||l===n)return t.set(n,s),e.set(s,n),s;o++}}}function P(t,e){let n=t.replace(/[^a-zA-Z0-9]/g,"");if(e===0&&n.length===S)return n;let r=n||t,o=e===0?r:`${r}:${e}`;return Ye(o).replace(/[^a-zA-Z0-9]/g,"").slice(0,S)}function H(t){if(t instanceof Error){let e=t,n=typeof e.statusCode==="number"?e.statusCode:void 0,r=typeof e.body==="string"?e.body.trim():void 0;if(n!==void 0&&r)return`Mistral API error (${n}): ${q(r,D)}`;if(n!==void 0)return`Mistral API error (${n}): ${t.message}`;return t.message}return F(t)}function q(t,e){if(t.length<=e)return t;return`${t.slice(0,e)}... [truncated ${t.length-e} chars]`}function F(t){try{let e=JSON.stringify(t);return e===void 0?String(t):e}catch{return String(t)}}async function Z(t,e,n,r){let o=new URL(t.baseUrl);o.pathname=`${o.pathname.replace(/\/+$/u,"")}/`;let s=new URL("v1/chat/completions",o),l=X(t,n,r),f=r?.timeoutMs??60000,u=AbortSignal.timeout(f),a=Pr([r?.signal,u]),i;try{i=await(r?.fetch??globalThis.fetch)(s,{method:"POST",headers:l,body:JSON.stringify(Y(e)),signal:a.signal})}catch(c){if(u.aborted&&!r?.signal?.aborted)throw Error(`Mistral response headers timed out after ${f}ms`);throw c}finally{a.cleanup()}if(await r?.onResponse?.({status:i.status,headers:j(i.headers)},t),!i.ok){let c=await i.text();throw new O(i.status,c,i.statusText)}if(!i.body)throw Error("Mistral response has no body");return ne(i.body,r?.signal)}class O extends Error{statusCode;body;constructor(t,e,n){super(n||`Request failed with status ${t}`);this.name="MistralHttpError",this.statusCode=t,this.body=e}}function X(t,e,n){let r=new Headers({"User-Agent":ee(),accept:"text/event-stream",authorization:`Bearer ${e}`,"content-type":"application/json"});A(r,t.headers),A(r,n?.headers);let o=I(t.headers,"x-affinity")||I(n?.headers,"x-affinity");if(L(n)&&!o)r.set("x-affinity",n.sessionId);return r}function A(t,e){if(!e)return;for(let[n,r]of Object.entries(e))if(r===null)t.delete(n);else t.set(n,r)}function I(t,e){return!!t&&Object.keys(t).some((n)=>n.toLowerCase()===e)}function Y(t){let e={...t};for(let[r,o]of[["topP","top_p"],["maxTokens","max_tokens"],["randomSeed","random_seed"],["responseFormat","response_format"],["toolChoice","tool_choice"],["presencePenalty","presence_penalty"],["frequencyPenalty","frequency_penalty"],["parallelToolCalls","parallel_tool_calls"],["reasoningEffort","reasoning_effort"],["promptMode","prompt_mode"],["promptCacheKey","prompt_cache_key"],["safePrompt","safe_prompt"]])k(e,r,o);e.messages=t.messages.map((r)=>V(r));let n=e.response_format;if(w(n)){let r={...n};k(r,"jsonSchema","json_schema");let o=r.json_schema;if(w(o)){let s={...o};k(s,"schemaDefinition","schema"),r.json_schema=s}e.response_format=r}return e}function V(t){let e={...t};if(k(e,"toolCalls","tool_calls"),k(e,"toolCallId","tool_call_id"),Array.isArray(t.content))e.content=t.content.map((n)=>te(n));return e}function te(t){let e={...t};for(let[n,r]of[["imageUrl","image_url"],["documentUrl","document_url"],["documentName","document_name"],["fileId","file_id"],["referenceIds","reference_ids"],["inputAudio","input_audio"]])k(e,n,r);return e}function k(t,e,n){if(!(e in t))return;t[n]=t[e],delete t[e]}function w(t){return typeof t==="object"&&t!==null&&!Array.isArray(t)}var b=Symbol("mistral-stream-done");async function*ne(t,e){let n=t.getReader(),r=new TextDecoder,o="",s=()=>{n.cancel().catch(()=>{})};e?.addEventListener("abort",s,{once:!0});try{while(!0){if(e?.aborted)throw e.reason;let{done:l,value:f}=await n.read();if(e?.aborted)throw e.reason;o+=l?r.decode():r.decode(f,{stream:!0});let u=E(o);while(u){let a=v(o.slice(0,u.index));if(o=o.slice(u.index+u.length),a===b)return;if(a)yield a;u=E(o)}if(l)break}if(o.trim()){let l=v(o);if(l!==b&&l)yield l}}finally{e?.removeEventListener("abort",s);try{await n.cancel()}catch{}try{n.releaseLock()}catch{}}}function E(t){let e=/\r\n\r\n|\r\n\r|\r\n\n|\r\r\n|\n\r\n|\r\r|\n\r|\n\n/u.exec(t);return e?.index===void 0?void 0:{index:e.index,length:e[0].length}}function v(t){let e=t.split(/\r\n|\r|\n/u).filter((r)=>r.startsWith("data:")).map((r)=>r.slice(5).trimStart()).join(`
|
|
3
|
+
`).trim();if(!e)return;if(e==="[DONE]")return b;let n=JSON.parse(e);if(!w(n)||!Array.isArray(n.choices))throw Error("Invalid Mistral streaming event");return{data:n}}function se(t,e,n,r){let o={model:t.id,stream:!0,messages:le(n,t.input.includes("image"))},s=oe(e.messages);if(s.length>0)o.tools=ce(s);if(r?.temperature!==void 0)o.temperature=r.temperature;if(r?.maxTokens!==void 0)o.maxTokens=r.maxTokens;if(r?.toolChoice)o.toolChoice=ue(r.toolChoice);if(r?.promptMode)o.promptMode=r.promptMode;if(r?.reasoningEffort)o.reasoningEffort=r.reasoningEffort;if(L(r))o.promptCacheKey=r.sessionId;return o}function L(t){return t?.cacheRetention!=="none"&&!!t?.sessionId}function ae(t,e){let n=t,r=n.promptTokensDetails?.cachedTokens??n.prompt_tokens_details?.cached_tokens??n.promptTokenDetails?.cachedTokens??n.prompt_token_details?.cached_tokens??n.numCachedTokens??n.num_cached_tokens??0,o=typeof r==="number"&&Number.isFinite(r)?r:0;return Math.min(e,Math.max(0,o))}async function ie(t,e,n,r,o){let s=null,l=e.content,f=()=>l.length-1,u=new Map,a=(i)=>{if(!i)return;if(i.type==="text"){n.push({type:"text_end",contentIndex:f(),content:i.text,partial:e});return}if(i.type==="thinking")n.push({type:"thinking_end",contentIndex:f(),content:i.thinking,partial:e})};for await(let i of r){let c=i.data;if(await o?.(c,t),e.responseId||=c.id,c.usage){let p=c.usage.prompt_tokens||0,h=ae(c.usage,p);e.usage.input=Math.max(0,p-h),e.usage.output=c.usage.completion_tokens||0,e.usage.cacheRead=h,e.usage.cacheWrite=0,e.usage.totalTokens=c.usage.total_tokens||e.usage.input+e.usage.output+e.usage.cacheRead+e.usage.cacheWrite,Q(t,e.usage)}let d=c.choices[0];if(!d)continue;if(d.finish_reason){e.rawStopReason=d.finish_reason;let p=me(d.finish_reason);if(e.stopReason=p.stopReason,p.errorMessage)e.errorMessage=p.errorMessage}let x=d.delta;if(x.content!==null&&x.content!==void 0){let p=typeof x.content==="string"?[x.content]:x.content;for(let h of p){if(typeof h==="string"){let m=y(h);if(!m)continue;if(!s||s.type!=="text")a(s),s={type:"text",text:""},e.content.push(s),n.push({type:"text_start",contentIndex:f(),partial:e});s.text+=m,n.push({type:"text_delta",contentIndex:f(),delta:m,partial:e});continue}if(h.type==="thinking"){let m=(h.thinking??[]).map((g)=>g.text??"").filter((g)=>g.length>0).join(""),_=y(m);if(!_)continue;if(!s||s.type!=="thinking")a(s),s={type:"thinking",thinking:""},e.content.push(s),n.push({type:"thinking_start",contentIndex:f(),partial:e});s.thinking+=_,n.push({type:"thinking_delta",contentIndex:f(),delta:_,partial:e});continue}if(h.type==="text"){let m=y(h.text??"");if(!m)continue;if(!s||s.type!=="text")a(s),s={type:"text",text:""},e.content.push(s),n.push({type:"text_start",contentIndex:f(),partial:e});s.text+=m,n.push({type:"text_delta",contentIndex:f(),delta:m,partial:e})}}}let N=x.tool_calls||[];for(let p of N){if(s)a(s),s=null;let h=p.id&&p.id!=="null"?p.id:P(`toolcall:${p.index??0}`,0),m=p.index??h,_=u.get(m),g;if(_!==void 0){let R=e.content[_];if(R?.type==="toolCall")g=R}if(!g)g={type:"toolCall",id:h,name:p.function.name,arguments:{},partialArgs:""},e.content.push(g),u.set(m,e.content.length-1),n.push({type:"toolcall_start",contentIndex:e.content.length-1,partial:e});let C=typeof p.function.arguments==="string"?p.function.arguments:JSON.stringify(p.function.arguments||{});g.partialArgs=(g.partialArgs||"")+C,g.arguments=W(g.partialArgs),n.push({type:"toolcall_delta",contentIndex:u.get(m),delta:C,partial:e})}}a(s);for(let i of u.values()){let c=e.content[i];if(c.type!=="toolCall")continue;let d=c;d.arguments=W(d.partialArgs),delete d.partialArgs,n.push({type:"toolcall_end",contentIndex:i,toolCall:d,partial:e})}}function ce(t){return t.map((e)=>{let n=pe(e,!0);return{type:"function",function:{name:e.name,description:e.description,parameters:T(fe(e,n)),strict:n??!1}}})}function T(t){if(Array.isArray(t))return t.map((e)=>T(e));if(t&&typeof t==="object"){let e={};for(let[n,r]of Object.entries(t))e[n]=T(r);return e}return t}function le(t,e){let n=[];for(let[r,o]of t.entries()){if(o.role==="system"){let a=r===0?U(o):Le(o);if(a.length>0)n.push({role:"system",content:y(a)});continue}if(o.role==="user"){if(typeof o.content==="string"){n.push({role:"user",content:y(o.content)});continue}let a=o.content.some((c)=>c.type==="image"),i=o.content.filter((c)=>c.type==="text"||e).map((c)=>{if(c.type==="text")return{type:"text",text:y(c.text)};return{type:"image_url",imageUrl:`data:${c.mimeType};base64,${c.data}`}});if(i.length>0){n.push({role:"user",content:i});continue}if(a&&!e)n.push({role:"user",content:"(image omitted: model does not support images)"});continue}if(o.role==="assistant"){let a=[],i=[];for(let d of o.content){if(d.type==="text"){if(d.text.trim().length>0)a.push({type:"text",text:y(d.text)});continue}if(d.type==="thinking"){if(d.thinking.trim().length>0)a.push({type:"thinking",thinking:[{type:"text",text:y(d.thinking)}]});continue}i.push({id:d.id,type:"function",function:{name:d.name,arguments:JSON.stringify(d.arguments||{})},index:0})}let c={role:"assistant",prefix:!1};if(a.length>0)c.content=a;if(i.length>0)c.toolCalls=i;if(a.length>0||i.length>0)n.push(c);continue}let s=[],l=o.content.filter((a)=>a.type==="text").map((a)=>a.type==="text"?y(a.text):"").join(`
|
|
4
4
|
`),f=o.content.some((a)=>a.type==="image"),u=de(l,f,e,o.isError);s.push({type:"text",text:u});for(let a of o.content){if(!e)continue;if(a.type!=="image")continue;s.push({type:"image_url",imageUrl:`data:${a.mimeType};base64,${a.data}`})}n.push({role:"tool",toolCallId:o.toolCallId,name:o.toolName,content:s})}return n}function de(t,e,n,r){let o=t.trim(),s=r?"[tool error] ":"";if(o.length>0)return`${s}${o}${e&&!n?`
|
|
5
|
-
[tool image omitted: model does not support images]`:""}`;if(e){if(n)return r?"[tool error] (see attached image)":"(see attached image)";return r?"[tool error] (image omitted: model does not support images)":"(image omitted: model does not support images)"}return r?"[tool error] (no tool output)":"(no tool output)"}function
|
|
5
|
+
[tool image omitted: model does not support images]`:""}`;if(e){if(n)return r?"[tool error] (see attached image)":"(see attached image)";return r?"[tool error] (image omitted: model does not support images)":"(image omitted: model does not support images)"}return r?"[tool error] (no tool output)":"(no tool output)"}function ue(t){if(!t)return;if(t==="auto"||t==="none"||t==="any"||t==="required")return t;return{type:"function",function:{name:t.function.name}}}function me(t){if(t===null)return{stopReason:"stop"};switch(t){case"stop":return{stopReason:"stop"};case"length":case"model_length":return{stopReason:"length"};case"tool_calls":return{stopReason:"toolUse"};case"error":return{stopReason:"error",errorMessage:"Provider stopped with: error (server error)"};default:return{stopReason:"error",errorMessage:`Provider stopped with: ${t}`}}}export{B as stream,Ie as streamSimple};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Be,it}from"./chunk-rnt1ckk9.js";import{Fe}from"./chunk-fpxc6qjr.js";import{qe,_e,L}from"./chunk-g3ed130w.js";import{Se,X,b,we,J,Qe,H}from"./chunk-adys4qq4.js";var{awsEndpointFunctions:Ce,emitWarningIfUnsupportedVersion:Ae,createDefaultUserAgentProvider:ye,NODE_APP_ID_CONFIG_OPTIONS:Te,getAwsRegionExtensionConfiguration:Oe,resolveAwsRegionExtensionConfiguration:De,resolveUserAgentConfig:Re,resolveHostHeaderConfig:ke,getUserAgentPlugin:$e,getHostHeaderPlugin:Ne,getLoggerPlugin:be,getRecursionDetectionPlugin:Ue}=L(),{NoAuthSigner:ze,getHttpAuthSchemeEndpointRuleSetPlugin:He,DefaultIdentityProviderConfig:Ge,getHttpSigningPlugin:Me}=_e(),{normalizeProvider:K,getSmithyContext:je,ServiceException:Ke,NoOpLogger:Ve,emitWarningIfUnsupportedVersion:Le,loadConfigsForDefaultMode:We,getDefaultExtensionConfiguration:Ye,resolveDefaultRuntimeConfig:Je,Client:V,makeBuilder:Xe,createAggregatedClient:Ze}=X(),{Command:et}=X();var Kr=et,Vr=V;var{resolveDefaultsModeConfig:tt,loadConfig:h,NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS:rt,NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS:ot,NODE_REGION_CONFIG_OPTIONS:nt,NODE_REGION_CONFIG_FILE_OPTIONS:st,resolveRegionConfig:ct}=b(),{BinaryDecisionDiagram:at,EndpointCache:dt,decideEndpoint:pt,customEndpointFunctions:ut,resolveEndpointConfig:lt,getEndpointPlugin:ht}=we(),{parseUrl:Et,getHttpHandlerExtensionConfiguration:gt,resolveHttpHandlerRuntimeConfig:_t,getContentLengthPlugin:mt}=H(),{DEFAULT_RETRY_MODE:xt,NODE_RETRY_MODE_CONFIG_OPTIONS:St,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:ft,resolveRetryConfig:It,getRetryPlugin:vt}=qe(),{TypeRegistry:B,getSchemaSerdePlugin:Pt}=Se(),{resolveAwsSdkSigV4Config:Ct,AwsSdkSigV4Signer:At,NODE_AUTH_SCHEME_PREFERENCE_OPTIONS:yt}=Be(),{toUtf8:Tt,fromUtf8:Ot,toBase64:wt,fromBase64:Dt,calculateBodyLength:Rt}=J(),{streamCollector:kt,NodeHttpHandler:$t}=Fe(),{AwsRestJsonProtocol:Nt}=it(),{Sha256:bt}=Qe(),Ut=async(e,t,n)=>({operation:je(t).operation,region:await K(e.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function Ft(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sso-oauth",region:e.region},propertiesExtractor:(t,n)=>({signingProperties:{config:t,context:n}})}}function qt(e){return{schemeId:"smithy.api#noAuth"}}var zt=(e)=>{let t=[];switch(e.operation){case"CreateToken":{t.push(qt());break}default:t.push(Ft(e))}return t},Ht=(e)=>{let t=Ct(e);return Object.assign(t,{authSchemePreference:K(e.authSchemePreference??[])})},Gt=(e)=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"sso-oauth"}),Mt={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},jt="3.997.47",Kt={version:jt},_="ref",E=-1,x=!0,z="isSet",W="PartitionResult",S="booleanEquals",k="getAttr",G={[_]:"Endpoint"},N={[_]:W},g={},M=[{[_]:"Region"}],j={conditions:[[z,[G]],[z,M],["aws.partition",M,W],[S,[{[_]:"UseFIPS"},x]],[S,[{[_]:"UseDualStack"},x]],[S,[{fn:k,argv:[N,"supportsDualStack"]},x]],[S,[{fn:k,argv:[N,"supportsFIPS"]},x]],["stringEquals",[{fn:k,argv:[N,"name"]},"aws-us-gov"]]],results:[[E],[E,"Invalid Configuration: FIPS and custom endpoint are not supported"],[E,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[G,g],["https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",g],[E,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://oidc.{Region}.amazonaws.com",g],["https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}",g],[E,"FIPS is enabled but this partition does not support FIPS"],["https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}",g],[E,"DualStack is enabled but this partition does not support DualStack"],["https://oidc.{Region}.{PartitionResult#dnsSuffix}",g],[E,"Invalid Configuration: Missing Region"]]},Vt=2,c=1e8,Lt=new Int32Array([-1,1,-1,0,13,3,1,4,c+12,2,5,c+12,3,8,6,4,7,c+11,5,c+9,c+10,4,11,9,6,10,c+8,7,c+6,c+7,5,12,c+5,6,c+4,c+5,3,c+1,14,4,c+2,c+3]),Bt=at.from(Lt,Vt,j.conditions,j.results),Wt=new dt({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),Yt=(e,t={})=>Wt.get(e,()=>pt(Bt,{endpointParams:e,logger:t.logger}));ut.aws=Ce;class i extends Ke{static shapeId="smithy.ts.sdk.synthetic.com.amazonaws.ssooidc#SSOOIDCServiceException";constructor(e){super(e);Object.setPrototypeOf(this,i.prototype)}}class f extends i{static shapeId="com.amazonaws.ssooidc#AccessDeniedException";name="AccessDeniedException";$fault="client";error;reason;error_description;constructor(e){super({name:"AccessDeniedException",$fault:"client",...e});Object.setPrototypeOf(this,f.prototype),this.error=e.error,this.reason=e.reason,this.error_description=e.error_description}}class I extends i{static shapeId="com.amazonaws.ssooidc#AuthorizationPendingException";name="AuthorizationPendingException";$fault="client";error;error_description;constructor(e){super({name:"AuthorizationPendingException",$fault:"client",...e});Object.setPrototypeOf(this,I.prototype),this.error=e.error,this.error_description=e.error_description}}class v extends i{static shapeId="com.amazonaws.ssooidc#ExpiredTokenException";name="ExpiredTokenException";$fault="client";error;error_description;constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e});Object.setPrototypeOf(this,v.prototype),this.error=e.error,this.error_description=e.error_description}}class P extends i{static shapeId="com.amazonaws.ssooidc#InternalServerException";name="InternalServerException";$fault="server";error;error_description;constructor(e){super({name:"InternalServerException",$fault:"server",...e});Object.setPrototypeOf(this,P.prototype),this.error=e.error,this.error_description=e.error_description}}class C extends i{static shapeId="com.amazonaws.ssooidc#InvalidClientException";name="InvalidClientException";$fault="client";error;error_description;constructor(e){super({name:"InvalidClientException",$fault:"client",...e});Object.setPrototypeOf(this,C.prototype),this.error=e.error,this.error_description=e.error_description}}class A extends i{static shapeId="com.amazonaws.ssooidc#InvalidGrantException";name="InvalidGrantException";$fault="client";error;error_description;constructor(e){super({name:"InvalidGrantException",$fault:"client",...e});Object.setPrototypeOf(this,A.prototype),this.error=e.error,this.error_description=e.error_description}}class y extends i{static shapeId="com.amazonaws.ssooidc#InvalidRequestException";name="InvalidRequestException";$fault="client";error;reason;error_description;constructor(e){super({name:"InvalidRequestException",$fault:"client",...e});Object.setPrototypeOf(this,y.prototype),this.error=e.error,this.reason=e.reason,this.error_description=e.error_description}}class T extends i{static shapeId="com.amazonaws.ssooidc#InvalidScopeException";name="InvalidScopeException";$fault="client";error;error_description;constructor(e){super({name:"InvalidScopeException",$fault:"client",...e});Object.setPrototypeOf(this,T.prototype),this.error=e.error,this.error_description=e.error_description}}class O extends i{static shapeId="com.amazonaws.ssooidc#SlowDownException";name="SlowDownException";$fault="client";error;error_description;constructor(e){super({name:"SlowDownException",$fault:"client",...e});Object.setPrototypeOf(this,O.prototype),this.error=e.error,this.error_description=e.error_description}}class w extends i{static shapeId="com.amazonaws.ssooidc#UnauthorizedClientException";name="UnauthorizedClientException";$fault="client";error;error_description;constructor(e){super({name:"UnauthorizedClientException",$fault:"client",...e});Object.setPrototypeOf(this,w.prototype),this.error=e.error,this.error_description=e.error_description}}class D extends i{static shapeId="com.amazonaws.ssooidc#UnsupportedGrantTypeException";name="UnsupportedGrantTypeException";$fault="client";error;error_description;constructor(e){super({name:"UnsupportedGrantTypeException",$fault:"client",...e});Object.setPrototypeOf(this,D.prototype),this.error=e.error,this.error_description=e.error_description}}var Jt="AccessDeniedException",Xt="AuthorizationPendingException",Qt="AccessToken",Zt="ClientSecret",er="CreateToken",tr="CreateTokenRequest",rr="CreateTokenResponse",or="CodeVerifier",nr="ExpiredTokenException",sr="InvalidClientException",ir="InvalidGrantException",cr="InvalidRequestException",ar="InternalServerException",dr="InvalidScopeException",pr="IdToken",ur="RefreshToken",lr="SlowDownException",hr="UnauthorizedClientException",Er="UnsupportedGrantTypeException",gr="accessToken",l="client",_r="clientId",mr="clientSecret",xr="codeVerifier",Sr="code",fr="deviceCode",r="error",Ir="expiresIn",p="error_description",vr="grantType",Pr="http",u="httpError",Cr="idToken",Y="reason",Q="refreshToken",Ar="redirectUri",Z="smithy.ts.sdk.synthetic.com.amazonaws.ssooidc",yr="scope",Tr="server",Or="tokenType",o="com.amazonaws.ssooidc",ee=new B(Z),te=[-3,Z,"SSOOIDCServiceException",0,[],[]];ee.registerError(te,i);var a=new B(o),re=[-3,o,Jt,{[r]:l,[u]:400},[r,Y,p],[0,0,0]];a.registerError(re,f);var oe=[-3,o,Xt,{[r]:l,[u]:400},[r,p],[0,0]];a.registerError(oe,I);var ne=[-3,o,nr,{[r]:l,[u]:400},[r,p],[0,0]];a.registerError(ne,v);var se=[-3,o,ar,{[r]:Tr,[u]:500},[r,p],[0,0]];a.registerError(se,P);var ie=[-3,o,sr,{[r]:l,[u]:401},[r,p],[0,0]];a.registerError(ie,C);var ce=[-3,o,ir,{[r]:l,[u]:400},[r,p],[0,0]];a.registerError(ce,A);var ae=[-3,o,cr,{[r]:l,[u]:400},[r,Y,p],[0,0,0]];a.registerError(ae,y);var de=[-3,o,dr,{[r]:l,[u]:400},[r,p],[0,0]];a.registerError(de,T);var pe=[-3,o,lr,{[r]:l,[u]:400},[r,p],[0,0]];a.registerError(pe,O);var ue=[-3,o,hr,{[r]:l,[u]:400},[r,p],[0,0]];a.registerError(ue,w);var le=[-3,o,Er,{[r]:l,[u]:400},[r,p],[0,0]];a.registerError(le,D);var he=[ee,a],wr=[0,o,Qt,8,0],Dr=[0,o,Zt,8,0],Rr=[0,o,or,8,0],kr=[0,o,pr,8,0],Ee=[0,o,ur,8,0],ge=[3,o,tr,0,[_r,mr,vr,fr,Sr,Q,yr,Ar,xr],[0,[()=>Dr,0],0,0,0,[()=>Ee,0],64,0,[()=>Rr,0]],3],me=[3,o,rr,0,[gr,Or,Ir,Q,Cr],[[()=>wr,0],0,1,[()=>Ee,0],[()=>kr,0]]],xe=[9,o,er,{[Pr]:["POST","/token",200]},()=>ge,()=>me],$r=(e)=>({apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??Dt,base64Encoder:e?.base64Encoder??wt,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Yt,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??zt,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(t)=>t.getIdentityProvider("aws.auth#sigv4"),signer:new At},{schemeId:"smithy.api#noAuth",identityProvider:(t)=>t.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new ze}],logger:e?.logger??new Ve,protocol:e?.protocol??Nt,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.ssooidc",errorTypeRegistries:he,version:"2019-06-10",serviceTarget:"AWSSSOOIDCService"},serviceId:e?.serviceId??"SSO OIDC",sha256:e?.sha256??bt,urlParser:e?.urlParser??Et,utf8Decoder:e?.utf8Decoder??Ot,utf8Encoder:e?.utf8Encoder??Tt}),Nr=(e)=>{Le(process.version);let t=tt(e),n=()=>t().then(We),d=$r(e);Ae(process.version);let s={profile:e?.profile,logger:d.logger};return{...d,...e,runtime:"node",defaultsMode:t,authSchemePreference:e?.authSchemePreference??h(yt,s),bodyLengthChecker:e?.bodyLengthChecker??Rt,defaultUserAgentProvider:e?.defaultUserAgentProvider??ye({serviceId:d.serviceId,clientVersion:Kt.version}),maxAttempts:e?.maxAttempts??h(ft,e),region:e?.region??h(nt,{...st,...s}),requestHandler:$t.create(e?.requestHandler??n),retryMode:e?.retryMode??h({...St,default:async()=>(await n()).retryMode||xt},e),streamCollector:e?.streamCollector??kt,useDualstackEndpoint:e?.useDualstackEndpoint??h(ot,s),useFipsEndpoint:e?.useFipsEndpoint??h(rt,s),userAgentAppId:e?.userAgentAppId??h(Te,s)}},br=(e)=>{let{httpAuthSchemes:t,httpAuthSchemeProvider:n,credentials:d}=e;return{setHttpAuthScheme(s){let m=t.findIndex((R)=>R.schemeId===s.schemeId);if(m===-1)t.push(s);else t.splice(m,1,s)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(s){n=s},httpAuthSchemeProvider(){return n},setCredentials(s){d=s},credentials(){return d}}},Ur=(e)=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}),Fr=(e,t)=>{let n=Object.assign(Oe(e),Ye(e),gt(e),br(e));return t.forEach((d)=>d.configure(n)),Object.assign(e,De(n),Je(n),_t(n),Ur(n))};class U extends V{config;constructor(...[e]){let t=Nr(e||{});super(t);this.initConfig=t;let n=Gt(t),d=Re(n),s=It(d),m=ct(s),R=ke(m),fe=lt(R),Ie=Ht(fe),ve=Fr(Ie,e?.extensions||[]);this.config=ve,this.middlewareStack.use(Pt(this.config)),this.middlewareStack.use($e(this.config)),this.middlewareStack.use(vt(this.config)),this.middlewareStack.use(mt(this.config)),this.middlewareStack.use(Ne(this.config)),this.middlewareStack.use(be(this.config)),this.middlewareStack.use(Ue(this.config)),this.middlewareStack.use(He(this.config,{httpAuthSchemeParametersProvider:Ut,identityProviderConfigProvider:async(Pe)=>new Ge({"aws.auth#sigv4":Pe.credentials})})),this.middlewareStack.use(Me(this.config))}destroy(){super.destroy()}}var qr=Xe(Mt,"AWSSSOOIDCService","SSOOIDCClient",ht),zr={},Hr=(e,t,n,d)=>[];class F extends qr(zr,Hr,"CreateToken",xe){}var Gr={CreateTokenCommand:F};class q extends U{}Ze(Gr,q);var Mr={KMS_ACCESS_DENIED:"KMS_AccessDeniedException"},jr={KMS_DISABLED_KEY:"KMS_DisabledException",KMS_INVALID_KEY_USAGE:"KMS_InvalidKeyUsageException",KMS_INVALID_STATE:"KMS_InvalidStateException",KMS_KEY_NOT_FOUND:"KMS_NotFoundException"};var Lr=f,Br=re,Wr=Mr,Yr=I,Jr=oe,Xr=xe,Qr=F,Zr=ge,eo=me,to=v,ro=ne,oo=P,no=se,so=C,io=ie,co=A,ao=ce,po=y,uo=ae,lo=jr,ho=T,Eo=de,go=q,_o=U,mo=i,xo=te,So=O,fo=pe,Io=w,vo=ue,Po=D,Co=le,Ao=he;export{Kr as $Command,Vr as __Client,Lr as AccessDeniedException,Br as AccessDeniedException$,Wr as AccessDeniedExceptionReason,Yr as AuthorizationPendingException,Jr as AuthorizationPendingException$,Xr as CreateToken$,Qr as CreateTokenCommand,Zr as CreateTokenRequest$,eo as CreateTokenResponse$,to as ExpiredTokenException,ro as ExpiredTokenException$,oo as InternalServerException,no as InternalServerException$,so as InvalidClientException,io as InvalidClientException$,co as InvalidGrantException,ao as InvalidGrantException$,po as InvalidRequestException,uo as InvalidRequestException$,lo as InvalidRequestExceptionReason,ho as InvalidScopeException,Eo as InvalidScopeException$,go as SSOOIDC,_o as SSOOIDCClient,mo as SSOOIDCServiceException,xo as SSOOIDCServiceException$,So as SlowDownException,fo as SlowDownException$,Io as UnauthorizedClientException,vo as UnauthorizedClientException$,Po as UnsupportedGrantTypeException,Co as UnsupportedGrantTypeException$,Ao as errorTypeRegistries};
|
|
2
|
+
import{Fe,ot}from"./chunk-a1rb1a48.js";import{We}from"./chunk-e1x629v0.js";import{qe,Ae,L}from"./chunk-tevejprz.js";import{we,X,b,xe,J,Qe,H}from"./chunk-cmwdjes8.js";var{awsEndpointFunctions:Pe,emitWarningIfUnsupportedVersion:Ce,createDefaultUserAgentProvider:ye,NODE_APP_ID_CONFIG_OPTIONS:Te,getAwsRegionExtensionConfiguration:Oe,resolveAwsRegionExtensionConfiguration:De,resolveUserAgentConfig:Re,resolveHostHeaderConfig:ke,getUserAgentPlugin:$e,getHostHeaderPlugin:Ne,getLoggerPlugin:be,getRecursionDetectionPlugin:Ue}=L(),{NoAuthSigner:ze,getHttpAuthSchemeEndpointRuleSetPlugin:He,DefaultIdentityProviderConfig:Ge,getHttpSigningPlugin:Me}=Ae(),{normalizeProvider:K,getSmithyContext:je,ServiceException:Ke,NoOpLogger:Ve,emitWarningIfUnsupportedVersion:Le,loadConfigsForDefaultMode:Be,getDefaultExtensionConfiguration:Ye,resolveDefaultRuntimeConfig:Je,Client:V,makeBuilder:Xe,createAggregatedClient:Ze}=X(),{Command:et}=X();var Kr=et,Vr=V;var{resolveDefaultsModeConfig:tt,loadConfig:h,NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS:rt,NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS:nt,NODE_REGION_CONFIG_OPTIONS:st,NODE_REGION_CONFIG_FILE_OPTIONS:it,resolveRegionConfig:ct}=b(),{BinaryDecisionDiagram:at,EndpointCache:dt,decideEndpoint:pt,customEndpointFunctions:ut,resolveEndpointConfig:lt,getEndpointPlugin:ht}=xe(),{parseUrl:Et,getHttpHandlerExtensionConfiguration:gt,resolveHttpHandlerRuntimeConfig:_t,getContentLengthPlugin:mt}=H(),{DEFAULT_RETRY_MODE:xt,NODE_RETRY_MODE_CONFIG_OPTIONS:St,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:ft,resolveRetryConfig:It,getRetryPlugin:vt}=qe(),{TypeRegistry:B,getSchemaSerdePlugin:Pt}=we(),{resolveAwsSdkSigV4Config:Ct,AwsSdkSigV4Signer:At,NODE_AUTH_SCHEME_PREFERENCE_OPTIONS:yt}=Fe(),{toUtf8:Tt,fromUtf8:Ot,toBase64:wt,fromBase64:Dt,calculateBodyLength:Rt}=J(),{streamCollector:kt,NodeHttpHandler:$t}=We(),{AwsRestJsonProtocol:Nt}=ot(),{Sha256:bt}=Qe(),Ut=async(e,t,n)=>({operation:je(t).operation,region:await K(e.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function Ft(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sso-oauth",region:e.region},propertiesExtractor:(t,n)=>({signingProperties:{config:t,context:n}})}}function qt(e){return{schemeId:"smithy.api#noAuth"}}var zt=(e)=>{let t=[];switch(e.operation){case"CreateToken":{t.push(qt());break}default:t.push(Ft(e))}return t},Ht=(e)=>{let t=Ct(e);return Object.assign(t,{authSchemePreference:K(e.authSchemePreference??[])})},Gt=(e)=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"sso-oauth"}),Mt={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},jt="3.997.47",Kt={version:jt},_="ref",E=-1,x=!0,z="isSet",W="PartitionResult",S="booleanEquals",k="getAttr",G={[_]:"Endpoint"},N={[_]:W},g={},M=[{[_]:"Region"}],j={conditions:[[z,[G]],[z,M],["aws.partition",M,W],[S,[{[_]:"UseFIPS"},x]],[S,[{[_]:"UseDualStack"},x]],[S,[{fn:k,argv:[N,"supportsDualStack"]},x]],[S,[{fn:k,argv:[N,"supportsFIPS"]},x]],["stringEquals",[{fn:k,argv:[N,"name"]},"aws-us-gov"]]],results:[[E],[E,"Invalid Configuration: FIPS and custom endpoint are not supported"],[E,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[G,g],["https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",g],[E,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://oidc.{Region}.amazonaws.com",g],["https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}",g],[E,"FIPS is enabled but this partition does not support FIPS"],["https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}",g],[E,"DualStack is enabled but this partition does not support DualStack"],["https://oidc.{Region}.{PartitionResult#dnsSuffix}",g],[E,"Invalid Configuration: Missing Region"]]},Vt=2,c=1e8,Lt=new Int32Array([-1,1,-1,0,13,3,1,4,c+12,2,5,c+12,3,8,6,4,7,c+11,5,c+9,c+10,4,11,9,6,10,c+8,7,c+6,c+7,5,12,c+5,6,c+4,c+5,3,c+1,14,4,c+2,c+3]),Bt=at.from(Lt,Vt,j.conditions,j.results),Wt=new dt({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),Yt=(e,t={})=>Wt.get(e,()=>pt(Bt,{endpointParams:e,logger:t.logger}));ut.aws=Pe;class i extends Ke{static shapeId="smithy.ts.sdk.synthetic.com.amazonaws.ssooidc#SSOOIDCServiceException";constructor(e){super(e);Object.setPrototypeOf(this,i.prototype)}}class f extends i{static shapeId="com.amazonaws.ssooidc#AccessDeniedException";name="AccessDeniedException";$fault="client";error;reason;error_description;constructor(e){super({name:"AccessDeniedException",$fault:"client",...e});Object.setPrototypeOf(this,f.prototype),this.error=e.error,this.reason=e.reason,this.error_description=e.error_description}}class I extends i{static shapeId="com.amazonaws.ssooidc#AuthorizationPendingException";name="AuthorizationPendingException";$fault="client";error;error_description;constructor(e){super({name:"AuthorizationPendingException",$fault:"client",...e});Object.setPrototypeOf(this,I.prototype),this.error=e.error,this.error_description=e.error_description}}class v extends i{static shapeId="com.amazonaws.ssooidc#ExpiredTokenException";name="ExpiredTokenException";$fault="client";error;error_description;constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e});Object.setPrototypeOf(this,v.prototype),this.error=e.error,this.error_description=e.error_description}}class P extends i{static shapeId="com.amazonaws.ssooidc#InternalServerException";name="InternalServerException";$fault="server";error;error_description;constructor(e){super({name:"InternalServerException",$fault:"server",...e});Object.setPrototypeOf(this,P.prototype),this.error=e.error,this.error_description=e.error_description}}class C extends i{static shapeId="com.amazonaws.ssooidc#InvalidClientException";name="InvalidClientException";$fault="client";error;error_description;constructor(e){super({name:"InvalidClientException",$fault:"client",...e});Object.setPrototypeOf(this,C.prototype),this.error=e.error,this.error_description=e.error_description}}class A extends i{static shapeId="com.amazonaws.ssooidc#InvalidGrantException";name="InvalidGrantException";$fault="client";error;error_description;constructor(e){super({name:"InvalidGrantException",$fault:"client",...e});Object.setPrototypeOf(this,A.prototype),this.error=e.error,this.error_description=e.error_description}}class y extends i{static shapeId="com.amazonaws.ssooidc#InvalidRequestException";name="InvalidRequestException";$fault="client";error;reason;error_description;constructor(e){super({name:"InvalidRequestException",$fault:"client",...e});Object.setPrototypeOf(this,y.prototype),this.error=e.error,this.reason=e.reason,this.error_description=e.error_description}}class T extends i{static shapeId="com.amazonaws.ssooidc#InvalidScopeException";name="InvalidScopeException";$fault="client";error;error_description;constructor(e){super({name:"InvalidScopeException",$fault:"client",...e});Object.setPrototypeOf(this,T.prototype),this.error=e.error,this.error_description=e.error_description}}class O extends i{static shapeId="com.amazonaws.ssooidc#SlowDownException";name="SlowDownException";$fault="client";error;error_description;constructor(e){super({name:"SlowDownException",$fault:"client",...e});Object.setPrototypeOf(this,O.prototype),this.error=e.error,this.error_description=e.error_description}}class w extends i{static shapeId="com.amazonaws.ssooidc#UnauthorizedClientException";name="UnauthorizedClientException";$fault="client";error;error_description;constructor(e){super({name:"UnauthorizedClientException",$fault:"client",...e});Object.setPrototypeOf(this,w.prototype),this.error=e.error,this.error_description=e.error_description}}class D extends i{static shapeId="com.amazonaws.ssooidc#UnsupportedGrantTypeException";name="UnsupportedGrantTypeException";$fault="client";error;error_description;constructor(e){super({name:"UnsupportedGrantTypeException",$fault:"client",...e});Object.setPrototypeOf(this,D.prototype),this.error=e.error,this.error_description=e.error_description}}var Jt="AccessDeniedException",Xt="AuthorizationPendingException",Qt="AccessToken",Zt="ClientSecret",er="CreateToken",tr="CreateTokenRequest",rr="CreateTokenResponse",or="CodeVerifier",nr="ExpiredTokenException",sr="InvalidClientException",ir="InvalidGrantException",cr="InvalidRequestException",ar="InternalServerException",dr="InvalidScopeException",pr="IdToken",ur="RefreshToken",lr="SlowDownException",hr="UnauthorizedClientException",Er="UnsupportedGrantTypeException",gr="accessToken",l="client",_r="clientId",mr="clientSecret",xr="codeVerifier",Sr="code",fr="deviceCode",r="error",Ir="expiresIn",p="error_description",vr="grantType",Pr="http",u="httpError",Cr="idToken",Y="reason",Q="refreshToken",Ar="redirectUri",Z="smithy.ts.sdk.synthetic.com.amazonaws.ssooidc",yr="scope",Tr="server",Or="tokenType",o="com.amazonaws.ssooidc",ee=new B(Z),te=[-3,Z,"SSOOIDCServiceException",0,[],[]];ee.registerError(te,i);var a=new B(o),re=[-3,o,Jt,{[r]:l,[u]:400},[r,Y,p],[0,0,0]];a.registerError(re,f);var oe=[-3,o,Xt,{[r]:l,[u]:400},[r,p],[0,0]];a.registerError(oe,I);var ne=[-3,o,nr,{[r]:l,[u]:400},[r,p],[0,0]];a.registerError(ne,v);var se=[-3,o,ar,{[r]:Tr,[u]:500},[r,p],[0,0]];a.registerError(se,P);var ie=[-3,o,sr,{[r]:l,[u]:401},[r,p],[0,0]];a.registerError(ie,C);var ce=[-3,o,ir,{[r]:l,[u]:400},[r,p],[0,0]];a.registerError(ce,A);var ae=[-3,o,cr,{[r]:l,[u]:400},[r,Y,p],[0,0,0]];a.registerError(ae,y);var de=[-3,o,dr,{[r]:l,[u]:400},[r,p],[0,0]];a.registerError(de,T);var pe=[-3,o,lr,{[r]:l,[u]:400},[r,p],[0,0]];a.registerError(pe,O);var ue=[-3,o,hr,{[r]:l,[u]:400},[r,p],[0,0]];a.registerError(ue,w);var le=[-3,o,Er,{[r]:l,[u]:400},[r,p],[0,0]];a.registerError(le,D);var he=[ee,a],wr=[0,o,Qt,8,0],Dr=[0,o,Zt,8,0],Rr=[0,o,or,8,0],kr=[0,o,pr,8,0],Ee=[0,o,ur,8,0],ge=[3,o,tr,0,[_r,mr,vr,fr,Sr,Q,yr,Ar,xr],[0,[()=>Dr,0],0,0,0,[()=>Ee,0],64,0,[()=>Rr,0]],3],_e=[3,o,rr,0,[gr,Or,Ir,Q,Cr],[[()=>wr,0],0,1,[()=>Ee,0],[()=>kr,0]]],me=[9,o,er,{[Pr]:["POST","/token",200]},()=>ge,()=>_e],$r=(e)=>({apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??Dt,base64Encoder:e?.base64Encoder??wt,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Yt,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??zt,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(t)=>t.getIdentityProvider("aws.auth#sigv4"),signer:new At},{schemeId:"smithy.api#noAuth",identityProvider:(t)=>t.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new ze}],logger:e?.logger??new Ve,protocol:e?.protocol??Nt,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.ssooidc",errorTypeRegistries:he,version:"2019-06-10",serviceTarget:"AWSSSOOIDCService"},serviceId:e?.serviceId??"SSO OIDC",sha256:e?.sha256??bt,urlParser:e?.urlParser??Et,utf8Decoder:e?.utf8Decoder??Ot,utf8Encoder:e?.utf8Encoder??Tt}),Nr=(e)=>{Le(process.version);let t=tt(e),n=()=>t().then(Be),d=$r(e);Ce(process.version);let s={profile:e?.profile,logger:d.logger};return{...d,...e,runtime:"node",defaultsMode:t,authSchemePreference:e?.authSchemePreference??h(yt,s),bodyLengthChecker:e?.bodyLengthChecker??Rt,defaultUserAgentProvider:e?.defaultUserAgentProvider??ye({serviceId:d.serviceId,clientVersion:Kt.version}),maxAttempts:e?.maxAttempts??h(ft,e),region:e?.region??h(st,{...it,...s}),requestHandler:$t.create(e?.requestHandler??n),retryMode:e?.retryMode??h({...St,default:async()=>(await n()).retryMode||xt},e),streamCollector:e?.streamCollector??kt,useDualstackEndpoint:e?.useDualstackEndpoint??h(nt,s),useFipsEndpoint:e?.useFipsEndpoint??h(rt,s),userAgentAppId:e?.userAgentAppId??h(Te,s)}},br=(e)=>{let{httpAuthSchemes:t,httpAuthSchemeProvider:n,credentials:d}=e;return{setHttpAuthScheme(s){let m=t.findIndex((R)=>R.schemeId===s.schemeId);if(m===-1)t.push(s);else t.splice(m,1,s)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(s){n=s},httpAuthSchemeProvider(){return n},setCredentials(s){d=s},credentials(){return d}}},Ur=(e)=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}),Fr=(e,t)=>{let n=Object.assign(Oe(e),Ye(e),gt(e),br(e));return t.forEach((d)=>d.configure(n)),Object.assign(e,De(n),Je(n),_t(n),Ur(n))};class U extends V{config;constructor(...[e]){let t=Nr(e||{});super(t);this.initConfig=t;let n=Gt(t),d=Re(n),s=It(d),m=ct(s),R=ke(m),Se=lt(R),fe=Ht(Se),Ie=Fr(fe,e?.extensions||[]);this.config=Ie,this.middlewareStack.use(Pt(this.config)),this.middlewareStack.use($e(this.config)),this.middlewareStack.use(vt(this.config)),this.middlewareStack.use(mt(this.config)),this.middlewareStack.use(Ne(this.config)),this.middlewareStack.use(be(this.config)),this.middlewareStack.use(Ue(this.config)),this.middlewareStack.use(He(this.config,{httpAuthSchemeParametersProvider:Ut,identityProviderConfigProvider:async(ve)=>new Ge({"aws.auth#sigv4":ve.credentials})})),this.middlewareStack.use(Me(this.config))}destroy(){super.destroy()}}var qr=Xe(Mt,"AWSSSOOIDCService","SSOOIDCClient",ht),zr={},Hr=(e,t,n,d)=>[];class F extends qr(zr,Hr,"CreateToken",me){}var Gr={CreateTokenCommand:F};class q extends U{}Ze(Gr,q);var Mr={KMS_ACCESS_DENIED:"KMS_AccessDeniedException"},jr={KMS_DISABLED_KEY:"KMS_DisabledException",KMS_INVALID_KEY_USAGE:"KMS_InvalidKeyUsageException",KMS_INVALID_STATE:"KMS_InvalidStateException",KMS_KEY_NOT_FOUND:"KMS_NotFoundException"};var Lr=f,Br=re,Wr=Mr,Yr=I,Jr=oe,Xr=me,Qr=F,Zr=ge,eo=_e,to=v,ro=ne,oo=P,no=se,so=C,io=ie,co=A,ao=ce,po=y,uo=ae,lo=jr,ho=T,Eo=de,go=q,_o=U,mo=i,xo=te,So=O,fo=pe,Io=w,vo=ue,Po=D,Co=le,Ao=he;export{Kr as $Command,Vr as __Client,Lr as AccessDeniedException,Br as AccessDeniedException$,Wr as AccessDeniedExceptionReason,Yr as AuthorizationPendingException,Jr as AuthorizationPendingException$,Xr as CreateToken$,Qr as CreateTokenCommand,Zr as CreateTokenRequest$,eo as CreateTokenResponse$,to as ExpiredTokenException,ro as ExpiredTokenException$,oo as InternalServerException,no as InternalServerException$,so as InvalidClientException,io as InvalidClientException$,co as InvalidGrantException,ao as InvalidGrantException$,po as InvalidRequestException,uo as InvalidRequestException$,lo as InvalidRequestExceptionReason,ho as InvalidScopeException,Eo as InvalidScopeException$,go as SSOOIDC,_o as SSOOIDCClient,mo as SSOOIDCServiceException,xo as SSOOIDCServiceException$,So as SlowDownException,fo as SlowDownException$,Io as UnauthorizedClientException,vo as UnauthorizedClientException$,Po as UnsupportedGrantTypeException,Co as UnsupportedGrantTypeException$,Ao as errorTypeRegistries};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{U,G}from"./chunk-
|
|
3
|
-
export{
|
|
2
|
+
import{U,G}from"./chunk-1n7dat03.js";class p extends Error{}var j=["$ref","$defs","definitions","allOf","oneOf","patternProperties","dependentSchemas","dependencies","unevaluatedProperties","propertyNames","contains","prefixItems","not","if","then","else"];function y(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function L(e){if(!y(e))return!1;let n=typeof e.type==="string"?[e.type]:Array.isArray(e.type)?e.type:[];return n.includes("object")||n.includes("array")||e.properties!==void 0||e.items!==void 0}function M(e){if(!y(e))return!1;if(e.type==="null"||Array.isArray(e.type)&&e.type.includes("null"))return!0;if(e.const===null||Array.isArray(e.enum)&&e.enum.includes(null))return!0;return Array.isArray(e.anyOf)&&e.anyOf.some((n)=>M(n))}function w(e,n){if(!y(e))throw new p("boolean schemas are unsupported");for(let a of j)if(e[a]!==void 0)throw new p(`${a} schemas are unsupported`);if(n){for(let[a,l]of Object.entries(e))if(n(a,l))throw new p(`${a}: ${JSON.stringify(l)} is unsupported`)}if(e.anyOf!==void 0){if(!Array.isArray(e.anyOf)||e.anyOf.length===0)throw new p("anyOf must contain at least one schema");for(let a of e.anyOf){if(L(a))throw new p("object and array unions are unsupported");w(a,n)}}if(e.items!==void 0){if(Array.isArray(e.items))throw new p("tuple schemas are unsupported");w(e.items,n)}let t=e.type==="object";if(e.properties!==void 0&&!t)throw new p("properties require type object");if(!t)return;if(e.additionalProperties!==void 0&&e.additionalProperties!==!1)throw new p("schema-valued or true additionalProperties is unsupported");if(e.properties!==void 0&&!y(e.properties))throw new p("object properties must be a schema map");if(e.required!==void 0&&(!Array.isArray(e.required)||e.required.some((a)=>typeof a!=="string")))throw new p("object required must be a string array");let r=e.properties??{},i=Object.keys(r),o=new Set(Array.isArray(e.required)?e.required:[]);if([...o].some((a)=>!i.includes(a)))throw new p("required contains an unknown property");for(let[a,l]of Object.entries(r))if(w(l,n),!o.has(a)&&!M(l))r[a]={anyOf:[l,{type:"null"}]};e.required=i,e.additionalProperties=!1}function N(e,n){let t=structuredClone(e);if(!y(t))throw new p("root schema must have type object");if(w(t,n),t.type!=="object")throw new p("root schema must have type object");return t}function fe(e,n){return n===!0?N(e.parameters):e.parameters}function Or(e,n,t){let r=n[t];if(typeof r!=="string")throw Error(`Grammar tool call "${e}" requires argument "${t}" to be a string.`);return r}function Nr(e,n,t,r){if(e.closed){if(r&&t===e.input)return;throw Error(`grammar tool input for property "${n}" changed after it was closed`)}if(!t.startsWith(e.input))throw Error(`grammar tool input for property "${n}" changed non-monotonically`);let i=t.slice(e.input.length);if(!r&&i.length===0)return;let o="";if(!e.started)o+=`{${JSON.stringify(n)}:"`,e.started=!0;if(o+=JSON.stringify(i).slice(1,-1),e.input=t,r)o+='"}',e.closed=!0;return o}function D(e){let n=e.parameters;if(n.type!=="object")throw Error("grammar constrained sampling requires an object parameter schema");if(!Array.isArray(n.required)||n.required.length!==1||typeof n.required[0]!=="string")throw Error("grammar constrained sampling requires exactly one required string property");let t=n.required[0];if(!n.properties?.[t])throw Error(`grammar constrained sampling requires a properties entry for ${t}`);if(n.properties[t]?.type!=="string")throw Error(`grammar constrained sampling property ${t} must have type string`);return t}function pe(e,n,t){let r=e.constrainedSampling;if(!r||r.type!=="json_schema")return;if(n)try{return N(e.parameters,t),!0}catch(i){if(!(i instanceof p))throw i;if(r.strict!=="require")return;throw Error(`Tool "${e.name}" requires JSON-schema constrained sampling, but ${i.message}.`)}if(r.strict==="require")throw Error(`Tool "${e.name}" requires JSON-schema constrained sampling, but strict tools are unsupported.`);return}function Yt(e,n){let t=e.constrainedSampling;if(!t||t.type!=="grammar")return;if(!n)return;let r=t.variants.openai_lark,i=t.variants.openai_regex,o=typeof r==="string"&&r.trim().length>0,a=typeof i==="string"&&i.trim().length>0;if(!o&&!a)throw Error(`Tool "${e.name}" cannot use grammar constrained sampling: no supported grammar variant was provided.`);try{return{format:o?"lark":"regex",definition:o?r:i,inputProperty:D(e)}}catch(l){let d=l instanceof Error?l.message:String(l);throw Error(`Tool "${e.name}" cannot use grammar constrained sampling: ${d}.`)}}function Pe(e,n){let t=new Map;for(let r of e??[]){let i=Yt(r,n);if(i)t.set(r.name,i.inputProperty)}return t}var O=3.5,b=4800;function R(e){return e.totalTokens||e.input+e.output+e.cacheRead+e.cacheWrite}function _(e){try{return JSON.stringify(e)??"undefined"}catch{return"[unserializable]"}}function H(e){if(typeof e==="string")return e.length;let n=0;for(let t of e)n+=t.type==="text"?t.text.length:b;return n}function P(e){return Math.ceil(e.length/O)}function k(e){return Math.ceil(H(e)/O)}function C(e){let n=0;if(e.role==="system")return P(U(e))+E(e.toolsAdded)+E(e.toolsRemoved);if(e.role==="user")return k(e.content);if(e.role==="toolResult")return k(e.content);for(let t of e.content)if(t.type==="text")n+=t.text.length;else if(t.type==="thinking")n+=t.thinking.length;else n+=t.name.length+_(t.arguments).length;return Math.ceil(n/O)}function W(e){let n=Number.NEGATIVE_INFINITY,t;for(let r=0;r<e.length;r++){let i=e[r];if(i.role==="assistant"){let o=i;if(o.timestamp>=n&&o.stopReason!=="aborted"&&o.stopReason!=="error"&&R(o.usage)>0)t={usage:o.usage,index:r}}n=Math.max(n,i.timestamp)}return t}function v(e){let n="messages"in e?e.messages:e,t=W(n);if(t){let i=R(t.usage),o=0;for(let a=t.index+1;a<n.length;a++)o+=C(n[a]);return{tokens:i+o,usageTokens:i,trailingTokens:o,lastUsageIndex:t.index}}let r=0;for(let i of n)r+=C(i);return{tokens:r,usageTokens:0,trailingTokens:r,lastUsageIndex:null}}function E(e){if(!e||e.length===0)return 0;return P(_(e))}var B=4096,S=1;function Zt(e,n,t){if(e.contextWindow<=0)return Math.max(S,t);let r=e.contextWindow-v(n).tokens-B;return Math.min(t,Math.max(S,r))}function ct(e,n,t){let r=G(e,n),i=e.samplingParamsByThinkingLevel?.[r];return e.samplingParams||i||t?{...e.samplingParams,...i,...t}:void 0}function K(e,n,t,r){let i=ct(e,t?.reasoning??"off",t?.samplingParams);return{temperature:t?.temperature,samplingParams:i,maxTokens:Zt(e,n,t?.maxTokens??e.maxTokens),signal:t?.signal,telemetryContext:t?.telemetryContext,apiKey:r||t?.apiKey,fetch:t?.fetch,transport:t?.transport,cacheRetention:t?.cacheRetention,sessionId:t?.sessionId,headers:t?.headers,onPayload:t?.onPayload,onResponse:t?.onResponse,onProviderStreamEvent:t?.onProviderStreamEvent,timeoutMs:t?.timeoutMs,websocketConnectTimeoutMs:t?.websocketConnectTimeoutMs,maxRetries:t?.maxRetries,maxRetryDelayMs:t?.maxRetryDelayMs,metadata:t?.metadata,env:t?.env}}var F=1024,V={minimal:1024,low:2048,medium:8192,high:16384};function ko(e){return e==="xhigh"||e==="max"?"high":e}function Ro(e,n){let t={...V,...n},r=ko(e);return t[r]}function Co(e,n){return Math.min(e,Math.max(0,n-F))}function Dr(e,n,t,r){let i=Ro(t,r),o=e===void 0?n:Math.min(e+i,n);if(o<=i)i=Co(i,o);return{maxTokens:o,thinkingBudget:i}}function q(e,n){let t=[],r=!1;for(let i of e){if(i.type==="image"){if(!r)t.push({type:"text",text:n});r=!0;continue}t.push(i),r=i.text===n}return t}function z(e,n){if(n.input.includes("image"))return e;return e.map((t)=>{if(t.role==="user"&&Array.isArray(t.content))return{...t,content:q(t.content,"(image omitted: model does not support images)")};if(t.role==="toolResult")return{...t,content:q(t.content,"(tool image omitted: model does not support images)")};return t})}function ge(e,n,t){let r=new Map,i=e.map((s)=>s.content==null?{...s,content:[]}:s),a=z(i,n).map((s)=>{if(s.role==="system"||s.role==="user")return s;if(s.role==="toolResult"){let u=r.get(s.toolCallId);if(u&&u!==s.toolCallId)return{...s,toolCallId:u};return s}if(s.role==="assistant"){let u=s,c=u.provider===n.provider&&u.api===n.api&&u.model===n.id,x=u.content.flatMap((f)=>{if(f.type==="thinking"){if(f.redacted)return c?f:[];if(c&&f.thinkingSignature)return f;if(!f.thinking||f.thinking.trim()==="")return[];if(c)return f;return{type:"text",text:f.thinking}}if(f.type==="text"){if(c)return f;return{type:"text",text:f.text}}if(f.type==="toolCall"){let m=f,g=m;if(!c&&m.thoughtSignature)g={...m},delete g.thoughtSignature;if(!c&&t){let I=t(m.id,n,u);if(I!==m.id)r.set(m.id,I),g={...g,id:I}}return g}return f});return{...u,content:x}}return s}),l=[],d=[],h=new Set,T=[],A=()=>{if(d.length>0){for(let s of d)if(!h.has(s.id))l.push({role:"toolResult",toolCallId:s.id,toolName:s.name,content:[{type:"text",text:"No result provided"}],isError:!0,timestamp:Date.now()});d=[],h=new Set}l.push(...T),T.length=0};for(let s=0;s<a.length;s++){let u=a[s];if(u.role==="assistant"){A();let c=u;if(c.stopReason==="error"||c.stopReason==="aborted")continue;let x=c.content.filter((f)=>f.type==="toolCall");if(x.length>0)d=x,h=new Set;l.push(u)}else if(u.role==="toolResult")h.add(u.toolCallId),l.push(u);else if(u.role==="system")if(d.length>0)T.push(u);else l.push(u);else if(u.role==="user")A(),l.push(u);else l.push(u)}return A(),l}
|
|
3
|
+
export{fe,Or,Nr,pe,Yt,Pe,Zt,ct,K,ko,Ro,Co,Dr,ge};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
function r(e){let t=e[e.length-1];return t&&t.role!=="user"?"agent":"user"}function
|
|
3
|
-
export{At
|
|
2
|
+
function r(e){let t=e[e.length-1];return t&&t.role!=="user"?"agent":"user"}function _t(e){return e.some((t)=>{if(t.role==="user"&&Array.isArray(t.content))return t.content.some((n)=>n.type==="image");if(t.role==="toolResult"&&Array.isArray(t.content))return t.content.some((n)=>n.type==="image");return!1})}function At(e){let t={"X-Initiator":r(e.messages),"Openai-Intent":"conversation-edits"};if(e.hasImages)t["Copilot-Vision-Request"]="true";return t}
|
|
3
|
+
export{_t,At};
|