@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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shumai-one/shumai",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "A fullstack AI-powered media workspace and workflow engine",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
"zod": "4.4.3"
|
|
28
28
|
},
|
|
29
29
|
"optionalDependencies": {
|
|
30
|
-
"@shumai-one/shumai-darwin-arm64": "0.2.
|
|
31
|
-
"@shumai-one/shumai-darwin-x64": "0.2.
|
|
32
|
-
"@shumai-one/shumai-linux-arm64": "0.2.
|
|
33
|
-
"@shumai-one/shumai-linux-x64": "0.2.
|
|
34
|
-
"@shumai-one/shumai-win32-arm64": "0.2.
|
|
35
|
-
"@shumai-one/shumai-win32-x64": "0.2.
|
|
30
|
+
"@shumai-one/shumai-darwin-arm64": "0.2.1",
|
|
31
|
+
"@shumai-one/shumai-darwin-x64": "0.2.1",
|
|
32
|
+
"@shumai-one/shumai-linux-arm64": "0.2.1",
|
|
33
|
+
"@shumai-one/shumai-linux-x64": "0.2.1",
|
|
34
|
+
"@shumai-one/shumai-win32-arm64": "0.2.1",
|
|
35
|
+
"@shumai-one/shumai-win32-x64": "0.2.1"
|
|
36
36
|
},
|
|
37
37
|
"repository": {
|
|
38
38
|
"type": "git",
|
package/prisma/schema.prisma
CHANGED
|
@@ -262,6 +262,7 @@ model Skill {
|
|
|
262
262
|
config Json? @default("{}")
|
|
263
263
|
assetId String @map("asset_id")
|
|
264
264
|
hash String @map("hash")
|
|
265
|
+
permission TeamMemberRole @default(reviewer)
|
|
265
266
|
createdAt DateTime @default(now()) @map("created_at")
|
|
266
267
|
updatedAt DateTime @updatedAt @map("updated_at")
|
|
267
268
|
|
package/bin/chunk-0at8vxt5.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
function L(G,q,D){return{temperature:q?.temperature,maxTokens:q?.maxTokens,signal:q?.signal,apiKey:D||q?.apiKey,transport:q?.transport,cacheRetention:q?.cacheRetention,sessionId:q?.sessionId,headers:q?.headers,onPayload:q?.onPayload,onResponse:q?.onResponse,timeoutMs:q?.timeoutMs,maxRetries:q?.maxRetries,maxRetryDelayMs:q?.maxRetryDelayMs,metadata:q?.metadata}}function K(G){return G==="xhigh"?"high":G}function y(G,q,D,N){let _={...{minimal:1024,low:2048,medium:8192,high:16384},...N},O=1024,V=K(D),J=_[V],Q=G===void 0?q:Math.min(G+J,q);if(Q<=J)J=Math.max(0,Q-1024);return{maxTokens:Q,thinkingBudget:J}}function j(G,q){let D=[],N=!1;for(let Y of G){if(Y.type==="image"){if(!N)D.push({type:"text",text:q});N=!0;continue}D.push(Y),N=Y.text===q}return D}function U(G,q){if(q.input.includes("image"))return G;return G.map((D)=>{if(D.role==="user"&&Array.isArray(D.content))return{...D,content:j(D.content,"(image omitted: model does not support images)")};if(D.role==="toolResult")return{...D,content:j(D.content,"(tool image omitted: model does not support images)")};return D})}function W(G,q,D){let N=new Map,_=U(G,q).map((E)=>{if(E.role==="user")return E;if(E.role==="toolResult"){let A=N.get(E.toolCallId);if(A&&A!==E.toolCallId)return{...E,toolCallId:A};return E}if(E.role==="assistant"){let A=E,H=A.provider===q.provider&&A.api===q.api&&A.model===q.id,$=A.content.flatMap((F)=>{if(F.type==="thinking"){if(F.redacted)return H?F:[];if(H&&F.thinkingSignature)return F;if(!F.thinking||F.thinking.trim()==="")return[];if(H)return F;return{type:"text",text:F.thinking}}if(F.type==="text"){if(H)return F;return{type:"text",text:F.text}}if(F.type==="toolCall"){let X=F,Z=X;if(!H&&X.thoughtSignature)Z={...X},delete Z.thoughtSignature;if(!H&&D){let w=D(X.id,q,A);if(w!==X.id)N.set(X.id,w),Z={...Z,id:w}}return Z}return F});return{...A,content:$}}return E}),O=[],V=[],J=new Set,Q=()=>{if(V.length>0){for(let E of V)if(!J.has(E.id))O.push({role:"toolResult",toolCallId:E.id,toolName:E.name,content:[{type:"text",text:"No result provided"}],isError:!0,timestamp:Date.now()});V=[],J=new Set}};for(let E=0;E<_.length;E++){let A=_[E];if(A.role==="assistant"){Q();let H=A;if(H.stopReason==="error"||H.stopReason==="aborted")continue;let $=H.content.filter((F)=>F.type==="toolCall");if($.length>0)V=$,J=new Set;O.push(A)}else if(A.role==="toolResult")J.add(A.toolCallId),O.push(A);else if(A.role==="user")Q(),O.push(A);else O.push(A)}return Q(),O}
|
|
3
|
-
export{L as xb,y as yb,W as zb};
|
package/bin/chunk-0zv7f9ca.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{rb as C,sb as j,tb as v,ub as T,vb as I,wb as B}from"./chunk-k5w64spz.js";import{xb as M}from"./chunk-0at8vxt5.js";import{Ab as P}from"./chunk-22dje1f5.js";import{ie as L,je as K,ke as G}from"./chunk-7rhjej0x.js";import{Oj as F,Qj as y,Rj as H}from"./chunk-mjan6b09.js";import"./chunk-kbzm1pwx.js";var b="v1",k="gcp-vertex-credentials",g={THINKING_LEVEL_UNSPECIFIED:F.THINKING_LEVEL_UNSPECIFIED,MINIMAL:F.MINIMAL,LOW:F.LOW,MEDIUM:F.MEDIUM,HIGH:F.HIGH},m=0,S=(q,w,J)=>{let Y=new G;return(async()=>{let Q={role:"assistant",content:[],api:"google-vertex",provider:q.provider,model:q.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"stop",timestamp:Date.now()};try{let W=p(J),z=W?u(q,W,J?.headers):d(q,r(J),s(J),J?.headers),N=i(q,w,J),R=await J?.onPayload?.(N,q);if(R!==void 0)N=R;let x=await z.models.generateContentStream(N);Y.push({type:"start",partial:Q});let Z=null,A=Q.content,X=()=>A.length-1;for await(let D of x){Q.responseId||=D.responseId;let V=D.candidates?.[0];if(V?.content?.parts)for(let $ of V.content.parts){if($.text!==void 0){let _=C($);if(!Z||_&&Z.type!=="thinking"||!_&&Z.type!=="text"){if(Z)if(Z.type==="text")Y.push({type:"text_end",contentIndex:A.length-1,content:Z.text,partial:Q});else Y.push({type:"thinking_end",contentIndex:X(),content:Z.thinking,partial:Q});if(_)Z={type:"thinking",thinking:"",thinkingSignature:void 0},Q.content.push(Z),Y.push({type:"thinking_start",contentIndex:X(),partial:Q});else Z={type:"text",text:""},Q.content.push(Z),Y.push({type:"text_start",contentIndex:X(),partial:Q})}if(Z.type==="thinking")Z.thinking+=$.text,Z.thinkingSignature=j(Z.thinkingSignature,$.thoughtSignature),Y.push({type:"thinking_delta",contentIndex:X(),delta:$.text,partial:Q});else Z.text+=$.text,Z.textSignature=j(Z.textSignature,$.thoughtSignature),Y.push({type:"text_delta",contentIndex:X(),delta:$.text,partial:Q})}if($.functionCall){if(Z){if(Z.type==="text")Y.push({type:"text_end",contentIndex:X(),content:Z.text,partial:Q});else Y.push({type:"thinking_end",contentIndex:X(),content:Z.thinking,partial:Q});Z=null}let _=$.functionCall.id,E={type:"toolCall",id:!_||Q.content.some((U)=>U.type==="toolCall"&&U.id===_)?`${$.functionCall.name}_${Date.now()}_${++m}`:_,name:$.functionCall.name||"",arguments:$.functionCall.args??{},...$.thoughtSignature&&{thoughtSignature:$.thoughtSignature}};Q.content.push(E),Y.push({type:"toolcall_start",contentIndex:X(),partial:Q}),Y.push({type:"toolcall_delta",contentIndex:X(),delta:JSON.stringify(E.arguments),partial:Q}),Y.push({type:"toolcall_end",contentIndex:X(),toolCall:E,partial:Q})}}if(V?.finishReason){if(Q.stopReason=B(V.finishReason),Q.content.some(($)=>$.type==="toolCall"))Q.stopReason="toolUse"}if(D.usageMetadata)Q.usage={input:(D.usageMetadata.promptTokenCount||0)-(D.usageMetadata.cachedContentTokenCount||0),output:(D.usageMetadata.candidatesTokenCount||0)+(D.usageMetadata.thoughtsTokenCount||0),cacheRead:D.usageMetadata.cachedContentTokenCount||0,cacheWrite:0,totalTokens:D.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},L(q,Q.usage)}if(Z)if(Z.type==="text")Y.push({type:"text_end",contentIndex:X(),content:Z.text,partial:Q});else Y.push({type:"thinking_end",contentIndex:X(),content:Z.thinking,partial:Q});if(J?.signal?.aborted)throw Error("Request was aborted");if(Q.stopReason==="aborted"||Q.stopReason==="error")throw Error("An unknown error occurred");Y.push({type:"done",reason:Q.stopReason,message:Q}),Y.end()}catch(W){for(let z of Q.content)if("index"in z)delete z.index;Q.stopReason=J?.signal?.aborted?"aborted":"error",Q.errorMessage=W instanceof Error?W.message:JSON.stringify(W),Y.push({type:"error",reason:Q.stopReason,error:Q}),Y.end()}})(),Y},Wq=(q,w,J)=>{let Y=M(q,J,void 0);if(!J?.reasoning)return S(q,w,{...Y,thinking:{enabled:!1}});let Q=K(q,J.reasoning),W=Q==="off"?"high":Q,z=q;if(O(z)||h(z))return S(q,w,{...Y,thinking:{enabled:!0,level:e(W,z)}});return S(q,w,{...Y,thinking:{enabled:!0,budgetTokens:t(z,W,J.thinkingBudgets)}})};function d(q,w,J,Y){return new H({vertexai:!0,project:w,location:J,apiVersion:b,httpOptions:f(q,Y)})}function u(q,w,J){return new H({vertexai:!0,apiKey:w,apiVersion:b,httpOptions:f(q,J)})}function f(q,w){let J={},Y=a(q.baseUrl);if(Y){if(J.baseUrl=Y,J.baseUrlResourceScope=y.COLLECTION,c(Y))J.apiVersion=""}if(q.headers||w)J.headers={...q.headers,...w};return Object.keys(J).length>0?J:void 0}function a(q){let w=q.trim();if(!w||w.includes("{location}"))return;return w}function c(q){try{return new URL(q).pathname.split("/").some((J)=>/^v\d+(?:beta\d*)?$/.test(J))}catch{return/(?:^|\/)v\d+(?:beta\d*)?(?:\/|$)/.test(q)}}function p(q){let w=q?.apiKey?.trim()||process.env.GOOGLE_CLOUD_API_KEY?.trim();if(!w||w===k||l(w))return;return w}function l(q){return/^<[^>]+>$/.test(q)}function r(q){let w=q?.project||process.env.GOOGLE_CLOUD_PROJECT||process.env.GCLOUD_PROJECT;if(!w)throw Error("Vertex AI requires a project ID. Set GOOGLE_CLOUD_PROJECT/GCLOUD_PROJECT or pass project in options.");return w}function s(q){let w=q?.location||process.env.GOOGLE_CLOUD_LOCATION;if(!w)throw Error("Vertex AI requires a location. Set GOOGLE_CLOUD_LOCATION or pass location in options.");return w}function i(q,w,J={}){let Y=v(q,w),Q={};if(J.temperature!==void 0)Q.temperature=J.temperature;if(J.maxTokens!==void 0)Q.maxOutputTokens=J.maxTokens;let W={...Object.keys(Q).length>0&&Q,...w.systemPrompt&&{systemInstruction:P(w.systemPrompt)},...w.tools&&w.tools.length>0&&{tools:T(w.tools)}};if(w.tools&&w.tools.length>0&&J.toolChoice)W.toolConfig={functionCallingConfig:{mode:I(J.toolChoice)}};else W.toolConfig=void 0;if(J.thinking?.enabled&&q.reasoning){let N={includeThoughts:!0};if(J.thinking.level!==void 0)N.thinkingLevel=g[J.thinking.level];else if(J.thinking.budgetTokens!==void 0)N.thinkingBudget=J.thinking.budgetTokens;W.thinkingConfig=N}else if(q.reasoning&&J.thinking&&!J.thinking.enabled)W.thinkingConfig=n(q);if(J.signal){if(J.signal.aborted)throw Error("Request aborted");W.abortSignal=J.signal}return{model:q.id,contents:Y,config:W}}function O(q){return/gemini-3(?:\.\d+)?-pro/.test(q.id.toLowerCase())}function h(q){return/gemini-3(?:\.\d+)?-flash/.test(q.id.toLowerCase())}function n(q){let w=q;if(O(w))return{thinkingLevel:F.LOW};if(h(w))return{thinkingLevel:F.MINIMAL};return{thinkingBudget:0}}function e(q,w){if(O(w))switch(q){case"minimal":case"low":return"LOW";case"medium":case"high":return"HIGH"}switch(q){case"minimal":return"MINIMAL";case"low":return"LOW";case"medium":return"MEDIUM";case"high":return"HIGH"}}function t(q,w,J){if(J?.[w]!==void 0)return J[w];if(q.id.includes("2.5-pro"))return{minimal:128,low:2048,medium:8192,high:32768}[w];if(q.id.includes("2.5-flash"))return{minimal:128,low:2048,medium:8192,high:24576}[w];return-1}export{Wq as streamSimpleGoogleVertex,S as streamGoogleVertex};
|
package/bin/chunk-2k4vp654.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{lb as T,mb as C,nb as L}from"./chunk-2vs3evc7.js";import"./chunk-dypsm6m2.js";import{pb as S}from"./chunk-9n0etqsy.js";import{qb as M}from"./chunk-7ddaxdpf.js";import{xb as D}from"./chunk-0at8vxt5.js";import"./chunk-22dje1f5.js";import"./chunk-wv4fe1fj.js";import{je as V,ke as f}from"./chunk-7rhjej0x.js";import{le as F}from"./chunk-n6jgyv4y.js";import{Cj as k}from"./chunk-w4y97tzy.js";import"./chunk-yhj8c5re.js";import"./chunk-kbzm1pwx.js";var B="v1",E=new Set(["openai","openai-codex","opencode","azure-openai-responses"]);function I(G){let Q=new Map;if(!G)return Q;for(let w of G.split(",")){let W=w.trim();if(!W)continue;let[X,J]=W.split("=",2);if(!X||!J)continue;Q.set(X.trim(),J.trim())}return Q}function P(G,Q){if(Q?.azureDeploymentName)return Q.azureDeploymentName;return I(process.env.AZURE_OPENAI_DEPLOYMENT_NAME_MAP).get(G.id)||G.id}function g(G){if(G instanceof Error){let Q=G.status,w=typeof Q==="number"?Q:void 0;if(w!==void 0)return`Azure OpenAI API error (${w}): ${G.message}`;return G.message}try{return JSON.stringify(G)}catch{return String(G)}}var O=(G,Q,w)=>{let W=new f;return(async()=>{let X=P(G,w),J={role:"assistant",content:[],api:"azure-openai-responses",provider:G.provider,model:G.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"stop",timestamp:Date.now()};try{let Y=w?.apiKey||F(G.provider)||"",$=K(G,Y,w),q=N(G,Q,w,X),H=await w?.onPayload?.(q,G);if(H!==void 0)q=H;let _={...w?.signal?{signal:w.signal}:{},...w?.timeoutMs!==void 0?{timeout:w.timeoutMs}:{},...w?.maxRetries!==void 0?{maxRetries:w.maxRetries}:{}},{data:j,response:Z}=await $.responses.create(q,_).withResponse();if(await w?.onResponse?.({status:Z.status,headers:M(Z.headers)},G),W.push({type:"start",partial:J}),await L(j,J,W,G),w?.signal?.aborted)throw Error("Request was aborted");if(J.stopReason==="aborted"||J.stopReason==="error")throw Error("An unknown error occurred");W.push({type:"done",reason:J.stopReason,message:J}),W.end()}catch(Y){for(let $ of J.content)delete $.index,delete $.partialJson;J.stopReason=w?.signal?.aborted?"aborted":"error",J.errorMessage=g(Y),W.push({type:"error",reason:J.stopReason,error:J}),W.end()}})(),W},d=(G,Q,w)=>{let W=w?.apiKey||F(G.provider);if(!W)throw Error(`No API key for provider: ${G.provider}`);let X=D(G,w,W),J=w?.reasoning?V(G,w.reasoning):void 0;return O(G,Q,{...X,reasoningEffort:J==="off"?void 0:J})};function h(G){let Q=G.trim().replace(/\/+$/,""),w;try{w=new URL(Q)}catch{throw Error(`Invalid Azure OpenAI base URL: ${G}`)}let W=w.hostname.endsWith(".openai.azure.com")||w.hostname.endsWith(".cognitiveservices.azure.com"),X=w.pathname.replace(/\/+$/,"");if(W&&(X===""||X==="/"||X==="/openai"))w.pathname="/openai/v1",w.search="";return w.toString().replace(/\/+$/,"")}function z(G){return`https://${G}.openai.azure.com/openai/v1`}function b(G,Q){let w=Q?.azureApiVersion||process.env.AZURE_OPENAI_API_VERSION||B,W=Q?.azureBaseUrl?.trim()||process.env.AZURE_OPENAI_BASE_URL?.trim()||void 0,X=Q?.azureResourceName||process.env.AZURE_OPENAI_RESOURCE_NAME,J=W;if(!J&&X)J=z(X);if(!J&&G.baseUrl)J=G.baseUrl;if(!J)throw Error("Azure OpenAI base URL is required. Set AZURE_OPENAI_BASE_URL or AZURE_OPENAI_RESOURCE_NAME, or pass azureBaseUrl, azureResourceName, or model.baseUrl.");return{baseUrl:h(J),apiVersion:w}}function K(G,Q,w){if(!Q){if(!process.env.AZURE_OPENAI_API_KEY)throw Error("Azure OpenAI API key is required. Set AZURE_OPENAI_API_KEY environment variable or pass it as an argument.");Q=process.env.AZURE_OPENAI_API_KEY}let W={...G.headers};if(w?.headers)Object.assign(W,w.headers);let{baseUrl:X,apiVersion:J}=b(G,w);return new k({apiKey:Q,apiVersion:J,dangerouslyAllowBrowser:!0,defaultHeaders:W,baseURL:X})}function N(G,Q,w,W){let X=T(G,Q,E),J={model:W,input:X,stream:!0,prompt_cache_key:S(w?.sessionId)};if(w?.maxTokens)J.max_output_tokens=w?.maxTokens;if(w?.temperature!==void 0)J.temperature=w?.temperature;if(Q.tools&&Q.tools.length>0)J.tools=C(Q.tools);if(G.reasoning){if(w?.reasoningEffort||w?.reasoningSummary){let Y=w?.reasoningEffort?G.thinkingLevelMap?.[w.reasoningEffort]??w.reasoningEffort:"medium";J.reasoning={effort:Y,summary:w?.reasoningSummary||"auto"},J.include=["reasoning.encrypted_content"]}else if(G.thinkingLevelMap?.off!==null)J.reasoning={effort:G.thinkingLevelMap?.off??"none"}}return J}export{d as streamSimpleAzureOpenAIResponses,O as streamAzureOpenAIResponses};
|
package/bin/chunk-2tbya52d.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import"./chunk-xg9xscqz.js";import{Vb as I,lc as w}from"./chunk-ac2ky3q0.js";import"./chunk-kbzm1pwx.js";function R(q,$){if(typeof q==="string"&&typeof $==="string")return q.toLowerCase()===$.toLowerCase();return q===$}function y(q,$){if(typeof q!=="string")return $.includes(q);return $.some((E)=>typeof E==="string"&&q.toLowerCase()===E.toLowerCase())}function j(q,$){return!y(q,$)}function g(q,$){if(typeof q!=="string"||typeof $!=="string")return!1;return q.toLowerCase().includes($.toLowerCase())}function f(q,$){if(typeof q!=="string"||typeof $!=="string")return!1;return q.toLowerCase().startsWith($.toLowerCase())}function V(q,$){if(typeof q!=="string"||typeof $!=="string")return!1;return q.toLowerCase().endsWith($.toLowerCase())}var v=(q,$)=>{let E=null,M=w({config:{adapterId:"memory",adapterName:"Memory Adapter",usePlural:!1,debugLogs:$?.debugLogs||!1,supportsArrays:!0,customTransformInput(P){if(P.options.advanced?.database?.generateId==="serial"&&P.field==="id"&&P.action==="create")return q[P.model].length+1;return P.data},transaction:async(P)=>{let A=structuredClone(q);try{return await P(M(E))}catch(_){throw Object.keys(q).forEach((S)=>{q[S]=A[S]}),_}}},adapter:({getFieldName:P,getDefaultFieldName:A,options:_,getModelName:S})=>{let N=(x,K,Y)=>{if(!K)return x;return x.sort((L,Z)=>{let z=P({model:Y,field:K.field}),D=L[z],X=Z[z],Q=0;if(D==null&&X==null)Q=0;else if(D==null)Q=-1;else if(X==null)Q=1;else if(typeof D==="string"&&typeof X==="string")Q=D.localeCompare(X);else if(D instanceof Date&&X instanceof Date)Q=D.getTime()-X.getTime();else if(typeof D==="number"&&typeof X==="number")Q=D-X;else if(typeof D==="boolean"&&typeof X==="boolean")Q=D===X?0:D?1:-1;else Q=String(D).localeCompare(String(X));return K.direction==="asc"?Q:-Q})};function F(x,K,Y,L){let Z=(()=>{let X=q[K];if(!X)throw I.error(`[MemoryAdapter] Model ${K} not found in the DB`,Object.keys(q)),Error(`Model ${K} not found`);let Q=(G,O)=>{let{field:J,value:H,operator:B,mode:k="sensitive"}=O,U=k==="insensitive"&&(typeof H==="string"||Array.isArray(H)&&H.every((W)=>typeof W==="string"));switch(B){case"in":if(!Array.isArray(H))throw Error("Value must be an array");if(U)return y(G[J],H);return H.includes(G[J]);case"not_in":if(!Array.isArray(H))throw Error("Value must be an array");if(U)return j(G[J],H);return!H.includes(G[J]);case"contains":if(U)return g(G[J],H);return G[J]?.includes(H);case"starts_with":if(U)return f(G[J],H);return G[J].startsWith(H);case"ends_with":if(U)return V(G[J],H);return G[J].endsWith(H);case"ne":return U?!R(G[J],H):G[J]!==H;case"gt":return H!=null&&Boolean(G[J]>H);case"gte":return H!=null&&Boolean(G[J]>=H);case"lt":return H!=null&&Boolean(G[J]<H);case"lte":return H!=null&&Boolean(G[J]<=H);default:if(U)return R(G[J],H);if(H===null)return G[J]==null;return G[J]===H}},T=X.filter((G)=>{if(!x.length||x.length===0)return!0;let O=Q(G,x[0]);for(let J of x){let H=Q(G,J);if(J.connector==="OR")O=O||H;else O=O&&H}return O});if(L?.length&&L.length>0)T=T.map((G)=>Object.fromEntries(Object.entries(G).filter(([O])=>L.includes(A({model:K,field:O})))));return T})();if(!Y)return Z;let z=new Map,D=new Map;for(let X of Z){let Q=String(X.id);if(!z.has(Q)){let G={...X};for(let[O,J]of Object.entries(Y)){let H=S(O);if(J.relation==="one-to-one")G[H]=null;else G[H]=[],D.set(`${Q}-${O}`,new Set)}z.set(Q,G)}let T=z.get(Q);for(let[G,O]of Object.entries(Y)){let J=S(G),H=q[J];if(!H)throw I.error(`[MemoryAdapter] JoinOption model ${J} not found in the DB`,Object.keys(q)),Error(`JoinOption model ${J} not found`);let B=H.filter((k)=>k[O.on.to]===X[O.on.from]);if(O.relation==="one-to-one")T[J]=B[0]||null;else{let k=D.get(`${Q}-${G}`),U=O.limit??100,W=0;for(let C of B){if(W>=U)break;if(!k.has(C.id))T[J].push(C),k.add(C.id),W++}}}}return Array.from(z.values())}return{create:async({model:x,data:K})=>{if(_.advanced?.database?.generateId==="serial")K.id=q[S(x)].length+1;if(!q[x])q[x]=[];return q[x].push(K),K},findOne:async({model:x,where:K,select:Y,join:L})=>{let Z=F(K,x,L,Y);if(L){let z=Z;if(!z.length)return null;return z[0]}return Z[0]||null},findMany:async({model:x,where:K,sortBy:Y,limit:L,select:Z,offset:z,join:D})=>{let X=F(K||[],x,D,Z);if(D){let T=X;if(!T.length)return[];N(T,Y,x);let G=T;if(z!==void 0)G=G.slice(z);if(L!==void 0)G=G.slice(0,L);return G}let Q=N(X,Y,x);if(z!==void 0)Q=Q.slice(z);if(L!==void 0)Q=Q.slice(0,L);return Q||[]},count:async({model:x,where:K})=>{if(K)return F(K,x).length;return q[x].length},update:async({model:x,where:K,update:Y})=>{let L=F(K,x);return L.forEach((Z)=>{Object.assign(Z,Y)}),L[0]||null},delete:async({model:x,where:K})=>{let Y=q[x],L=F(K,x);q[x]=Y.filter((Z)=>!L.includes(Z))},deleteMany:async({model:x,where:K})=>{let Y=q[x],L=F(K,x),Z=0;return q[x]=Y.filter((z)=>{if(L.includes(z))return Z++,!1;return!L.includes(z)}),Z},consumeOne:async({model:x,where:K})=>{let Y=q[x],L=F(K,x)[0];if(!L)return null;return q[x]=Y.filter((Z)=>Z!==L),L},updateMany({model:x,where:K,update:Y}){let L=F(K,x);return L.forEach((Z)=>{Object.assign(Z,Y)}),L[0]||null}}}});return(P)=>{return E=P,M(P)}};export{v as memoryAdapter};
|
package/bin/chunk-2vs3evc7.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{ob as f}from"./chunk-dypsm6m2.js";import{zb as j}from"./chunk-0at8vxt5.js";import{Ab as U}from"./chunk-22dje1f5.js";import{ge as H}from"./chunk-wv4fe1fj.js";import{ie as J}from"./chunk-7rhjej0x.js";function M(Q,E){let W={v:1,id:Q};if(E)W.phase=E;return JSON.stringify(W)}function R(Q){if(!Q)return;if(Q.startsWith("{"))try{let E=JSON.parse(Q);if(E.v===1&&typeof E.id==="string"){if(E.phase==="commentary"||E.phase==="final_answer")return{id:E.id,phase:E.phase};return{id:E.id}}}catch{}return{id:Q}}function b(Q,E,W,L){let D=[],N=(G)=>{let O=G.replace(/[^a-zA-Z0-9_-]/g,"_");return(O.length>64?O.slice(0,64):O).replace(/_+$/,"")},A=(G)=>{let O=`fc_${f(G)}`;return O.length>64?O.slice(0,64):O},w=(G,O,X)=>{if(!W.has(Q.provider))return N(G);if(!G.includes("|"))return N(G);let[V,F]=G.split("|"),$=N(V),Y=X.provider!==Q.provider||X.api!==Q.api?A(F):N(F);if(!Y.startsWith("fc_"))Y=N(`fc_${Y}`);return`${$}|${Y}`},Z=j(E.messages,Q,w);if((L?.includeSystemPrompt??!0)&&E.systemPrompt){let G=Q.reasoning?"developer":"system";D.push({role:G,content:U(E.systemPrompt)})}let q=0;for(let G of Z){if(G.role==="user")if(typeof G.content==="string")D.push({role:"user",content:[{type:"input_text",text:U(G.content)}]});else{let O=G.content.map((X)=>{if(X.type==="text")return{type:"input_text",text:U(X.text)};return{type:"input_image",detail:"auto",image_url:`data:${X.mimeType};base64,${X.data}`}});if(O.length===0)continue;D.push({role:"user",content:O})}else if(G.role==="assistant"){let O=[],X=G,V=X.model!==Q.id&&X.provider===Q.provider&&X.api===Q.api;for(let F of G.content)if(F.type==="thinking"){if(F.thinkingSignature){let $=JSON.parse(F.thinkingSignature);O.push($)}}else if(F.type==="text"){let $=F,_=R($.textSignature),Y=_?.id;if(!Y)Y=`msg_${q}`;else if(Y.length>64)Y=`msg_${f(Y)}`;O.push({type:"message",role:"assistant",content:[{type:"output_text",text:U($.text),annotations:[]}],status:"completed",id:Y,phase:_?.phase})}else if(F.type==="toolCall"){let $=F,[_,Y]=$.id.split("|"),y=Y;if(V&&y?.startsWith("fc_"))y=void 0;O.push({type:"function_call",id:y,call_id:_,name:$.name,arguments:JSON.stringify($.arguments)})}if(O.length===0)continue;D.push(...O)}else if(G.role==="toolResult"){let O=G.content.filter((_)=>_.type==="text").map((_)=>_.text).join(`
|
|
3
|
-
`),X=G.content.some((_)=>_.type==="image"),V=O.length>0,[F]=G.toolCallId.split("|"),$;if(X&&Q.input.includes("image")){let _=[];if(V)_.push({type:"input_text",text:U(O)});for(let Y of G.content)if(Y.type==="image")_.push({type:"input_image",detail:"auto",image_url:`data:${Y.mimeType};base64,${Y.data}`});$=_}else $=U(V?O:"(see attached image)");D.push({type:"function_call_output",call_id:F,output:$})}q++}return D}function x(Q,E){let W=E?.strict===void 0?!1:E.strict;return Q.map((L)=>({type:"function",name:L.name,description:L.description,parameters:L.parameters,strict:W}))}async function B(Q,E,W,L,D){let N=null,A=null,w=E.content,Z=()=>w.length-1;for await(let K of Q)if(K.type==="response.created")E.responseId=K.response.id;else if(K.type==="response.output_item.added"){let q=K.item;if(q.type==="reasoning")N=q,A={type:"thinking",thinking:""},E.content.push(A),W.push({type:"thinking_start",contentIndex:Z(),partial:E});else if(q.type==="message")N=q,A={type:"text",text:""},E.content.push(A),W.push({type:"text_start",contentIndex:Z(),partial:E});else if(q.type==="function_call")N=q,A={type:"toolCall",id:`${q.call_id}|${q.id}`,name:q.name,arguments:{},partialJson:q.arguments||""},E.content.push(A),W.push({type:"toolcall_start",contentIndex:Z(),partial:E})}else if(K.type==="response.reasoning_summary_part.added"){if(N&&N.type==="reasoning")N.summary=N.summary||[],N.summary.push(K.part)}else if(K.type==="response.reasoning_summary_text.delta"){if(N?.type==="reasoning"&&A?.type==="thinking"){N.summary=N.summary||[];let q=N.summary[N.summary.length-1];if(q)A.thinking+=K.delta,q.text+=K.delta,W.push({type:"thinking_delta",contentIndex:Z(),delta:K.delta,partial:E})}}else if(K.type==="response.reasoning_summary_part.done"){if(N?.type==="reasoning"&&A?.type==="thinking"){N.summary=N.summary||[];let q=N.summary[N.summary.length-1];if(q)A.thinking+=`
|
|
4
|
-
|
|
5
|
-
`,q.text+=`
|
|
6
|
-
|
|
7
|
-
`,W.push({type:"thinking_delta",contentIndex:Z(),delta:`
|
|
8
|
-
|
|
9
|
-
`,partial:E})}}else if(K.type==="response.reasoning_text.delta"){if(N?.type==="reasoning"&&A?.type==="thinking")A.thinking+=K.delta,W.push({type:"thinking_delta",contentIndex:Z(),delta:K.delta,partial:E})}else if(K.type==="response.content_part.added"){if(N?.type==="message"){if(N.content=N.content||[],K.part.type==="output_text"||K.part.type==="refusal")N.content.push(K.part)}}else if(K.type==="response.output_text.delta"){if(N?.type==="message"&&A?.type==="text"){if(!N.content||N.content.length===0)continue;let q=N.content[N.content.length-1];if(q?.type==="output_text")A.text+=K.delta,q.text+=K.delta,W.push({type:"text_delta",contentIndex:Z(),delta:K.delta,partial:E})}}else if(K.type==="response.refusal.delta"){if(N?.type==="message"&&A?.type==="text"){if(!N.content||N.content.length===0)continue;let q=N.content[N.content.length-1];if(q?.type==="refusal")A.text+=K.delta,q.refusal+=K.delta,W.push({type:"text_delta",contentIndex:Z(),delta:K.delta,partial:E})}}else if(K.type==="response.function_call_arguments.delta"){if(N?.type==="function_call"&&A?.type==="toolCall")A.partialJson+=K.delta,A.arguments=H(A.partialJson),W.push({type:"toolcall_delta",contentIndex:Z(),delta:K.delta,partial:E})}else if(K.type==="response.function_call_arguments.done"){if(N?.type==="function_call"&&A?.type==="toolCall"){let q=A.partialJson;if(A.partialJson=K.arguments,A.arguments=H(A.partialJson),K.arguments.startsWith(q)){let G=K.arguments.slice(q.length);if(G.length>0)W.push({type:"toolcall_delta",contentIndex:Z(),delta:G,partial:E})}}}else if(K.type==="response.output_item.done"){let q=K.item;if(q.type==="reasoning"&&A?.type==="thinking"){let G=q.summary?.map((X)=>X.text).join(`
|
|
10
|
-
|
|
11
|
-
`)||"",O=q.content?.map((X)=>X.text).join(`
|
|
12
|
-
|
|
13
|
-
`)||"";A.thinking=G||O||A.thinking,A.thinkingSignature=JSON.stringify(q),W.push({type:"thinking_end",contentIndex:Z(),content:A.thinking,partial:E}),A=null}else if(q.type==="message"&&A?.type==="text")A.text=q.content.map((G)=>G.type==="output_text"?G.text:G.refusal).join(""),A.textSignature=M(q.id,q.phase??void 0),W.push({type:"text_end",contentIndex:Z(),content:A.text,partial:E}),A=null;else if(q.type==="function_call"){let G=A?.type==="toolCall"&&A.partialJson?H(A.partialJson):H(q.arguments||"{}"),O;if(A?.type==="toolCall")A.arguments=G,delete A.partialJson,O=A;else O={type:"toolCall",id:`${q.call_id}|${q.id}`,name:q.name,arguments:G};A=null,W.push({type:"toolcall_end",contentIndex:Z(),toolCall:O,partial:E})}}else if(K.type==="response.completed"){let q=K.response;if(q?.id)E.responseId=q.id;if(q?.usage){let G=q.usage.input_tokens_details?.cached_tokens||0;E.usage={input:(q.usage.input_tokens||0)-G,output:q.usage.output_tokens||0,cacheRead:G,cacheWrite:0,totalTokens:q.usage.total_tokens||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}}}if(J(L,E.usage),D?.applyServiceTierPricing){let G=D.resolveServiceTier?D.resolveServiceTier(q?.service_tier,D.serviceTier):q?.service_tier??D.serviceTier;D.applyServiceTierPricing(E.usage,G)}if(E.stopReason=C(q?.status),E.content.some((G)=>G.type==="toolCall")&&E.stopReason==="stop")E.stopReason="toolUse"}else if(K.type==="error")throw Error(`Error Code ${K.code}: ${K.message}`||"Unknown error");else if(K.type==="response.failed"){let q=K.response?.error,G=K.response?.incomplete_details,O=q?`${q.code||"unknown"}: ${q.message||"no message"}`:G?.reason?`incomplete: ${G.reason}`:"Unknown error (no error details in response)";throw Error(O)}}function C(Q){if(!Q)return"stop";switch(Q){case"completed":return"stop";case"incomplete":return"length";case"failed":case"cancelled":return"error";case"in_progress":case"queued":return"stop";default:throw Error(`Unhandled stop reason: ${Q}`)}}
|
|
14
|
-
export{b as lb,x as mb,B as nb};
|
package/bin/chunk-33169en9.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{lb as I,mb as s,nb as k}from"./chunk-2vs3evc7.js";import"./chunk-dypsm6m2.js";import{pb as o}from"./chunk-9n0etqsy.js";import{qb as b}from"./chunk-7ddaxdpf.js";import{xb as t}from"./chunk-0at8vxt5.js";import"./chunk-22dje1f5.js";import{Hb as e,Ib as f,Jb as NN,Kb as QN}from"./chunk-3rt9mnj3.js";import"./chunk-wv4fe1fj.js";import{je as r,ke as n}from"./chunk-7rhjej0x.js";import{le as g}from"./chunk-n6jgyv4y.js";import"./chunk-yhj8c5re.js";import"./chunk-kbzm1pwx.js";var zN=function(N,Q){if(typeof N==="string"&&/^\.\.?\//.test(N))return N.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(V,X,Y,Z,G){return X?Q?".jsx":".js":Y&&(!Z||!G)?V:Y+Z+"."+G.toLowerCase()+"js"});return N},B=null,VN=(N)=>import(zN(N)),RN="node:os";if(typeof process<"u"&&(process.versions?.node||process.versions?.bun))VN(RN).then((N)=>{B=N});var KN="https://chatgpt.com/backend-api",ON="https://api.openai.com/auth",x=3,l=1000,XN=new Set(["openai","openai-codex","opencode"]),_N=1009,UN=new Set(["completed","incomplete","failed","cancelled","queued","in_progress"]);function jN(N,Q){if(N===429||N===500||N===502||N===503||N===504)return!0;return/rate.?limit|overloaded|service.?unavailable|upstream.?connect|connection.?refused/i.test(Q)}function p(N,Q){return new Promise((V,X)=>{if(Q?.aborted){X(Error("Request was aborted"));return}let Y=setTimeout(V,N);Q?.addEventListener("abort",()=>{clearTimeout(Y),X(Error("Request was aborted"))})})}var WN=(N,Q,V)=>{let X=new n;return(async()=>{let Y={role:"assistant",content:[],api:"openai-codex-responses",provider:N.provider,model:N.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"stop",timestamp:Date.now()};try{let Z=V?.apiKey||g(N.provider)||"";if(!Z)throw Error(`No API key for provider: ${N.provider}`);let G=pN(Z),$=AN(N,Q,V),F=await V?.onPayload?.($,N);if(F!==void 0)$=F;let L=V?.sessionId||iN(),_=dN(N.headers,V?.headers,G,Z,V?.sessionId),j=aN(N.headers,V?.headers,G,Z,L),J=JSON.stringify($),O=V?.transport||"auto",P=O!=="sse"&&DN(V?.sessionId);if(P)i(V?.sessionId);if(O!=="sse"&&!P){let K=!1;try{if(await cN(HN(N.baseUrl),$,j,Y,X,N,()=>{K=!0},V),V?.signal?.aborted)throw Error("Request was aborted");X.push({type:"done",reason:Y.stopReason,message:Y}),X.end();return}catch(z){if(V?.signal?.aborted||qN(z))throw z;if(QN(Y,NN("provider_transport_failure",z,{configuredTransport:O,fallbackTransport:K?void 0:"sse",eventsEmitted:K,phase:K?"after_message_stream_start":"before_message_stream_start",requestBytes:new TextEncoder().encode(J).byteLength})),SN(V?.sessionId,z),K)throw z;i(V?.sessionId)}}let D,R;for(let K=0;K<=x;K++){if(V?.signal?.aborted)throw Error("Request was aborted");try{if(D=await fetch($N(N.baseUrl),{method:"POST",headers:_,body:J,signal:V?.signal}),await V?.onResponse?.({status:D.status,headers:b(D.headers)},N),D.ok)break;let z=await D.text();if(K<x&&jN(D.status,z)){let q=l*2**K,m=D.headers.get("retry-after-ms");if(m!==null){let A=Number(m);if(Number.isFinite(A))q=Math.max(0,A)}else{let A=D.headers.get("retry-after");if(A){let u=Number(A);if(Number.isFinite(u))q=Math.max(0,u*1000);else{let c=Date.parse(A);if(!Number.isNaN(c))q=Math.max(0,c-Date.now())}}}await p(q,V?.signal);continue}let M=new Response(z,{status:D.status,statusText:D.statusText}),y=await lN(M);throw Error(y.friendlyMessage||y.message)}catch(z){if(z instanceof Error){if(z.name==="AbortError"||z.message==="Request was aborted")throw Error("Request was aborted")}if(R=z instanceof Error?z:Error(String(z)),K<x&&!R.message.includes("usage limit")){let M=l*2**K;await p(M,V?.signal);continue}throw R}}if(!D?.ok)throw R??Error("Failed after retries");if(!D.body)throw Error("No response body");if(X.push({type:"start",partial:Y}),await MN(D,Y,X,N,V),V?.signal?.aborted)throw Error("Request was aborted");X.push({type:"done",reason:Y.stopReason,message:Y}),X.end()}catch(Z){for(let G of Y.content)delete G.partialJson;Y.stopReason=V?.signal?.aborted?"aborted":"error",Y.errorMessage=Z instanceof Error?Z.message:String(Z),X.push({type:"error",reason:Y.stopReason,error:Y}),X.end()}})(),X},XQ=(N,Q,V)=>{let X=V?.apiKey||g(N.provider);if(!X)throw Error(`No API key for provider: ${N.provider}`);let Y=t(N,V,X),Z=V?.reasoning?r(N,V.reasoning):void 0;return WN(N,Q,{...Y,reasoningEffort:Z==="off"?void 0:Z})};function AN(N,Q,V){let X=I(N,Q,XN,{includeSystemPrompt:!1}),Y={model:N.id,store:!1,stream:!0,instructions:Q.systemPrompt||"You are a helpful assistant.",input:X,text:{verbosity:V?.textVerbosity||"low"},include:["reasoning.encrypted_content"],prompt_cache_key:o(V?.sessionId),tool_choice:"auto",parallel_tool_calls:!0};if(V?.temperature!==void 0)Y.temperature=V.temperature;if(V?.serviceTier!==void 0)Y.service_tier=V.serviceTier;if(Q.tools&&Q.tools.length>0)Y.tools=s(Q.tools,{strict:null});if(V?.reasoningEffort!==void 0){let Z=V.reasoningEffort==="none"?N.thinkingLevelMap?.off??"none":N.thinkingLevelMap?.[V.reasoningEffort]??V.reasoningEffort;if(Z!==null)Y.reasoning={effort:Z,summary:V.reasoningSummary??"auto"}}return Y}function BN(N,Q){switch(Q){case"flex":return 0.5;case"priority":return N.id==="gpt-5.5"?2.5:2;default:return 1}}function YN(N,Q,V){let X=BN(V,Q);if(X===1)return;N.cost.input*=X,N.cost.output*=X,N.cost.cacheRead*=X,N.cost.cacheWrite*=X,N.cost.total=N.cost.input+N.cost.output+N.cost.cacheRead+N.cost.cacheWrite}function ZN(N,Q){if(N==="default"&&(Q==="flex"||Q==="priority"))return Q;return N??Q}function $N(N){let V=(N&&N.trim().length>0?N:KN).replace(/\/+$/,"");if(V.endsWith("/codex/responses"))return V;if(V.endsWith("/codex"))return`${V}/responses`;return`${V}/codex/responses`}function HN(N){let Q=new URL($N(N));if(Q.protocol==="https:")Q.protocol="wss:";if(Q.protocol==="http:")Q.protocol="ws:";return Q.toString()}async function MN(N,Q,V,X,Y){await k(GN(TN(N)),Q,V,X,{serviceTier:Y?.serviceTier,resolveServiceTier:ZN,applyServiceTierPricing:(Z,G)=>YN(Z,G,X)})}class C extends Error{code;payload;constructor(N,Q){super(N);this.name="CodexApiError",this.code=Q?.code,this.payload=Q?.payload,this.cause=Q?.cause}}class S extends Error{payload;constructor(N,Q){super(N);this.name="CodexProtocolError",this.payload=Q?.payload,this.cause=Q?.cause}}function qN(N){return N instanceof C||N instanceof S}async function*GN(N){for await(let Q of N){let V=typeof Q.type==="string"?Q.type:void 0;if(!V)continue;if(V==="error"){let X=Q.code||"",Y=Q.message||"";throw new C(`Codex error: ${Y||X||JSON.stringify(Q)}`,{code:X||void 0,payload:Q})}if(V==="response.failed"){let X=Q.response,Y=X?.error?.code,Z=X?.error?.message;throw new C(Z||"Codex response failed",{code:Y,payload:Q})}if(V==="response.done"||V==="response.completed"||V==="response.incomplete"){let X=Q.response,Y=X?{...X,status:wN(X.status)}:X;yield{...Q,type:"response.completed",response:Y};return}yield Q}}function wN(N){if(typeof N!=="string")return;return UN.has(N)?N:void 0}async function*TN(N){if(!N.body)return;let Q=N.body.getReader(),V=new TextDecoder,X="";try{while(!0){let{done:Y,value:Z}=await Q.read();if(Y)break;X+=V.decode(Z,{stream:!0});let G=X.indexOf(`
|
|
3
|
-
|
|
4
|
-
`);while(G!==-1){let $=X.slice(0,G);X=X.slice(G+2);let F=$.split(`
|
|
5
|
-
`).filter((L)=>L.startsWith("data:")).map((L)=>L.slice(5).trim());if(F.length>0){let L=F.join(`
|
|
6
|
-
`).trim();if(L&&L!=="[DONE]")try{yield JSON.parse(L)}catch(_){throw new S(`Invalid Codex SSE JSON: ${f(_)}`,{cause:_,payload:L})}}G=X.indexOf(`
|
|
7
|
-
|
|
8
|
-
`)}}}finally{try{await Q.cancel()}catch{}try{Q.releaseLock()}catch{}}}var CN="responses_websockets=2026-02-06",EN=300000,U=new Map,H=new Map,E=new Set;function v(N){let Q=H.get(N);if(!Q)Q={requests:0,connectionsCreated:0,connectionsReused:0,cachedContextRequests:0,storeTrueRequests:0,fullContextRequests:0,deltaRequests:0,lastInputItems:0,websocketFailures:0,sseFallbacks:0},H.set(N,Q);return Q}function YQ(N){let Q=H.get(N);return Q?{...Q}:void 0}function ZQ(N){if(N){H.delete(N),E.delete(N);return}H.clear(),E.clear()}function fN(N){let Q=(V)=>{if(V.idleTimer)clearTimeout(V.idleTimer);W(V.socket,1000,"debug_close")};if(N){let V=U.get(N);if(V)Q(V);U.delete(N);return}for(let V of U.values())Q(V);U.clear()}e(fN);function DN(N){return N?E.has(N):!1}function i(N){if(!N)return;let Q=v(N);Q.sseFallbacks++,Q.websocketFallbackActive=DN(N)}function SN(N,Q){if(!N)return;E.add(N);let V=v(N);V.websocketFailures++,V.lastWebSocketError=f(Q),V.websocketFallbackActive=!0}var w=null;async function xN(){if(w)return w;if(process?.versions?.bun&&(process.env.HTTP_PROXY||process.env.HTTPS_PROXY||process.env.http_proxy||process.env.https_proxy)){let V=(await VN("proxy-from-env")).getProxyForUrl;return w=class extends WebSocket{constructor(X,Y){let Z={};if(Array.isArray(Y)||typeof Y==="string")Z={protocols:Y};else Z={...Y};let G=V(X.toString().replace(/^wss:/,"https:").replace(/^ws:/,"http:"));super(X,{...Z,...G?{proxy:G}:{}})}},w}let N=globalThis.WebSocket;if(typeof N!=="function")return null;return N}class FN extends Error{code;reason;wasClean;constructor(N,Q){super(N);this.name="WebSocketCloseError",this.code=Q?.code,this.reason=Q?.reason,this.wasClean=Q?.wasClean}}function hN(N){let Q=N.readyState;return typeof Q==="number"?Q:void 0}function T(N){let Q=hN(N);return Q===void 0||Q===1}function W(N,Q=1000,V="done"){try{N.close(Q,V)}catch{}}function d(N,Q){if(Q.idleTimer)clearTimeout(Q.idleTimer);Q.idleTimer=setTimeout(()=>{if(Q.busy)return;W(Q.socket,1000,"idle_timeout"),U.delete(N)},EN)}async function h(N,Q,V){let X=await xN();if(!X)throw Error("WebSocket transport is not available in this runtime");let Y=b(Q);return delete Y["OpenAI-Beta"],new Promise((Z,G)=>{let $=!1,F;try{F=new X(N,{headers:Y})}catch(P){G(P instanceof Error?P:Error(String(P)));return}let L=()=>{if($)return;$=!0,O(),Z(F)},_=(P)=>{let D=LN(P);if($)return;$=!0,O(),G(D)},j=(P)=>{let D=JN(P);if($)return;$=!0,O(),G(D)},J=()=>{if($)return;$=!0,O(),F.close(1000,"aborted"),G(Error("Request was aborted"))},O=()=>{F.removeEventListener("open",L),F.removeEventListener("error",_),F.removeEventListener("close",j),V?.removeEventListener("abort",J)};F.addEventListener("open",L),F.addEventListener("error",_),F.addEventListener("close",j),V?.addEventListener("abort",J)})}async function gN(N,Q,V,X){if(!V){let $=await h(N,Q,X);return{socket:$,reused:!1,release:({keep:F}={})=>{if(F===!1){W($);return}W($)}}}let Y=U.get(V);if(Y){if(Y.idleTimer)clearTimeout(Y.idleTimer),Y.idleTimer=void 0;if(!Y.busy&&T(Y.socket))return Y.busy=!0,{socket:Y.socket,entry:Y,reused:!0,release:({keep:$}={})=>{if(!$||!T(Y.socket)){W(Y.socket),U.delete(V);return}Y.busy=!1,d(V,Y)}};if(Y.busy){let $=await h(N,Q,X);return{socket:$,reused:!1,release:()=>{W($)}}}if(!T(Y.socket))W(Y.socket),U.delete(V)}let Z=await h(N,Q,X),G={socket:Z,busy:!0};return U.set(V,G),{socket:Z,entry:G,reused:!1,release:({keep:$}={})=>{if(!$||!T(G.socket)){if(W(G.socket),G.idleTimer)clearTimeout(G.idleTimer);if(U.get(V)===G)U.delete(V);return}G.busy=!1,d(V,G)}}}function LN(N){if(N&&typeof N==="object"){let Q="message"in N?N.message:void 0;if(typeof Q==="string"&&Q.length>0)return Error(Q);let V="error"in N?N.error:void 0;if(V instanceof Error&&V.message.length>0)return V;if(V&&typeof V==="object"&&"message"in V){let X=V.message;if(typeof X==="string"&&X.length>0)return Error(X)}}return Error("WebSocket error")}function JN(N){if(N&&typeof N==="object"){let Q="code"in N?N.code:void 0,V="reason"in N?N.reason:void 0,X="wasClean"in N?N.wasClean:void 0,Y=typeof Q==="number"?` ${Q}`:"",Z=typeof V==="string"&&V.length>0?` ${V}`:"";if(!Z&&Q===_N)Z=" message too big";return new FN(`WebSocket closed${Y}${Z}`.trim(),{code:typeof Q==="number"?Q:void 0,reason:typeof V==="string"&&V.length>0?V:void 0,wasClean:typeof X==="boolean"?X:void 0})}return Error("WebSocket closed")}async function bN(N){if(typeof N==="string")return N;if(N instanceof ArrayBuffer)return new TextDecoder().decode(new Uint8Array(N));if(ArrayBuffer.isView(N)){let Q=N;return new TextDecoder().decode(new Uint8Array(Q.buffer,Q.byteOffset,Q.byteLength))}if(N&&typeof N==="object"&&"arrayBuffer"in N){let V=await N.arrayBuffer();return new TextDecoder().decode(new Uint8Array(V))}return null}async function*IN(N,Q){let V=[],X=null,Y=!1,Z=null,G=!1,$=()=>{if(!X)return;let J=X;X=null,J()},F=(J)=>{(async()=>{let O=null;try{if(!J||typeof J!=="object"||!("data"in J))return;if(O=await bN(J.data),!O)return;let P=JSON.parse(O),D=typeof P.type==="string"?P.type:"";if(D==="response.completed"||D==="response.done"||D==="response.incomplete")G=!0,Y=!0;V.push(P),$()}catch(P){Z=new S(`Invalid Codex WebSocket JSON: ${f(P)}`,{cause:P,payload:O}),Y=!0,$()}})()},L=(J)=>{Z=LN(J),Y=!0,$()},_=(J)=>{if(G){Y=!0,$();return}if(!Z)Z=JN(J);Y=!0,$()},j=()=>{Z=Error("Request was aborted"),Y=!0,$()};N.addEventListener("message",F),N.addEventListener("error",L),N.addEventListener("close",_),Q?.addEventListener("abort",j);try{while(!0){if(Q?.aborted)throw Error("Request was aborted");if(V.length>0){yield V.shift();continue}if(Y)break;await new Promise((J)=>{X=J})}if(Z)throw Z;if(!G)throw Error("WebSocket stream closed before response.completed")}finally{N.removeEventListener("message",F),N.removeEventListener("error",L),N.removeEventListener("close",_),Q?.removeEventListener("abort",j)}}function a(N){let{input:Q,previous_response_id:V,...X}=N;return X}function kN(N,Q){return JSON.stringify(N??[])===JSON.stringify(Q??[])}function vN(N,Q){return JSON.stringify(a(N))===JSON.stringify(a(Q))}function yN(N,Q){if(!vN(N,Q.lastRequestBody))return;let V=N.input??[],X=[...Q.lastRequestBody.input??[],...Q.lastResponseItems];if(V.length<X.length)return;let Y=V.slice(0,X.length);if(!kN(Y,X))return;return V.slice(X.length)}function mN(N,Q){let V=N.continuation;if(!V)return Q;let X=yN(Q,V);if(!X||!V.lastResponseId)return N.continuation=void 0,Q;return{...Q,previous_response_id:V.lastResponseId,input:X}}async function*uN(N,Q,V,X){let Y=!1;for await(let Z of N){if(!Y)Y=!0,X(),V.push({type:"start",partial:Q});yield Z}}async function cN(N,Q,V,X,Y,Z,G,$){let{socket:F,entry:L,reused:_,release:j}=await gN(N,V,$?.sessionId,$?.signal),J=!0,O=$?.transport==="websocket-cached"||$?.transport==="auto",P=Q,D=O&&L?mN(L,P):P,R=$?.sessionId?v($.sessionId):void 0;if(R){if(R.requests++,_)R.connectionsReused++;else R.connectionsCreated++;if(O)R.cachedContextRequests++;if(D.store===!0)R.storeTrueRequests++;if(R.lastInputItems=D.input?.length??0,D.previous_response_id)R.deltaRequests++,R.lastDeltaInputItems=D.input?.length??0,R.lastPreviousResponseId=D.previous_response_id;else R.fullContextRequests++,R.lastDeltaInputItems=void 0,R.lastPreviousResponseId=void 0}try{if(F.send(JSON.stringify({type:"response.create",...D})),await k(uN(GN(IN(F,$?.signal)),X,Y,G),X,Y,Z,{serviceTier:$?.serviceTier,resolveServiceTier:ZN,applyServiceTierPricing:(K,z)=>YN(K,z,Z)}),$?.signal?.aborted)J=!1;else if(O&&L&&X.responseId){let K=I(Z,{messages:[X]},XN,{includeSystemPrompt:!1}).filter((z)=>z.type!=="function_call_output");L.continuation={lastRequestBody:P,lastResponseId:X.responseId,lastResponseItems:K}}}catch(K){if(L)L.continuation=void 0;throw J=!1,K}finally{j({keep:J})}}async function lN(N){let Q=await N.text(),V=Q||N.statusText||"Request failed",X;try{let Z=JSON.parse(Q)?.error;if(Z){let G=Z.code||Z.type||"";if(/usage_limit_reached|usage_not_included|rate_limit_exceeded/i.test(G)||N.status===429){let $=Z.plan_type?` (${Z.plan_type.toLowerCase()} plan)`:"",F=Z.resets_at?Math.max(0,Math.round((Z.resets_at*1000-Date.now())/60000)):void 0,L=F!==void 0?` Try again in ~${F} min.`:"";X=`You have hit your ChatGPT usage limit${$}.${L}`.trim()}V=Z.message||X||V}}catch{}return{message:V,friendlyMessage:X}}function pN(N){try{let Q=N.split(".");if(Q.length!==3)throw Error("Invalid token");let X=JSON.parse(atob(Q[1]))?.[ON]?.chatgpt_account_id;if(!X)throw Error("No account ID in token");return X}catch{throw Error("Failed to extract accountId from token")}}function iN(){if(typeof globalThis.crypto?.randomUUID==="function")return globalThis.crypto.randomUUID();return`codex_${Date.now()}_${Math.random().toString(36).slice(2,10)}`}function PN(N,Q,V,X){let Y=new Headers(N);for(let[G,$]of Object.entries(Q||{}))Y.set(G,$);Y.set("Authorization",`Bearer ${X}`),Y.set("chatgpt-account-id",V),Y.set("originator","pi");let Z=B?`pi (${B.platform()} ${B.release()}; ${B.arch()})`:"pi (browser)";return Y.set("User-Agent",Z),Y}function dN(N,Q,V,X,Y){let Z=PN(N,Q,V,X);if(Z.set("OpenAI-Beta","responses=experimental"),Z.set("accept","text/event-stream"),Z.set("content-type","application/json"),Y)Z.set("session_id",Y),Z.set("x-client-request-id",Y);return Z}function aN(N,Q,V,X,Y){let Z=PN(N,Q,V,X);return Z.delete("accept"),Z.delete("content-type"),Z.delete("OpenAI-Beta"),Z.delete("openai-beta"),Z.set("OpenAI-Beta",CN),Z.set("x-client-request-id",Y),Z.set("session_id",Y),Z}export{XQ as streamSimpleOpenAICodexResponses,WN as streamOpenAICodexResponses,ZQ as resetOpenAICodexWebSocketDebugStats,YQ as getOpenAICodexWebSocketDebugStats,fN as closeOpenAICodexWebSocketSessions};
|
package/bin/chunk-3m39v371.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as V}from"./chunk-vgvmt2m1.js";import"./chunk-49ej1y67.js";import"./chunk-2s5a64nr.js";import"./chunk-ps4h3387.js";import"./chunk-dgx2zxze.js";import"./chunk-axx5bh38.js";import"./chunk-e5833tbd.js";import"./chunk-q4f5vvtx.js";import"./chunk-33ee1cvv.js";import"./chunk-kpy0kpna.js";import"./chunk-ajqsprm0.js";import"./chunk-xpqcvxej.js";import"./chunk-4hnrd4qh.js";import{Ee as U}from"./chunk-m7jfszqt.js";import"./chunk-fwf8yne2.js";import"./chunk-cp18trqb.js";import"./chunk-8wv3kdz9.js";import"./chunk-j8q688sx.js";import"./chunk-6r9w7z15.js";import"./chunk-pf8edn5x.js";import"./chunk-5a2maxwp.js";import"./chunk-4kk5g619.js";import{Uf as N}from"./chunk-5tmf3c0g.js";import"./chunk-mnv6pj0k.js";import{$f as Z,Eg as J,bg as q,fg as B,gg as G,ij as K,sg as H}from"./chunk-nwtb6dt1.js";import{Zj as Y}from"./chunk-kbzm1pwx.js";var W=Y(Z(),1);function _(){let{projectId:h}=$.useParams(),{teamId:v,ensureTeamIdForProject:w}=K();W.useEffect(()=>{w(h)},[h,w]);let{data:A}=G(U(h)),b=A?.rootFolder,{data:X}=B({queryKey:["folders",b],queryFn:()=>(async()=>{return await(await J.api.folders[":folderId"].$get({param:{folderId:b}})).json()})(),enabled:!!b});if(!v||!b||!X)return q(N,{});return q(V,{teamId:v,projectId:h,projectName:A.name??"",assetId:"recently-deleted",rootFolderId:b})}var $=H("/projects/$projectId/recently-deleted")({component:_});export{$ as Route};
|
package/bin/chunk-6c4c7t0n.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as q}from"./chunk-gk7158n4.js";import"./chunk-hb5v9ees.js";import"./chunk-ps4h3387.js";import"./chunk-dgx2zxze.js";import"./chunk-axx5bh38.js";import"./chunk-e5833tbd.js";import"./chunk-q4f5vvtx.js";import"./chunk-33ee1cvv.js";import"./chunk-kpy0kpna.js";import"./chunk-ajqsprm0.js";import"./chunk-xpqcvxej.js";import"./chunk-4hnrd4qh.js";import"./chunk-twzgpwst.js";import"./chunk-6mn3jqm9.js";import"./chunk-fwf8yne2.js";import"./chunk-cp18trqb.js";import"./chunk-8wv3kdz9.js";import"./chunk-j8q688sx.js";import"./chunk-pf8edn5x.js";import"./chunk-5a2maxwp.js";import"./chunk-4kk5g619.js";import"./chunk-mnv6pj0k.js";import{bg as f,sg as k}from"./chunk-nwtb6dt1.js";import"./chunk-kbzm1pwx.js";function w(){let{shareId:v}=A.useParams();return f(q,{shareId:v})}var A=k("/share/$shareId/")({component:w});export{A as Route};
|
package/bin/chunk-6frqqxkv.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as V}from"./chunk-vgvmt2m1.js";import"./chunk-49ej1y67.js";import"./chunk-2s5a64nr.js";import"./chunk-ps4h3387.js";import"./chunk-dgx2zxze.js";import"./chunk-axx5bh38.js";import"./chunk-e5833tbd.js";import"./chunk-q4f5vvtx.js";import"./chunk-33ee1cvv.js";import"./chunk-kpy0kpna.js";import"./chunk-ajqsprm0.js";import"./chunk-xpqcvxej.js";import"./chunk-4hnrd4qh.js";import{we as U}from"./chunk-yk3k5g5w.js";import"./chunk-fwf8yne2.js";import"./chunk-cp18trqb.js";import"./chunk-8wv3kdz9.js";import"./chunk-j8q688sx.js";import"./chunk-6r9w7z15.js";import"./chunk-pf8edn5x.js";import"./chunk-5a2maxwp.js";import"./chunk-4kk5g619.js";import{Uf as N}from"./chunk-5tmf3c0g.js";import"./chunk-mnv6pj0k.js";import{$f as Z,Eg as J,bg as q,fg as D,gg as G,ij as K,sg as H}from"./chunk-nwtb6dt1.js";import{Zj as Y}from"./chunk-kbzm1pwx.js";var W=Y(Z(),1);function _(){let{projectId:h}=$.useParams(),{teamId:v,ensureTeamIdForProject:w}=K();W.useEffect(()=>{w(h)},[h,w]);let{data:A}=G(U(h)),b=A?.rootFolder,{data:X}=D({queryKey:["folders",b],queryFn:async()=>{let B=await J.api.folders[":folderId"].$get({param:{folderId:b}});if(!B.ok)throw Error("failed to fetch folder");return await B.json()},enabled:!!b});if(!v||!b||!X)return q(N,{});return q(V,{teamId:v,projectId:h,projectName:A.name??"",assetId:b,rootFolderId:b})}var $=H("/projects/$projectId/")({component:_});export{$ as Route};
|