gemi 0.206.0 → 0.207.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.
Files changed (42) hide show
  1. package/dist/{chunk-qjk68wda.js → chunk-53fv4c39.js} +2 -2
  2. package/dist/{chunk-qjk68wda.js.map → chunk-53fv4c39.js.map} +4 -4
  3. package/dist/{chunk-jr5t2hrk.js → chunk-8h4vs3j2.js} +1 -1
  4. package/dist/{chunk-xmpamj50.js → chunk-8y1kks8h.js} +2 -2
  5. package/dist/{chunk-xmpamj50.js.map → chunk-8y1kks8h.js.map} +1 -1
  6. package/dist/{chunk-j9ga7b74.js → chunk-k8a41gkt.js} +1 -1
  7. package/dist/{chunk-s4tq4y69.js → chunk-zq4y4f46.js} +1 -1
  8. package/dist/chunks/{RealtimeClient-CLXePUcE.js → RealtimeClient-D4qIHPf1.js} +2 -2
  9. package/dist/chunks/{RealtimeClient-CLXePUcE.js.map → RealtimeClient-D4qIHPf1.js.map} +1 -1
  10. package/dist/chunks/{ThemeProvider-COjYIalw.js → ThemeProvider-w_axEu6B.js} +48 -9
  11. package/dist/chunks/ThemeProvider-w_axEu6B.js.map +1 -0
  12. package/dist/chunks/{fetchFileRequest-BaufNZpI.js → fetchFileRequest-Bhh5BC_l.js} +2 -2
  13. package/dist/chunks/{fetchFileRequest-BaufNZpI.js.map → fetchFileRequest-Bhh5BC_l.js.map} +1 -1
  14. package/dist/chunks/{live-Dz_rk7fm.js → live-9IXFtoGy.js} +3 -3
  15. package/dist/chunks/{live-Dz_rk7fm.js.map → live-9IXFtoGy.js.map} +1 -1
  16. package/dist/chunks/{mutationExtras-DtSw6BcX.js → mutationExtras-bNF9JOSk.js} +2 -2
  17. package/dist/chunks/{mutationExtras-DtSw6BcX.js.map → mutationExtras-bNF9JOSk.js.map} +1 -1
  18. package/dist/chunks/{subscriptionStream-CqhJOfPn.js → subscriptionStream-D42DpDiZ.js} +2 -2
  19. package/dist/chunks/{subscriptionStream-CqhJOfPn.js.map → subscriptionStream-D42DpDiZ.js.map} +1 -1
  20. package/dist/client/QueryManagerContext.d.ts +5 -1
  21. package/dist/client/QueryManagerContext.d.ts.map +1 -1
  22. package/dist/client/QueryResource.d.ts +27 -1
  23. package/dist/client/QueryResource.d.ts.map +1 -1
  24. package/dist/client/index.js +56 -16
  25. package/dist/client/index.js.map +1 -1
  26. package/dist/client/useMultipleQuery.d.ts +11 -1
  27. package/dist/client/useMultipleQuery.d.ts.map +1 -1
  28. package/dist/client/useQuery.d.ts +12 -1
  29. package/dist/client/useQuery.d.ts.map +1 -1
  30. package/dist/facades/index.js +1 -1
  31. package/dist/http/index.js +1 -1
  32. package/dist/i18n/index.js +1 -1
  33. package/dist/kernel/index.js +1 -1
  34. package/dist/server/index.js +1 -1
  35. package/dist/services/index.js +1 -1
  36. package/dist/testing/index.js +2 -2
  37. package/package.json +1 -1
  38. package/skills/gemi-react-best-practices/rules/query-multiple-query-per-component.md +22 -0
  39. package/dist/chunks/ThemeProvider-COjYIalw.js.map +0 -1
  40. /package/dist/{chunk-jr5t2hrk.js.map → chunk-8h4vs3j2.js.map} +0 -0
  41. /package/dist/{chunk-j9ga7b74.js.map → chunk-k8a41gkt.js.map} +0 -0
  42. /package/dist/{chunk-s4tq4y69.js.map → chunk-zq4y4f46.js.map} +0 -0
@@ -33,6 +33,13 @@ export interface MultipleQueryReturn<Q, G> {
33
33
  };
34
34
  /** True while at least one key is loading. */
35
35
  loading: boolean;
36
+ /**
37
+ * Each key's own loading flag, for a view that shows one key's spinner
38
+ * apart from the others.
39
+ */
40
+ loadingByKey: {
41
+ [K in keyof Q]: boolean;
42
+ };
36
43
  /** Each key's error, `null` when it has none. */
