@shumai-one/shumai 0.4.3 → 0.4.5
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/bin/{chunk-xp59apdb.js → chunk-0z8tgn67.js} +1 -1
- package/bin/{chunk-87zxtf66.js → chunk-18qzk2mm.js} +2 -2
- package/bin/{chunk-rbj4fad9.js → chunk-1b7gg0nx.js} +13 -13
- package/bin/{chunk-rpywcvg1.js → chunk-1hnpvtvf.js} +2 -2
- package/bin/chunk-1n1h09e9.js +2 -0
- package/bin/{chunk-q2bvyv39.js → chunk-1yv06e0q.js} +2 -2
- package/bin/chunk-20ee2pqp.js +4 -0
- package/bin/chunk-20yset6k.js +1 -0
- package/bin/{chunk-zqv0zhfb.js → chunk-21e4gjvw.js} +2 -2
- package/bin/{chunk-v9b3w8q5.js → chunk-23bg4h8n.js} +2 -2
- package/bin/chunk-2swjkvxv.js +211 -0
- package/bin/chunk-2y6teq4s.js +11 -0
- package/bin/chunk-3115qtvj.js +2 -0
- package/bin/{chunk-f15qyp41.js → chunk-3c0tcbga.js} +1 -1
- package/bin/{chunk-v9w25rp2.js → chunk-3mfdp2nh.js} +2 -2
- package/bin/chunk-3rwx54z7.js +2 -0
- package/bin/chunk-3x3sf7rp.js +3 -0
- package/bin/{chunk-4v5n0ayb.js → chunk-3x80f4jk.js} +1 -1
- package/bin/chunk-42ygnm34.js +2 -0
- package/bin/{chunk-wfzqnpc1.js → chunk-46wfxyd7.js} +2 -2
- package/bin/{chunk-b235azv4.js → chunk-48rbc18e.js} +13 -13
- package/bin/{chunk-4r81ghg8.js → chunk-4k2bej3c.js} +2 -2
- package/bin/{chunk-0e4wawpq.js → chunk-5trfc3xh.js} +1 -1
- package/bin/chunk-5xcjnbm9.js +1 -0
- package/bin/chunk-685gzbdg.js +14 -0
- package/bin/chunk-6kzm51c7.js +2 -0
- package/bin/{chunk-cak32x57.js → chunk-73evafrq.js} +1 -1
- package/bin/{chunk-fxswt9hc.js → chunk-7jtmwt5a.js} +2 -2
- package/bin/{chunk-av1a8fqp.js → chunk-7sc73pfr.js} +2 -2
- package/bin/{chunk-qwqvt9v6.js → chunk-7t1r3sj3.js} +2 -2
- package/bin/{chunk-vgn5zcpv.js → chunk-7v7mypc6.js} +2 -2
- package/bin/chunk-813885jm.js +1 -0
- package/bin/{chunk-bay038pj.js → chunk-8yg9zy53.js} +2 -2
- package/bin/chunk-923agf2d.js +1 -0
- package/bin/chunk-942ksfnj.js +2 -0
- package/bin/chunk-99yzvkq5.js +2 -0
- package/bin/chunk-9by727gr.js +2 -0
- package/bin/chunk-9sr1z8kv.js +42 -0
- package/bin/chunk-a0fggks8.js +2 -0
- package/bin/{chunk-cqb415s6.js → chunk-a3j3hyx2.js} +2 -2
- package/bin/chunk-a8x0dmec.js +2 -0
- package/bin/{chunk-tf28796q.js → chunk-af1mcn9p.js} +1 -1
- package/bin/{chunk-ea79xnn3.js → chunk-azafjrm4.js} +2 -2
- package/bin/{chunk-qf24e71w.js → chunk-b5a77dzv.js} +1 -1
- package/bin/chunk-b80fgsdf.js +1 -0
- package/bin/{chunk-n1jwdb0a.js → chunk-bg6kp843.js} +1 -1
- package/bin/chunk-brxwrh0b.js +11 -0
- package/bin/{chunk-zmv8cg4s.js → chunk-c51tvhra.js} +3 -3
- package/bin/chunk-c5dr9m1d.js +2 -0
- package/bin/{chunk-8fmy5jtp.js → chunk-cbpgrg5j.js} +1 -1
- package/bin/{chunk-m7m9d4fb.js → chunk-cwfjvynz.js} +2 -2
- package/bin/{chunk-66hsjnw6.js → chunk-da2w7c80.js} +2 -2
- package/bin/{chunk-1yacmegc.js → chunk-dchtr0ap.js} +2 -2
- package/bin/chunk-dqxh6dwz.js +16 -0
- package/bin/chunk-e1s1zgv0.js +2 -0
- package/bin/chunk-erharpzt.js +2 -0
- package/bin/{chunk-f3ehv01n.js → chunk-f3pb9mh9.js} +26 -26
- package/bin/chunk-fp8x63vs.js +2 -0
- package/bin/chunk-ft11rrhz.js +1 -0
- package/bin/chunk-fyszcddw.js +2 -0
- package/bin/chunk-g6hq18q1.js +1 -0
- package/bin/{chunk-wry2hvrq.js → chunk-g6xgghnq.js} +4 -4
- package/bin/{chunk-hfh0c082.js → chunk-gdg0tkbk.js} +1 -1
- package/bin/{chunk-3cyrcgm5.js → chunk-gjp851vj.js} +9 -9
- package/bin/{chunk-ehc9adfz.js → chunk-gy68h3x5.js} +2 -2
- package/bin/chunk-h4s1fgf1.js +2 -0
- package/bin/chunk-hsv4v7na.js +1 -0
- package/bin/chunk-j3kjscfj.js +2 -0
- package/bin/chunk-jbt3e1ac.js +7 -0
- package/bin/chunk-jrf90z42.js +3 -0
- package/bin/chunk-k2aqztk1.js +2 -0
- package/bin/{chunk-3a13dcs1.js → chunk-kfpfqxb3.js} +1 -1
- package/bin/chunk-kyxramkk.js +1 -0
- package/bin/chunk-m5z5mzan.js +2 -0
- package/bin/chunk-n48548fs.js +4 -0
- package/bin/chunk-ncnr223m.js +2 -0
- package/bin/chunk-ncp007yb.js +12 -0
- package/bin/{chunk-2291ehh5.js → chunk-ncqhp76x.js} +2 -2
- package/bin/chunk-njswnpaq.js +3 -0
- package/bin/{chunk-pb1zf0vb.js → chunk-nkmr6gqc.js} +2 -2
- package/bin/chunk-nngp6fhe.js +1 -0
- package/bin/chunk-nzggcbgk.js +20 -0
- package/bin/chunk-p1nb8wk8.js +3 -0
- package/bin/{chunk-6gg1ymer.js → chunk-p4yrnr37.js} +2 -2
- package/bin/chunk-pc2dnpkh.js +2 -0
- package/bin/{chunk-sfx2588q.js → chunk-pdrmbxrt.js} +2 -2
- package/bin/chunk-pmj9b8qt.js +3 -0
- package/bin/{chunk-h3tbf521.js → chunk-psk38vp4.js} +1 -1
- package/bin/{chunk-abt0azmv.js → chunk-pve3zpta.js} +2 -2
- package/bin/chunk-q3q0brsn.js +2 -0
- package/bin/{chunk-jy006gcv.js → chunk-qg1f1z3t.js} +4 -4
- package/bin/chunk-qk7me5ra.js +2 -0
- package/bin/{chunk-zehyn6vd.js → chunk-qqqarj5v.js} +2 -2
- package/bin/chunk-qysf4mpk.js +299 -0
- package/bin/chunk-r0j962y1.js +1 -0
- package/bin/chunk-r5dxd4sx.js +1 -0
- package/bin/{chunk-a32vreya.js → chunk-rq0n0vcc.js} +2 -2
- package/bin/chunk-s0caa0zm.js +5 -0
- package/bin/chunk-sa6k5ye7.js +1 -0
- package/bin/{chunk-83e12sjg.js → chunk-ss0mcgbd.js} +2 -2
- package/bin/chunk-sz6cnm4q.css +1 -0
- package/bin/{chunk-ck8azecb.js → chunk-tgee88jq.js} +5 -5
- package/bin/{chunk-ag6p3mbf.js → chunk-ty71fdw9.js} +2 -2
- package/bin/chunk-v0201sn5.js +3 -0
- package/bin/chunk-v2xt5p3x.js +10 -0
- package/bin/{chunk-2yxj593j.js → chunk-w3jmahea.js} +2 -2
- package/bin/chunk-w88h5wtf.js +1 -0
- package/bin/chunk-w9160hxz.js +5 -0
- package/bin/{chunk-k7hss0bd.js → chunk-wmkbkad1.js} +3 -3
- package/bin/{chunk-9t1ne8xr.js → chunk-wnpjz2kw.js} +2 -2
- package/bin/{chunk-8zqgaxvv.js → chunk-wrbas9cg.js} +1 -1
- package/bin/{chunk-j8fxp8ej.js → chunk-xcwjsav0.js} +1 -1
- package/bin/{chunk-jje8nj8h.js → chunk-xgy6ppww.js} +2 -2
- package/bin/{chunk-cnxwmycy.js → chunk-y13s3641.js} +3 -3
- package/bin/chunk-y78v01te.js +2 -0
- package/bin/{chunk-twdxayky.js → chunk-y8a3hans.js} +2 -2
- package/bin/chunk-z422yh6b.js +3 -0
- package/bin/chunk-z5t4yxzb.js +2 -0
- package/bin/chunk-zcfehv0w.js +18 -0
- package/bin/chunk-zg7a107s.js +3 -0
- package/bin/{chunk-e99dv20z.js → chunk-zp1sv030.js} +2 -2
- package/bin/{chunk-32pcmaqm.js → chunk-zrxe6p0q.js} +2 -2
- package/bin/chunk-zwenq5zy.js +2 -0
- package/bin/shumai-app.html +1 -1
- package/bin/shumai-app.js +987 -776
- package/package.json +7 -7
- package/prisma/migrations/20260907021754_add_asset_upload_id/migration.sql +2 -0
- package/prisma/migrations/20260913130237_add_asset_comment_asset_id_idx/migration.sql +2 -0
- package/prisma/schema.prisma +2 -0
- package/bin/chunk-185qefn1.js +0 -2
- package/bin/chunk-1kw2mbqb.js +0 -1
- package/bin/chunk-1wm6ptdx.js +0 -1
- package/bin/chunk-2520aq8j.js +0 -2
- package/bin/chunk-29zdp63z.js +0 -3
- package/bin/chunk-3swpwb9v.js +0 -1
- package/bin/chunk-3wmcx2bv.js +0 -2
- package/bin/chunk-5a8nt4me.js +0 -1
- package/bin/chunk-6bhn1p8v.js +0 -211
- package/bin/chunk-70c3xrgd.js +0 -2
- package/bin/chunk-7esm0hqb.js +0 -2
- package/bin/chunk-7fst8kdw.js +0 -12
- package/bin/chunk-a3dmtt2j.js +0 -1
- package/bin/chunk-aqbrzx9z.js +0 -1
- package/bin/chunk-awfwk64v.js +0 -2
- package/bin/chunk-b9yrw9et.js +0 -10
- package/bin/chunk-c007p0t8.js +0 -299
- package/bin/chunk-ce8m4zeg.js +0 -3
- package/bin/chunk-e2mvmq2m.js +0 -1
- package/bin/chunk-e7mqtkzn.js +0 -2
- package/bin/chunk-ejbvfj4r.js +0 -1
- package/bin/chunk-ekfem7kf.js +0 -1
- package/bin/chunk-etwkk0xh.js +0 -1
- package/bin/chunk-evrdd32b.js +0 -2
- package/bin/chunk-fm6p03ad.js +0 -2
- package/bin/chunk-fyha3r13.js +0 -2
- package/bin/chunk-g0vs7k2x.js +0 -1
- package/bin/chunk-g84z2w7v.js +0 -16
- package/bin/chunk-gk3eqd50.js +0 -2
- package/bin/chunk-h837fyed.js +0 -2
- package/bin/chunk-j20e0qsw.js +0 -7
- package/bin/chunk-p5gf1zdm.js +0 -4
- package/bin/chunk-pfgxggaj.js +0 -11
- package/bin/chunk-q16490pv.js +0 -2
- package/bin/chunk-qh81zhg1.js +0 -1
- package/bin/chunk-qwp3kwbz.js +0 -2
- package/bin/chunk-qydeqgyj.js +0 -5
- package/bin/chunk-r7dty1tg.js +0 -2
- package/bin/chunk-rhdxwebf.js +0 -2
- package/bin/chunk-rhh716z0.js +0 -42
- package/bin/chunk-rza4ae5z.js +0 -3
- package/bin/chunk-sk4e6rb1.js +0 -1
- package/bin/chunk-t2n1dbgx.js +0 -4
- package/bin/chunk-x8f4defx.js +0 -3
- package/bin/chunk-xtf3c29c.css +0 -1
- package/bin/chunk-z3gkt8w1.js +0 -3
- package/bin/chunk-zh6fqq44.js +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
export{
|
|
2
|
+
import{Dn}from"./chunk-23bg4h8n.js";var r=/"/g,n=/[\\'"]/g;class Yi extends Dn{visitOrAction(e){this.append("or "),this.append(e.action)}getCurrentParameterPlaceholder(){return"?"}getLeftExplainOptionsWrapper(){return""}getRightExplainOptionsWrapper(){return""}getLeftIdentifierWrapper(){return'"'}getRightIdentifierWrapper(){return'"'}getAutoIncrement(){return"autoincrement"}sanitizeIdentifier(e){return e.replace(r,'""')}sanitizeJSONPathMemberValue(e){return e.replace(n,(t)=>t==="\\"?"\\\\":t==="'"?"''":"\\\"")}visitDefaultInsertValue(e){this.append("null")}}class ta{get supportsCreateIfNotExists(){return!0}get supportsTransactionalDdl(){return!1}get supportsReturning(){return!1}get supportsOutput(){return!1}}class Ji extends ta{get supportsTransactionalDdl(){return!1}get supportsReturning(){return!0}async acquireMigrationLock(e,t){}async releaseMigrationLock(e,t){}}
|
|
3
|
+
export{ta,Yi,Ji};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ts,Ho}from"./chunk-nzggcbgk.js";import{$o}from"./chunk-w9160hxz.js";import{Go,mo,kt}from"./chunk-brxwrh0b.js";import{an,sr,He,Jr,Jt,go,jt}from"./chunk-zcfehv0w.js";var{awsEndpointFunctions:me,emitWarningIfUnsupportedVersion:xe,createDefaultUserAgentProvider:fe,NODE_APP_ID_CONFIG_OPTIONS:Se,getAwsRegionExtensionConfiguration:ve,resolveAwsRegionExtensionConfiguration:Pe,resolveUserAgentConfig:Ie,resolveHostHeaderConfig:Ce,getUserAgentPlugin:Ae,getHostHeaderPlugin:ye,getLoggerPlugin:Te,getRecursionDetectionPlugin:Oe}=kt(),{NoAuthSigner:Re,getHttpAuthSchemeEndpointRuleSetPlugin:De,DefaultIdentityProviderConfig:ke,getHttpSigningPlugin:$e}=mo(),{normalizeProvider:j,getSmithyContext:we,ServiceException:Ne,NoOpLogger:be,emitWarningIfUnsupportedVersion:Ue,loadConfigsForDefaultMode:Fe,getDefaultExtensionConfiguration:qe,resolveDefaultRuntimeConfig:Me,Client:K,makeBuilder:Ge,createAggregatedClient:je}=sr(),{Command:Ke}=sr();var Ur=Ke,Fr=K;var{resolveDefaultsModeConfig:Ve,loadConfig:h,NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS:ze,NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS:Le,NODE_REGION_CONFIG_OPTIONS:Be,NODE_REGION_CONFIG_FILE_OPTIONS:We,resolveRegionConfig:Ye}=He(),{BinaryDecisionDiagram:Je,EndpointCache:Xe,decideEndpoint:Qe,customEndpointFunctions:Ze,resolveEndpointConfig:et,getEndpointPlugin:tt}=Jr(),{parseUrl:rt,getHttpHandlerExtensionConfiguration:ot,resolveHttpHandlerRuntimeConfig:nt,getContentLengthPlugin:st}=jt(),{DEFAULT_RETRY_MODE:it,NODE_RETRY_MODE_CONFIG_OPTIONS:ct,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:at,resolveRetryConfig:pt,getRetryPlugin:dt}=Go(),{TypeRegistry:V,getSchemaSerdePlugin:ut}=an(),{resolveAwsSdkSigV4Config:lt,AwsSdkSigV4Signer:ht,NODE_AUTH_SCHEME_PREFERENCE_OPTIONS:_t}=Ho(),{toUtf8:gt,fromUtf8:Et,toBase64:mt,fromBase64:xt,calculateBodyLength:ft}=Jt(),{streamCollector:St,NodeHttpHandler:vt}=$o(),{AwsRestJsonProtocol:Pt}=Ts(),{Sha256:It}=go(),Ct=async(e,t,n)=>({operation:we(t).operation,region:await j(e.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function At(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sso-oauth",region:e.region},propertiesExtractor:(t,n)=>({signingProperties:{config:t,context:n}})}}function yt(e){return{schemeId:"smithy.api#noAuth"}}var Tt=(e)=>{let t=[];switch(e.operation){case"CreateToken":{t.push(yt());break}default:t.push(At(e))}return t},Ot=(e)=>{let t=lt(e);return Object.assign(t,{authSchemePreference:j(e.authSchemePreference??[])})},Rt=(e)=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"sso-oauth"}),Dt={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},$t="3.997.43",wt={version:$t},E="ref",_=-1,x=!0,q="isSet",z="PartitionResult",f="booleanEquals",w="getAttr",H={[E]:"Endpoint"},N={[E]:z},g={},M=[{[E]:"Region"}],G={conditions:[[q,[H]],[q,M],["aws.partition",M,z],[f,[{[E]:"UseFIPS"},x]],[f,[{[E]:"UseDualStack"},x]],[f,[{fn:w,argv:[N,"supportsDualStack"]},x]],[f,[{fn:w,argv:[N,"supportsFIPS"]},x]],["stringEquals",[{fn:w,argv:[N,"name"]},"aws-us-gov"]]],results:[[_],[_,"Invalid Configuration: FIPS and custom endpoint are not supported"],[_,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[H,g],["https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",g],[_,"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],[_,"FIPS is enabled but this partition does not support FIPS"],["https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}",g],[_,"DualStack is enabled but this partition does not support DualStack"],["https://oidc.{Region}.{PartitionResult#dnsSuffix}",g],[_,"Invalid Configuration: Missing Region"]]},Nt=2,c=1e8,bt=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]),Ut=Je.from(bt,Nt,G.conditions,G.results),Ft=new Xe({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),qt=(e,t={})=>Ft.get(e,()=>Qe(Ut,{endpointParams:e,logger:t.logger}));Ze.aws=me;class i extends Ne{constructor(e){super(e);Object.setPrototypeOf(this,i.prototype)}}class S extends i{name="AccessDeniedException";$fault="client";error;reason;error_description;constructor(e){super({name:"AccessDeniedException",$fault:"client",...e});Object.setPrototypeOf(this,S.prototype),this.error=e.error,this.reason=e.reason,this.error_description=e.error_description}}class v extends i{name="AuthorizationPendingException";$fault="client";error;error_description;constructor(e){super({name:"AuthorizationPendingException",$fault:"client",...e});Object.setPrototypeOf(this,v.prototype),this.error=e.error,this.error_description=e.error_description}}class P extends i{name="ExpiredTokenException";$fault="client";error;error_description;constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e});Object.setPrototypeOf(this,P.prototype),this.error=e.error,this.error_description=e.error_description}}class I extends i{name="InternalServerException";$fault="server";error;error_description;constructor(e){super({name:"InternalServerException",$fault:"server",...e});Object.setPrototypeOf(this,I.prototype),this.error=e.error,this.error_description=e.error_description}}class C extends i{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{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{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{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{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 R extends i{name="UnauthorizedClientException";$fault="client";error;error_description;constructor(e){super({name:"UnauthorizedClientException",$fault:"client",...e});Object.setPrototypeOf(this,R.prototype),this.error=e.error,this.error_description=e.error_description}}class D extends i{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 Ht="AccessDeniedException",Mt="AuthorizationPendingException",Gt="AccessToken",Kt="ClientSecret",Vt="CreateToken",zt="CreateTokenRequest",Lt="CreateTokenResponse",Bt="CodeVerifier",Wt="ExpiredTokenException",Yt="InvalidClientException",Xt="InvalidGrantException",Qt="InvalidRequestException",Zt="InternalServerException",er="InvalidScopeException",tr="IdToken",rr="RefreshToken",or="SlowDownException",nr="UnauthorizedClientException",ir="UnsupportedGrantTypeException",cr="accessToken",l="client",ar="clientId",pr="clientSecret",dr="codeVerifier",ur="code",lr="deviceCode",r="error",hr="expiresIn",d="error_description",_r="grantType",gr="http",u="httpError",Er="idToken",L="reason",B="refreshToken",mr="redirectUri",W="smithy.ts.sdk.synthetic.com.amazonaws.ssooidc",xr="scope",fr="server",Sr="tokenType",o="com.amazonaws.ssooidc",Y=V.for(W),J=[-3,W,"SSOOIDCServiceException",0,[],[]];Y.registerError(J,i);var a=V.for(o),X=[-3,o,Ht,{[r]:l,[u]:400},[r,L,d],[0,0,0]];a.registerError(X,S);var Q=[-3,o,Mt,{[r]:l,[u]:400},[r,d],[0,0]];a.registerError(Q,v);var Z=[-3,o,Wt,{[r]:l,[u]:400},[r,d],[0,0]];a.registerError(Z,P);var ee=[-3,o,Zt,{[r]:fr,[u]:500},[r,d],[0,0]];a.registerError(ee,I);var te=[-3,o,Yt,{[r]:l,[u]:401},[r,d],[0,0]];a.registerError(te,C);var re=[-3,o,Xt,{[r]:l,[u]:400},[r,d],[0,0]];a.registerError(re,A);var oe=[-3,o,Qt,{[r]:l,[u]:400},[r,L,d],[0,0,0]];a.registerError(oe,y);var ne=[-3,o,er,{[r]:l,[u]:400},[r,d],[0,0]];a.registerError(ne,T);var se=[-3,o,or,{[r]:l,[u]:400},[r,d],[0,0]];a.registerError(se,O);var ie=[-3,o,nr,{[r]:l,[u]:400},[r,d],[0,0]];a.registerError(ie,R);var ce=[-3,o,ir,{[r]:l,[u]:400},[r,d],[0,0]];a.registerError(ce,D);var ae=[Y,a],vr=[0,o,Gt,8,0],Pr=[0,o,Kt,8,0],Ir=[0,o,Bt,8,0],Cr=[0,o,tr,8,0],pe=[0,o,rr,8,0],de=[3,o,zt,0,[ar,pr,_r,lr,ur,B,xr,mr,dr],[0,[()=>Pr,0],0,0,0,[()=>pe,0],64,0,[()=>Ir,0]],3],ue=[3,o,Lt,0,[cr,Sr,hr,B,Er],[[()=>vr,0],0,1,[()=>pe,0],[()=>Cr,0]]],le=[9,o,Vt,{[gr]:["POST","/token",200]},()=>de,()=>ue],Ar=(e)=>({apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??xt,base64Encoder:e?.base64Encoder??mt,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??qt,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??Tt,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(t)=>t.getIdentityProvider("aws.auth#sigv4"),signer:new ht},{schemeId:"smithy.api#noAuth",identityProvider:(t)=>t.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new Re}],logger:e?.logger??new be,protocol:e?.protocol??Pt,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.ssooidc",errorTypeRegistries:ae,version:"2019-06-10",serviceTarget:"AWSSSOOIDCService"},serviceId:e?.serviceId??"SSO OIDC",sha256:e?.sha256??It,urlParser:e?.urlParser??rt,utf8Decoder:e?.utf8Decoder??Et,utf8Encoder:e?.utf8Encoder??gt}),yr=(e)=>{Ue(process.version);let t=Ve(e),n=()=>t().then(Fe),p=Ar(e);xe(process.version);let s={profile:e?.profile,logger:p.logger};return{...p,...e,runtime:"node",defaultsMode:t,authSchemePreference:e?.authSchemePreference??h(_t,s),bodyLengthChecker:e?.bodyLengthChecker??ft,defaultUserAgentProvider:e?.defaultUserAgentProvider??fe({serviceId:p.serviceId,clientVersion:wt.version}),maxAttempts:e?.maxAttempts??h(at,e),region:e?.region??h(Be,{...We,...s}),requestHandler:vt.create(e?.requestHandler??n),retryMode:e?.retryMode??h({...ct,default:async()=>(await n()).retryMode||it},e),streamCollector:e?.streamCollector??St,useDualstackEndpoint:e?.useDualstackEndpoint??h(Le,s),useFipsEndpoint:e?.useFipsEndpoint??h(ze,s),userAgentAppId:e?.userAgentAppId??h(Se,s)}},Tr=(e)=>{let{httpAuthSchemes:t,httpAuthSchemeProvider:n,credentials:p}=e;return{setHttpAuthScheme(s){let m=t.findIndex((k)=>k.schemeId===s.schemeId);if(m===-1)t.push(s);else t.splice(m,1,s)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(s){n=s},httpAuthSchemeProvider(){return n},setCredentials(s){p=s},credentials(){return p}}},Or=(e)=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}),Rr=(e,t)=>{let n=Object.assign(ve(e),qe(e),ot(e),Tr(e));return t.forEach((p)=>p.configure(n)),Object.assign(e,Pe(n),Me(n),nt(n),Or(n))};class b extends K{config;constructor(...[e]){let t=yr(e||{});super(t);this.initConfig=t;let n=Rt(t),p=Ie(n),s=pt(p),m=Ye(s),k=Ce(m),he=et(k),_e=Ot(he),ge=Rr(_e,e?.extensions||[]);this.config=ge,this.middlewareStack.use(ut(this.config)),this.middlewareStack.use(Ae(this.config)),this.middlewareStack.use(dt(this.config)),this.middlewareStack.use(st(this.config)),this.middlewareStack.use(ye(this.config)),this.middlewareStack.use(Te(this.config)),this.middlewareStack.use(Oe(this.config)),this.middlewareStack.use(De(this.config,{httpAuthSchemeParametersProvider:Ct,identityProviderConfigProvider:async(Ee)=>new ke({"aws.auth#sigv4":Ee.credentials})})),this.middlewareStack.use($e(this.config))}destroy(){super.destroy()}}var Dr=Ge(Dt,"AWSSSOOIDCService","SSOOIDCClient",tt),kr={},$r=(e,t,n,p)=>[];class U extends Dr(kr,$r,"CreateToken",le){}var wr={CreateTokenCommand:U};class F extends b{}je(wr,F);var Nr={KMS_ACCESS_DENIED:"KMS_AccessDeniedException"},br={KMS_DISABLED_KEY:"KMS_DisabledException",KMS_INVALID_KEY_USAGE:"KMS_InvalidKeyUsageException",KMS_INVALID_STATE:"KMS_InvalidStateException",KMS_KEY_NOT_FOUND:"KMS_NotFoundException"};var qr=S,Hr=X,Mr=Nr,Gr=v,jr=Q,Kr=le,Vr=U,zr=de,Lr=ue,Br=P,Wr=Z,Yr=I,Xr=ee,Qr=C,Zr=te,eo=A,to=re,ro=y,oo=oe,no=br,so=T,io=ne,co=F,ao=b,po=i,uo=J,lo=O,ho=se,_o=R,Eo=ie,xo=D,fo=ce,So=ae;export{Ur as $Command,Fr as __Client,qr as AccessDeniedException,Hr as AccessDeniedException$,Mr as AccessDeniedExceptionReason,Gr as AuthorizationPendingException,jr as AuthorizationPendingException$,Kr as CreateToken$,Vr as CreateTokenCommand,zr as CreateTokenRequest$,Lr as CreateTokenResponse$,Br as ExpiredTokenException,Wr as ExpiredTokenException$,Yr as InternalServerException,Xr as InternalServerException$,Qr as InvalidClientException,Zr as InvalidClientException$,eo as InvalidGrantException,to as InvalidGrantException$,ro as InvalidRequestException,oo as InvalidRequestException$,no as InvalidRequestExceptionReason,so as InvalidScopeException,io as InvalidScopeException$,co as SSOOIDC,ao as SSOOIDCClient,po as SSOOIDCServiceException,uo as SSOOIDCServiceException$,lo as SlowDownException,ho as SlowDownException$,_o as UnauthorizedClientException,Eo as UnauthorizedClientException$,xo as UnsupportedGrantTypeException,fo as UnsupportedGrantTypeException$,So as errorTypeRegistries};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Wr}from"./chunk-s0caa0zm.js";import{ir}from"./chunk-pdrmbxrt.js";import{on,Za}from"./chunk-jrf90z42.js";import{hc,Xi,Yt}from"./chunk-v0201sn5.js";class g extends Error{code;diagnosticDetails;constructor(r,t,n){super(r);this.name="PiMessagesResponseError",this.code=t,this.diagnosticDetails=n}}function x(r){try{let t=JSON.parse(r),n=t?.error;return t&&typeof n==="object"&&n!==null&&!Array.isArray(n)?t:void 0}catch{return}}function m(r){return r.length>8192?`${r.slice(0,8192)}\u2026`:r}function y(r,t,n){let e=typeof n?.error?.message==="string"?n.error.message:void 0,s=typeof n?.error?.code==="string"?n.error.code:void 0,a=e??t,o=s?` (${s})`:"";return`${r.status} ${r.statusText}: ${a}${o}`}function w(r,t,n,e){let s=x(e),a=typeof s?.error?.code==="string"?s.error.code:void 0;return new g(y(n,e,s),a,{version:1,provider:r.provider,model:r.id,url:t.toString(),status:n.status,statusText:n.statusText,error:s?.error,body:s?void 0:m(e),timestampMs:Date.now()})}function h(){return{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}}}function l(r,t){if(!t)return;Xi(r,{type:"pi_messages_rewrite",timestamp:Date.now(),details:{...t}})}function b(r){let t={role:"assistant",content:[],api:r.api,provider:r.provider,model:r.id,usage:h(),stopReason:"stop",timestamp:Date.now()},n=new Map;return(e)=>{switch(e.type){case"done":return Object.assign(t,{stopReason:e.reason,usage:e.usage,responseId:e.responseId}),l(t,e.rewrite),{type:"done",reason:e.reason,message:t};case"error":return Object.assign(t,{stopReason:e.reason,usage:e.usage,errorMessage:e.errorMessage,responseId:e.responseId}),l(t,e.rewrite),{type:"error",reason:e.reason,error:t};case"start":break;case"text_start":t.content[e.contentIndex]={type:"text",text:""};break;case"text_delta":t.content[e.contentIndex].text+=e.delta;break;case"text_end":Object.assign(t.content[e.contentIndex],{text:e.content,textSignature:e.contentSignature});break;case"thinking_start":t.content[e.contentIndex]={type:"thinking",thinking:""};break;case"thinking_delta":t.content[e.contentIndex].thinking+=e.delta;break;case"thinking_end":Object.assign(t.content[e.contentIndex],{thinking:e.content,thinkingSignature:e.contentSignature,redacted:e.redacted});break;case"toolcall_start":t.content[e.contentIndex]={type:"toolCall",id:e.id,name:e.toolName,arguments:{}},n.set(e.contentIndex,"");break;case"toolcall_delta":{let s=`${n.get(e.contentIndex)??""}${e.delta}`;n.set(e.contentIndex,s),t.content[e.contentIndex].arguments=Wr(s);break}case"toolcall_end":return Object.assign(t.content[e.contentIndex],e.toolCall),n.delete(e.contentIndex),{type:"toolcall_end",contentIndex:e.contentIndex,toolCall:t.content[e.contentIndex],partial:t}}return{...e,partial:t}}}async function*I(r){let t=new TextDecoder,n=r.getReader(),e="";try{while(!0){let{done:s,value:a}=await n.read();e+=s?t.decode():t.decode(a,{stream:!0}),e=e.replace(/\r\n/g,`
|
|
3
3
|
`);let o=e.indexOf(`
|
|
4
4
|
|
|
5
5
|
`);while(o!==-1){let c=f(e.slice(0,o));if(c)yield c;e=e.slice(o+2),o=e.indexOf(`
|
|
6
6
|
|
|
7
7
|
`)}if(s)break}if(e.trim()){let s=f(e);if(s)yield s}}finally{n.releaseLock()}}function f(r){let t=r.split(`
|
|
8
|
-
`).find((n)=>n.startsWith("data:"))?.slice(5).trim();return t&&t!=="[DONE]"?JSON.parse(t):void 0}function k(r,t,n){let e=n?"aborted":"error",s={role:"assistant",content:[],api:r.api,provider:r.provider,model:r.id,usage:h(),stopReason:e,errorMessage:t instanceof Error?t.message:String(t),timestamp:Date.now()};if(!n&&t instanceof g)
|
|
8
|
+
`).find((n)=>n.startsWith("data:"))?.slice(5).trim();return t&&t!=="[DONE]"?JSON.parse(t):void 0}function k(r,t,n){let e=n?"aborted":"error",s={role:"assistant",content:[],api:r.api,provider:r.provider,model:r.id,usage:h(),stopReason:e,errorMessage:t instanceof Error?t.message:String(t),timestamp:Date.now()};if(!n&&t instanceof g)Xi(s,hc("pi_messages_response_failure",t,t.diagnosticDetails));return{type:"error",reason:e,error:s}}function E(r,t){if(r)return r;return ir("PI_CACHE_RETENTION",t)==="long"?"long":void 0}var R=(r,t,n)=>{let e=new Yt,s=b(r);return(async()=>{try{let a=n?.apiKey;if(!a)throw Error(`No API key provided for provider "${r.provider}"`);let o=new URL(`${r.baseUrl.replace(/\/+$/u,"")}/messages`);if(n?.debug)o.searchParams.set("debug","1");let c={model:r.id,context:t,options:{temperature:n?.temperature,maxTokens:n?.maxTokens,reasoning:n?.reasoning,cacheRetention:E(n?.cacheRetention,n?.env),sessionId:n?.sessionId,toolChoice:n?.toolChoice}},p=await n?.onPayload?.(c,r);if(p!==void 0)c=p;let i=await fetch(o,{method:"POST",headers:{authorization:`Bearer ${a}`,accept:"text/event-stream","content-type":"application/json",...Za(n?.headers)},body:JSON.stringify(c),signal:n?.signal});if(await n?.onResponse?.({status:i.status,headers:on(i.headers)},r),!i.ok){let d=await i.text();throw w(r,o,i,d)}if(!i.body)throw Error(`${r.provider} response has no body`);for await(let d of I(i.body)){let u=s(d);if(e.push(u),u.type==="done"||u.type==="error")return}throw Error(`${r.provider} stream ended without a terminal event`)}catch(a){e.push(k(r,a,n?.signal?.aborted??!1))}})(),e},P=(r,t,n)=>{let e=n;return R(r,t,{...n,reasoning:n?.reasoning,toolChoice:e?.toolChoice,debug:e?.debug})};export{g as PiMessagesResponseError,R as stream,P as streamSimple};
|