gemi 0.107.0 → 0.108.0

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.
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{Qc as c,Rc as d,Sc as f,Tc as g,Uc as i,Vc as j,Wc as k,Xc as l,Yc as m,kd as n,ld as o,md as p,rc as a}from"../chunk-5mj7a141.js";import"../chunk-h7pafjej.js";import"../chunk-1npdp1w2.js";import{Ef as b,Mf as e,Of as h}from"../chunk-rh9j8cwv.js";import"../chunk-fwympxqk.js";import"../chunk-njkk498k.js";import"../chunk-gqpge54c.js";import"../chunk-5wt25tyd.js";import"../chunk-k9qmr2wa.js";import"../chunk-4rr9wmh8.js";import"../chunk-47rgq59q.js";import"../chunk-2q7m8a16.js";import"../chunk-9mqqr05d.js";import"../chunk-2gmgd05c.js";import"../chunk-kqz8jp6v.js";import"../chunk-82hpq0bq.js";import"../chunk-3s3awh38.js";export{g as Url,e as Storage,k as Redis,a as Redirect,l as RateLimiter,f as Query,i as Meta,h as Log,m as Lock,d as Lang,n as Features,b as Facade,p as DB,j as Cookie,o as ConnectionQueries,c as Auth};
2
+ import{Qc as c,Rc as d,Sc as f,Tc as g,Uc as i,Vc as j,Wc as k,Xc as l,Yc as m,kd as n,ld as o,md as p,rc as a}from"../chunk-ncfxmtd5.js";import"../chunk-h7pafjej.js";import"../chunk-1npdp1w2.js";import{Ef as b,Mf as e,Of as h}from"../chunk-rh9j8cwv.js";import"../chunk-fwympxqk.js";import"../chunk-njkk498k.js";import"../chunk-gqpge54c.js";import"../chunk-5wt25tyd.js";import"../chunk-k9qmr2wa.js";import"../chunk-4rr9wmh8.js";import"../chunk-47rgq59q.js";import"../chunk-2q7m8a16.js";import"../chunk-9mqqr05d.js";import"../chunk-2gmgd05c.js";import"../chunk-kqz8jp6v.js";import"../chunk-82hpq0bq.js";import"../chunk-3s3awh38.js";export{g as Url,e as Storage,k as Redis,a as Redirect,l as RateLimiter,f as Query,i as Meta,h as Log,m as Lock,d as Lang,n as Features,b as Facade,p as DB,j as Cookie,o as ConnectionQueries,c as Auth};
3
3
 
4
4
  //# debugId=09461EE0626509F964756E2164756E21
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{$d as aa,Dc as I,Ec as J,Fc as K,Ld as M,Md as N,Nd as O,Od as P,Pd as Q,Qd as R,Rd as S,Sd as T,Td as U,Ud as V,Vd as W,Wd as X,Xd as Y,Yd as Z,Zd as _,_d as $,ae as ba,be as ca,ic as n,jc as o,kc as p,lc as q,mc as r,nc as x,oc as y,pc as z,qc as A,sc as B,sd as L,tc as C,uc as D,vc as E,wc as F,xc as G,yc as H}from"../chunk-5mj7a141.js";import"../chunk-h7pafjej.js";import"../chunk-1npdp1w2.js";import{Af as t,Bf as u,Cf as v,Df as w,df as a,ef as b,ff as d,jf as e,kf as f,lf as g,mf as h,nf as i,of as j,tf as k,uf as l,yf as m,zf as s}from"../chunk-rh9j8cwv.js";import{Sf as c}from"../chunk-fwympxqk.js";import"../chunk-njkk498k.js";import"../chunk-gqpge54c.js";import"../chunk-5wt25tyd.js";import"../chunk-k9qmr2wa.js";import"../chunk-4rr9wmh8.js";import"../chunk-47rgq59q.js";import"../chunk-2q7m8a16.js";import"../chunk-9mqqr05d.js";import"../chunk-2gmgd05c.js";import"../chunk-kqz8jp6v.js";import"../chunk-82hpq0bq.js";import"../chunk-3s3awh38.js";export{g as toRangeHeaderValue,n as toMiddlewareList,ca as safeFetch,f as resolveRange,e as parseRangeHeader,h as parseContentRange,r as parseByteSize,H as middlewareConfigDefaults,C as httpError,d as getCookies,j as formatUnsatisfiedContentRange,i as formatContentRange,G as defineMiddlewareConfig,o as createUnsatisfiableResponse,p as createStreamResponse,D as createFileResponse,K as clientIp,S as classifyAddress,E as ViewRouter,k as ValidationError,$ as TooManyRedirectsError,Z as TooLargeError,Y as TimeoutError,ba as SafeResponse,T as SafeFetchError,b as ResourceController,c as RequestBreakerError,J as RateLimitMiddleware,I as RateLimitExceededError,u as RangeNotSatisfiableError,Q as PoliciesServiceProvider,R as Policies,q as PayloadTooLargeError,aa as NetworkError,F as Middleware,A as McpRouter,z as McpRouteDeclaration,y as McpModelParam,l as InvalidValidationRuleError,U as InvalidUrlError,t as InsufficientPermissionsError,B as HttpResponse,m as HttpRequest,v as FileNotFoundError,X as DnsError,O as CorsMiddleware,a as Controller,_ as ContentTypeError,N as CacheMiddleware,P as CSRFMiddleware,L as BodyLimitMiddleware,V as BlockedHostError,W as BlockedAddressError,s as AuthorizationError,M as AuthenticationMiddleware,w as AuthenticationError,x as ApiRouter};
2
+ import{$d as aa,Dc as I,Ec as J,Fc as K,Ld as M,Md as N,Nd as O,Od as P,Pd as Q,Qd as R,Rd as S,Sd as T,Td as U,Ud as V,Vd as W,Wd as X,Xd as Y,Yd as Z,Zd as _,_d as $,ae as ba,be as ca,ic as n,jc as o,kc as p,lc as q,mc as r,nc as x,oc as y,pc as z,qc as A,sc as B,sd as L,tc as C,uc as D,vc as E,wc as F,xc as G,yc as H}from"../chunk-ncfxmtd5.js";import"../chunk-h7pafjej.js";import"../chunk-1npdp1w2.js";import{Af as t,Bf as u,Cf as v,Df as w,df as a,ef as b,ff as d,jf as e,kf as f,lf as g,mf as h,nf as i,of as j,tf as k,uf as l,yf as m,zf as s}from"../chunk-rh9j8cwv.js";import{Sf as c}from"../chunk-fwympxqk.js";import"../chunk-njkk498k.js";import"../chunk-gqpge54c.js";import"../chunk-5wt25tyd.js";import"../chunk-k9qmr2wa.js";import"../chunk-4rr9wmh8.js";import"../chunk-47rgq59q.js";import"../chunk-2q7m8a16.js";import"../chunk-9mqqr05d.js";import"../chunk-2gmgd05c.js";import"../chunk-kqz8jp6v.js";import"../chunk-82hpq0bq.js";import"../chunk-3s3awh38.js";export{g as toRangeHeaderValue,n as toMiddlewareList,ca as safeFetch,f as resolveRange,e as parseRangeHeader,h as parseContentRange,r as parseByteSize,H as middlewareConfigDefaults,C as httpError,d as getCookies,j as formatUnsatisfiedContentRange,i as formatContentRange,G as defineMiddlewareConfig,o as createUnsatisfiableResponse,p as createStreamResponse,D as createFileResponse,K as clientIp,S as classifyAddress,E as ViewRouter,k as ValidationError,$ as TooManyRedirectsError,Z as TooLargeError,Y as TimeoutError,ba as SafeResponse,T as SafeFetchError,b as ResourceController,c as RequestBreakerError,J as RateLimitMiddleware,I as RateLimitExceededError,u as RangeNotSatisfiableError,Q as PoliciesServiceProvider,R as Policies,q as PayloadTooLargeError,aa as NetworkError,F as Middleware,A as McpRouter,z as McpRouteDeclaration,y as McpModelParam,l as InvalidValidationRuleError,U as InvalidUrlError,t as InsufficientPermissionsError,B as HttpResponse,m as HttpRequest,v as FileNotFoundError,X as DnsError,O as CorsMiddleware,a as Controller,_ as ContentTypeError,N as CacheMiddleware,P as CSRFMiddleware,L as BodyLimitMiddleware,V as BlockedHostError,W as BlockedAddressError,s as AuthorizationError,M as AuthenticationMiddleware,w as AuthenticationError,x as ApiRouter};
3
3
 