37
44
  error: {
38
45
  [K in keyof Q]: Record<string, unknown> | null;
@@ -67,7 +74,10 @@ export interface MultipleQueryReturn<Q, G> {
67
74
  * waterfall and about two renders per query.
68
75
  * - With `suspense: false`, keys that are loading for the first time hold
69
76
  * back the others' answers, so the component renders once with all of them.
70
- * `loading` is true while at least one key is loading.
77
+ * `loading` is true while at least one key is loading; `loadingByKey` has
78
+ * each key's own flag. Their requests start in the render too, so next to
79
+ * suspending keys (in this hook or another one) they go out in the same
80
+ * round instead of after the suspending ones answered.
71
81
  *
72
82
  * The optional second argument is config for every key; a key's own config
73
83
  * (the tuple's third element) wins over it.
@@ -1 +1 @@
1
- {"version":3,"file":"useMultipleQuery.d.ts","sourceRoot":"","sources":["../../client/useMultipleQuery.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAQpD,OAAO,EAGL,KAAK,MAAM,EACX,KAAK,IAAI,EACT,KAAK,iBAAiB,EACtB,KAAK,MAAM,EACX,KAAK,OAAO,EACb,MAAM,YAAY,CAAC;AAkBpB;;;GAGG;AACH,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AAE7D,+FAA+F;AAC/F,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,MAAM,MAAM,GAAG,MAAM,MAAM,IAChE,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC,GAClB,SAAS,CAAC,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,GACnD,SAAS;IACP,IAAI,EAAE,CAAC;IACP,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,SAAS;IAC/B,MAAM,EAAE,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;CACrC,CAAC;AAEN,KAAK,SAAS,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,CAAC,MAAM,CAAC,SAAS,MAAM,MAAM,EAAE,GAAG,GAAG,EAAE,CAAC,GAC3E,CAAC,GACD,KAAK,CAAC;AAEV,KAAK,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAA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OAAO,EAAE;SAAG,CAAC,IAAI,MAAM,CAAC,GAAG,MAAM,IAAI;KAAE,CAAC;CACzC;AAwBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,CAAC,CAAC,SAAS;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,MAAM,MAAM;CAAE,EAChD,KAAK,CAAC,CAAC,SAAS;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,SAAS,OAAO,EAAE;CAAE,EACtD,KAAK,CAAC,CAAC,SAAS,mBAAmB,CAAC,GAAG,CAAC,GAAG,EAAE,EAE7C,OAAO,EAAE;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GAAG,CAAC,EACzD,MAAM,CAAC,EAAE,CAAC,GACT,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC"}
@@ -167,7 +167,18 @@ export declare function useQuery<T extends keyof GetRPC>(url: T, options?: Optio
167
167
  * (`useUser`'s `suspense: false`, `useSignIn`'s `lazy`) build on this so an
168
168
  * app-wide `queryConfig` can never change their semantics. Deliberately not
169
169
  * exported from the package root.
170
+ *
171
+ * `startOnServer`: a `suspense: false` query starts its request on a
172
+ * streaming server render too (#1253). Only `useQuery` asks for it: `useUser`
173
+ * of an anonymous visitor would put a 401 for `/auth/me` on every render, and
174
+ * report it through `onRequestFail`.
170
175
  */
171
- export declare function useFrameworkQuery<T extends keyof GetRPC>(url: T, ...args: [options?: Options<T>, config?: Config<Data<T>>]): QueryReturn<T, NestedPrettify<Data<T>> | undefined>;
176
+ export declare function useFrameworkQuery<T extends keyof GetRPC>(url: T, ...args: [
177
+ options?: Options<T>,
178
+ config?: Config<Data<T>>,
179
+ internal?: {
180
+ startOnServer?: boolean;
181
+ }
182
+ ]): QueryReturn<T, NestedPrettify<Data<T>> | undefined>;
172
183
  export {};
173
184
  //# sourceMappingURL=useQuery.d.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AAC,EACpB,MAAM,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GACvB,WAAW,CAAC,CAAC,EAAE,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC;AAmBvD;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,MAAM,EACtD,GAAG,EAAE,CAAC,EACN,GAAG,IAAI,EAAE;IACP,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACxB,QAAQ,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,OAAO,CAAA;KAAE;CACvC,GACA,WAAW,CAAC,CAAC,EAAE,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CA8ZrD"}
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{Ef as a,Gg as r,Hf as c,Hg as s,If as e,Ig as t,Jf as f,Jg as u,Kf as h,Lf as i,Mf as j,Tf as k,Uf as l,Vf as m,Wf as n,Xf as o,fg as p,rh as v,vg as q}from"../chunk-qjk68wda.js";import"../chunk-hthyn5pj.js";import"../chunk-1em8t2x1.js";import{Wi as b,vj as d,zj as g}from"../chunk-7wzhdq1x.js";import"../chunk-aed0vv5g.js";import"../chunk-jy26hy7z.js";import"../chunk-8ar7180x.js";import"../chunk-yj1h4rzn.js";import"../chunk-3z8d8v8q.js";import"../chunk-wdrmzjtq.js";import"../chunk-6cx6kh04.js";import"../chunk-06w8hhnk.js";import"../chunk-24tj4dzx.js";import"../chunk-xgc5tj8k.js";import"../chunk-etcds9w3.js";import"../chunk-nfher0gz.js";import"../chunk-65btke6p.js";import"../chunk-vyaedzr8.js";import"../chunk-djnn8vvp.js";import"../chunk-tx5zrdmb.js";import"../chunk-0eq7am78.js";import"../chunk-77dt2tap.js";import"../chunk-ne51fxg2.js";import"../chunk-zf1eqgzt.js";export{f as Url,d as Storage,r as Runs,j as Redis,a as Redirect,l as RateLimiter,e as Query,h as Meta,g as Log,m as Lock,c as Lang,s as Features,b as Facade,u as DB,n as Crypt,i as Cookie,o as Connections,t as ConnectionQueries,p as ChangeFeed,k as Cache,q as Broadcast,v as Auth};
2
+ import{Ef as a,Gg as r,Hf as c,Hg as s,If as e,Ig as t,Jf as f,Jg as u,Kf as h,Lf as i,Mf as j,Tf as k,Uf as l,Vf as m,Wf as n,Xf as o,fg as p,rh as v,vg as q}from"../chunk-53fv4c39.js";import"../chunk-hthyn5pj.js";import"../chunk-1em8t2x1.js";import{Wi as b,vj as d,zj as g}from"../chunk-7wzhdq1x.js";import"../chunk-aed0vv5g.js";import"../chunk-jy26hy7z.js";import"../chunk-8ar7180x.js";import"../chunk-yj1h4rzn.js";import"../chunk-3z8d8v8q.js";import"../chunk-wdrmzjtq.js";import"../chunk-6cx6kh04.js";import"../chunk-06w8hhnk.js";import"../chunk-24tj4dzx.js";import"../chunk-xgc5tj8k.js";import"../chunk-etcds9w3.js";import"../chunk-nfher0gz.js";import"../chunk-65btke6p.js";import"../chunk-vyaedzr8.js";import"../chunk-djnn8vvp.js";import"../chunk-tx5zrdmb.js";import"../chunk-0eq7am78.js";import"../chunk-77dt2tap.js";import"../chunk-ne51fxg2.js";import"../chunk-zf1eqgzt.js";export{f as Url,d as Storage,r as Runs,j as Redis,a as Redirect,l as RateLimiter,e as Query,h as Meta,g as Log,m as Lock,c as Lang,s as Features,b as Facade,u as DB,n as Crypt,i as Cookie,o as Connections,t as ConnectionQueries,p as ChangeFeed,k as Cache,q as Broadcast,v as Auth};
3
3
 
4
4
  //# debugId=34483C98FFA730EE64756E2164756E21
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{$e as I,Ah as ga,Bh as ha,Cf as J,Ch as ia,Df as K,Dh as ja,Eh as ka,Ff as L,Fh as la,Gf as M,Gh as ma,Hh as na,Ih as oa,Jh as pa,Kh as qa,Lh as ra,Me as t,Mh as sa,Ne as u,Nh as ta,Oe as v,Oh as ua,Pe as w,Qe as x,Re as E,Rg as $,We as F,Ze as G,_e as H,sh as aa,th as ba,uh as ca,xh as da,yh as ea,zh as fa}from"../chunk-qjk68wda.js";import"../chunk-hthyn5pj.js";import"../chunk-1em8t2x1.js";import{Bi as n,Gi as o,Hi as p,Ii as q,Ji as r,Oi as s,Qi as y,Ri as z,Si as A,Ti as B,Ui as C,Vi as D,ej as N,fj as O,gj as P,hj as Q,ij as R,jj as S,kj as T,lj as U,mi as a,mj as V,ni as b,nj as W,oi as d,oj as X,qj as Y,rj as Z,sj as _,ti as e,ui as f,vi as g,wi as h,xi as i,yi as j}from"../chunk-7wzhdq1x.js";import{Ij as c}from"../chunk-aed0vv5g.js";import{Nj as k,Oj as l,Pj as m}from"../chunk-jy26hy7z.js";import"../chunk-8ar7180x.js";import"../chunk-yj1h4rzn.js";import"../chunk-3z8d8v8q.js";import"../chunk-wdrmzjtq.js";import"../chunk-6cx6kh04.js";import"../chunk-06w8hhnk.js";import"../chunk-24tj4dzx.js";import"../chunk-xgc5tj8k.js";import"../chunk-etcds9w3.js";import"../chunk-nfher0gz.js";import"../chunk-65btke6p.js";import"../chunk-vyaedzr8.js";import"../chunk-djnn8vvp.js";import"../chunk-tx5zrdmb.js";import"../chunk-0eq7am78.js";import"../chunk-77dt2tap.js";import"../chunk-ne51fxg2.js";import"../chunk-zf1eqgzt.js";export{g as toRangeHeaderValue,v as toMiddlewareList,k as stateKey,_ as safeFetch,f as resolveRange,e as parseRangeHeader,h as parseContentRange,r as parseByteSize,ia as middlewareConfigDefaults,u as httpError,d as getCookies,j as formatUnsatisfiedContentRange,i as formatContentRange,qa as defineResourcePolicy,ha as defineMiddlewareConfig,n as cspNonce,w as createUnsatisfiableResponse,x as createStreamResponse,L as createFileResponse,I as clientIp,Y as classifyAddress,ca as authorizeChannel,M as ViewRouter,o as ValidationError,V as TooManyRedirectsError,T as TooLargeError,S as TimeoutError,ra as SitemapError,sa as Sitemap,K as SameSiteBounceMiddleware,Z as SafeResponse,N as SafeFetchError,J as SAME_SITE_BOUNCE_PARAM,ta as RobotsTxt,ua as Robots,pa as ResourcePolicy,b as ResourceController,m as RequestState,c as RequestBreakerError,H as RateLimitMiddleware,F as RateLimitExceededError,A as RangeNotSatisfiableError,na as PoliciesServiceProvider,oa as Policies,q as PayloadTooLargeError,B as NotFoundError,W as NetworkError,l as MissingRequestStateError,G as Middleware,fa as McpToolDeclaration,ga as McpRouter,ea as McpRouteDeclaration,da as McpModelParam,p as InvalidValidationRuleError,O as InvalidUrlError,z as InsufficientPermissionsError,X as HttpStatusError,t as HttpResponse,s as HttpRequest,C as FileNotFoundError,R as DnsError,la as CorsMiddleware,a as Controller,U as ContentTypeError,ba as ChannelRouter,aa as ChannelDeclaration,ka as CacheMiddleware,ma as CSRFMiddleware,$ as BodyLimitMiddleware,P as BlockedHostError,Q as BlockedAddressError,y as AuthorizationError,ja as AuthenticationMiddleware,D as AuthenticationError,E as ApiRouter};
2
+ import{$e as I,Ah as ga,Bh as ha,Cf as J,Ch as ia,Df as K,Dh as ja,Eh as ka,Ff as L,Fh as la,Gf as M,Gh as ma,Hh as na,Ih as oa,Jh as pa,Kh as qa,Lh as ra,Me as t,Mh as sa,Ne as u,Nh as ta,Oe as v,Oh as ua,Pe as w,Qe as x,Re as E,Rg as $,We as F,Ze as G,_e as H,sh as aa,th as ba,uh as ca,xh as da,yh as ea,zh as fa}from"../chunk-53fv4c39.js";import"../chunk-hthyn5pj.js";import"../chunk-1em8t2x1.js";import{Bi as n,Gi as o,Hi as p,Ii as q,Ji as r,Oi as s,Qi as y,Ri as z,Si as A,Ti as B,Ui as C,Vi as D,ej as N,fj as O,gj as P,hj as Q,ij as R,jj as S,kj as T,lj as U,mi as a,mj as V,ni as b,nj as W,oi as d,oj as X,qj as Y,rj as Z,sj as _,ti as e,ui as f,vi as g,wi as h,xi as i,yi as j}from"../chunk-7wzhdq1x.js";import{Ij as c}from"../chunk-aed0vv5g.js";import{Nj as k,Oj as l,Pj as m}from"../chunk-jy26hy7z.js";import"../chunk-8ar7180x.js";import"../chunk-yj1h4rzn.js";import"../chunk-3z8d8v8q.js";import"../chunk-wdrmzjtq.js";import"../chunk-6cx6kh04.js";import"../chunk-06w8hhnk.js";import"../chunk-24tj4dzx.js";import"../chunk-xgc5tj8k.js";import"../chunk-etcds9w3.js";import"../chunk-nfher0gz.js";import"../chunk-65btke6p.js";import"../chunk-vyaedzr8.js";import"../chunk-djnn8vvp.js";import"../chunk-tx5zrdmb.js";import"../chunk-0eq7am78.js";import"../chunk-77dt2tap.js";import"../chunk-ne51fxg2.js";import"../chunk-zf1eqgzt.js";export{g as toRangeHeaderValue,v as toMiddlewareList,k as stateKey,_ as safeFetch,f as resolveRange,e as parseRangeHeader,h as parseContentRange,r as parseByteSize,ia as middlewareConfigDefaults,u as httpError,d as getCookies,j as formatUnsatisfiedContentRange,i as formatContentRange,qa as defineResourcePolicy,ha as defineMiddlewareConfig,n as cspNonce,w as createUnsatisfiableResponse,x as createStreamResponse,L as createFileResponse,I as clientIp,Y as classifyAddress,ca as authorizeChannel,M as ViewRouter,o as ValidationError,V as TooManyRedirectsError,T as TooLargeError,S as TimeoutError,ra as SitemapError,sa as Sitemap,K as SameSiteBounceMiddleware,Z as SafeResponse,N as SafeFetchError,J as SAME_SITE_BOUNCE_PARAM,ta as RobotsTxt,ua as Robots,pa as ResourcePolicy,b as ResourceController,m as RequestState,c as RequestBreakerError,H as RateLimitMiddleware,F as RateLimitExceededError,A as RangeNotSatisfiableError,na as PoliciesServiceProvider,oa as Policies,q as PayloadTooLargeError,B as NotFoundError,W as NetworkError,l as MissingRequestStateError,G as Middleware,fa as McpToolDeclaration,ga as McpRouter,ea as McpRouteDeclaration,da as McpModelParam,p as InvalidValidationRuleError,O as InvalidUrlError,z as InsufficientPermissionsError,X as HttpStatusError,t as HttpResponse,s as HttpRequest,C as FileNotFoundError,R as DnsError,la as CorsMiddleware,a as Controller,U as ContentTypeError,ba as ChannelRouter,aa as ChannelDeclaration,ka as CacheMiddleware,ma as CSRFMiddleware,$ as BodyLimitMiddleware,P as BlockedHostError,Q as BlockedAddressError,y as AuthorizationError,ja as AuthenticationMiddleware,D as AuthenticationError,E as ApiRouter};
3
3
 
4
4
  //# debugId=3F2E457DAA00B39364756E2164756E21
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{ra as T}from"../chunk-wpfempaj.js";import"../chunk-hke4hzfm.js";import{pb as D}from"../chunk-4q59y78y.js";import{Je as b,Ke as w}from"../chunk-09hzyf9g.js";import"../chunk-3830ee5d.js";import{Hf as j}from"../chunk-qjk68wda.js";import"../chunk-hthyn5pj.js";import"../chunk-1em8t2x1.js";import"../chunk-7wzhdq1x.js";import"../chunk-aed0vv5g.js";import"../chunk-jy26hy7z.js";import"../chunk-8ar7180x.js";import"../chunk-yj1h4rzn.js";import"../chunk-3z8d8v8q.js";import"../chunk-wdrmzjtq.js";import"../chunk-6cx6kh04.js";import"../chunk-06w8hhnk.js";import"../chunk-24tj4dzx.js";import"../chunk-xgc5tj8k.js";import"../chunk-etcds9w3.js";import"../chunk-nfher0gz.js";import{$l as S,Wl as V,Xl as X,Yl as E,Zl as L,_l as R}from"../chunk-65btke6p.js";import"../chunk-vyaedzr8.js";import"../chunk-djnn8vvp.js";import"../chunk-tx5zrdmb.js";import"../chunk-0eq7am78.js";import"../chunk-77dt2tap.js";import"../chunk-ne51fxg2.js";import"../chunk-zf1eqgzt.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{w as translationConfigDefaults,N as translate,V as resolveLocale,X as negotiateLocale,L as isValidTimeZone,b as defineTranslationConfig,T as defineDictionary,R as createFormatter,S as Translator,D as TranslationServiceProvider,P as Dictionary,E as DEFAULT_TIME_ZONE};
2
+ import{ra as T}from"../chunk-wpfempaj.js";import"../chunk-hke4hzfm.js";import{pb as D}from"../chunk-4q59y78y.js";import{Je as b,Ke as w}from"../chunk-09hzyf9g.js";import"../chunk-3830ee5d.js";import{Hf as j}from"../chunk-53fv4c39.js";import"../chunk-hthyn5pj.js";import"../chunk-1em8t2x1.js";import"../chunk-7wzhdq1x.js";import"../chunk-aed0vv5g.js";import"../chunk-jy26hy7z.js";import"../chunk-8ar7180x.js";import"../chunk-yj1h4rzn.js";import"../chunk-3z8d8v8q.js";import"../chunk-wdrmzjtq.js";import"../chunk-6cx6kh04.js";import"../chunk-06w8hhnk.js";import"../chunk-24tj4dzx.js";import"../chunk-xgc5tj8k.js";import"../chunk-etcds9w3.js";import"../chunk-nfher0gz.js";import{$l as S,Wl as V,Xl as X,Yl as E,Zl as L,_l as R}from"../chunk-65btke6p.js";import"../chunk-vyaedzr8.js";import"../chunk-djnn8vvp.js";import"../chunk-tx5zrdmb.js";import"../chunk-0eq7am78.js";import"../chunk-77dt2tap.js";import"../chunk-ne51fxg2.js";import"../chunk-zf1eqgzt.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{w as translationConfigDefaults,N as translate,V as resolveLocale,X as negotiateLocale,L as isValidTimeZone,b as defineTranslationConfig,T as defineDictionary,R as createFormatter,S as Translator,D as TranslationServiceProvider,P as Dictionary,E as DEFAULT_TIME_ZONE};
3
3
 
4
4
  //# debugId=7A444A0D86D9713664756E2164756E21
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Ta as E}from"../chunk-6zpf257t.js";import{ob as l}from"../chunk-rjtge67x.js";import{pb as H}from"../chunk-4q59y78y.js";import{$b as I,Cb as g,Db as W,Eb as _,Fb as p,Gb as P,Hb as u,Ib as $,Jb as V,Kb as q,Lb as B,Mb as K,Qb as L,Rb as Q,Sb as T,Wb as U,Xb as y,Yb as F,Zb as C,_b as D,cc as b,fc as f,gc as k,hc as m}from"../chunk-j9ga7b74.js";import"../chunk-v1d7xya8.js";import"../chunk-e0scxs81.js";import"../chunk-p9c5rc1z.js";import"../chunk-9m6mkaqb.js";import{De as h}from"../chunk-vebstesm.js";import"../chunk-09hzyf9g.js";import"../chunk-3830ee5d.js";import{Af as n,Bf as v,ef as d,ff as s,hh as w,lh as A,ph as R}from"../chunk-qjk68wda.js";import"../chunk-hthyn5pj.js";import"../chunk-1em8t2x1.js";import"../chunk-7wzhdq1x.js";import"../chunk-aed0vv5g.js";import"../chunk-jy26hy7z.js";import"../chunk-8ar7180x.js";import"../chunk-yj1h4rzn.js";import{fk as M}from"../chunk-3z8d8v8q.js";import"../chunk-wdrmzjtq.js";import"../chunk-6cx6kh04.js";import"../chunk-06w8hhnk.js";import"../chunk-24tj4dzx.js";import"../chunk-xgc5tj8k.js";import"../chunk-etcds9w3.js";import"../chunk-nfher0gz.js";import"../chunk-wfees83q.js";import"../chunk-65btke6p.js";import{am as O,cm as J}from"../chunk-vyaedzr8.js";import"../chunk-djnn8vvp.js";import"../chunk-tx5zrdmb.js";import"../chunk-0eq7am78.js";import"../chunk-77dt2tap.js";import"../chunk-ne51fxg2.js";import"../chunk-zf1eqgzt.js";var N=[C,I,E,T,L,k,B,Q,D,y,_,U,f,V,F,H,b,K,q,m,$];class S{config={};providers=[];services=[];serviceInstances=[];serviceTokens=new Set;servicesBooted=!1;models=[];app=new J;boot(){if(this.models.length>0)l(...this.models);else a();this.app.config.merge(this.config),J.setInstance(this.app),this.app.registerMany([...N,...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 G=typeof z==="function"?new z:z,x=G.constructor;if(!x.token)throw Error(`Service [${x.name}] is listed in \`services\` but does not declare a \`static token\`.`);let Y=X.get(x.token);if(Y)throw Error(`Services [${Y}] and [${x.name}] both declare the token "${x.token}". Tokens are the container's keys, so they must be unique.`);X.set(x.token,x.name);let Z=x;if(!j.has(x.token)&&this.app.bound(Z))throw Error(`Service [${x.name}] declares the token "${x.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(Z,G),this.serviceInstances.push(G),this.serviceTokens.add(x.token)}this.app.setShutdownHooks(this.serviceInstances.map((z)=>({name:`${z.constructor.name}.onShutdown`,shutdown:(G)=>z.onShutdown(G)})))}async waitForBoot(){await this.app.boot(),await this.bootServices(),p(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 O.run(this.app,j)}resolve(j){return this.app.make(j)}apiRoutes(){return this.app.make(A)}viewRoutes(){return this.app.make(w)}domains(){return this.app.make(R)}queue(){return this.app.make(h)}mcpHttp(){return this.app.config.get("route.mcp.remote.enabled")===!0?this.app.make(g):null}sockets(){return this.app.config.get("route.channels")?this.app.make(u):null}globalMiddleware(j){return P(j)}destroy(){if(this.app.resolved(W))this.app.make(W).stop();if(this.app.flush(),J.getInstance()===this.app)J.setInstance(void 0);O.disable()}}function a(){if(Bun.env.NODE_ENV==="production")return;let j=M();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{Ta as E}from"../chunk-6zpf257t.js";import{ob as l}from"../chunk-rjtge67x.js";import{pb as H}from"../chunk-4q59y78y.js";import{$b as I,Cb as g,Db as W,Eb as _,Fb as p,Gb as P,Hb as u,Ib as $,Jb as V,Kb as q,Lb as B,Mb as K,Qb as L,Rb as Q,Sb as T,Wb as U,Xb as y,Yb as F,Zb as C,_b as D,cc as b,fc as f,gc as k,hc as m}from"../chunk-k8a41gkt.js";import"../chunk-v1d7xya8.js";import"../chunk-e0scxs81.js";import"../chunk-p9c5rc1z.js";import"../chunk-9m6mkaqb.js";import{De as h}from"../chunk-vebstesm.js";import"../chunk-09hzyf9g.js";import"../chunk-3830ee5d.js";import{Af as n,Bf as v,ef as d,ff as s,hh as w,lh as A,ph as R}from"../chunk-53fv4c39.js";import"../chunk-hthyn5pj.js";import"../chunk-1em8t2x1.js";import"../chunk-7wzhdq1x.js";import"../chunk-aed0vv5g.js";import"../chunk-jy26hy7z.js";import"../chunk-8ar7180x.js";import"../chunk-yj1h4rzn.js";import{fk as M}from"../chunk-3z8d8v8q.js";import"../chunk-wdrmzjtq.js";import"../chunk-6cx6kh04.js";import"../chunk-06w8hhnk.js";import"../chunk-24tj4dzx.js";import"../chunk-xgc5tj8k.js";import"../chunk-etcds9w3.js";import"../chunk-nfher0gz.js";import"../chunk-wfees83q.js";import"../chunk-65btke6p.js";import{am as O,cm as J}from"../chunk-vyaedzr8.js";import"../chunk-djnn8vvp.js";import"../chunk-tx5zrdmb.js";import"../chunk-0eq7am78.js";import"../chunk-77dt2tap.js";import"../chunk-ne51fxg2.js";import"../chunk-zf1eqgzt.js";var N=[C,I,E,T,L,k,B,Q,D,y,_,U,f,V,F,H,b,K,q,m,$];class S{config={};providers=[];services=[];serviceInstances=[];serviceTokens=new Set;servicesBooted=!1;models=[];app=new J;boot(){if(this.models.length>0)l(...this.models);else a();this.app.config.merge(this.config),J.setInstance(this.app),this.app.registerMany([...N,...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 G=typeof z==="function"?new z:z,x=G.constructor;if(!x.token)throw Error(`Service [${x.name}] is listed in \`services\` but does not declare a \`static token\`.`);let Y=X.get(x.token);if(Y)throw Error(`Services [${Y}] and [${x.name}] both declare the token "${x.token}". Tokens are the container's keys, so they must be unique.`);X.set(x.token,x.name);let Z=x;if(!j.has(x.token)&&this.app.bound(Z))throw Error(`Service [${x.name}] declares the token "${x.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(Z,G),this.serviceInstances.push(G),this.serviceTokens.add(x.token)}this.app.setShutdownHooks(this.serviceInstances.map((z)=>({name:`${z.constructor.name}.onShutdown`,shutdown:(G)=>z.onShutdown(G)})))}async waitForBoot(){await this.app.boot(),await this.bootServices(),p(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 O.run(this.app,j)}resolve(j){return this.app.make(j)}apiRoutes(){return this.app.make(A)}viewRoutes(){return this.app.make(w)}domains(){return this.app.make(R)}queue(){return this.app.make(h)}mcpHttp(){return this.app.config.get("route.mcp.remote.enabled")===!0?this.app.make(g):null}sockets(){return this.app.config.get("route.channels")?this.app.make(u):null}globalMiddleware(j){return P(j)}destroy(){if(this.app.resolved(W))this.app.make(W).stop();if(this.app.flush(),J.getInstance()===this.app)J.setInstance(void 0);O.disable()}}function a(){if(Bun.env.NODE_ENV==="production")return;let j=M();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,4 +1,4 @@
1
1
  // @bun
2
- import{Ra as f}from"../chunk-ba1h9pm6.js";import{Sa as A}from"../chunk-jy61580r.js";import{mm as Q,om as q,pm as w,sm as Z,tm as P,um as y,vm as S,wm as U}from"../chunk-0eq7am78.js";import{Am as H}from"../chunk-77dt2tap.js";import"../chunk-ne51fxg2.js";import{Im as F}from"../chunk-zf1eqgzt.js";var x="/__gemi__/health",$=Symbol.for("gemi.server.health");function V(){let z=globalThis;return z[$]??={lagMs:0,consecutiveBreaches:0,degraded:!1,timer:void 0},z[$]}function W(){let z=V(),B=Q();return{healthy:!B&&!z.degraded,shuttingDown:B,lagMs:z.lagMs,consecutiveBreaches:z.consecutiveBreaches}}function E(z,B){let I=V();I.lagMs=z,I.consecutiveBreaches=z>B.maxLagMs?I.consecutiveBreaches+1:0;let J=I.consecutiveBreaches>=B.breaches;if(J&&!I.degraded)console.warn(`[gemi] Health: degraded (event-loop lag ${Math.round(z)}ms, ${I.consecutiveBreaches} samples in a row over ${B.maxLagMs}ms).`);else if(!J&&I.degraded)console.log(`[gemi] Health: recovered (event-loop lag ${Math.round(z)}ms).`);I.degraded=J}function G(z){let B=V();if(B.timer)return;let I=performance.now()+z.intervalMs;B.timer=setInterval(()=>{let J=performance.now();E(Math.max(0,J-I),z),I=J+z.intervalMs},z.intervalMs),B.timer.unref?.()}function _(z=process.env){return{paths:D(z.GEMI_HEALTH_PATH),intervalMs:O("GEMI_HEALTH_INTERVAL_MS",z.GEMI_HEALTH_INTERVAL_MS,500),maxLagMs:O("GEMI_HEALTH_MAX_LAG_MS",z.GEMI_HEALTH_MAX_LAG_MS,1000),breaches:Math.ceil(O("GEMI_HEALTH_BREACHES",z.GEMI_HEALTH_BREACHES,3))}}function D(z){if(z===void 0||z.trim()==="")return[x];if(z.trim().toLowerCase()==="off")return[];let B=z.split(",").map((J)=>J.trim()).filter(Boolean);if(B.filter((J)=>!J.startsWith("/")).length>0)throw Error(`GEMI_HEALTH_PATH: expected comma-separated paths starting with "/", or "off"; got ${JSON.stringify(z)}.`);return B}function O(z,B,I){if(B===void 0||B.trim()==="")return I;let J=Number(B);if(Number.isFinite(J)&&J>0)return J;return console.warn(`[gemi] Ignoring ${z}="${B}": expected a positive number.`),I}function j(z,B){if(B.length===0)return z;let I=new Set(B);return async(J,K)=>{if(!B.some((b)=>J.url.includes(b))||!I.has(new URL(J.url).pathname))return z(J,K);return y(R(J.method))}}function R(z){let B={"Cache-Control":"no-store","Content-Type":"text/plain; charset=utf-8"};if(z!=="GET"&&z!=="HEAD")return new Response("Method Not Allowed",{status:405,headers:{...B,Allow:"GET, HEAD"}});let{healthy:I,shuttingDown:J}=W();return new Response(z==="HEAD"?null:I?"ok":J?"shutting down":"degraded",{status:I?200:503,headers:B})}var L=Symbol.for("gemi.server.devGeneration"),X={graceMs:1e4,providerTimeoutMs:5000};class Y{app;inFlight=0;waiters=new Set;constructor(z){this.app=z}track(z){return async(B,I)=>{this.inFlight++;try{return await z(B,I)}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(I){C(I)}}idle(z){if(this.inFlight===0)return Promise.resolve();return new Promise((B)=>{let I=()=>{clearTimeout(J),this.waiters.delete(I),B()},J=setTimeout(I,z);this.waiters.add(I)})}wake(){for(let z of this.waiters)z()}}function N(z,B=X){let I=globalThis,J=I[L];if(I[L]=z,!J||J===z||typeof J.retire!=="function")return Promise.resolve();let K=J.retire.bind(J);return Promise.resolve().then(()=>K(B)).catch(C)}function C(z){console.error("[gemi] Shutting down the application a reload replaced failed:",z)}class k{app;instrumentation;handleSignals;server;stopping;settings;constructor(z){this.app=new A({kernel:z.kernel}),this.handleSignals=z.handleSignals??!0,this.instrumentation=S(z.instrumentation??((B,I)=>I(B)))}async start(){process.env.ROOT_DIR=H();let z=Bun.env.NODE_ENV==="production",B=_();if(z)G(B);let I=j(this.instrumentation,B.paths);if(z){if(this.handleSignals)U(()=>this.stop());this.settings=Z()}try{await this.app.waitForBoot()}catch(J){if(!z)this.app.shutdown({timeoutMs:X.providerTimeoutMs});throw J}if(z){let{httpProd:J}=await import("../chunk-s4tq4y69.js");this.server=await J(this.app,I)}else{f();let{httpDev:J}=await import("../chunk-jr5t2hrk.js"),K=new Y(this.app);this.server=await J(this.app,K.track(I)),N(K)}return this.server}stop(z={}){let B=this.app.sockets();return this.stopping??=P({server:this.server,closeSockets:B?()=>B.shutdown():void 0,shutdownProviders:(I)=>this.app.shutdown(I),settings:{...this.settings??Z(),...z}}),this.stopping}}export{q as shutdownSignal,W as liveness,Q as isShuttingDown,w as holdShutdown,k as Server};
2
+ import{Ra as f}from"../chunk-ba1h9pm6.js";import{Sa as A}from"../chunk-jy61580r.js";import{mm as Q,om as q,pm as w,sm as Z,tm as P,um as y,vm as S,wm as U}from"../chunk-0eq7am78.js";import{Am as H}from"../chunk-77dt2tap.js";import"../chunk-ne51fxg2.js";import{Im as F}from"../chunk-zf1eqgzt.js";var x="/__gemi__/health",$=Symbol.for("gemi.server.health");function V(){let z=globalThis;return z[$]??={lagMs:0,consecutiveBreaches:0,degraded:!1,timer:void 0},z[$]}function W(){let z=V(),B=Q();return{healthy:!B&&!z.degraded,shuttingDown:B,lagMs:z.lagMs,consecutiveBreaches:z.consecutiveBreaches}}function E(z,B){let I=V();I.lagMs=z,I.consecutiveBreaches=z>B.maxLagMs?I.consecutiveBreaches+1:0;let J=I.consecutiveBreaches>=B.breaches;if(J&&!I.degraded)console.warn(`[gemi] Health: degraded (event-loop lag ${Math.round(z)}ms, ${I.consecutiveBreaches} samples in a row over ${B.maxLagMs}ms).`);else if(!J&&I.degraded)console.log(`[gemi] Health: recovered (event-loop lag ${Math.round(z)}ms).`);I.degraded=J}function G(z){let B=V();if(B.timer)return;let I=performance.now()+z.intervalMs;B.timer=setInterval(()=>{let J=performance.now();E(Math.max(0,J-I),z),I=J+z.intervalMs},z.intervalMs),B.timer.unref?.()}function _(z=process.env){return{paths:D(z.GEMI_HEALTH_PATH),intervalMs:O("GEMI_HEALTH_INTERVAL_MS",z.GEMI_HEALTH_INTERVAL_MS,500),maxLagMs:O("GEMI_HEALTH_MAX_LAG_MS",z.GEMI_HEALTH_MAX_LAG_MS,1000),breaches:Math.ceil(O("GEMI_HEALTH_BREACHES",z.GEMI_HEALTH_BREACHES,3))}}function D(z){if(z===void 0||z.trim()==="")return[x];if(z.trim().toLowerCase()==="off")return[];let B=z.split(",").map((J)=>J.trim()).filter(Boolean);if(B.filter((J)=>!J.startsWith("/")).length>0)throw Error(`GEMI_HEALTH_PATH: expected comma-separated paths starting with "/", or "off"; got ${JSON.stringify(z)}.`);return B}function O(z,B,I){if(B===void 0||B.trim()==="")return I;let J=Number(B);if(Number.isFinite(J)&&J>0)return J;return console.warn(`[gemi] Ignoring ${z}="${B}": expected a positive number.`),I}function j(z,B){if(B.length===0)return z;let I=new Set(B);return async(J,K)=>{if(!B.some((b)=>J.url.includes(b))||!I.has(new URL(J.url).pathname))return z(J,K);return y(R(J.method))}}function R(z){let B={"Cache-Control":"no-store","Content-Type":"text/plain; charset=utf-8"};if(z!=="GET"&&z!=="HEAD")return new Response("Method Not Allowed",{status:405,headers:{...B,Allow:"GET, HEAD"}});let{healthy:I,shuttingDown:J}=W();return new Response(z==="HEAD"?null:I?"ok":J?"shutting down":"degraded",{status:I?200:503,headers:B})}var L=Symbol.for("gemi.server.devGeneration"),X={graceMs:1e4,providerTimeoutMs:5000};class Y{app;inFlight=0;waiters=new Set;constructor(z){this.app=z}track(z){return async(B,I)=>{this.inFlight++;try{return await z(B,I)}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(I){C(I)}}idle(z){if(this.inFlight===0)return Promise.resolve();return new Promise((B)=>{let I=()=>{clearTimeout(J),this.waiters.delete(I),B()},J=setTimeout(I,z);this.waiters.add(I)})}wake(){for(let z of this.waiters)z()}}function N(z,B=X){let I=globalThis,J=I[L];if(I[L]=z,!J||J===z||typeof J.retire!=="function")return Promise.resolve();let K=J.retire.bind(J);return Promise.resolve().then(()=>K(B)).catch(C)}function C(z){console.error("[gemi] Shutting down the application a reload replaced failed:",z)}class k{app;instrumentation;handleSignals;server;stopping;settings;constructor(z){this.app=new A({kernel:z.kernel}),this.handleSignals=z.handleSignals??!0,this.instrumentation=S(z.instrumentation??((B,I)=>I(B)))}async start(){process.env.ROOT_DIR=H();let z=Bun.env.NODE_ENV==="production",B=_();if(z)G(B);let I=j(this.instrumentation,B.paths);if(z){if(this.handleSignals)U(()=>this.stop());this.settings=Z()}try{await this.app.waitForBoot()}catch(J){if(!z)this.app.shutdown({timeoutMs:X.providerTimeoutMs});throw J}if(z){let{httpProd:J}=await import("../chunk-zq4y4f46.js");this.server=await J(this.app,I)}else{f();let{httpDev:J}=await import("../chunk-8h4vs3j2.js"),K=new Y(this.app);this.server=await J(this.app,K.track(I)),N(K)}return this.server}stop(z={}){let B=this.app.sockets();return this.stopping??=P({server:this.server,closeSockets:B?()=>B.shutdown():void 0,shutdownProviders:(I)=>this.app.shutdown(I),settings:{...this.settings??Z(),...z}}),this.stopping}}export{q as shutdownSignal,W as liveness,Q as isShuttingDown,w as holdShutdown,k as Server};
3
3
 
4
4
  //# debugId=FE20FBD008CD065864756E2164756E21
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{rb as v9}from"../chunk-g6tqje74.js";import{$b as k9,Ab as q4,Bb as c1,Cb as mZ,Db as cZ,Eb as Y9,Ib as K9,Jb as G9,Kb as z9,Lb as X9,Mb as F9,Nb as M9,Ob as L9,Pb as N9,Qb as D9,Rb as H9,Sb as U9,Tb as g4,Ub as _6,Vb as w,Wb as x9,Xb as O9,Yb as S9,Zb as R9,_b as _9,ac as f9,bc as C9,cc as V9,dc as T9,ec as P9,fc as b9,gc as w9,hc as q9,sb as IZ,tb as yZ,ub as AZ,vb as hZ,wb as EZ,xb as y4,yb as gZ,zb as w4}from"../chunk-j9ga7b74.js";import{kc as h4}from"../chunk-v1d7xya8.js";import"../chunk-e0scxs81.js";import{$d as dZ,Zd as uZ,_d as pZ,ae as lZ,be as nZ,ce as sZ,de as oZ,ee as aZ,fe as tZ,ge as rZ,he as eZ,ie as W9,je as Z9,ke as $9,le as J9,me as Q9}from"../chunk-p9c5rc1z.js";import{ne as iZ}from"../chunk-9m6mkaqb.js";import{Ae as PZ,Be as bZ,Ce as wZ,De as qZ,Ie as vZ,oe as HZ,pe as UZ,qe as xZ,re as OZ,se as SZ,te as RZ,ue as _Z,ve as kZ,we as fZ,xe as CZ,ye as VZ,ze as TZ}from"../chunk-vebstesm.js";import{Je as B9,Ke as j9}from"../chunk-09hzyf9g.js";import"../chunk-3830ee5d.js";import{$e as D6,$f as _8,$g as GZ,Ag as p8,Bg as d8,Bh as jZ,Cg as l8,Ch as FZ,Dg as n8,Eg as i8,Fg as s8,Kg as U,Lg as m,Mg as o8,Nf as J8,Ng as a8,Of as Q8,Og as t8,Pf as Y8,Pg as r8,Qf as K8,Qg as e8,Rf as G8,Se as N6,Sf as z8,Sg as WZ,Te as P5,Tg as ZZ,Ue as b5,Ug as $Z,Ve as w5,Vg as JZ,Wg as QZ,Xe as q5,Yf as O8,Zf as S8,Zg as YZ,_f as R8,_g as KZ,af as x4,ag as k8,bf as Z6,bg as f8,cf as O4,cg as C8,ch as zZ,df as S4,dg as V8,eg as T8,gg as P8,hf as f6,hg as R6,hh as XZ,if as C6,ig as b8,kf as v5,lf as I5,lh as BZ,mf as y5,mg as w8,nf as A5,ng as q8,of as h5,og as I8,pf as E5,ph as m4,qf as g5,qh as e,rf as m5,rg as y8,sf as c5,sg as A8,tf as o0,tg as h8,uf as u5,ug as E8,vf as p5,wf as d5,wg as g8,xf as l5,xg as m8,yf as n5,yg as c8,zg as u8}from"../chunk-qjk68wda.js";import"../chunk-hthyn5pj.js";import"../chunk-1em8t2x1.js";import{$i as i5,Aj as h1,Oi as b4,Si as J1,Ui as a,Yi as D4,Zi as U1,_i as A1,aj as s5,bj as o5,cj as a5,dj as t5,pj as HW,qj as UW,tj as r5,ui as U4,uj as e5,vi as N4,wi as H1,wj as W8,xj as Z8,yj as $8}from"../chunk-7wzhdq1x.js";import"../chunk-aed0vv5g.js";import{Lj as V}from"../chunk-jy26hy7z.js";import"../chunk-8ar7180x.js";import{$j as d0,Xj as N8,Yj as D8,Zj as v1,_j as H8,ak as U8,bk as x8}from"../chunk-yj1h4rzn.js";import{hk as F8,ik as M8,jk as L8}from"../chunk-3z8d8v8q.js";import"../chunk-wdrmzjtq.js";import{Sk as v8}from"../chunk-6cx6kh04.js";import{Uk as X8,Vk as B8,Wk as j8}from"../chunk-06w8hhnk.js";import"../chunk-24tj4dzx.js";import"../chunk-xgc5tj8k.js";import"../chunk-etcds9w3.js";import"../chunk-nfher0gz.js";import{Ql as _4,Rl as MZ,Sl as LZ,Tl as NZ,Vl as DZ}from"../chunk-wfees83q.js";import"../chunk-65btke6p.js";import{dm as _}from"../chunk-vyaedzr8.js";import"../chunk-djnn8vvp.js";import"../chunk-tx5zrdmb.js";import"../chunk-0eq7am78.js";import"../chunk-77dt2tap.js";import"../chunk-ne51fxg2.js";import{Im as y1}from"../chunk-zf1eqgzt.js";import{Buffer as a0}from"buffer";class t0 extends U1{client;config;constructor(...W){super();this.config=W}async connect(){let W=await import("../chunk-njnng5ew.js");return this.client??=new W.S3Client(...this.config),{sdk:W,client:this.client}}async put(W,{signal:Z}={}){Z?.throwIfAborted();let $,J,Q,Y=process.env.BUCKET_NAME;if(W instanceof Blob)$=W,Q=`${Bun.randomUUIDv7()}.${W.type.split("/")[1].split(";")[0]}`,J=W.type;else $=W.body,Q=W.name,Y=W.bucket??Y,J=W.contentType||($ instanceof Blob||$ instanceof File?$.type:void 0);J=J||void 0;let K=$ instanceof a0?$:$ instanceof Blob||$ instanceof File?a0.from(await $.arrayBuffer()):"",{sdk:G,client:z}=await this.connect();return Z?.throwIfAborted(),await z.send(new G.PutObjectCommand({Bucket:Y,Key:Q,Body:K,ContentType:J}),{abortSignal:Z}),Q}async delete(W){let Z=typeof W==="string"?W:W.name,$=(typeof W==="string"?void 0:W.bucket)??process.env.BUCKET_NAME;if(!Z)throw Error("Object name has to be specified");let{sdk:J,client:Q}=await this.connect();try{await Q.send(new J.DeleteObjectCommand({Bucket:$,Key:Z}))}catch(Y){if(Y?.name==="NoSuchKey"||Y?.$metadata?.httpStatusCode===404)return;throw Y}}async*pages(W,{bucket:Z,signal:$}){let{sdk:J,client:Q}=await this.connect(),Y;do{$?.throwIfAborted();let K=await Q.send(new J.ListObjectsV2Command({Bucket:Z??process.env.BUCKET_NAME,Prefix:W,ContinuationToken:Y}),{abortSignal:$});yield(K.Contents??[]).map((G)=>({name:G.Key,size:G.Size??0,lastModified:G.LastModified??new Date(0)})),Y=K.IsTruncated?K.NextContinuationToken:void 0}while(Y)}async*objects(W,Z={}){for await(let $ of this.pages(W,Z))yield*$}async deletePrefix(W,Z={}){D4(W);let $=Z.bucket??process.env.BUCKET_NAME,{sdk:J,client:Q}=await this.connect(),Y=0;for await(let K of this.pages(W,{...Z,bucket:$})){if(K.length===0)continue;Z.signal?.throwIfAborted();let z=(await Q.send(new J.DeleteObjectsCommand({Bucket:$,Delete:{Objects:K.map((X)=>({Key:X.name})),Quiet:!0}}),{abortSignal:Z.signal}))?.Errors??[];if(z.length>0){let X=z[0];throw Error(`S3 could not delete ${z.length} object(s) under "${W}", e.g. "${X.Key}": ${X.Code??"unknown"} ${X.Message??""}`.trim())}Y+=K.length}return Y}async list(W){let{sdk:Z,client:$}=await this.connect();return await $.send(new Z.ListObjectsV2Command({Bucket:process.env.BUCKET_NAME,Prefix:W}))}async fetch(W,{signal:Z}={}){Z?.throwIfAborted();let $=process.env.BUCKET_NAME,J;if(typeof W==="string")J=W;else $=W.bucket??$,J=W.name;if(!J)throw Error("Object name has to be specified");let{sdk:Q,client:Y}=await this.connect();Z?.throwIfAborted();let K=await Y.send(new Q.GetObjectCommand({Bucket:$,Key:J}),{abortSignal:Z}),G=A1(K.Body.transformToWebStream(),Z);return Z?.throwIfAborted(),new Response(G,{headers:{"Content-Type":K.ContentType,"Content-Length":K.ContentLength.toString(),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":K.LastModified?.toUTCString()||"",ETag:K.ETag||""}})}async read(W){let Z=typeof W==="string"?{name:W}:W,$=Z.bucket??process.env.BUCKET_NAME,{name:J,range:Q=null}=Z;if(!J)throw Error("Object name has to be specified");let{sdk:Y,client:K}=await this.connect(),G;try{G=await K.send(new Y.GetObjectCommand({Bucket:$,Key:J,Range:Q?N4(Q):void 0}))}catch(j){if(j?.name==="InvalidRange"||j?.$metadata?.httpStatusCode===416)throw new J1(await this.size({name:J,bucket:$}));if(j?.name==="NoSuchKey"||j?.$metadata?.httpStatusCode===404)throw new a(J);throw j}let z=H1(G.ContentRange),X=Boolean(z)&&G.$metadata?.httpStatusCode===206,B=z?.total??G.ContentLength??0;return{body:G.Body.transformToWebStream(),start:z?.start??0,end:z?.end??B-1,total:B,partial:X,type:G.ContentType??"application/octet-stream",etag:G.ETag||void 0,lastModified:G.LastModified,name:J}}async size(W){let Z=typeof W==="string"?W:W.name,$=(typeof W==="string"?void 0:W.bucket)??process.env.BUCKET_NAME,{sdk:J,client:Q}=await this.connect();try{return(await Q.send(new J.HeadObjectCommand({Bucket:$,Key:Z}))).ContentLength??0}catch(Y){if(Y?.name==="NotFound"||Y?.$metadata?.httpStatusCode===404)throw new a(Z);throw Y}}}import{Buffer as r0}from"buffer";import{Readable as SW}from"stream";function H4(W){return W?.statusCode===404||W?.details?.errorCode==="BlobNotFound"||W?.code==="BlobNotFound"}function RW(W){return W?.statusCode===416||W?.details?.errorCode==="InvalidRange"||W?.code==="InvalidRange"}class e0 extends U1{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 Z=this.config.connectionString??process.env.AZURE_STORAGE_CONNECTION_STRING;if(this.config.url)return new W.BlobServiceClient(this.config.url,this.config.credential);if(Z)return W.BlobServiceClient.fromConnectionString(Z);throw Error("AzureBlobDriver needs a connection string (AZURE_STORAGE_CONNECTION_STRING), a `url`, or a `serviceClient`.")})(),this.serviceClientPromise}async blob(W,Z){if(!W)throw Error("Object name has to be specified");let $=Z??this.config.container??process.env.BUCKET_NAME;if(!$)throw Error("AzureBlobDriver needs a container name, from `bucket`, the `container` config, or BUCKET_NAME.");return(await this.serviceClient()).getContainerClient($).getBlockBlobClient(W)}async put(W,{signal:Z}={}){Z?.throwIfAborted();let $,J,Q,Y;if(W instanceof Blob)$=W,Q=`${Bun.randomUUIDv7()}.${W.type.split("/")[1].split(";")[0]}`,J=W.type;else $=W.body,Q=W.name,Y=W.bucket,J=W.contentType??($ instanceof Blob||$ instanceof File?$.type:void 0);let K=$ instanceof r0?$:r0.from(await $.arrayBuffer()),G=await this.blob(Q,Y);return Z?.throwIfAborted(),await G.uploadData(K,{blobHTTPHeaders:J?{blobContentType:J}:void 0,abortSignal:Z}),Q}async*objects(W,{bucket:Z,signal:$}={}){$?.throwIfAborted();let J=Z??this.config.container??process.env.BUCKET_NAME;if(!J)throw Error("AzureBlobDriver needs a container name, from `bucket`, the `container` config, or BUCKET_NAME.");let Y=(await this.serviceClient()).getContainerClient(J);for await(let K of Y.listBlobsFlat({prefix:W}))$?.throwIfAborted(),yield{name:K.name,size:K.properties?.contentLength??0,lastModified:K.properties?.lastModified??new Date(0)}}async list(W){let Z=this.config.container??process.env.BUCKET_NAME,J=(await this.serviceClient()).getContainerClient(Z),Q=[];for await(let Y of J.listBlobsFlat({prefix:W}))Q.push(Y.name);return Q}async fetch(W,{signal:Z}={}){Z?.throwIfAborted();let $=await this.download(typeof W==="string"?{name:W}:{name:W.name,bucket:W.bucket},Z);return new Response($.body,{headers:{"Content-Type":$.type,"Content-Length":String($.total),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":$.lastModified?.toUTCString()??"",ETag:$.etag??""}})}async read(W){return this.download(typeof W==="string"?{name:W}:W)}async download(W,Z){let{name:$,bucket:J,range:Q=null}=W,Y=await this.blob($,J);Z?.throwIfAborted();let K,G,z=Q?.kind==="suffix"||Q?.kind==="offset"&&Q.end===null&&Q.start===0;if(Q&&z){let S=await this.size({name:$,bucket:J}),o=U4(Q,S);if(!o)throw new J1(S);K=o.start,G=o.length}else if(Q?.kind==="offset")K=Q.start,G=Q.end===null?void 0:Q.end-Q.start+1;let X;try{X=await Y.download(K,G,Z?{abortSignal:Z}:void 0)}catch(S){if(RW(S))throw new J1(await this.size({name:$,bucket:J}));if(H4(S))throw new a($);throw S}let B=H1(X.contentRange),j=Boolean(B),L=B?.total??X.contentLength??0,H=await _W(X);if(H instanceof ReadableStream)H=A1(H,Z);return Z?.throwIfAborted(),{body:H,start:B?.start??0,end:B?.end??L-1,total:L,partial:j,type:X.contentType??"application/octet-stream",etag:X.etag||void 0,lastModified:X.lastModified,name:$}}async size(W){let Z=typeof W==="string"?W:W.name,$=typeof W==="string"?void 0:W.bucket,J=await this.blob(Z,$);try{return(await J.getProperties()).contentLength??0}catch(Q){if(H4(Q))throw new a(Z);throw Q}}async delete(W){let Z=typeof W==="string"?W:W.name,$=typeof W==="string"?void 0:W.bucket,J=await this.blob(Z,$);try{await J.delete()}catch(Q){if(H4(Q))return;throw Q}}}async function _W(W){if(W.blobBody)return await W.blobBody;if(W.readableStreamBody)return SW.toWeb(W.readableStreamBody);return null}function kW(W){return W}class R4 extends Error{code="ERR_RATE_LIMITER_TIMEOUT";constructor(W){super(`RedisRateLimiter: Redis did not answer within ${W}ms.`);this.name="RedisRateLimiterTimeoutError"}}class E1 extends Error{code="ERR_RATE_LIMITER_DISCONNECTED";constructor(){super("RedisRateLimiter: the Redis client is not connected.");this.name="RedisRateLimiterDisconnectedError"}}var W6=1000,fW=60000,CW=`
2
+ import{rb as v9}from"../chunk-g6tqje74.js";import{$b as k9,Ab as q4,Bb as c1,Cb as mZ,Db as cZ,Eb as Y9,Ib as K9,Jb as G9,Kb as z9,Lb as X9,Mb as F9,Nb as M9,Ob as L9,Pb as N9,Qb as D9,Rb as H9,Sb as U9,Tb as g4,Ub as _6,Vb as w,Wb as x9,Xb as O9,Yb as S9,Zb as R9,_b as _9,ac as f9,bc as C9,cc as V9,dc as T9,ec as P9,fc as b9,gc as w9,hc as q9,sb as IZ,tb as yZ,ub as AZ,vb as hZ,wb as EZ,xb as y4,yb as gZ,zb as w4}from"../chunk-k8a41gkt.js";import{kc as h4}from"../chunk-v1d7xya8.js";import"../chunk-e0scxs81.js";import{$d as dZ,Zd as uZ,_d as pZ,ae as lZ,be as nZ,ce as sZ,de as oZ,ee as aZ,fe as tZ,ge as rZ,he as eZ,ie as W9,je as Z9,ke as $9,le as J9,me as Q9}from"../chunk-p9c5rc1z.js";import{ne as iZ}from"../chunk-9m6mkaqb.js";import{Ae as PZ,Be as bZ,Ce as wZ,De as qZ,Ie as vZ,oe as HZ,pe as UZ,qe as xZ,re as OZ,se as SZ,te as RZ,ue as _Z,ve as kZ,we as fZ,xe as CZ,ye as VZ,ze as TZ}from"../chunk-vebstesm.js";import{Je as B9,Ke as j9}from"../chunk-09hzyf9g.js";import"../chunk-3830ee5d.js";import{$e as D6,$f as _8,$g as GZ,Ag as p8,Bg as d8,Bh as jZ,Cg as l8,Ch as FZ,Dg as n8,Eg as i8,Fg as s8,Kg as U,Lg as m,Mg as o8,Nf as J8,Ng as a8,Of as Q8,Og as t8,Pf as Y8,Pg as r8,Qf as K8,Qg as e8,Rf as G8,Se as N6,Sf as z8,Sg as WZ,Te as P5,Tg as ZZ,Ue as b5,Ug as $Z,Ve as w5,Vg as JZ,Wg as QZ,Xe as q5,Yf as O8,Zf as S8,Zg as YZ,_f as R8,_g as KZ,af as x4,ag as k8,bf as Z6,bg as f8,cf as O4,cg as C8,ch as zZ,df as S4,dg as V8,eg as T8,gg as P8,hf as f6,hg as R6,hh as XZ,if as C6,ig as b8,kf as v5,lf as I5,lh as BZ,mf as y5,mg as w8,nf as A5,ng as q8,of as h5,og as I8,pf as E5,ph as m4,qf as g5,qh as e,rf as m5,rg as y8,sf as c5,sg as A8,tf as o0,tg as h8,uf as u5,ug as E8,vf as p5,wf as d5,wg as g8,xf as l5,xg as m8,yf as n5,yg as c8,zg as u8}from"../chunk-53fv4c39.js";import"../chunk-hthyn5pj.js";import"../chunk-1em8t2x1.js";import{$i as i5,Aj as h1,Oi as b4,Si as J1,Ui as a,Yi as D4,Zi as U1,_i as A1,aj as s5,bj as o5,cj as a5,dj as t5,pj as HW,qj as UW,tj as r5,ui as U4,uj as e5,vi as N4,wi as H1,wj as W8,xj as Z8,yj as $8}from"../chunk-7wzhdq1x.js";import"../chunk-aed0vv5g.js";import{Lj as V}from"../chunk-jy26hy7z.js";import"../chunk-8ar7180x.js";import{$j as d0,Xj as N8,Yj as D8,Zj as v1,_j as H8,ak as U8,bk as x8}from"../chunk-yj1h4rzn.js";import{hk as F8,ik as M8,jk as L8}from"../chunk-3z8d8v8q.js";import"../chunk-wdrmzjtq.js";import{Sk as v8}from"../chunk-6cx6kh04.js";import{Uk as X8,Vk as B8,Wk as j8}from"../chunk-06w8hhnk.js";import"../chunk-24tj4dzx.js";import"../chunk-xgc5tj8k.js";import"../chunk-etcds9w3.js";import"../chunk-nfher0gz.js";import{Ql as _4,Rl as MZ,Sl as LZ,Tl as NZ,Vl as DZ}from"../chunk-wfees83q.js";import"../chunk-65btke6p.js";import{dm as _}from"../chunk-vyaedzr8.js";import"../chunk-djnn8vvp.js";import"../chunk-tx5zrdmb.js";import"../chunk-0eq7am78.js";import"../chunk-77dt2tap.js";import"../chunk-ne51fxg2.js";import{Im as y1}from"../chunk-zf1eqgzt.js";import{Buffer as a0}from"buffer";class t0 extends U1{client;config;constructor(...W){super();this.config=W}async connect(){let W=await import("../chunk-njnng5ew.js");return this.client??=new W.S3Client(...this.config),{sdk:W,client:this.client}}async put(W,{signal:Z}={}){Z?.throwIfAborted();let $,J,Q,Y=process.env.BUCKET_NAME;if(W instanceof Blob)$=W,Q=`${Bun.randomUUIDv7()}.${W.type.split("/")[1].split(";")[0]}`,J=W.type;else $=W.body,Q=W.name,Y=W.bucket??Y,J=W.contentType||($ instanceof Blob||$ instanceof File?$.type:void 0);J=J||void 0;let K=$ instanceof a0?$:$ instanceof Blob||$ instanceof File?a0.from(await $.arrayBuffer()):"",{sdk:G,client:z}=await this.connect();return Z?.throwIfAborted(),await z.send(new G.PutObjectCommand({Bucket:Y,Key:Q,Body:K,ContentType:J}),{abortSignal:Z}),Q}async delete(W){let Z=typeof W==="string"?W:W.name,$=(typeof W==="string"?void 0:W.bucket)??process.env.BUCKET_NAME;if(!Z)throw Error("Object name has to be specified");let{sdk:J,client:Q}=await this.connect();try{await Q.send(new J.DeleteObjectCommand({Bucket:$,Key:Z}))}catch(Y){if(Y?.name==="NoSuchKey"||Y?.$metadata?.httpStatusCode===404)return;throw Y}}async*pages(W,{bucket:Z,signal:$}){let{sdk:J,client:Q}=await this.connect(),Y;do{$?.throwIfAborted();let K=await Q.send(new J.ListObjectsV2Command({Bucket:Z??process.env.BUCKET_NAME,Prefix:W,ContinuationToken:Y}),{abortSignal:$});yield(K.Contents??[]).map((G)=>({name:G.Key,size:G.Size??0,lastModified:G.LastModified??new Date(0)})),Y=K.IsTruncated?K.NextContinuationToken:void 0}while(Y)}async*objects(W,Z={}){for await(let $ of this.pages(W,Z))yield*$}async deletePrefix(W,Z={}){D4(W);let $=Z.bucket??process.env.BUCKET_NAME,{sdk:J,client:Q}=await this.connect(),Y=0;for await(let K of this.pages(W,{...Z,bucket:$})){if(K.length===0)continue;Z.signal?.throwIfAborted();let z=(await Q.send(new J.DeleteObjectsCommand({Bucket:$,Delete:{Objects:K.map((X)=>({Key:X.name})),Quiet:!0}}),{abortSignal:Z.signal}))?.Errors??[];if(z.length>0){let X=z[0];throw Error(`S3 could not delete ${z.length} object(s) under "${W}", e.g. "${X.Key}": ${X.Code??"unknown"} ${X.Message??""}`.trim())}Y+=K.length}return Y}async list(W){let{sdk:Z,client:$}=await this.connect();return await $.send(new Z.ListObjectsV2Command({Bucket:process.env.BUCKET_NAME,Prefix:W}))}async fetch(W,{signal:Z}={}){Z?.throwIfAborted();let $=process.env.BUCKET_NAME,J;if(typeof W==="string")J=W;else $=W.bucket??$,J=W.name;if(!J)throw Error("Object name has to be specified");let{sdk:Q,client:Y}=await this.connect();Z?.throwIfAborted();let K=await Y.send(new Q.GetObjectCommand({Bucket:$,Key:J}),{abortSignal:Z}),G=A1(K.Body.transformToWebStream(),Z);return Z?.throwIfAborted(),new Response(G,{headers:{"Content-Type":K.ContentType,"Content-Length":K.ContentLength.toString(),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":K.LastModified?.toUTCString()||"",ETag:K.ETag||""}})}async read(W){let Z=typeof W==="string"?{name:W}:W,$=Z.bucket??process.env.BUCKET_NAME,{name:J,range:Q=null}=Z;if(!J)throw Error("Object name has to be specified");let{sdk:Y,client:K}=await this.connect(),G;try{G=await K.send(new Y.GetObjectCommand({Bucket:$,Key:J,Range:Q?N4(Q):void 0}))}catch(j){if(j?.name==="InvalidRange"||j?.$metadata?.httpStatusCode===416)throw new J1(await this.size({name:J,bucket:$}));if(j?.name==="NoSuchKey"||j?.$metadata?.httpStatusCode===404)throw new a(J);throw j}let z=H1(G.ContentRange),X=Boolean(z)&&G.$metadata?.httpStatusCode===206,B=z?.total??G.ContentLength??0;return{body:G.Body.transformToWebStream(),start:z?.start??0,end:z?.end??B-1,total:B,partial:X,type:G.ContentType??"application/octet-stream",etag:G.ETag||void 0,lastModified:G.LastModified,name:J}}async size(W){let Z=typeof W==="string"?W:W.name,$=(typeof W==="string"?void 0:W.bucket)??process.env.BUCKET_NAME,{sdk:J,client:Q}=await this.connect();try{return(await Q.send(new J.HeadObjectCommand({Bucket:$,Key:Z}))).ContentLength??0}catch(Y){if(Y?.name==="NotFound"||Y?.$metadata?.httpStatusCode===404)throw new a(Z);throw Y}}}import{Buffer as r0}from"buffer";import{Readable as SW}from"stream";function H4(W){return W?.statusCode===404||W?.details?.errorCode==="BlobNotFound"||W?.code==="BlobNotFound"}function RW(W){return W?.statusCode===416||W?.details?.errorCode==="InvalidRange"||W?.code==="InvalidRange"}class e0 extends U1{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 Z=this.config.connectionString??process.env.AZURE_STORAGE_CONNECTION_STRING;if(this.config.url)return new W.BlobServiceClient(this.config.url,this.config.credential);if(Z)return W.BlobServiceClient.fromConnectionString(Z);throw Error("AzureBlobDriver needs a connection string (AZURE_STORAGE_CONNECTION_STRING), a `url`, or a `serviceClient`.")})(),this.serviceClientPromise}async blob(W,Z){if(!W)throw Error("Object name has to be specified");let $=Z??this.config.container??process.env.BUCKET_NAME;if(!$)throw Error("AzureBlobDriver needs a container name, from `bucket`, the `container` config, or BUCKET_NAME.");return(await this.serviceClient()).getContainerClient($).getBlockBlobClient(W)}async put(W,{signal:Z}={}){Z?.throwIfAborted();let $,J,Q,Y;if(W instanceof Blob)$=W,Q=`${Bun.randomUUIDv7()}.${W.type.split("/")[1].split(";")[0]}`,J=W.type;else $=W.body,Q=W.name,Y=W.bucket,J=W.contentType??($ instanceof Blob||$ instanceof File?$.type:void 0);let K=$ instanceof r0?$:r0.from(await $.arrayBuffer()),G=await this.blob(Q,Y);return Z?.throwIfAborted(),await G.uploadData(K,{blobHTTPHeaders:J?{blobContentType:J}:void 0,abortSignal:Z}),Q}async*objects(W,{bucket:Z,signal:$}={}){$?.throwIfAborted();let J=Z??this.config.container??process.env.BUCKET_NAME;if(!J)throw Error("AzureBlobDriver needs a container name, from `bucket`, the `container` config, or BUCKET_NAME.");let Y=(await this.serviceClient()).getContainerClient(J);for await(let K of Y.listBlobsFlat({prefix:W}))$?.throwIfAborted(),yield{name:K.name,size:K.properties?.contentLength??0,lastModified:K.properties?.lastModified??new Date(0)}}async list(W){let Z=this.config.container??process.env.BUCKET_NAME,J=(await this.serviceClient()).getContainerClient(Z),Q=[];for await(let Y of J.listBlobsFlat({prefix:W}))Q.push(Y.name);return Q}async fetch(W,{signal:Z}={}){Z?.throwIfAborted();let $=await this.download(typeof W==="string"?{name:W}:{name:W.name,bucket:W.bucket},Z);return new Response($.body,{headers:{"Content-Type":$.type,"Content-Length":String($.total),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":$.lastModified?.toUTCString()??"",ETag:$.etag??""}})}async read(W){return this.download(typeof W==="string"?{name:W}:W)}async download(W,Z){let{name:$,bucket:J,range:Q=null}=W,Y=await this.blob($,J);Z?.throwIfAborted();let K,G,z=Q?.kind==="suffix"||Q?.kind==="offset"&&Q.end===null&&Q.start===0;if(Q&&z){let S=await this.size({name:$,bucket:J}),o=U4(Q,S);if(!o)throw new J1(S);K=o.start,G=o.length}else if(Q?.kind==="offset")K=Q.start,G=Q.end===null?void 0:Q.end-Q.start+1;let X;try{X=await Y.download(K,G,Z?{abortSignal:Z}:void 0)}catch(S){if(RW(S))throw new J1(await this.size({name:$,bucket:J}));if(H4(S))throw new a($);throw S}let B=H1(X.contentRange),j=Boolean(B),L=B?.total??X.contentLength??0,H=await _W(X);if(H instanceof ReadableStream)H=A1(H,Z);return Z?.throwIfAborted(),{body:H,start:B?.start??0,end:B?.end??L-1,total:L,partial:j,type:X.contentType??"application/octet-stream",etag:X.etag||void 0,lastModified:X.lastModified,name:$}}async size(W){let Z=typeof W==="string"?W:W.name,$=typeof W==="string"?void 0:W.bucket,J=await this.blob(Z,$);try{return(await J.getProperties()).contentLength??0}catch(Q){if(H4(Q))throw new a(Z);throw Q}}async delete(W){let Z=typeof W==="string"?W:W.name,$=typeof W==="string"?void 0:W.bucket,J=await this.blob(Z,$);try{await J.delete()}catch(Q){if(H4(Q))return;throw Q}}}async function _W(W){if(W.blobBody)return await W.blobBody;if(W.readableStreamBody)return SW.toWeb(W.readableStreamBody);return null}function kW(W){return W}class R4 extends Error{code="ERR_RATE_LIMITER_TIMEOUT";constructor(W){super(`RedisRateLimiter: Redis did not answer within ${W}ms.`);this.name="RedisRateLimiterTimeoutError"}}class E1 extends Error{code="ERR_RATE_LIMITER_DISCONNECTED";constructor(){super("RedisRateLimiter: the Redis client is not connected.");this.name="RedisRateLimiterDisconnectedError"}}var W6=1000,fW=60000,CW=`
3
3
  local currentKey = KEYS[1]
4
4
  local previousKey = KEYS[2]
5
5
  local limit = tonumber(ARGV[1])
@@ -1,8 +1,8 @@
1
- import { $ as applyParams, N as I18nProvider, P as ServerDataContext, Q as toVariantKey, W as RealtimeContext, bt as Subject, c as ClientRouterContext, i as RouteTransitionProvider, nt as QueryManagerProvider, q as liveModule, r as m, t as ThemeProvider, tt as QueryManagerContext, z as ProgressManager } from "../chunks/ThemeProvider-COjYIalw.js";
1
+ import { $ as applyParams, N as I18nProvider, P as ServerDataContext, Q as toVariantKey, W as RealtimeContext, bt as Subject, c as ClientRouterContext, i as RouteTransitionProvider, nt as QueryManagerProvider, q as liveModule, r as m, t as ThemeProvider, tt as QueryManagerContext, z as ProgressManager } from "../chunks/ThemeProvider-w_axEu6B.js";
2
2
  import { r as RouteStateProvider } from "../chunks/useParams-BN3XXfmG.js";
3
3
  import "../chunks/urlpattern-polyfill-Cc7YrzJf.js";
4
4
  import { t as channelKey } from "../chunks/channelKey-CIhHpX6x.js";
5
- import { t as followLive } from "../chunks/live-Dz_rk7fm.js";
5
+ import { t as followLive } from "../chunks/live-9IXFtoGy.js";
6
6
  import { Suspense, createElement, useContext, useMemo, useRef, useState } from "react";
7
7
  import { jsx } from "react/jsx-runtime";
8
8
  import { hydrateRoot } from "react-dom/client";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gemi",
3
- "version": "0.206.0",
3
+ "version": "0.207.1",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "Enes Tufekci <enes@gemijs.dev>",
@@ -50,6 +50,25 @@ function Dashboard({ orgId }: { orgId: string }) {
50
50
  A key's third element is its `useQuery` config (`staleTime`, `refetchUntil`,
51
51
  `live`, `suspense`, …); a second argument applies config to every key.
52
52
 
53
+ **One key outside the segment's `Loading`:** give that key `suspense: false` in
54
+ the same call and read its own flag from `loadingByKey`. Every key, suspending or
55
+ not, starts its request in the same render, so the view still costs one request
56
+ round:
57
+
58
+ ```tsx
59
+ const { data, loadingByKey } = useMultipleQuery({
60
+ account: ["/settings/account"],
61
+ invoices: ["/settings/invoices", {}, { suspense: false }],
62
+ });
63
+ // data.account is ready; data.invoices may be undefined while loadingByKey.invoices
64
+ ```
65
+
66
+ **Two hooks, one of them `suspense: false`** (e.g. a shared hook that wraps its
67
+ own `suspense: false` read): call the non-suspending hook **first**. Its requests
68
+ start in the render and run alongside the suspending ones. After a suspending
69
+ hook they can't: it throws before the next hook runs, and the non-suspending
70
+ requests only go out once the suspending ones answered (two rounds).
71
+
53
72
  **Exceptions — a second `useQuery` is fine when:**
54
73
 
55
74
  - **One query needs another's answer** (its `params` or `search` come from the
@@ -59,6 +78,9 @@ A key's third element is its `useQuery` config (`staleTime`, `refetchUntil`,
59
78
  or, better, in a child component that receives the first answer as a prop.
60
79
  - **A query is `lazy`** (fetched on `trigger()`): it does not load with the
61
80
  others, and `useMultipleQuery` does not take `lazy`.
81
+ - **A `suspense: false` read before the suspending one** (see above): both start
82
+ in the same render. Prefer one call with per-key `suspense` when you write both
83
+ reads yourself.
62
84
  - **A paged list** uses `useInfiniteQuery`, which has its own hook.
63
85
 
64
86
  Reading the same query in separate components is not this case: that is one