@shumai-one/shumai 0.2.0 → 0.2.1
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-fcb14agg.js → chunk-044xt1se.js} +1 -1
- package/bin/chunk-0a5k9avd.js +4 -0
- package/bin/{chunk-xh2ntgmk.js → chunk-14fh4s1a.js} +2 -2
- package/bin/{chunk-y1xs4c5j.js → chunk-1ae8csk6.js} +1 -1
- package/bin/{chunk-yk3k5g5w.js → chunk-1w9dnk5p.js} +2 -2
- package/bin/chunk-211y81mp.js +1 -0
- package/bin/{chunk-twzgpwst.js → chunk-25d1g086.js} +2 -2
- package/bin/chunk-29pkpmvy.js +2 -0
- package/bin/{chunk-9rw65s3e.js → chunk-2djd6pq1.js} +2 -2
- package/bin/chunk-2dsmsa6a.js +3 -0
- package/bin/{chunk-08m8mzfa.js → chunk-2dz8nn9v.js} +1 -1
- package/bin/{chunk-mnv6pj0k.js → chunk-2xnys7v4.js} +2 -2
- package/bin/{chunk-a5kfa0k9.js → chunk-3rmc8nz6.js} +1 -1
- package/bin/{chunk-fwf8yne2.js → chunk-46c5xkmn.js} +2 -2
- package/bin/{chunk-axx5bh38.js → chunk-4fnak2zn.js} +2 -2
- package/bin/{chunk-gk7158n4.js → chunk-50ebjdkv.js} +2 -2
- package/bin/{chunk-29ectt6g.js → chunk-58aabg1f.js} +2 -2
- package/bin/{chunk-hb5v9ees.js → chunk-5j7axztv.js} +2 -2
- package/bin/chunk-5k03xpzq.js +6 -0
- package/bin/chunk-6724dtsx.js +2 -0
- package/bin/{chunk-q4f5vvtx.js → chunk-6h4ay2p8.js} +2 -2
- package/bin/chunk-6w5cn6p3.js +3 -0
- package/bin/{chunk-ps4h3387.js → chunk-75jka5v9.js} +2 -2
- package/bin/chunk-79n633wf.js +3 -0
- package/bin/chunk-7b17fb36.js +6 -0
- package/bin/{chunk-dypsm6m2.js → chunk-7h75r7ep.js} +1 -1
- package/bin/{chunk-pf8edn5x.js → chunk-7ktvhtp1.js} +2 -2
- package/bin/{chunk-6r9w7z15.js → chunk-7mnezagc.js} +2 -2
- package/bin/chunk-7we7ex0m.js +3 -0
- package/bin/{chunk-z42cyc20.js → chunk-82w2419d.js} +2 -2
- package/bin/chunk-861dz0bf.js +8 -0
- package/bin/chunk-891h8br6.js +3 -0
- package/bin/chunk-8abs8d48.js +12 -0
- package/bin/chunk-8qg47kj6.js +3 -0
- package/bin/{chunk-kbzm1pwx.js → chunk-976v5s8y.js} +1 -1
- package/bin/{chunk-8wv3kdz9.js → chunk-99db4j0k.js} +2 -2
- package/bin/{chunk-dgx2zxze.js → chunk-9bpjfkjf.js} +2 -2
- package/bin/chunk-9evm8x70.js +1 -0
- package/bin/{chunk-ec88pb09.js → chunk-9h3ds7rn.js} +2 -2
- package/bin/{chunk-ehfk24cf.js → chunk-9n783gva.js} +1 -1
- package/bin/chunk-a5s5ny4z.js +2 -0
- package/bin/{chunk-3rajscaz.js → chunk-ag35pxnb.js} +1 -1
- package/bin/{chunk-ajqsprm0.js → chunk-azfgjqjx.js} +2 -2
- package/bin/{chunk-s8d2045p.js → chunk-b9hb5jzt.js} +1 -1
- package/bin/chunk-bepnbw1g.js +2 -0
- package/bin/chunk-bg24g9kk.js +1 -0
- package/bin/{chunk-1fpqq6ed.js → chunk-c1v946wb.js} +2 -2
- package/bin/chunk-c45rh4hk.js +3 -0
- package/bin/{chunk-acxm86fh.js → chunk-cj5qwc9c.js} +1 -1
- package/bin/{chunk-j8q688sx.js → chunk-cpr05qng.js} +2 -2
- package/bin/chunk-d2vxmn9v.js +3 -0
- package/bin/chunk-dqtq9t8e.js +1 -0
- package/bin/{chunk-4kk5g619.js → chunk-dwf5e5g3.js} +2 -2
- package/bin/{chunk-w4y97tzy.js → chunk-dzm2f82x.js} +1 -1
- package/bin/chunk-e3c6hyz8.js +4 -0
- package/bin/chunk-fgnxtqtk.js +1 -0
- package/bin/chunk-fxvb6g2r.js +1 -0
- package/bin/{chunk-7ddaxdpf.js → chunk-ga0drqj7.js} +1 -1
- package/bin/{chunk-n5hfy93f.js → chunk-ga3mh3cd.js} +3 -3
- package/bin/chunk-gd5xwgp6.js +2 -0
- package/bin/chunk-hcz4snm7.js +8 -0
- package/bin/{chunk-dyybbn07.js → chunk-hmsb7ehr.js} +1 -1
- package/bin/{chunk-49ej1y67.js → chunk-hqptebzb.js} +2 -2
- package/bin/{chunk-mv79zk8q.js → chunk-hy50c4pw.js} +3 -3
- package/bin/chunk-jbde7evp.js +8 -0
- package/bin/{chunk-mjan6b09.js → chunk-jfjcxyhf.js} +3 -3
- package/bin/{chunk-hdk93ghf.js → chunk-jyjnt0s9.js} +2 -2
- package/bin/chunk-k1r17nfa.js +7 -0
- package/bin/{chunk-3qdn3pty.js → chunk-k5bekrrp.js} +1 -1
- package/bin/{chunk-3x62t1m0.js → chunk-kj751zje.js} +1 -1
- package/bin/chunk-kjkmh26f.js +1 -0
- package/bin/{chunk-m7jfszqt.js → chunk-m11g9hx7.js} +2 -2
- package/bin/{chunk-e5833tbd.js → chunk-m3dwydr3.js} +2 -2
- package/bin/{chunk-5a2maxwp.js → chunk-mg6fce5x.js} +2 -2
- package/bin/{chunk-xpqcvxej.js → chunk-mjncyjwf.js} +1 -1
- package/bin/{chunk-33ee1cvv.js → chunk-mk1jewvw.js} +2 -2
- package/bin/{chunk-gdm6y33a.js → chunk-mv8c5fky.js} +1 -1
- package/bin/chunk-mwh2n8yt.js +3 -0
- package/bin/{chunk-ysq64j13.js → chunk-n4meg9wb.js} +1 -1
- package/bin/{chunk-k5w64spz.js → chunk-nceqrqey.js} +2 -2
- package/bin/{chunk-wv4fe1fj.js → chunk-ngd23mtc.js} +2 -2
- package/bin/{chunk-m54p1cvp.js → chunk-p3emandj.js} +2 -2
- package/bin/{chunk-1wq9hjjr.js → chunk-phw4ne8b.js} +1 -1
- package/bin/{chunk-22dje1f5.js → chunk-pmx9760x.js} +1 -1
- package/bin/chunk-pv76qkym.js +2 -0
- package/bin/{chunk-d1ka11hc.js → chunk-pvy0gccg.js} +1 -1
- package/bin/chunk-pxw97qbq.js +3 -0
- package/bin/chunk-q09dfja5.js +3 -0
- package/bin/chunk-q72ax3m8.js +12 -0
- package/bin/{chunk-zsdwska1.js → chunk-q9sgjs4d.js} +1 -1
- package/bin/chunk-qag3w2dd.js +3 -0
- package/bin/{chunk-2cmg5sfn.js → chunk-qf7n519d.js} +2 -2
- package/bin/{chunk-3n1k9qt5.js → chunk-qj2kpkje.js} +1 -1
- package/bin/{chunk-cp18trqb.js → chunk-qjjr3fff.js} +2 -2
- package/bin/{chunk-fwe9g818.js → chunk-s1n39qte.js} +1 -1
- package/bin/chunk-s2725w64.js +1 -0
- package/bin/{chunk-09wp20mv.js → chunk-saq5797j.js} +1 -1
- package/bin/{chunk-d2y3rbjm.js → chunk-sp75qe28.js} +1 -1
- package/bin/{chunk-4hnrd4qh.js → chunk-sy8rqacm.js} +1 -1
- package/bin/{chunk-6mn3jqm9.js → chunk-t1mxqskx.js} +2 -2
- package/bin/chunk-t84t3v6q.js +1 -0
- package/bin/{chunk-eadb78m8.js → chunk-ta7bfdrn.js} +1 -1
- package/bin/{chunk-2s5a64nr.js → chunk-ttsqdsxr.js} +2 -2
- package/bin/chunk-v05d1aeq.js +2 -0
- package/bin/{chunk-yhj8c5re.js → chunk-v3j7acwn.js} +2 -2
- package/bin/{chunk-kpy0kpna.js → chunk-v98yavtp.js} +2 -2
- package/bin/chunk-vreq89j6.js +1 -0
- package/bin/{chunk-pqm0g14r.js → chunk-w1d5vmtc.js} +2 -2
- package/bin/chunk-w88219ex.js +3 -0
- package/bin/{chunk-vgvmt2m1.js → chunk-wbhsmhgp.js} +2 -2
- package/bin/{chunk-nwtb6dt1.js → chunk-wf4d1anc.js} +5 -5
- package/bin/{chunk-frm7vz6v.js → chunk-wfex9jw0.js} +2 -2
- package/bin/chunk-x9q2vzn8.js +7 -0
- package/bin/chunk-xv4mfppt.js +2 -0
- package/bin/{chunk-r3n9zpfw.js → chunk-y4s3xr4n.js} +2 -2
- package/bin/{chunk-9n0etqsy.js → chunk-ydagqpny.js} +1 -1
- package/bin/{chunk-aakzq0w1.js → chunk-ymyyap80.js} +1 -1
- package/bin/{chunk-5tmf3c0g.js → chunk-zn9jbc6t.js} +2 -2
- package/bin/{chunk-3rt9mnj3.js → chunk-ztmj61z9.js} +1 -1
- package/bin/shumai-app.html +1 -1
- package/bin/shumai-app.js +248 -247
- package/package.json +7 -7
- package/prisma/migrations/20260722022359_add_skill_permission/migration.sql +2 -0
- package/prisma/schema.prisma +1 -0
- package/bin/chunk-0at8vxt5.js +0 -3
- package/bin/chunk-0zv7f9ca.js +0 -2
- package/bin/chunk-2k4vp654.js +0 -2
- package/bin/chunk-2tbya52d.js +0 -2
- package/bin/chunk-2vs3evc7.js +0 -14
- package/bin/chunk-33169en9.js +0 -8
- package/bin/chunk-3m39v371.js +0 -1
- package/bin/chunk-6c4c7t0n.js +0 -1
- package/bin/chunk-6frqqxkv.js +0 -1
- package/bin/chunk-7rhjej0x.js +0 -3
- package/bin/chunk-7wvgtw25.js +0 -3
- package/bin/chunk-8s0ae37g.js +0 -1
- package/bin/chunk-94h8644q.js +0 -2
- package/bin/chunk-ac2ky3q0.js +0 -12
- package/bin/chunk-cthpdt54.js +0 -11
- package/bin/chunk-d0earxhc.js +0 -4
- package/bin/chunk-d0n8nxp3.js +0 -3
- package/bin/chunk-d22pyc5n.js +0 -1
- package/bin/chunk-dmgjse02.js +0 -4
- package/bin/chunk-g7wrxnmd.js +0 -1
- package/bin/chunk-jrvrg4fx.js +0 -1
- package/bin/chunk-k712q1zj.js +0 -2
- package/bin/chunk-kef0rnwn.js +0 -1
- package/bin/chunk-n296vcfw.js +0 -3
- package/bin/chunk-n6jgyv4y.js +0 -3
- package/bin/chunk-nar4s9v9.js +0 -3
- package/bin/chunk-nn8e9j7c.js +0 -1
- package/bin/chunk-qqesrgjk.js +0 -7
- package/bin/chunk-qz9xht6d.js +0 -2
- package/bin/chunk-symna5cj.js +0 -1
- package/bin/chunk-w4t9n9te.js +0 -6
- package/bin/chunk-z14hh99h.js +0 -2
|
@@ -38,4 +38,4 @@ If you understand the risks and have appropriate mitigations in place,
|
|
|
38
38
|
you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g.,
|
|
39
39
|
|
|
40
40
|
new Anthropic({ apiKey, dangerouslyAllowBrowser: true });
|
|
41
|
-
`);this.baseURL=W.baseURL,this.timeout=W.timeout??C0.DEFAULT_TIMEOUT,this.logger=W.logger??console;let J="warn";this.logLevel=J,this.logLevel=iZ(W.logLevel,"ClientOptions.logLevel",this)??iZ(GZ("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??J,this.fetchOptions=W.fetchOptions,this.maxRetries=W.maxRetries??2,this.fetch=W.fetch??D0(),G(this,vZ,P0,"f"),this._options=W,this.apiKey=typeof Z==="string"?Z:null,this.authToken=$}withOptions(X){return new this.constructor({...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,authToken:this.authToken,...X})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:X,nulls:Z}){if(X.get("x-api-key")||X.get("authorization"))return;if(this.apiKey&&X.get("x-api-key"))return;if(Z.has("x-api-key"))return;if(this.authToken&&X.get("authorization"))return;if(Z.has("authorization"))return;throw Error('Could not resolve authentication method. Expected either apiKey or authToken to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}async authHeaders(X){return w([await this.apiKeyAuth(X),await this.bearerAuth(X)])}async apiKeyAuth(X){if(this.apiKey==null)return;return w([{"X-Api-Key":this.apiKey}])}async bearerAuth(X){if(this.authToken==null)return;return w([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(X){return k0(X)}getUserAgent(){return`${this.constructor.name}/JS ${m}`}defaultIdempotencyKey(){return`stainless-node-retry-${cZ()}`}makeStatusError(X,Z,$,z){return A.generate(X,Z,$,z)}buildURL(X,Z,$){let z=!Y(this,U0,"m",Q1).call(this)&&$||this.baseURL,W=E0(X)?new URL(X):new URL(z+(z.endsWith("/")&&X.startsWith("/")?X.slice(1):X)),J=this.defaultQuery(),Q=Object.fromEntries(W.searchParams);if(!uZ(J)||!uZ(Q))Z={...Q,...J,...Z};if(typeof Z==="object"&&Z&&!Array.isArray(Z))W.search=this.stringifyQuery(Z);return W.toString()}_calculateNonstreamingTimeout(X){if(3600*X/128000>600)throw new N("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 600000}async prepareOptions(X){}async prepareRequest(X,{url:Z,options:$}){}get(X,Z){return this.methodRequest("get",X,Z)}post(X,Z){return this.methodRequest("post",X,Z)}patch(X,Z){return this.methodRequest("patch",X,Z)}put(X,Z){return this.methodRequest("put",X,Z)}delete(X,Z){return this.methodRequest("delete",X,Z)}methodRequest(X,Z,$){return this.request(Promise.resolve($).then((z)=>{return{method:X,path:Z,...z}}))}request(X,Z=null){return new r(this,this.makeRequest(X,Z,void 0))}async makeRequest(X,Z,$){let z=await X,W=z.maxRetries??this.maxRetries;if(Z==null)Z=W;await this.prepareOptions(z);let{req:J,url:Q,timeout:K}=await this.buildRequest(z,{retryCount:W-Z});await this.prepareRequest(J,{url:Q,options:z});let x="log_"+(Math.random()*16777216|0).toString(16).padStart(6,"0"),E=$===void 0?"":`, retryOf: ${$}`,O=Date.now();if(T(this).debug(`[${x}] sending request`,g({retryOfRequestLogID:$,method:z.method,url:Q,options:z,headers:J.headers})),z.signal?.aborted)throw new L;let k=new AbortController,C=await this.fetchWithTimeout(Q,J,K,k).catch(MX),F=Date.now();if(C instanceof globalThis.Error){let h=`retrying, ${Z} attempts remaining`;if(z.signal?.aborted)throw new L;let _=b(C)||/timed? ?out/i.test(String(C)+("cause"in C?String(C.cause):""));if(Z)return T(this).info(`[${x}] connection ${_?"timed out":"failed"} - ${h}`),T(this).debug(`[${x}] connection ${_?"timed out":"failed"} (${h})`,g({retryOfRequestLogID:$,url:Q,durationMs:F-O,message:C.message})),this.retryRequest(z,Z,$??x);if(T(this).info(`[${x}] connection ${_?"timed out":"failed"} - error; no more retries left`),T(this).debug(`[${x}] connection ${_?"timed out":"failed"} (error; no more retries left)`,g({retryOfRequestLogID:$,url:Q,durationMs:F-O,message:C.message})),_)throw new EX;throw new o({cause:C})}let a=[...C.headers.entries()].filter(([h])=>h==="request-id").map(([h,_])=>", "+h+": "+JSON.stringify(_)).join(""),OX=`[${x}${E}${a}] ${J.method} ${Q} ${C.ok?"succeeded":"failed"} with status ${C.status} in ${F-O}ms`;if(!C.ok){let h=await this.shouldRetry(C);if(Z&&h){let NZ=`retrying, ${Z} attempts remaining`;return await f0(C.body),T(this).info(`${OX} - ${NZ}`),T(this).debug(`[${x}] response error (${NZ})`,g({retryOfRequestLogID:$,url:C.url,status:C.status,headers:C.headers,durationMs:F-O})),this.retryRequest(z,Z,$??x,C.headers)}let _=h?"error; no more retries left":"error; not retryable";T(this).info(`${OX} - ${_}`);let q0=await C.text().catch((NZ)=>MX(NZ).message),O0=UZ(q0),M0=O0?void 0:q0;throw T(this).debug(`[${x}] response error (${_})`,g({retryOfRequestLogID:$,url:C.url,status:C.status,headers:C.headers,message:M0,durationMs:Date.now()-O})),this.makeStatusError(C.status,O0,M0,C.headers)}return T(this).info(OX),T(this).debug(`[${x}] response start`,g({retryOfRequestLogID:$,url:C.url,status:C.status,headers:C.headers,durationMs:F-O})),{response:C,options:z,controller:k,requestLogID:x,retryOfRequestLogID:$,startTime:O}}getAPIList(X,Z,$){return this.requestAPIList(Z,$&&"then"in $?$.then((z)=>({method:"get",path:X,...z})):{method:"get",path:X,...$})}requestAPIList(X,Z){let $=this.makeRequest(Z,null,void 0);return new AZ(this,$,X)}async fetchWithTimeout(X,Z,$,z){let{signal:W,method:J,...Q}=Z||{},K=this._makeAbort(z);if(W)W.addEventListener("abort",K,{once:!0});let x=setTimeout(K,$),E=globalThis.ReadableStream&&Q.body instanceof globalThis.ReadableStream||typeof Q.body==="object"&&Q.body!==null&&Symbol.asyncIterator in Q.body,O={signal:z.signal,...E?{duplex:"half"}:{},method:"GET",...Q};if(J)O.method=J.toUpperCase();try{return await this.fetch.call(void 0,X,O)}finally{clearTimeout(x)}}async shouldRetry(X){let Z=X.headers.get("x-should-retry");if(Z==="true")return!0;if(Z==="false")return!1;if(X.status===408)return!0;if(X.status===409)return!0;if(X.status===429)return!0;if(X.status>=500)return!0;return!1}async retryRequest(X,Z,$,z){let W,J=z?.get("retry-after-ms");if(J){let K=parseFloat(J);if(!Number.isNaN(K))W=K}let Q=z?.get("retry-after");if(Q&&!W){let K=parseFloat(Q);if(!Number.isNaN(K))W=K*1000;else W=Date.parse(Q)-Date.now()}if(W===void 0){let K=X.maxRetries??this.maxRetries;W=this.calculateDefaultRetryTimeoutMillis(Z,K)}return await F0(W),this.makeRequest(X,Z-1,$)}calculateDefaultRetryTimeoutMillis(X,Z){let W=Z-X,J=Math.min(0.5*Math.pow(2,W),8),Q=1-Math.random()*0.25;return J*Q*1000}calculateNonstreamingTimeout(X,Z){if(3600000*X/128000>600000||Z!=null&&X>Z)throw new N("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 600000}async buildRequest(X,{retryCount:Z=0}={}){let $={...X},{method:z,path:W,query:J,defaultBaseURL:Q}=$,K=this.buildURL(W,J,Q);if("timeout"in $)H0("timeout",$.timeout);$.timeout=$.timeout??this.timeout;let{bodyHeaders:x,body:E}=this.buildBody({options:$}),O=await this.buildHeaders({options:X,method:z,bodyHeaders:x,retryCount:Z});return{req:{method:z,headers:O,...$.signal&&{signal:$.signal},...globalThis.ReadableStream&&E instanceof globalThis.ReadableStream&&{duplex:"half"},...E&&{body:E},...this.fetchOptions??{},...$.fetchOptions??{}},url:K,timeout:$.timeout}}async buildHeaders({options:X,method:Z,bodyHeaders:$,retryCount:z}){let W={};if(this.idempotencyHeader&&Z!=="get"){if(!X.idempotencyKey)X.idempotencyKey=this.defaultIdempotencyKey();W[this.idempotencyHeader]=X.idempotencyKey}let J=w([W,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(z),...X.timeout?{"X-Stainless-Timeout":String(Math.trunc(X.timeout/1000))}:{},...B0(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(X),this._options.defaultHeaders,$,X.headers]);return this.validateHeaders(J),J.values}_makeAbort(X){return()=>X.abort()}buildBody({options:{body:X,headers:Z}}){if(!X)return{bodyHeaders:void 0,body:void 0};let $=w([Z]);if(ArrayBuffer.isView(X)||X instanceof ArrayBuffer||X instanceof DataView||typeof X==="string"&&$.values.has("content-type")||globalThis.Blob&&X instanceof globalThis.Blob||X instanceof FormData||X instanceof URLSearchParams||globalThis.ReadableStream&&X instanceof globalThis.ReadableStream)return{bodyHeaders:void 0,body:X};else if(typeof X==="object"&&((Symbol.asyncIterator in X)||(Symbol.iterator in X)&&("next"in X)&&typeof X.next==="function"))return{bodyHeaders:void 0,body:CZ(X)};else if(typeof X==="object"&&$.values.get("content-type")==="application/x-www-form-urlencoded")return{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(X)};else return Y(this,vZ,"f").call(this,{body:X,headers:$})}}C0=M,vZ=new WeakMap,U0=new WeakSet,Q1=function(){return this.baseURL!=="https://api.anthropic.com"};M.Anthropic=C0;M.HUMAN_PROMPT=V1;M.AI_PROMPT=G1;M.DEFAULT_TIMEOUT=600000;M.AnthropicError=N;M.APIError=A;M.APIConnectionError=o;M.APIConnectionTimeoutError=EX;M.APIUserAbortError=L;M.NotFoundError=TX;M.ConflictError=LX;M.RateLimitError=jX;M.BadRequestError=AX;M.AuthenticationError=HX;M.InternalServerError=BX;M.PermissionDeniedError=FX;M.UnprocessableEntityError=SX;M.toFile=HZ;class WX extends M{constructor(){super(...arguments);this.completions=new UX(this),this.messages=new zX(this),this.models=new qX(this),this.beta=new S(this)}}WX.Completions=UX;WX.Messages=zX;WX.Models=qX;WX.Beta=S;export{WX as
|
|
41
|
+
`);this.baseURL=W.baseURL,this.timeout=W.timeout??C0.DEFAULT_TIMEOUT,this.logger=W.logger??console;let J="warn";this.logLevel=J,this.logLevel=iZ(W.logLevel,"ClientOptions.logLevel",this)??iZ(GZ("ANTHROPIC_LOG"),"process.env['ANTHROPIC_LOG']",this)??J,this.fetchOptions=W.fetchOptions,this.maxRetries=W.maxRetries??2,this.fetch=W.fetch??D0(),G(this,vZ,P0,"f"),this._options=W,this.apiKey=typeof Z==="string"?Z:null,this.authToken=$}withOptions(X){return new this.constructor({...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,authToken:this.authToken,...X})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:X,nulls:Z}){if(X.get("x-api-key")||X.get("authorization"))return;if(this.apiKey&&X.get("x-api-key"))return;if(Z.has("x-api-key"))return;if(this.authToken&&X.get("authorization"))return;if(Z.has("authorization"))return;throw Error('Could not resolve authentication method. Expected either apiKey or authToken to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted')}async authHeaders(X){return w([await this.apiKeyAuth(X),await this.bearerAuth(X)])}async apiKeyAuth(X){if(this.apiKey==null)return;return w([{"X-Api-Key":this.apiKey}])}async bearerAuth(X){if(this.authToken==null)return;return w([{Authorization:`Bearer ${this.authToken}`}])}stringifyQuery(X){return k0(X)}getUserAgent(){return`${this.constructor.name}/JS ${m}`}defaultIdempotencyKey(){return`stainless-node-retry-${cZ()}`}makeStatusError(X,Z,$,z){return A.generate(X,Z,$,z)}buildURL(X,Z,$){let z=!Y(this,U0,"m",Q1).call(this)&&$||this.baseURL,W=E0(X)?new URL(X):new URL(z+(z.endsWith("/")&&X.startsWith("/")?X.slice(1):X)),J=this.defaultQuery(),Q=Object.fromEntries(W.searchParams);if(!uZ(J)||!uZ(Q))Z={...Q,...J,...Z};if(typeof Z==="object"&&Z&&!Array.isArray(Z))W.search=this.stringifyQuery(Z);return W.toString()}_calculateNonstreamingTimeout(X){if(3600*X/128000>600)throw new N("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#streaming-responses for more details");return 600000}async prepareOptions(X){}async prepareRequest(X,{url:Z,options:$}){}get(X,Z){return this.methodRequest("get",X,Z)}post(X,Z){return this.methodRequest("post",X,Z)}patch(X,Z){return this.methodRequest("patch",X,Z)}put(X,Z){return this.methodRequest("put",X,Z)}delete(X,Z){return this.methodRequest("delete",X,Z)}methodRequest(X,Z,$){return this.request(Promise.resolve($).then((z)=>{return{method:X,path:Z,...z}}))}request(X,Z=null){return new r(this,this.makeRequest(X,Z,void 0))}async makeRequest(X,Z,$){let z=await X,W=z.maxRetries??this.maxRetries;if(Z==null)Z=W;await this.prepareOptions(z);let{req:J,url:Q,timeout:K}=await this.buildRequest(z,{retryCount:W-Z});await this.prepareRequest(J,{url:Q,options:z});let x="log_"+(Math.random()*16777216|0).toString(16).padStart(6,"0"),E=$===void 0?"":`, retryOf: ${$}`,O=Date.now();if(T(this).debug(`[${x}] sending request`,g({retryOfRequestLogID:$,method:z.method,url:Q,options:z,headers:J.headers})),z.signal?.aborted)throw new L;let k=new AbortController,C=await this.fetchWithTimeout(Q,J,K,k).catch(MX),F=Date.now();if(C instanceof globalThis.Error){let h=`retrying, ${Z} attempts remaining`;if(z.signal?.aborted)throw new L;let _=b(C)||/timed? ?out/i.test(String(C)+("cause"in C?String(C.cause):""));if(Z)return T(this).info(`[${x}] connection ${_?"timed out":"failed"} - ${h}`),T(this).debug(`[${x}] connection ${_?"timed out":"failed"} (${h})`,g({retryOfRequestLogID:$,url:Q,durationMs:F-O,message:C.message})),this.retryRequest(z,Z,$??x);if(T(this).info(`[${x}] connection ${_?"timed out":"failed"} - error; no more retries left`),T(this).debug(`[${x}] connection ${_?"timed out":"failed"} (error; no more retries left)`,g({retryOfRequestLogID:$,url:Q,durationMs:F-O,message:C.message})),_)throw new EX;throw new o({cause:C})}let a=[...C.headers.entries()].filter(([h])=>h==="request-id").map(([h,_])=>", "+h+": "+JSON.stringify(_)).join(""),OX=`[${x}${E}${a}] ${J.method} ${Q} ${C.ok?"succeeded":"failed"} with status ${C.status} in ${F-O}ms`;if(!C.ok){let h=await this.shouldRetry(C);if(Z&&h){let NZ=`retrying, ${Z} attempts remaining`;return await f0(C.body),T(this).info(`${OX} - ${NZ}`),T(this).debug(`[${x}] response error (${NZ})`,g({retryOfRequestLogID:$,url:C.url,status:C.status,headers:C.headers,durationMs:F-O})),this.retryRequest(z,Z,$??x,C.headers)}let _=h?"error; no more retries left":"error; not retryable";T(this).info(`${OX} - ${_}`);let q0=await C.text().catch((NZ)=>MX(NZ).message),O0=UZ(q0),M0=O0?void 0:q0;throw T(this).debug(`[${x}] response error (${_})`,g({retryOfRequestLogID:$,url:C.url,status:C.status,headers:C.headers,message:M0,durationMs:Date.now()-O})),this.makeStatusError(C.status,O0,M0,C.headers)}return T(this).info(OX),T(this).debug(`[${x}] response start`,g({retryOfRequestLogID:$,url:C.url,status:C.status,headers:C.headers,durationMs:F-O})),{response:C,options:z,controller:k,requestLogID:x,retryOfRequestLogID:$,startTime:O}}getAPIList(X,Z,$){return this.requestAPIList(Z,$&&"then"in $?$.then((z)=>({method:"get",path:X,...z})):{method:"get",path:X,...$})}requestAPIList(X,Z){let $=this.makeRequest(Z,null,void 0);return new AZ(this,$,X)}async fetchWithTimeout(X,Z,$,z){let{signal:W,method:J,...Q}=Z||{},K=this._makeAbort(z);if(W)W.addEventListener("abort",K,{once:!0});let x=setTimeout(K,$),E=globalThis.ReadableStream&&Q.body instanceof globalThis.ReadableStream||typeof Q.body==="object"&&Q.body!==null&&Symbol.asyncIterator in Q.body,O={signal:z.signal,...E?{duplex:"half"}:{},method:"GET",...Q};if(J)O.method=J.toUpperCase();try{return await this.fetch.call(void 0,X,O)}finally{clearTimeout(x)}}async shouldRetry(X){let Z=X.headers.get("x-should-retry");if(Z==="true")return!0;if(Z==="false")return!1;if(X.status===408)return!0;if(X.status===409)return!0;if(X.status===429)return!0;if(X.status>=500)return!0;return!1}async retryRequest(X,Z,$,z){let W,J=z?.get("retry-after-ms");if(J){let K=parseFloat(J);if(!Number.isNaN(K))W=K}let Q=z?.get("retry-after");if(Q&&!W){let K=parseFloat(Q);if(!Number.isNaN(K))W=K*1000;else W=Date.parse(Q)-Date.now()}if(W===void 0){let K=X.maxRetries??this.maxRetries;W=this.calculateDefaultRetryTimeoutMillis(Z,K)}return await F0(W),this.makeRequest(X,Z-1,$)}calculateDefaultRetryTimeoutMillis(X,Z){let W=Z-X,J=Math.min(0.5*Math.pow(2,W),8),Q=1-Math.random()*0.25;return J*Q*1000}calculateNonstreamingTimeout(X,Z){if(3600000*X/128000>600000||Z!=null&&X>Z)throw new N("Streaming is required for operations that may take longer than 10 minutes. See https://github.com/anthropics/anthropic-sdk-typescript#long-requests for more details");return 600000}async buildRequest(X,{retryCount:Z=0}={}){let $={...X},{method:z,path:W,query:J,defaultBaseURL:Q}=$,K=this.buildURL(W,J,Q);if("timeout"in $)H0("timeout",$.timeout);$.timeout=$.timeout??this.timeout;let{bodyHeaders:x,body:E}=this.buildBody({options:$}),O=await this.buildHeaders({options:X,method:z,bodyHeaders:x,retryCount:Z});return{req:{method:z,headers:O,...$.signal&&{signal:$.signal},...globalThis.ReadableStream&&E instanceof globalThis.ReadableStream&&{duplex:"half"},...E&&{body:E},...this.fetchOptions??{},...$.fetchOptions??{}},url:K,timeout:$.timeout}}async buildHeaders({options:X,method:Z,bodyHeaders:$,retryCount:z}){let W={};if(this.idempotencyHeader&&Z!=="get"){if(!X.idempotencyKey)X.idempotencyKey=this.defaultIdempotencyKey();W[this.idempotencyHeader]=X.idempotencyKey}let J=w([W,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(z),...X.timeout?{"X-Stainless-Timeout":String(Math.trunc(X.timeout/1000))}:{},...B0(),...this._options.dangerouslyAllowBrowser?{"anthropic-dangerous-direct-browser-access":"true"}:void 0,"anthropic-version":"2023-06-01"},await this.authHeaders(X),this._options.defaultHeaders,$,X.headers]);return this.validateHeaders(J),J.values}_makeAbort(X){return()=>X.abort()}buildBody({options:{body:X,headers:Z}}){if(!X)return{bodyHeaders:void 0,body:void 0};let $=w([Z]);if(ArrayBuffer.isView(X)||X instanceof ArrayBuffer||X instanceof DataView||typeof X==="string"&&$.values.has("content-type")||globalThis.Blob&&X instanceof globalThis.Blob||X instanceof FormData||X instanceof URLSearchParams||globalThis.ReadableStream&&X instanceof globalThis.ReadableStream)return{bodyHeaders:void 0,body:X};else if(typeof X==="object"&&((Symbol.asyncIterator in X)||(Symbol.iterator in X)&&("next"in X)&&typeof X.next==="function"))return{bodyHeaders:void 0,body:CZ(X)};else if(typeof X==="object"&&$.values.get("content-type")==="application/x-www-form-urlencoded")return{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(X)};else return Y(this,vZ,"f").call(this,{body:X,headers:$})}}C0=M,vZ=new WeakMap,U0=new WeakSet,Q1=function(){return this.baseURL!=="https://api.anthropic.com"};M.Anthropic=C0;M.HUMAN_PROMPT=V1;M.AI_PROMPT=G1;M.DEFAULT_TIMEOUT=600000;M.AnthropicError=N;M.APIError=A;M.APIConnectionError=o;M.APIConnectionTimeoutError=EX;M.APIUserAbortError=L;M.NotFoundError=TX;M.ConflictError=LX;M.RateLimitError=jX;M.BadRequestError=AX;M.AuthenticationError=HX;M.InternalServerError=BX;M.PermissionDeniedError=FX;M.UnprocessableEntityError=SX;M.toFile=HZ;class WX extends M{constructor(){super(...arguments);this.completions=new UX(this),this.messages=new zX(this),this.models=new qX(this),this.beta=new S(this)}}WX.Completions=UX;WX.Messages=zX;WX.Models=qX;WX.Beta=S;export{WX as lk};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{td as Z,ud as v}from"./chunk-9h3ds7rn.js";import{fe as $,ge as h}from"./chunk-n4meg9wb.js";import"./chunk-976v5s8y.js";var F=class extends v{},G=class{#j;#z;constructor(j){this.#j={...j}}async init(){if(this.#z=new M(this.#j.database),this.#j.onCreateConnection)await this.#j.onCreateConnection(this.#z)}async acquireConnection(){return this.#z}async beginTransaction(){throw Error("D1 does not support interactive transactions. Use the D1 batch() API instead.")}async commitTransaction(){throw Error("D1 does not support interactive transactions. Use the D1 batch() API instead.")}async rollbackTransaction(){throw Error("D1 does not support interactive transactions. Use the D1 batch() API instead.")}async releaseConnection(){}async destroy(){}},M=class{#j;constructor(j){this.#j=j}async executeQuery(j){let z=await this.#j.prepare(j.sql).bind(...j.parameters).all(),J=z.meta.changes!=null?BigInt(z.meta.changes):void 0;return{insertId:z.meta.last_row_id===void 0||z.meta.last_row_id===null?void 0:BigInt(z.meta.last_row_id),rows:z?.results||[],numAffectedRows:J}}async*streamQuery(){throw Error("D1 does not support streaming queries.")}},N=class{#j;#z;constructor(j,z){this.#j=j,this.#z=z}async getSchemas(){return[]}async getTables(j={withInternalKyselyTables:!1}){let z=this.#j.selectFrom("sqlite_master").where("type","in",["table","view"]).where("name","not like","sqlite_%").where("name","not like","_cf_%").select(["name","type","sql"]).$castTo();if(!j.withInternalKyselyTables)z=z.where("name","!=",$).where("name","!=",h);let J=await z.execute();if(J.length===0)return[];let w=J.map((V)=>this.#z.prepare("SELECT * FROM pragma_table_info(?)").bind(V.name)),K=await this.#z.batch(w);return J.map((V,x)=>{let Y=K[x]?.results??[],W=V.sql?.split(/[(),]/)?.find((H)=>H.toLowerCase().includes("autoincrement"))?.split(/\s+/)?.filter(Boolean)?.[0]?.replace(/["`]/g,"");if(!W){let H=Y.filter((B)=>B.pk>0),X=H.length===1?H[0]:void 0;if(X&&X.type.toLowerCase()==="integer")W=X.name}return{name:V.name,isView:V.type==="view",columns:Y.map((H)=>({name:H.name,dataType:H.type,isNullable:!H.notnull,isAutoIncrementing:H.name===W,hasDefaultValue:H.dflt_value!=null}))}})}async getMetadata(j){return{tables:await this.getTables(j)}}},U=class extends Z{},P=class{#j;constructor(j){this.#j={...j}}createDriver(){return new G(this.#j)}createQueryCompiler(){return new U}createAdapter(){return new F}createIntrospector(j){return new N(j,this.#j.database)}};export{P as D1SqliteDialect};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as d,b as x,c as r,d as D,e as G,f as M}from"./chunk-w1d5vmtc.js";import{fa as m}from"./chunk-mk1jewvw.js";import{Va as p}from"./chunk-v98yavtp.js";import"./chunk-azfgjqjx.js";import"./chunk-sy8rqacm.js";import{jf as I}from"./chunk-82w2419d.js";import{zf as g}from"./chunk-zn9jbc6t.js";import{og as f,pg as u}from"./chunk-2xnys7v4.js";import{Dh as h,Ij as F,Jj as P,Kj as T,Rg as o,Sg as y,Sh as z,Tg as q,Ug as K,Wh as C,Yg as R,Zj as Y,_g as k,_j as b,dh as v,ih as L,uh as N,wi as S}from"./chunk-wf4d1anc.js";import{Pk as t}from"./chunk-976v5s8y.js";var Z=t(o(),1);var s=(X)=>{if(!X)return"??";return X.split(" ").map((_)=>_[0]).slice(0,2).join("").toUpperCase()};function e(){let{projectId:X}=qq.useParams(),{teamId:_,ensureTeamIdForProject:E}=b(),j=v();Z.useEffect(()=>{E(X)},[X,E]);let{data:O}=R(I(X)),W=O?.rootFolder,[n,i]=Z.useState(240),{fileListLeftSidebarCollapsed:A,setFileListLeftSidebarCollapsed:c}=u(),{data:B,isLoading:a,fetchNextPage:Q,hasNextPage:V,isFetchingNextPage:U}=k({queryKey:["collections",X],queryFn:async({pageParam:J})=>{let $=await N.api.projects[":projectId"].collections.$get({param:{projectId:X},query:{first:"20",after:J}});if(!$.ok)throw Error("Failed to fetch collections");return await $.json()},initialPageParam:"",getNextPageParam:(J)=>J.pageInfo?.cursor||void 0,enabled:!!X}),{ref:l,inView:H}=f();Z.useEffect(()=>{if(H&&V&&!U)Q()},[H,V,U,Q]);let w=Z.useMemo(()=>B?.pages.flatMap((J)=>J.data)||[],[B]);if(!_||!W||!O)return q(g,{});return q("div",{className:"flex flex-1 flex-col bg-background min-h-0",children:K("div",{className:"flex flex-1 overflow-hidden relative",children:[!A&&q("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>c(!0)}),!A&&K(y,{children:[q("div",{className:"bg-background",style:{width:n},children:q(m,{teamId:_,projectId:X,projectName:O.name??"",rootFolderId:W})}),q(p,{onResize:(J)=>{i(($)=>Math.max(180,Math.min(400,$+J)))},className:"hidden md:block"})]}),K("div",{className:"flex-1 flex flex-col min-h-0 bg-card overflow-hidden",children:[q("header",{className:"h-14 border-b flex items-center justify-between px-6 shrink-0 bg-background/50 backdrop-blur-sm sticky top-0 z-10",children:K("div",{className:"flex items-center gap-2",children:[q(z,{className:"h-5 w-5 text-primary"}),q("h1",{className:"font-bold text-lg text-foreground",children:Y.all_collections()})]})}),q("div",{className:"flex-1 overflow-y-auto p-6",children:a?q("div",{className:"flex justify-center items-center h-64",children:q("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):w.length===0?K("div",{className:"flex flex-col items-center justify-center h-64 text-muted-foreground gap-3",children:[q(S,{className:"h-10 w-10 text-muted-foreground/50"}),q("p",{children:Y.no_collections_yet()})]}):K("div",{className:"border border-border rounded-xl bg-background overflow-hidden shadow-xs",children:[K(d,{children:[q(x,{children:K(D,{className:"hover:bg-transparent bg-muted/20",children:[q(G,{className:"font-semibold px-4 py-3",children:Y.collection_name()}),q(G,{className:"font-semibold px-4 py-3",children:Y.creator()}),q(G,{className:"font-semibold px-4 py-3 w-[200px]",children:Y.created_date()})]})}),q(r,{children:w.map((J)=>K(D,{className:"hover:bg-muted/10 transition-colors cursor-pointer",onClick:()=>j({to:"/projects/$projectId/collections/$collectionId",params:{projectId:X,collectionId:J.id}}),children:[q(M,{className:"font-medium px-4 py-3.5",children:K("div",{className:"flex items-center gap-2",children:[q(z,{className:"h-4 w-4 text-primary shrink-0"}),q("span",{className:"text-foreground font-semibold hover:underline",children:J.name})]})}),q(M,{className:"px-4 py-3.5",children:K("div",{className:"flex items-center gap-2",children:[K(F,{className:"h-6 w-6",children:[J.creator?.image&&q(P,{src:J.creator.image,alt:J.creator.name,className:"object-cover"}),q(T,{className:"text-[10px]",children:s(J.creator?.name)})]}),q("span",{className:"text-sm font-medium text-foreground truncate max-w-[200px]",children:J.creator?.name||Y.unknown()})]})}),q(M,{className:"px-4 py-3.5 text-muted-foreground text-sm",children:K("div",{className:"flex items-center gap-2",children:[q(C,{className:"h-3.5 w-3.5 text-muted-foreground/70"}),q("span",{children:new Date(J.createdAt).toLocaleDateString()})]})})]},J.id))})]}),q("div",{ref:l,className:"h-10 w-full flex items-center justify-center",children:U&&q(h,{className:"h-6 w-6 animate-spin text-primary"})})]})})]})]})})}var qq=L("/projects/$projectId/collections/")({component:e});export{qq as Route};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{B as
|
|
1
|
+
import{zf as A}from"./chunk-zn9jbc6t.js";import{Tg as v,hh as w,uh as z}from"./chunk-wf4d1anc.js";var B=(b)=>({queryKey:["projects",b],queryFn:async()=>{let h=await z.api.projects[":projectId"].$get({param:{projectId:b}});if(!h.ok)throw Error("Failed to fetch project");return await h.json()}}),H=w("/projects/$projectId/recently-deleted")({loader:({context:{queryClient:b},params:{projectId:h}})=>b.ensureQueryData(B(h)),pendingComponent:()=>v(A,{})});
|
|
2
|
+
export{B as ff,H as gf};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{$a as o,_a as s,ab as r,bb as m,cb as e,db as qq,eb as Eq,fb as Jq}from"./chunk-
|
|
2
|
-
export{Cq as
|
|
1
|
+
import{$a as o,_a as s,ab as r,bb as m,cb as e,db as qq,eb as Eq,fb as Jq}from"./chunk-sy8rqacm.js";import{Dh as $,Hj as Q,Ij as c,Jj as T,Kj as w,Lj as H,Nj as z,Oj as y,Qj as F,Rg as yq,Rj as X,Sg as j,Tg as E,Ug as K,Zh as f,Zj as J,ak as d,bk as b,cj as i,ck as a,dk as t,fk as n,gi as l,sh as P}from"./chunk-wf4d1anc.js";import{Pk as zq}from"./chunk-976v5s8y.js";var V=zq(yq(),1);function Cq({open:Kq,onOpenChange:Nq,title:Pq,members:A,isOwner:B,onInvite:S,onUpdateRole:D,onRemoveMember:R,currentUserId:Qq,availableMembersToAdd:k,onAddMember:I,type:Vq="team"}){let[G,g]=V.useState("editor"),[Z,M]=V.useState(null),[v,u]=V.useState(!1),[L,_]=V.useState(null),[Y,h]=V.useState(null),[Wq,p]=V.useState({}),[U,O]=V.useState(null),C=(q)=>{if(!q)return"";switch(q.toLowerCase()){case"owner":return J.owner();case"editor":return J.editor();case"reviewer":return J.reviewer();default:return q}},Xq=(q,N)=>{p((W)=>({...W,[q]:N}))},Yq=async(q,N)=>{if(!D)return;_(q);try{await D(q,N),P.success(J.member_role_updated())}catch(W){console.error(W),P.error(J.failed_to_update_member_role())}finally{_(null)}},Zq=async()=>{if(!R||!Y?.id)return;_(Y.id);try{await R(Y.id),P.success(J.member_removed()),h(null)}catch(q){console.error(q),P.error(J.failed_to_remove_member())}finally{_(null)}},_q=async()=>{if(!S)return;u(!0);try{let q=await S(G),N=`${window.location.origin}/signup?inviteCode=${q}`;M(N)}catch(q){console.error(q),P.error(J.failed_to_generate_invite_link())}finally{u(!1)}},$q=()=>{if(Z)navigator.clipboard.writeText(Z),P.success(J.invite_link_copied())},x=(q)=>{if(!q)return"??";return q.split(" ").map((N)=>N[0]).slice(0,2).join("").toUpperCase()},fq=(q)=>{if(!q)M(null),g("editor"),p({}),O(null);Nq(q)},Hq=Array.isArray(A)?A:[];return E(b,{open:Kq,onOpenChange:fq,children:K(a,{className:"sm:max-w-md",onOpenAutoFocus:(q)=>q.preventDefault(),children:[E(t,{children:E(n,{children:Pq})}),K("div",{className:"space-y-4",children:[E("div",{className:"max-h-[300px] overflow-y-auto space-y-2",children:Hq.map((q)=>K("div",{className:"flex items-center justify-between p-2 rounded-lg hover:bg-muted/50",children:[K("div",{className:"flex items-center gap-3",children:[K(c,{children:[q.image&&E(T,{src:q.image,alt:q.name,className:"object-cover"}),E(w,{children:x(q.name)})]}),K("div",{className:"flex flex-col",children:[E("span",{className:"text-sm font-medium",children:q.name}),K("div",{className:"flex items-center gap-2",children:[E("span",{className:"text-xs text-muted-foreground capitalize",children:C(q.role)}),q.scope&&K(j,{children:[E("span",{className:"text-[10px] text-muted-foreground/70",children:"•"}),E("span",{className:"text-xs text-muted-foreground capitalize",children:q.scope==="team"?J.team_member():J.project_member()})]})]})]})]}),B&&q.role!=="owner"&&q.id!==Qq&&K("div",{className:"flex items-center gap-2",children:[K(H,{children:[E(z,{asChild:!0,children:K(Q,{variant:"outline",size:"sm",className:"h-8 px-2 text-xs capitalize w-26",disabled:L===q.id,children:[C(q.role),E(f,{className:"ml-1 h-3 w-3 opacity-50"})]})}),E(y,{children:K(F,{value:q.role,onValueChange:(N)=>Yq(q.id,N),children:[E(X,{value:"editor",className:"text-xs",children:J.editor()}),E(X,{value:"reviewer",className:"text-xs",children:J.reviewer()})]})})]}),E(Q,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:text-destructive hover:bg-destructive/10",onClick:()=>h(q),disabled:L===q.id,children:L===q.id?E($,{className:"h-3 w-3 animate-spin"}):E(i,{className:"h-3 w-3"})})]})]},q.id))}),E(s,{open:!!Y,onOpenChange:(q)=>!q&&h(null),children:K(o,{children:[K(r,{children:[E(e,{children:J.remove_member()}),E(qq,{children:J.remove_member_confirmation({name:Y?.name||"",type:Vq==="project"?J.project():J.team()})})]}),K(m,{children:[E(Jq,{children:J.cancel()}),E(Eq,{onClick:Zq,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:J.remove()})]})]})})," ",B&&I&&k&&k.length>0&&K("div",{className:"border-t pt-4",children:[E("h4",{className:"text-sm font-medium mb-3",children:J.add_team_member_to_project()}),E("div",{className:"max-h-[200px] overflow-y-auto space-y-2 pr-1",children:k.map((q)=>{let N=Wq[q.id]||"editor";return K("div",{className:"flex items-center justify-between p-2 rounded-lg hover:bg-muted/50",children:[K("div",{className:"flex items-center gap-3",children:[K(c,{children:[q.image&&E(T,{src:q.image,alt:q.name,className:"object-cover"}),E(w,{children:x(q.name)})]}),K("div",{className:"flex flex-col",children:[E("span",{className:"text-sm font-medium",children:q.name}),E("span",{className:"text-xs text-muted-foreground capitalize",children:q.scope==="team"?J.team_member():J.project_member()})]})]}),K("div",{className:"flex items-center gap-2",children:[K(H,{children:[E(z,{asChild:!0,children:K(Q,{variant:"outline",size:"sm",className:"h-8 px-2 text-xs capitalize w-26",disabled:U===q.id,children:[C(N),E(f,{className:"ml-1 h-3 w-3 opacity-50"})]})}),E(y,{children:K(F,{value:N,onValueChange:(W)=>Xq(q.id,W),children:[E(X,{value:"editor",className:"text-xs",children:J.editor()}),E(X,{value:"reviewer",className:"text-xs",children:J.reviewer()})]})})]}),E(Q,{onClick:async()=>{O(q.id);try{await I(q.id,N),P.success(J.added_member_successfully({name:q.name||""}))}catch(W){console.error(W),P.error(J.failed_to_add_member({name:q.name||""}))}finally{O(null)}},disabled:U!==null,size:"sm",className:"h-8 text-xs px-3 w-[60px]",children:U===q.id?E($,{className:"h-3 w-3 animate-spin"}):J.add()})]})]},q.id)})})]}),B&&S&&K("div",{className:"border-t pt-4",children:[E("h4",{className:"text-sm font-medium mb-3",children:J.invite_new_member()}),K("div",{className:"space-y-3",children:[K("div",{className:"flex gap-2",children:[K(H,{children:[E(z,{asChild:!0,children:K(Q,{variant:"outline",className:"w-[120px] justify-between",children:[G==="editor"?J.editor():J.reviewer(),E(f,{className:"h-4 w-4 opacity-50"})]})}),E(y,{children:K(F,{value:G,onValueChange:(q)=>g(q),children:[E(X,{value:"editor",children:J.editor()}),E(X,{value:"reviewer",children:J.reviewer()})]})})]}),K(Q,{onClick:_q,disabled:v,className:"flex-1",children:[v&&E($,{className:"mr-2 h-4 w-4 animate-spin"}),J.generate_link()]})]}),Z&&K("div",{className:"flex gap-2",children:[E(d,{value:Z,readOnly:!0}),E(Q,{variant:"outline",size:"icon",onClick:$q,children:E(l,{className:"h-4 w-4"})})]})]})]})]})]})})}
|
|
2
|
+
export{Cq as Ya};
|