4
4
  //# debugId=3F6C4E393A63F83664756E2164756E21
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{aa as w}from"../chunk-rjernda5.js";import"../chunk-564zfdd1.js";import{Ya as b}from"../chunk-mrvcaakf.js";import{fc as R,gc as S}from"../chunk-h4x7cba0.js";import"../chunk-9hbwvcxn.js";import{Rc as j}from"../chunk-5mj7a141.js";import"../chunk-h7pafjej.js";import"../chunk-1npdp1w2.js";import"../chunk-rh9j8cwv.js";import"../chunk-fwympxqk.js";import"../chunk-njkk498k.js";import"../chunk-gqpge54c.js";import"../chunk-5wt25tyd.js";import"../chunk-k9qmr2wa.js";import"../chunk-4rr9wmh8.js";import"../chunk-47rgq59q.js";import{Wg as X,Xg as E,Yg as V,Zg as L}from"../chunk-2q7m8a16.js";import"../chunk-9mqqr05d.js";import"../chunk-2gmgd05c.js";import"../chunk-kqz8jp6v.js";import"../chunk-82hpq0bq.js";import"../chunk-3s3awh38.js";import{createElement as J,Fragment as M,isValidElement as U}from"react";function $(q,B){let G=Object.values(B).some((z)=>typeof z==="function"&&U(z(""))),Q=/{{([^{}]+?)(?::([^{}\[\]]+?))?(?:\[(.*?)\])?}}/g;if(!G)return q.replace(Q,(W,O,_,Z)=>{let C=O.includes(":")?O.split(":")[0]:O,H=B[C];if(H===void 0)return W;if(typeof H==="function"){let K=H(Z!==void 0?Z:"");if(U(K))throw Error("JSX returned in string context");return String(K)}if(_)switch(_.toLowerCase()){case"number":return Number(H).toString();case"string":return String(H);case"boolean":return Boolean(H).toString();default:return String(H)}return String(H)});else{let z=[],W=0,O=null;while((O=Q.exec(q))!==null){let[_,Z,C,H]=O,F=O.index,K=Z.includes(":")?Z.split(":")[0]:Z;if(F>W)z.push(q.substring(W,F));let Y=B[K];if(Y===void 0)z.push(_);else if(typeof Y==="function"){let A=Y(H!==void 0?H:"");z.push(A)}else if(C)switch(C.toLowerCase()){case"number":z.push(Number(Y).toString());break;case"string":z.push(String(Y));break;case"boolean":z.push(Boolean(Y).toString());break;default:z.push(String(Y))}else z.push(String(Y));W=F+_.length}if(W<q.length)z.push(q.substring(W));return J(M,{},...z)}}class P{name;dictionary;constructor(q,B){this.name=q;this.dictionary=B}reference(q){if(typeof window<"u")throw Error("Cannot use reference in the browser");if(!this.dictionary?.[q])throw Error(`Translation not found for ${String(q)}`);return this.dictionary[q]}render(q,...B){let{locale:G=j.locale(),params:Q}={params:{},...B[0]};if(typeof window<"u")throw Error("Cannot use render in the browser");if(!this.dictionary?.[q]?.[G])throw Error(`Translation not found for ${String(q)} in ${String(G)}`);return $(this.dictionary[q][G],Q??{})}static create(q,B){return new P(q,B)}static text(q,...B){let{locale:G=j.locale(),params:Q}={params:{},...B?.[0]};if(!q?.[G])throw Error(`Translation not found for ${String(G)}`);return $(q[G],Q??{})}}async function N(q,B,...G){let{locale:Q=j.locale(),params:z}={params:{},...G[0]},O=(await q.load(String(Q)))[B];if(typeof O!=="string")throw Error(`Translation not found for "${B}" in "${String(Q)}" (dictionary ${q.id})`);return $(O,z??{})}export{S as translationConfigDefaults,N as translate,E as isValidTimeZone,R as defineTranslationConfig,w as defineDictionary,V as createFormatter,L as Translator,b as TranslationServiceProvider,P as Dictionary,X as DEFAULT_TIME_ZONE};
2
+ import{aa as w}from"../chunk-rjernda5.js";import"../chunk-564zfdd1.js";import{Ya as b}from"../chunk-mrvcaakf.js";import{fc as R,gc as S}from"../chunk-h4x7cba0.js";import"../chunk-9hbwvcxn.js";import{Rc as j}from"../chunk-ncfxmtd5.js";import"../chunk-h7pafjej.js";import"../chunk-1npdp1w2.js";import"../chunk-rh9j8cwv.js";import"../chunk-fwympxqk.js";import"../chunk-njkk498k.js";import"../chunk-gqpge54c.js";import"../chunk-5wt25tyd.js";import"../chunk-k9qmr2wa.js";import"../chunk-4rr9wmh8.js";import"../chunk-47rgq59q.js";import{Wg as X,Xg as E,Yg as V,Zg as L}from"../chunk-2q7m8a16.js";import"../chunk-9mqqr05d.js";import"../chunk-2gmgd05c.js";import"../chunk-kqz8jp6v.js";import"../chunk-82hpq0bq.js";import"../chunk-3s3awh38.js";import{createElement as J,Fragment as M,isValidElement as U}from"react";function $(q,B){let G=Object.values(B).some((z)=>typeof z==="function"&&U(z(""))),Q=/{{([^{}]+?)(?::([^{}\[\]]+?))?(?:\[(.*?)\])?}}/g;if(!G)return q.replace(Q,(W,O,_,Z)=>{let C=O.includes(":")?O.split(":")[0]:O,H=B[C];if(H===void 0)return W;if(typeof H==="function"){let K=H(Z!==void 0?Z:"");if(U(K))throw Error("JSX returned in string context");return String(K)}if(_)switch(_.toLowerCase()){case"number":return Number(H).toString();case"string":return String(H);case"boolean":return Boolean(H).toString();default:return String(H)}return String(H)});else{let z=[],W=0,O=null;while((O=Q.exec(q))!==null){let[_,Z,C,H]=O,F=O.index,K=Z.includes(":")?Z.split(":")[0]:Z;if(F>W)z.push(q.substring(W,F));let Y=B[K];if(Y===void 0)z.push(_);else if(typeof Y==="function"){let A=Y(H!==void 0?H:"");z.push(A)}else if(C)switch(C.toLowerCase()){case"number":z.push(Number(Y).toString());break;case"string":z.push(String(Y));break;case"boolean":z.push(Boolean(Y).toString());break;default:z.push(String(Y))}else z.push(String(Y));W=F+_.length}if(W<q.length)z.push(q.substring(W));return J(M,{},...z)}}class P{name;dictionary;constructor(q,B){this.name=q;this.dictionary=B}reference(q){if(typeof window<"u")throw Error("Cannot use reference in the browser");if(!this.dictionary?.[q])throw Error(`Translation not found for ${String(q)}`);return this.dictionary[q]}render(q,...B){let{locale:G=j.locale(),params:Q}={params:{},...B[0]};if(typeof window<"u")throw Error("Cannot use render in the browser");if(!this.dictionary?.[q]?.[G])throw Error(`Translation not found for ${String(q)} in ${String(G)}`);return $(this.dictionary[q][G],Q??{})}static create(q,B){return new P(q,B)}static text(q,...B){let{locale:G=j.locale(),params:Q}={params:{},...B?.[0]};if(!q?.[G])throw Error(`Translation not found for ${String(G)}`);return $(q[G],Q??{})}}async function N(q,B,...G){let{locale:Q=j.locale(),params:z}={params:{},...G[0]},O=(await q.load(String(Q)))[B];if(typeof O!=="string")throw Error(`Translation not found for "${B}" in "${String(Q)}" (dictionary ${q.id})`);return $(O,z??{})}export{S as translationConfigDefaults,N as translate,E as isValidTimeZone,R as defineTranslationConfig,w as defineDictionary,V as createFormatter,L as Translator,b as TranslationServiceProvider,P as Dictionary,X as DEFAULT_TIME_ZONE};
3
3
 
4
4
  //# debugId=65B0DC47E3658F0F64756E2164756E21
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Aa as y}from"../chunk-yebaheh7.js";import{Xa as i}from"../chunk-k17prwhx.js";import{Ya as g}from"../chunk-mrvcaakf.js";import{$a as T,Ab as n,ab as D,bb as e,cb as A,db as w,hb as P,ib as S,kb as h,lb as R,mb as u,nb as l,qb as v,rb as d,ub as c,xb as p}from"../chunk-vbm1ng3f.js";import"../chunk-t26n9vzw.js";import"../chunk-ftgd68se.js";import{ac as r}from"../chunk-6wrhc9bq.js";import"../chunk-h4x7cba0.js";import"../chunk-9hbwvcxn.js";import{Cd as K,Dd as M,Ed as s,Fd as C,Gd as m,Hd as Q,Id as t,Jd as o,Kc as Zj,Lc as $j,Oc as Gj,Pc as Hj,td as x,yd as I,zd as E}from"../chunk-5mj7a141.js";import{fe as a}from"../chunk-h7pafjej.js";import{se as V,xe as f}from"../chunk-1npdp1w2.js";import{yf as F}from"../chunk-rh9j8cwv.js";import{Rf as B}from"../chunk-fwympxqk.js";import{Xf as L}from"../chunk-njkk498k.js";import"../chunk-gqpge54c.js";import"../chunk-5wt25tyd.js";import"../chunk-k9qmr2wa.js";import"../chunk-4rr9wmh8.js";import"../chunk-47rgq59q.js";import"../chunk-tyhrrnp5.js";import"../chunk-2q7m8a16.js";import{_g as _,ah as N,bh as b}from"../chunk-9mqqr05d.js";import"../chunk-2gmgd05c.js";import"../chunk-6rz8kyqb.js";import"../chunk-kqz8jp6v.js";import{oh as q}from"../chunk-82hpq0bq.js";import"../chunk-3s3awh38.js";function Jj(j){let X=j.headers.get("Cache-Control")?.toLowerCase()??"";return/(^|[\s,])(public|s-maxage)\b/.test(X)}var Wj=new Set,Xj={refusal:null,apply:(j)=>j,carried:null};async function k(j){let X=b(x);if(X.config.global.length===0)return Xj;let{pathname:Z}=new URL(j.url),W=q(Z),z=new F(j,{},W?"api":"view","");return await L.run(z,async()=>{let $=L.getStore(),{headers:H,cookies:zj}=$,Y=(J)=>{if(!Jj(J))return Q(J,H,zj);let G=new Headers(H);return G.delete("Set-Cookie"),Q(J,G,Wj)};try{return await X.runGlobalMiddleware(),{refusal:null,apply:Y,carried:{user:$.user}}}catch(J){let G=!W&&Z.endsWith(".json");if(J?.kind===B){let O=W?m(J.payload.api):G?M(J.payload.viewData??J.payload.api):K(J.payload.view);return{refusal:Y(O),apply:Y,carried:null}}if(V(J)&&(W||G))return{refusal:Y(C()),apply:Y,carried:null};if(f(J)){console.error(J);let O=W||G?I():K(E());return{refusal:Y(O),apply:Y,carried:null}}throw J}finally{$.destroy()}})}var U=[l,d,y,P,n,A,S,v,R,D,h,p,u,g,c,w];class jj{config={};providers=[];services=[];serviceInstances=[];serviceTokens=new Set;servicesBooted=!1;models=[];app=new N;boot(){if(this.models.length>0)i(...this.models);else Yj();this.app.config.merge(this.config),N.setInstance(this.app),this.app.registerMany([...U,...this.providers]),this.registerServices()}registerServices(){let j=this.serviceTokens;this.serviceInstances=[],this.serviceTokens=new Set,this.servicesBooted=!1;let X=new Map;for(let Z of this.services){let W=typeof Z==="function"?new Z:Z,z=W.constructor;if(!z.token)throw Error(`Service [${z.name}] is listed in \`services\` but does not declare a \`static token\`.`);let $=X.get(z.token);if($)throw Error(`Services [${$}] and [${z.name}] both declare the token "${z.token}". Tokens are the container's keys, so they must be unique.`);X.set(z.token,z.name);let H=z;if(!j.has(z.token)&&this.app.bound(H))throw Error(`Service [${z.name}] declares the token "${z.token}", which is already bound in the container by the framework or a provider. Binding it would replace that service everywhere, so pick a token nothing else owns.`);this.app.instance(H,W),this.serviceInstances.push(W),this.serviceTokens.add(z.token)}}async waitForBoot(){await this.app.boot(),await this.bootServices(),e(this.app)}async bootServices(){if(this.servicesBooted)return;for(let j of this.serviceInstances)await j.boot();this.servicesBooted=!0}shutdown(j){return this.run(()=>this.app.shutdown(j))}run(j){return _.run(this.app,j)}resolve(j){return this.app.make(j)}apiRoutes(){return this.app.make(t)}viewRoutes(){return this.app.make(s)}domains(){return this.app.make(o)}queue(){return this.app.make(r)}globalMiddleware(j){return k(j)}destroy(){if(this.app.resolved(T))this.app.make(T).stop();if(this.app.flush(),N.getInstance()===this.app)N.setInstance(void 0);_.disable()}}function Yj(){if(Bun.env.NODE_ENV==="production")return;let j=a();if(j.length===0)return;console.warn(`[gemi] ${j.length} model${j.length===1?" is":"s are"} registered, but Kernel.models is empty.
2
+ import{Aa as y}from"../chunk-yebaheh7.js";import{Xa as i}from"../chunk-k17prwhx.js";import{Ya as g}from"../chunk-mrvcaakf.js";import{$a as T,Ab as n,ab as D,bb as e,cb as A,db as w,hb as P,ib as S,kb as h,lb as R,mb as u,nb as l,qb as v,rb as d,ub as c,xb as p}from"../chunk-2mhx4e4g.js";import"../chunk-t26n9vzw.js";import"../chunk-ftgd68se.js";import{ac as r}from"../chunk-6wrhc9bq.js";import"../chunk-h4x7cba0.js";import"../chunk-9hbwvcxn.js";import{Cd as K,Dd as M,Ed as s,Fd as C,Gd as m,Hd as Q,Id as t,Jd as o,Kc as Zj,Lc as $j,Oc as Gj,Pc as Hj,td as x,yd as I,zd as E}from"../chunk-ncfxmtd5.js";import{fe as a}from"../chunk-h7pafjej.js";import{se as V,xe as f}from"../chunk-1npdp1w2.js";import{yf as F}from"../chunk-rh9j8cwv.js";import{Rf as B}from"../chunk-fwympxqk.js";import{Xf as L}from"../chunk-njkk498k.js";import"../chunk-gqpge54c.js";import"../chunk-5wt25tyd.js";import"../chunk-k9qmr2wa.js";import"../chunk-4rr9wmh8.js";import"../chunk-47rgq59q.js";import"../chunk-tyhrrnp5.js";import"../chunk-2q7m8a16.js";import{_g as _,ah as N,bh as b}from"../chunk-9mqqr05d.js";import"../chunk-2gmgd05c.js";import"../chunk-6rz8kyqb.js";import"../chunk-kqz8jp6v.js";import{oh as q}from"../chunk-82hpq0bq.js";import"../chunk-3s3awh38.js";function Jj(j){let X=j.headers.get("Cache-Control")?.toLowerCase()??"";return/(^|[\s,])(public|s-maxage)\b/.test(X)}var Wj=new Set,Xj={refusal:null,apply:(j)=>j,carried:null};async function k(j){let X=b(x);if(X.config.global.length===0)return Xj;let{pathname:Z}=new URL(j.url),W=q(Z),z=new F(j,{},W?"api":"view","");return await L.run(z,async()=>{let $=L.getStore(),{headers:H,cookies:zj}=$,Y=(J)=>{if(!Jj(J))return Q(J,H,zj);let G=new Headers(H);return G.delete("Set-Cookie"),Q(J,G,Wj)};try{return await X.runGlobalMiddleware(),{refusal:null,apply:Y,carried:{user:$.user}}}catch(J){let G=!W&&Z.endsWith(".json");if(J?.kind===B){let O=W?m(J.payload.api):G?M(J.payload.viewData??J.payload.api):K(J.payload.view);return{refusal:Y(O),apply:Y,carried:null}}if(V(J)&&(W||G))return{refusal:Y(C()),apply:Y,carried:null};if(f(J)){console.error(J);let O=W||G?I():K(E());return{refusal:Y(O),apply:Y,carried:null}}throw J}finally{$.destroy()}})}var U=[l,d,y,P,n,A,S,v,R,D,h,p,u,g,c,w];class jj{config={};providers=[];services=[];serviceInstances=[];serviceTokens=new Set;servicesBooted=!1;models=[];app=new N;boot(){if(this.models.length>0)i(...this.models);else Yj();this.app.config.merge(this.config),N.setInstance(this.app),this.app.registerMany([...U,...this.providers]),this.registerServices()}registerServices(){let j=this.serviceTokens;this.serviceInstances=[],this.serviceTokens=new Set,this.servicesBooted=!1;let X=new Map;for(let Z of this.services){let W=typeof Z==="function"?new Z:Z,z=W.constructor;if(!z.token)throw Error(`Service [${z.name}] is listed in \`services\` but does not declare a \`static token\`.`);let $=X.get(z.token);if($)throw Error(`Services [${$}] and [${z.name}] both declare the token "${z.token}". Tokens are the container's keys, so they must be unique.`);X.set(z.token,z.name);let H=z;if(!j.has(z.token)&&this.app.bound(H))throw Error(`Service [${z.name}] declares the token "${z.token}", which is already bound in the container by the framework or a provider. Binding it would replace that service everywhere, so pick a token nothing else owns.`);this.app.instance(H,W),this.serviceInstances.push(W),this.serviceTokens.add(z.token)}}async waitForBoot(){await this.app.boot(),await this.bootServices(),e(this.app)}async bootServices(){if(this.servicesBooted)return;for(let j of this.serviceInstances)await j.boot();this.servicesBooted=!0}shutdown(j){return this.run(()=>this.app.shutdown(j))}run(j){return _.run(this.app,j)}resolve(j){return this.app.make(j)}apiRoutes(){return this.app.make(t)}viewRoutes(){return this.app.make(s)}domains(){return this.app.make(o)}queue(){return this.app.make(r)}globalMiddleware(j){return k(j)}destroy(){if(this.app.resolved(T))this.app.make(T).stop();if(this.app.flush(),N.getInstance()===this.app)N.setInstance(void 0);_.disable()}}function Yj(){if(Bun.env.NODE_ENV==="production")return;let j=a();if(j.length===0)return;console.warn(`[gemi] ${j.length} model${j.length===1?" is":"s are"} registered, but Kernel.models is empty.
3
3
  Nested relation reads resolve a model by name, so a policy on a subclass that does not own its
4
4
  `+" name is skipped inside every include \u2014 scoped at the root, "+`unscoped in an include, with nothing
5
5
  to notice it. Declaring the modules registers each class under its own name and audits the set:
@@ -1 +1 @@
1
- {"version":3,"file":"httpProd.d.ts","sourceRoot":"","sources":["../../server/httpProd.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAiD1C,wBAAsB,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,eAAe,EAAE,eAAe,kCAuNxE"}
1
+ {"version":3,"file":"httpProd.d.ts","sourceRoot":"","sources":["../../server/httpProd.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAmD1C,wBAAsB,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,eAAe,EAAE,eAAe,kCAsOxE"}
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{ya as I}from"../chunk-tvy2fqza.js";import{za as A}from"../chunk-wsftnxzs.js";import{eh as b,gh as V,hh as H,ih as O,jh as W}from"../chunk-6rz8kyqb.js";import{nh as k}from"../chunk-kqz8jp6v.js";import"../chunk-82hpq0bq.js";import{uh as $}from"../chunk-3s3awh38.js";var X=Symbol.for("gemi.server.devGeneration"),L={graceMs:1e4,providerTimeoutMs:5000};class Q{app;inFlight=0;waiters=new Set;constructor(z){this.app=z}track(z){return async(B,J)=>{this.inFlight++;try{return await z(B,J)}finally{if(this.inFlight--,this.inFlight===0)this.wake()}}}get pending(){return this.inFlight}async retire({graceMs:z,providerTimeoutMs:B}){try{await this.idle(z),await Promise.resolve().then(()=>this.app.shutdown({timeoutMs:B}))}catch(J){Z(J)}}idle(z){if(this.inFlight===0)return Promise.resolve();return new Promise((B)=>{let J=()=>{clearTimeout(K),this.waiters.delete(J),B()},K=setTimeout(J,z);this.waiters.add(J)})}wake(){for(let z of this.waiters)z()}}function Y(z,B=L){let J=globalThis,K=J[X];if(J[X]=z,!K||K===z||typeof K.retire!=="function")return Promise.resolve();let _=K.retire.bind(K);return Promise.resolve().then(()=>_(B)).catch(Z)}function Z(z){console.error("[gemi] Shutting down the application a reload replaced failed:",z)}class P{app;instrumentation;handleSignals;server;stopping;settings;constructor(z){this.app=new A({kernel:z.kernel}),this.handleSignals=z.handleSignals??!0,this.instrumentation=O(z.instrumentation??((B,J)=>J(B)))}async start(){process.env.ROOT_DIR=k();let z=Bun.env.NODE_ENV==="production";if(z){if(this.handleSignals)W(()=>this.stop());this.settings=V()}try{await this.app.waitForBoot()}catch(B){if(!z)this.app.shutdown({timeoutMs:L.providerTimeoutMs});throw B}if(z){let{httpProd:B}=await import("../chunk-6tyf0h6k.js");this.server=await B(this.app,this.instrumentation.bind(this))}else{I();let{httpDev:B}=await import("../chunk-6zqqec7r.js"),J=new Q(this.app);this.server=await B(this.app,J.track(this.instrumentation.bind(this))),Y(J)}return this.server}stop(z={}){return this.stopping??=H({server:this.server,shutdownProviders:(B)=>this.app.shutdown(B),settings:{...this.settings??V(),...z}}),this.stopping}}export{b as isShuttingDown,P as Server};
2
+ import{ya as I}from"../chunk-tvy2fqza.js";import{za as A}from"../chunk-wsftnxzs.js";import{eh as b,gh as V,hh as H,ih as O,jh as W}from"../chunk-6rz8kyqb.js";import{nh as k}from"../chunk-kqz8jp6v.js";import"../chunk-82hpq0bq.js";import{uh as $}from"../chunk-3s3awh38.js";var X=Symbol.for("gemi.server.devGeneration"),L={graceMs:1e4,providerTimeoutMs:5000};class Q{app;inFlight=0;waiters=new Set;constructor(z){this.app=z}track(z){return async(B,J)=>{this.inFlight++;try{return await z(B,J)}finally{if(this.inFlight--,this.inFlight===0)this.wake()}}}get pending(){return this.inFlight}async retire({graceMs:z,providerTimeoutMs:B}){try{await this.idle(z),await Promise.resolve().then(()=>this.app.shutdown({timeoutMs:B}))}catch(J){Z(J)}}idle(z){if(this.inFlight===0)return Promise.resolve();return new Promise((B)=>{let J=()=>{clearTimeout(K),this.waiters.delete(J),B()},K=setTimeout(J,z);this.waiters.add(J)})}wake(){for(let z of this.waiters)z()}}function Y(z,B=L){let J=globalThis,K=J[X];if(J[X]=z,!K||K===z||typeof K.retire!=="function")return Promise.resolve();let _=K.retire.bind(K);return Promise.resolve().then(()=>_(B)).catch(Z)}function Z(z){console.error("[gemi] Shutting down the application a reload replaced failed:",z)}class P{app;instrumentation;handleSignals;server;stopping;settings;constructor(z){this.app=new A({kernel:z.kernel}),this.handleSignals=z.handleSignals??!0,this.instrumentation=O(z.instrumentation??((B,J)=>J(B)))}async start(){process.env.ROOT_DIR=k();let z=Bun.env.NODE_ENV==="production";if(z){if(this.handleSignals)W(()=>this.stop());this.settings=V()}try{await this.app.waitForBoot()}catch(B){if(!z)this.app.shutdown({timeoutMs:L.providerTimeoutMs});throw B}if(z){let{httpProd:B}=await import("../chunk-h2hdpm70.js");this.server=await B(this.app,this.instrumentation.bind(this))}else{I();let{httpDev:B}=await import("../chunk-b9av1sgb.js"),J=new Q(this.app);this.server=await B(this.app,J.track(this.instrumentation.bind(this))),Y(J)}return this.server}stop(z={}){return this.stopping??=H({server:this.server,shutdownProviders:(B)=>this.app.shutdown(B),settings:{...this.settings??V(),...z}}),this.stopping}}export{b as isShuttingDown,P as Server};
3
3
 
4
4
  //# debugId=8D2146DF54E7056B64756E2164756E21
@@ -1,3 +1,4 @@
1
+ import { type ContentEncoding } from "./compression";
1
2
  /**
2
3
  * Every file in `dist/client` outside `/assets`, as absolute paths — what
3
4
  * Vite copied out of `public/` (#583).
@@ -16,6 +17,19 @@
16
17
  * reach. `/.well-known` is served by its own rule.
17
18
  */
18
19
  export declare function listPublicFiles(clientDir: string): Promise<Set<string>>;
20
+ export interface StaticFileOptions {
21
+ /**
22
+ * The file is a content-hashed build asset (it is in the build's
23
+ * `static-assets.json`), so it is sent as `immutable`.
24
+ */
25
+ immutable?: boolean;
26
+ /**
27
+ * The precompressed siblings the build wrote for it (`file.br`,
28
+ * `file.gz`), in preference order. Offering any makes the response vary by
29
+ * `Accept-Encoding`, so it says so even when it sends identity.
30
+ */
31
+ encodings?: ContentEncoding[];
32
+ }
19
33
  /**
20
34
  * The response for a file in `dist/client` that is known to exist.
21
35
  *
@@ -26,8 +40,13 @@ export declare function listPublicFiles(clientDir: string): Promise<Set<string>>
26
40
  * Bun version a deployment runs, and answers an unsatisfiable range with the
27
41
  * same 416 the `stream()` responses use.
28
42
  *
43
+ * A build asset with precompressed siblings is sent as the one
44
+ * `Accept-Encoding` prefers (brotli, then gzip, then identity), with the
45
+ * original's `Content-Type`. Nothing is compressed here: a file without a
46
+ * sibling is sent as is.
47
+ *
29
48
  * `Bun.file().type` is the mime lookup, and is `application/octet-stream` for
30
49
  * an extension it does not know.
31
50
  */
32
- export declare function staticFileResponse(req: Request, path: string): Response;
51
+ export declare function staticFileResponse(req: Request, path: string, options?: StaticFileOptions): Promise<Response>;
33
52
  //# sourceMappingURL=staticFile.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"staticFile.d.ts","sourceRoot":"","sources":["../../server/staticFile.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAkC7E;AAID;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,QAAQ,CAgCvE"}
1
+ {"version":3,"file":"staticFile.d.ts","sourceRoot":"","sources":["../../server/staticFile.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,eAAe,EAAqB,MAAM,eAAe,CAAC;AAGxE;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAkC7E;AAWD,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,SAAS,CAAC,EAAE,eAAe,EAAE,CAAC;CAC/B;AA2BD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,OAAO,EACZ,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,QAAQ,CAAC,CAkDnB"}
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{_a as dW}from"../chunk-hyfzw1fk.js";import{$a as i6,Ab as uW,ab as DW,cb as FW,db as UW,eb as SW,fb as fW,gb as RW,hb as kW,ib as _W,jb as U,kb as CW,lb as vW,mb as bW,nb as IW,ob as TW,pb as qW,qb as hW,rb as PW,sb as wW,tb as AW,ub as yW,vb as VW,wb as gW,xb as cW,yb as EW,zb as mW}from"../chunk-vbm1ng3f.js";import"../chunk-t26n9vzw.js";import{Gb as YW,Hb as JW,Ib as ZW,Jb as GW,Kb as $W,Lb as QW,Mb as KW,Nb as XW,Ob as zW,Pb as BW,Qb as xW,Rb as MW,Sb as jW,Tb as NW,Ub as LW}from"../chunk-ftgd68se.js";import{$b as e6,Vb as n6,Wb as o6,Xb as s6,Yb as a6,Zb as t6,_b as r6,ac as WW}from"../chunk-6wrhc9bq.js";import{fc as OW,gc as HW}from"../chunk-h4x7cba0.js";import"../chunk-9hbwvcxn.js";import{$c as O6,Ac as J6,Bc as Z6,Cc as G6,Ed as g6,Gc as s4,Hc as a4,Ic as g1,Id as c6,Jc as $6,Kd as E6,Mc as Q6,Nc as K6,Zc as D6,_c as F6,ad as H6,bd as U6,cd as S6,dd as f6,ed as d4,fd as R6,gd as k6,hd as _6,id as C6,jd as v6,nd as b6,od as I6,pd as T6,qd as q6,rc as b0,rd as h6,td as P6,ud as w6,vd as A6,wd as y6,xc as e0,xd as V6,yc as W6,zc as Y6}from"../chunk-5mj7a141.js";import"../chunk-h7pafjej.js";import"../chunk-1npdp1w2.js";import{Bf as g,Cf as w,Gf as J1,Hf as L1,If as X6,Jf as z6,Kf as B6,Lf as x6,Nf as M6,Pf as D1,kf as V1,lf as A1,mf as Y1}from"../chunk-rh9j8cwv.js";import"../chunk-fwympxqk.js";import"../chunk-njkk498k.js";import{Yf as j6,Zf as N6,_f as L6}from"../chunk-gqpge54c.js";import"../chunk-5wt25tyd.js";import"../chunk-k9qmr2wa.js";import"../chunk-4rr9wmh8.js";import"../chunk-47rgq59q.js";import{Pg as m6,Qg as u6,Rg as d6,Sg as p6,Ug as l6}from"../chunk-tyhrrnp5.js";import"../chunk-2q7m8a16.js";import{bh as c}from"../chunk-9mqqr05d.js";import"../chunk-2gmgd05c.js";import"../chunk-6rz8kyqb.js";import"../chunk-kqz8jp6v.js";import"../chunk-82hpq0bq.js";import{uh as l4}from"../chunk-3s3awh38.js";import{Buffer as p4}from"buffer";class n4 extends J1{client;config;constructor(...W){super();this.config=W}async connect(){let W=await import("../chunk-cfsscms3.js");return this.client??=new W.S3Client(...this.config),{sdk:W,client:this.client}}async put(W,{signal:Y}={}){Y?.throwIfAborted();let J,Z,G,$=process.env.BUCKET_NAME;if(W instanceof Blob)J=W,G=`${Bun.randomUUIDv7()}.${W.type.split("/")[1].split(";")[0]}`,Z=W.type;else J=W.body,G=W.name,$=W.bucket??$,Z=W.contentType||(J instanceof Blob||J instanceof File?J.type:void 0);Z=Z||void 0;let Q=J instanceof p4?J:J instanceof Blob||J instanceof File?p4.from(await J.arrayBuffer()):"",{sdk:K,client:z}=await this.connect();return Y?.throwIfAborted(),await z.send(new K.PutObjectCommand({Bucket:$,Key:G,Body:Q,ContentType:Z}),{abortSignal:Y}),G}async delete(W){let Y=typeof W==="string"?W:W.name,J=(typeof W==="string"?void 0:W.bucket)??process.env.BUCKET_NAME;if(!Y)throw Error("Object name has to be specified");let{sdk:Z,client:G}=await this.connect();try{await G.send(new Z.DeleteObjectCommand({Bucket:J,Key:Y}))}catch($){if($?.name==="NoSuchKey"||$?.$metadata?.httpStatusCode===404)return;throw $}}async list(W){let{sdk:Y,client:J}=await this.connect();return await J.send(new Y.ListObjectsV2Command({Bucket:process.env.BUCKET_NAME,Prefix:W}))}async fetch(W,{signal:Y}={}){Y?.throwIfAborted();let J=process.env.BUCKET_NAME,Z;if(typeof W==="string")Z=W;else J=W.bucket??J,Z=W.name;if(!Z)throw Error("Object name has to be specified");let{sdk:G,client:$}=await this.connect();Y?.throwIfAborted();let Q=await $.send(new G.GetObjectCommand({Bucket:J,Key:Z}),{abortSignal:Y}),K=L1(Q.Body.transformToWebStream(),Y);return Y?.throwIfAborted(),new Response(K,{headers:{"Content-Type":Q.ContentType,"Content-Length":Q.ContentLength.toString(),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":Q.LastModified?.toUTCString()||"",ETag:Q.ETag||""}})}async read(W){let Y=typeof W==="string"?{name:W}:W,J=Y.bucket??process.env.BUCKET_NAME,{name:Z,range:G=null}=Y;if(!Z)throw Error("Object name has to be specified");let{sdk:$,client:Q}=await this.connect(),K;try{K=await Q.send(new $.GetObjectCommand({Bucket:J,Key:Z,Range:G?A1(G):void 0}))}catch(M){if(M?.name==="InvalidRange"||M?.$metadata?.httpStatusCode===416)throw new g(await this.size({name:Z,bucket:J}));if(M?.name==="NoSuchKey"||M?.$metadata?.httpStatusCode===404)throw new w(Z);throw M}let z=Y1(K.ContentRange),X=Boolean(z)&&K.$metadata?.httpStatusCode===206,x=z?.total??K.ContentLength??0;return{body:K.Body.transformToWebStream(),start:z?.start??0,end:z?.end??x-1,total:x,partial:X,type:K.ContentType??"application/octet-stream",etag:K.ETag||void 0,lastModified:K.LastModified,name:Z}}async size(W){let Y=typeof W==="string"?W:W.name,J=(typeof W==="string"?void 0:W.bucket)??process.env.BUCKET_NAME,{sdk:Z,client:G}=await this.connect();try{return(await G.send(new Z.HeadObjectCommand({Bucket:J,Key:Y}))).ContentLength??0}catch($){if($?.name==="NotFound"||$?.$metadata?.httpStatusCode===404)throw new w(Y);throw $}}}import{Buffer as i4}from"buffer";import{Readable as q0}from"stream";function y1(W){return W?.statusCode===404||W?.details?.errorCode==="BlobNotFound"||W?.code==="BlobNotFound"}function h0(W){return W?.statusCode===416||W?.details?.errorCode==="InvalidRange"||W?.code==="InvalidRange"}class o4 extends J1{config;serviceClientPromise=null;constructor(W={}){super();this.config=W}async serviceClient(){if(this.config.serviceClient)return this.config.serviceClient;return this.serviceClientPromise??=(async()=>{let W;try{W=await import("@azure/storage-blob")}catch{throw Error("AzureBlobDriver requires the '@azure/storage-blob' package. Install it with `bun add @azure/storage-blob`, or pass a pre-built `serviceClient`.")}let Y=this.config.connectionString??process.env.AZURE_STORAGE_CONNECTION_STRING;if(this.config.url)return new W.BlobServiceClient(this.config.url,this.config.credential);if(Y)return W.BlobServiceClient.fromConnectionString(Y);throw Error("AzureBlobDriver needs a connection string (AZURE_STORAGE_CONNECTION_STRING), a `url`, or a `serviceClient`.")})(),this.serviceClientPromise}async blob(W,Y){if(!W)throw Error("Object name has to be specified");let J=Y??this.config.container??process.env.BUCKET_NAME;if(!J)throw Error("AzureBlobDriver needs a container name, from `bucket`, the `container` config, or BUCKET_NAME.");return(await this.serviceClient()).getContainerClient(J).getBlockBlobClient(W)}async put(W,{signal:Y}={}){Y?.throwIfAborted();let J,Z,G,$;if(W instanceof Blob)J=W,G=`${Bun.randomUUIDv7()}.${W.type.split("/")[1].split(";")[0]}`,Z=W.type;else J=W.body,G=W.name,$=W.bucket,Z=W.contentType??(J instanceof Blob||J instanceof File?J.type:void 0);let Q=J instanceof i4?J:i4.from(await J.arrayBuffer()),K=await this.blob(G,$);return Y?.throwIfAborted(),await K.uploadData(Q,{blobHTTPHeaders:Z?{blobContentType:Z}:void 0,abortSignal:Y}),G}async list(W){let Y=this.config.container??process.env.BUCKET_NAME,Z=(await this.serviceClient()).getContainerClient(Y),G=[];for await(let $ of Z.listBlobsFlat({prefix:W}))G.push($.name);return G}async fetch(W,{signal:Y}={}){Y?.throwIfAborted();let J=await this.download(typeof W==="string"?{name:W}:{name:W.name,bucket:W.bucket},Y);return new Response(J.body,{headers:{"Content-Type":J.type,"Content-Length":String(J.total),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":J.lastModified?.toUTCString()??"",ETag:J.etag??""}})}async read(W){return this.download(typeof W==="string"?{name:W}:W)}async download(W,Y){let{name:J,bucket:Z,range:G=null}=W,$=await this.blob(J,Z);Y?.throwIfAborted();let Q,K,z=G?.kind==="suffix"||G?.kind==="offset"&&G.end===null&&G.start===0;if(G&&z){let b=await this.size({name:J,bucket:Z}),W1=V1(G,b);if(!W1)throw new g(b);Q=W1.start,K=W1.length}else if(G?.kind==="offset")Q=G.start,K=G.end===null?void 0:G.end-G.start+1;let X;try{X=await $.download(Q,K,Y?{abortSignal:Y}:void 0)}catch(b){if(h0(b))throw new g(await this.size({name:J,bucket:Z}));if(y1(b))throw new w(J);throw b}let x=Y1(X.contentRange),M=Boolean(x),R=x?.total??X.contentLength??0,v=await P0(X);if(v instanceof ReadableStream)v=L1(v,Y);return Y?.throwIfAborted(),{body:v,start:x?.start??0,end:x?.end??R-1,total:R,partial:M,type:X.contentType??"application/octet-stream",etag:X.etag||void 0,lastModified:X.lastModified,name:J}}async size(W){let Y=typeof W==="string"?W:W.name,J=typeof W==="string"?void 0:W.bucket,Z=await this.blob(Y,J);try{return(await Z.getProperties()).contentLength??0}catch(G){if(y1(G))throw new w(Y);throw G}}async delete(W){let Y=typeof W==="string"?W:W.name,J=typeof W==="string"?void 0:W.bucket,Z=await this.blob(Y,J);try{await Z.delete()}catch(G){if(y1(G))return;throw G}}}async function P0(W){if(W.blobBody)return await W.blobBody;if(W.readableStreamBody)return q0.toWeb(W.readableStreamBody);return null}var w0=`
2
+ import{_a as dW}from"../chunk-hyfzw1fk.js";import{$a as i6,Ab as uW,ab as DW,cb as FW,db as UW,eb as SW,fb as fW,gb as RW,hb as kW,ib as _W,jb as U,kb as CW,lb as vW,mb as bW,nb as IW,ob as TW,pb as qW,qb as hW,rb as PW,sb as wW,tb as AW,ub as yW,vb as VW,wb as gW,xb as cW,yb as EW,zb as mW}from"../chunk-2mhx4e4g.js";import"../chunk-t26n9vzw.js";import{Gb as YW,Hb as JW,Ib as ZW,Jb as GW,Kb as $W,Lb as QW,Mb as KW,Nb as XW,Ob as zW,Pb as BW,Qb as xW,Rb as MW,Sb as jW,Tb as NW,Ub as LW}from"../chunk-ftgd68se.js";import{$b as e6,Vb as n6,Wb as o6,Xb as s6,Yb as a6,Zb as t6,_b as r6,ac as WW}from"../chunk-6wrhc9bq.js";import{fc as OW,gc as HW}from"../chunk-h4x7cba0.js";import"../chunk-9hbwvcxn.js";import{$c as O6,Ac as J6,Bc as Z6,Cc as G6,Ed as g6,Gc as s4,Hc as a4,Ic as g1,Id as c6,Jc as $6,Kd as E6,Mc as Q6,Nc as K6,Zc as D6,_c as F6,ad as H6,bd as U6,cd as S6,dd as f6,ed as d4,fd as R6,gd as k6,hd as _6,id as C6,jd as v6,nd as b6,od as I6,pd as T6,qd as q6,rc as b0,rd as h6,td as P6,ud as w6,vd as A6,wd as y6,xc as e0,xd as V6,yc as W6,zc as Y6}from"../chunk-ncfxmtd5.js";import"../chunk-h7pafjej.js";import"../chunk-1npdp1w2.js";import{Bf as g,Cf as w,Gf as J1,Hf as L1,If as X6,Jf as z6,Kf as B6,Lf as x6,Nf as M6,Pf as D1,kf as V1,lf as A1,mf as Y1}from"../chunk-rh9j8cwv.js";import"../chunk-fwympxqk.js";import"../chunk-njkk498k.js";import{Yf as j6,Zf as N6,_f as L6}from"../chunk-gqpge54c.js";import"../chunk-5wt25tyd.js";import"../chunk-k9qmr2wa.js";import"../chunk-4rr9wmh8.js";import"../chunk-47rgq59q.js";import{Pg as m6,Qg as u6,Rg as d6,Sg as p6,Ug as l6}from"../chunk-tyhrrnp5.js";import"../chunk-2q7m8a16.js";import{bh as c}from"../chunk-9mqqr05d.js";import"../chunk-2gmgd05c.js";import"../chunk-6rz8kyqb.js";import"../chunk-kqz8jp6v.js";import"../chunk-82hpq0bq.js";import{uh as l4}from"../chunk-3s3awh38.js";import{Buffer as p4}from"buffer";class n4 extends J1{client;config;constructor(...W){super();this.config=W}async connect(){let W=await import("../chunk-cfsscms3.js");return this.client??=new W.S3Client(...this.config),{sdk:W,client:this.client}}async put(W,{signal:Y}={}){Y?.throwIfAborted();let J,Z,G,$=process.env.BUCKET_NAME;if(W instanceof Blob)J=W,G=`${Bun.randomUUIDv7()}.${W.type.split("/")[1].split(";")[0]}`,Z=W.type;else J=W.body,G=W.name,$=W.bucket??$,Z=W.contentType||(J instanceof Blob||J instanceof File?J.type:void 0);Z=Z||void 0;let Q=J instanceof p4?J:J instanceof Blob||J instanceof File?p4.from(await J.arrayBuffer()):"",{sdk:K,client:z}=await this.connect();return Y?.throwIfAborted(),await z.send(new K.PutObjectCommand({Bucket:$,Key:G,Body:Q,ContentType:Z}),{abortSignal:Y}),G}async delete(W){let Y=typeof W==="string"?W:W.name,J=(typeof W==="string"?void 0:W.bucket)??process.env.BUCKET_NAME;if(!Y)throw Error("Object name has to be specified");let{sdk:Z,client:G}=await this.connect();try{await G.send(new Z.DeleteObjectCommand({Bucket:J,Key:Y}))}catch($){if($?.name==="NoSuchKey"||$?.$metadata?.httpStatusCode===404)return;throw $}}async list(W){let{sdk:Y,client:J}=await this.connect();return await J.send(new Y.ListObjectsV2Command({Bucket:process.env.BUCKET_NAME,Prefix:W}))}async fetch(W,{signal:Y}={}){Y?.throwIfAborted();let J=process.env.BUCKET_NAME,Z;if(typeof W==="string")Z=W;else J=W.bucket??J,Z=W.name;if(!Z)throw Error("Object name has to be specified");let{sdk:G,client:$}=await this.connect();Y?.throwIfAborted();let Q=await $.send(new G.GetObjectCommand({Bucket:J,Key:Z}),{abortSignal:Y}),K=L1(Q.Body.transformToWebStream(),Y);return Y?.throwIfAborted(),new Response(K,{headers:{"Content-Type":Q.ContentType,"Content-Length":Q.ContentLength.toString(),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":Q.LastModified?.toUTCString()||"",ETag:Q.ETag||""}})}async read(W){let Y=typeof W==="string"?{name:W}:W,J=Y.bucket??process.env.BUCKET_NAME,{name:Z,range:G=null}=Y;if(!Z)throw Error("Object name has to be specified");let{sdk:$,client:Q}=await this.connect(),K;try{K=await Q.send(new $.GetObjectCommand({Bucket:J,Key:Z,Range:G?A1(G):void 0}))}catch(M){if(M?.name==="InvalidRange"||M?.$metadata?.httpStatusCode===416)throw new g(await this.size({name:Z,bucket:J}));if(M?.name==="NoSuchKey"||M?.$metadata?.httpStatusCode===404)throw new w(Z);throw M}let z=Y1(K.ContentRange),X=Boolean(z)&&K.$metadata?.httpStatusCode===206,x=z?.total??K.ContentLength??0;return{body:K.Body.transformToWebStream(),start:z?.start??0,end:z?.end??x-1,total:x,partial:X,type:K.ContentType??"application/octet-stream",etag:K.ETag||void 0,lastModified:K.LastModified,name:Z}}async size(W){let Y=typeof W==="string"?W:W.name,J=(typeof W==="string"?void 0:W.bucket)??process.env.BUCKET_NAME,{sdk:Z,client:G}=await this.connect();try{return(await G.send(new Z.HeadObjectCommand({Bucket:J,Key:Y}))).ContentLength??0}catch($){if($?.name==="NotFound"||$?.$metadata?.httpStatusCode===404)throw new w(Y);throw $}}}import{Buffer as i4}from"buffer";import{Readable as q0}from"stream";function y1(W){return W?.statusCode===404||W?.details?.errorCode==="BlobNotFound"||W?.code==="BlobNotFound"}function h0(W){return W?.statusCode===416||W?.details?.errorCode==="InvalidRange"||W?.code==="InvalidRange"}class o4 extends J1{config;serviceClientPromise=null;constructor(W={}){super();this.config=W}async serviceClient(){if(this.config.serviceClient)return this.config.serviceClient;return this.serviceClientPromise??=(async()=>{let W;try{W=await import("@azure/storage-blob")}catch{throw Error("AzureBlobDriver requires the '@azure/storage-blob' package. Install it with `bun add @azure/storage-blob`, or pass a pre-built `serviceClient`.")}let Y=this.config.connectionString??process.env.AZURE_STORAGE_CONNECTION_STRING;if(this.config.url)return new W.BlobServiceClient(this.config.url,this.config.credential);if(Y)return W.BlobServiceClient.fromConnectionString(Y);throw Error("AzureBlobDriver needs a connection string (AZURE_STORAGE_CONNECTION_STRING), a `url`, or a `serviceClient`.")})(),this.serviceClientPromise}async blob(W,Y){if(!W)throw Error("Object name has to be specified");let J=Y??this.config.container??process.env.BUCKET_NAME;if(!J)throw Error("AzureBlobDriver needs a container name, from `bucket`, the `container` config, or BUCKET_NAME.");return(await this.serviceClient()).getContainerClient(J).getBlockBlobClient(W)}async put(W,{signal:Y}={}){Y?.throwIfAborted();let J,Z,G,$;if(W instanceof Blob)J=W,G=`${Bun.randomUUIDv7()}.${W.type.split("/")[1].split(";")[0]}`,Z=W.type;else J=W.body,G=W.name,$=W.bucket,Z=W.contentType??(J instanceof Blob||J instanceof File?J.type:void 0);let Q=J instanceof i4?J:i4.from(await J.arrayBuffer()),K=await this.blob(G,$);return Y?.throwIfAborted(),await K.uploadData(Q,{blobHTTPHeaders:Z?{blobContentType:Z}:void 0,abortSignal:Y}),G}async list(W){let Y=this.config.container??process.env.BUCKET_NAME,Z=(await this.serviceClient()).getContainerClient(Y),G=[];for await(let $ of Z.listBlobsFlat({prefix:W}))G.push($.name);return G}async fetch(W,{signal:Y}={}){Y?.throwIfAborted();let J=await this.download(typeof W==="string"?{name:W}:{name:W.name,bucket:W.bucket},Y);return new Response(J.body,{headers:{"Content-Type":J.type,"Content-Length":String(J.total),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":J.lastModified?.toUTCString()??"",ETag:J.etag??""}})}async read(W){return this.download(typeof W==="string"?{name:W}:W)}async download(W,Y){let{name:J,bucket:Z,range:G=null}=W,$=await this.blob(J,Z);Y?.throwIfAborted();let Q,K,z=G?.kind==="suffix"||G?.kind==="offset"&&G.end===null&&G.start===0;if(G&&z){let b=await this.size({name:J,bucket:Z}),W1=V1(G,b);if(!W1)throw new g(b);Q=W1.start,K=W1.length}else if(G?.kind==="offset")Q=G.start,K=G.end===null?void 0:G.end-G.start+1;let X;try{X=await $.download(Q,K,Y?{abortSignal:Y}:void 0)}catch(b){if(h0(b))throw new g(await this.size({name:J,bucket:Z}));if(y1(b))throw new w(J);throw b}let x=Y1(X.contentRange),M=Boolean(x),R=x?.total??X.contentLength??0,v=await P0(X);if(v instanceof ReadableStream)v=L1(v,Y);return Y?.throwIfAborted(),{body:v,start:x?.start??0,end:x?.end??R-1,total:R,partial:M,type:X.contentType??"application/octet-stream",etag:X.etag||void 0,lastModified:X.lastModified,name:J}}async size(W){let Y=typeof W==="string"?W:W.name,J=typeof W==="string"?void 0:W.bucket,Z=await this.blob(Y,J);try{return(await Z.getProperties()).contentLength??0}catch(G){if(y1(G))throw new w(Y);throw G}}async delete(W){let Y=typeof W==="string"?W:W.name,J=typeof W==="string"?void 0:W.bucket,Z=await this.blob(Y,J);try{await Z.delete()}catch(G){if(y1(G))return;throw G}}}async function P0(W){if(W.blobBody)return await W.blobBody;if(W.readableStreamBody)return q0.toWeb(W.readableStreamBody);return null}var w0=`
3
3
  local currentKey = KEYS[1]
4
4
  local previousKey = KEYS[2]
5
5
  local limit = tonumber(ARGV[1])
@@ -1 +1 @@
1
- {"version":3,"file":"createComponentTree.d.ts","sourceRoot":"","sources":["../../../services/router/createComponentTree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,UAAU,GAAG,aAAa,CAkCrE"}
1
+ {"version":3,"file":"createComponentTree.d.ts","sourceRoot":"","sources":["../../../services/router/createComponentTree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAuBxD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,UAAU,GAAG,aAAa,CAoCrE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gemi",
3
- "version": "0.107.0",
3
+ "version": "0.108.0",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "Enes Tufekci <enes@gemijs.dev>",
@@ -1,24 +0,0 @@
1
- // @bun
2
- import{i as B,j as e}from"./chunk-z38355mx.js";import{ma as D,qa as I,ra as r}from"./chunk-a1g0bahx.js";import"./chunk-tvy2fqza.js";import{Ad as o,Bd as P,jc as c}from"./chunk-5mj7a141.js";import"./chunk-h7pafjej.js";import"./chunk-1npdp1w2.js";import{jf as f,kf as u,nf as m}from"./chunk-rh9j8cwv.js";import{Uf as n}from"./chunk-fwympxqk.js";import"./chunk-njkk498k.js";import"./chunk-gqpge54c.js";import"./chunk-5wt25tyd.js";import"./chunk-k9qmr2wa.js";import"./chunk-4rr9wmh8.js";import"./chunk-47rgq59q.js";import"./chunk-2q7m8a16.js";import"./chunk-9mqqr05d.js";import"./chunk-2gmgd05c.js";import{nh as a}from"./chunk-kqz8jp6v.js";import{oh as _}from"./chunk-82hpq0bq.js";import"./chunk-3s3awh38.js";import{join as M,resolve as yJ,sep as vJ}from"path";import{Duplex as KJ}from"stream";import{constants as L,createBrotliCompress as OJ,createGzip as YJ}from"zlib";var UJ=["br","gzip"],xJ=1024,VJ=5,IJ=19,CJ=6;function LJ(J){if(J===void 0)return 1;if(!/^\d+(\.\d{0,3})?$/.test(J.trim()))return 1;let $=Number(J.trim());return Number.isFinite($)?Math.min($,1):1}function AJ(J){if(J===null||J===void 0)return null;let $=new Map;for(let X of J.split(",")){let[Z,...Q]=X.split(";"),W=Z.trim().toLowerCase();if(W==="")continue;let j=1;for(let G of Q){let Y=G.indexOf("=");if(Y===-1)continue;if(G.slice(0,Y).trim().toLowerCase()==="q"){j=LJ(G.slice(Y+1));break}}$.set(W,j)}return $}function PJ(J,$=UJ){let X=AJ(J);if(!X)return null;let Z=X.get("*"),Q=null,W=0;for(let j of $){let G=X.get(j)??Z??0;if(G>W)Q=j,W=G}return Q}function _J(J,$){if(!J)return!1;return J.split(",").some((X)=>X.trim().toLowerCase().split("=")[0].trim()===$)}function SJ(J,$){if(J==="HEAD")return!1;if($.status<200||$.status===204||$.status===206||$.status===304)return!1;if($.headers.has("Content-Range"))return!1;let X=$.headers.get("Content-Type");if(!X||!/^\s*text\/html\s*(;|$)/i.test(X))return!1;if(!$.body)return!1;let Z=$.headers.get("Content-Encoding");if(Z&&Z.trim().toLowerCase()!=="identity")return!1;if(_J($.headers.get("Cache-Control"),"no-transform"))return!1;let Q=$.headers.get("Content-Length");if(Q!==null&&Number(Q)<xJ)return!1;return!0}function TJ(J){let $=J==="br"?OJ({params:{[L.BROTLI_PARAM_QUALITY]:VJ,[L.BROTLI_PARAM_LGWIN]:IJ},flush:L.BROTLI_OPERATION_FLUSH}):YJ({level:CJ,flush:L.Z_SYNC_FLUSH});return KJ.toWeb($)}function DJ(J){let $=J.get("Vary");if(!$){J.set("Vary","Accept-Encoding");return}let X=$.split(",").map((Z)=>Z.trim().toLowerCase());if(X.includes("*")||X.includes("accept-encoding"))return;J.append("Vary","Accept-Encoding")}function g(J,$){if(!SJ(J.method,$))return $;let X=new Headers($.headers);DJ(X);let Z=PJ(J.headers.get("Accept-Encoding"));if(!Z)return new Response($.body,{status:$.status,statusText:$.statusText,headers:X});let Q;try{Q=TJ(Z)}catch{return new Response($.body,{status:$.status,statusText:$.statusText,headers:X})}return X.set("Content-Encoding",Z),X.delete("Content-Length"),new Response($.body.pipeThrough(Q),{status:$.status,statusText:$.statusText,headers:X})}import{readdir as FJ,stat as NJ}from"fs/promises";import{join as BJ}from"path";function w(J){let $=J.toString(),X=new Bun.CryptoHasher("sha1");return X.update($),X.digest("hex")}async function h(J){let $=new Set;async function X(Z,Q){let W;try{W=await FJ(Z,{withFileTypes:!0})}catch{return}for(let j of W){if(j.name.startsWith("."))continue;if(Q&&j.name==="assets")continue;let G=BJ(Z,j.name),Y=j.isDirectory(),V=j.isFile();if(j.isSymbolicLink())try{let C=await NJ(G);Y=C.isDirectory(),V=C.isFile()}catch{continue}if(V)$.add(G);else if(Y&&!j.isSymbolicLink())await X(G,!1)}}return await X(J,!0),$}var bJ="public, max-age=31536000, must-revalidate";function p(J,$){let X=Bun.file($),Z=X.size,Q=w(X.lastModified),W={"Content-Type":X.type||"application/octet-stream","Cache-Control":bJ,"Accept-Ranges":"bytes",ETag:Q},j=f(J.headers.get("Range"));if(j){let G=u(j,Z);if(!G)return c(Z);return new Response(X.slice(G.start,G.end+1).stream(),{status:206,headers:{...W,"Content-Range":m(G.start,G.end,Z),"Content-Length":String(G.length)}})}return new Response(X.stream(),{headers:{...W,"Content-Length":String(Z)}})}import{stat as EJ}from"fs/promises";var A="app/client.tsx";function d(J,$=D){let X=J[A]?.file;if(!X)return;return{module:I(X,$),preload:F(J,A,$)}}function F(J,$,X=D){let Z=[],Q=new Set,W=(j)=>{if(Q.has(j))return;Q.add(j);let G=J[j];if(!G?.file)return;Z.push(I(G.file,X));for(let Y of G.imports??[])W(Y)};return W($),Z}function l(J,$=30000){let X=JSON.stringify("gemi:chunk-reload"),Z=JSON.stringify(`Failed to fetch dynamically imported module: ${J}`);return`var r=!1;try{var s=window.sessionStorage,m=JSON.parse(s.getItem(${X})||"null");var d=m?Date.now()-m.at:NaN;if(navigator.onLine!==!1&&!(d>=0&&d<${$})){s.setItem(${X},JSON.stringify({url:window.location.href,at:Date.now()}));r=!0}}catch(e){}if(r)window.location.reload();else throw new Error(${Z});export {}`}var MJ=new RegExp(`^${o}/.+\\.m?js$`);function qJ(J){return MJ.test(J)}function i(J){if(qJ(J))return new Response(l(J),{headers:{"Content-Type":"application/javascript","Cache-Control":"no-store"}});if(P(J))return new Response("Not found",{status:404});return}var RJ=`<!DOCTYPE html>
3
- <html lang="en">
4
- <head>
5
- <meta charset="UTF-8" />
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
- <title>Internal Server Error</title>
8
- <style>
9
- body { font-family: system-ui, sans-serif; margin: 0; min-height: 100vh; display: grid; place-items: center; }
10
- main { text-align: center; padding: 16px; }
11
- h1 { font-size: 1.5rem; margin: 0 0 0.5rem; }
12
- p { margin: 0; opacity: 0.7; }
13
- </style>
14
- </head>
15
- <body>
16
- <main>
17
- <h1>Something went wrong</h1>
18
- <p>Please try again later.</p>
19
- </main>
20
- </body>
21
- </html>`;function N(J,$,X){if(!X)console.error(J);else try{X(J instanceof Error?J:Error(String(J),{cause:J}))}catch(Z){console.error(J),console.error(Z)}if(_($))return new Response(JSON.stringify({error:n("server_error","Internal Server Error",500)}),{status:500,headers:{"Content-Type":"application/json"}});return new Response(RJ,{status:500,headers:{"Content-Type":"text/html; charset=utf-8"}})}var kJ={kind:"none"};function s(J){let $=(J??"").trim().toLowerCase();if($===""||$==="false"||$==="off"||$==="0")return kJ;if($==="true")return{kind:"all"};if(/^[1-9]\d*$/.test($))return{kind:"hops",hops:Number($)};throw Error(`GEMI_TRUST_PROXY must be "false", "true" or the number of proxies in front of the app (e.g. 1). Got ${JSON.stringify(J)}.`)}function t(J,$,X){if(X.kind==="all"){if(!J.get("x-forwarded-for")&&$)J.set("x-forwarded-for",$);return}J.delete("x-real-ip");let Z=$;if(X.kind==="hops"){let Q=(J.get("x-forwarded-for")??"").split(",").map((j)=>j.trim()).filter(Boolean),W=Q.length-X.hops;Z=W>=0?Q[W]:Q[0]??$}if(Z)J.set("x-forwarded-for",Z);else J.delete("x-forwarded-for")}var S=a(),gJ=M(S,"app"),x=M(S,"dist"),b=M(x,"client");function wJ(J){let $;try{$=decodeURIComponent(J)}catch{return null}let X=yJ(b,"."+$.replace("/assets/assets","/assets"));return X.startsWith(b+vJ)?X:null}async function fJ(J){try{return(await EJ(J)).isFile()}catch{return!1}}async function L3(J,$){let X=await import(`${x}/client/.vite/manifest.json`),Z=await import(`${x}/server/.vite/manifest.json`),Q=await r(`${x}/client`);process.env.ROOT_DIR=S,process.env.APP_DIR=gJ,process.env.DIST_DIR=x;let W={},j={},G={},Y={},V={},C=(z,H)=>`"${z}": () => import("${H}")`,q=[];for(let z of["404",...J.getFlatComponentTree.call(J)]){let H=Z[`app/views/${z}.tsx`];if(!H?.file){console.log(`Server file not found for ${z}`),console.log(H);let U=Object.keys(Z),y=`app/views/${z}.tsx`;console.log(`${y} not found in server manifest`),console.log(U)}let O=await import(`${process.env.DIST_DIR}/server/${H?.file}`);W[z]=O.default,j[z]=O.OpenGraph,G[z]=O;let K=X[`app/views/${z}.tsx`];if(K?.css&&K?.css.length>0)Y[z]=K?.css;if(K)q.push(C(z,I(K?.file,Q))),V[z]=F(X,`app/views/${z}.tsx`,Q)}let JJ=`{${q.join(",")}}`,R=d(X,Q);if(!R)console.error(`Client manifest has no "${A}" entry \u2014 dist/client is incomplete, so documents will render but never hydrate.`);let $J=X["app/client.tsx"]?.css??[],XJ=(await Promise.all($J.map((z)=>Bun.file(`${x}/client/${z}`).text()))).join(`
22
- `),ZJ=await h(b);async function zJ(z){let{pathname:H}=new URL(z.url);if(_(H))return await T(z,H);let O=wJ(H);if(P(H)||H.startsWith("/.well-known")||O!==null&&ZJ.has(O)){if(!O||!await fJ(O))return i(H)??await T(z,H);try{return p(z,O)}catch(U){return J.onException?.(U),new Response("Not found",{status:404})}}return await T(z,H)}async function T(z,H){let O=J.fetch.bind(J);try{let K=await O(z);if(K instanceof Response)return K;else{let U=[];return U.push({content:XJ}),await K({getStyles:async(v)=>{if(!v)return B([]);for(let GJ of v){let WJ=X[`app/views/${GJ}.tsx`];for(let E of WJ?.css??[]){let HJ=Bun.file(`${process.env.DIST_DIR}/client/${E}`);U.push({id:E,content:await HJ.text()})}}return B(U)},clientEntry:R,modulePreloadManifest:V,loaders:JJ,viewImportMap:W,viewModules:G,ogMap:j,cssManifest:Y,assetBase:Q})}}catch(K){return N(K,H,J.onException)}}let QJ=(process.env.GEMI_COMPRESSION??"auto").toLowerCase()!=="off",jJ=s(process.env.GEMI_TRUST_PROXY),k=Bun.serve({maxRequestBodySize:10737418240,fetch:async(z,H)=>{t(z.headers,H.requestIP(z)?.address??null,jJ);let O=await $(z,(K)=>J.withGlobalMiddleware(K,zJ,(U)=>N(U,new URL(K.url).pathname,J.onException)));return QJ?g(z,O):O},idleTimeout:Number(process.env.SERVER_IDLE_TIMEOUT??10),port:process.env.PORT||5173});return e({port:k.port,rootDir:S}),k}export{L3 as httpProd};
23
-
24
- //# debugId=E0B59B185FC1784364756E2164756E21