gemi 0.224.1 → 0.225.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.
Files changed (53) hide show
  1. package/dist/{chunk-y8cj5cap.js → chunk-dgy6pf2h.js} +1 -1
  2. package/dist/{chunk-jyyrgb6j.js → chunk-jychsmhf.js} +2 -2
  3. package/dist/{chunk-jyyrgb6j.js.map → chunk-jychsmhf.js.map} +1 -1
  4. package/dist/{chunk-79v94sa6.js → chunk-knfvx96p.js} +1 -1
  5. package/dist/{chunk-3k4p9agd.js → chunk-mdg8g8h2.js} +22 -22
  6. package/dist/{chunk-3k4p9agd.js.map → chunk-mdg8g8h2.js.map} +8 -7
  7. package/dist/{chunk-99216y02.js → chunk-rdfatx17.js} +1 -1
  8. package/dist/chunks/{RealtimeClient-CuTFz0v1.js → RealtimeClient-C5Zh3fD6.js} +2 -2
  9. package/dist/chunks/{RealtimeClient-CuTFz0v1.js.map → RealtimeClient-C5Zh3fD6.js.map} +1 -1
  10. package/dist/chunks/{ThemeProvider-BO3sQkWl.js → ThemeProvider-bbbE-N3t.js} +5 -3
  11. package/dist/chunks/ThemeProvider-bbbE-N3t.js.map +1 -0
  12. package/dist/chunks/{fetchFileRequest-CrKd0rD5.js → fetchFileRequest-JXhnEi-R.js} +2 -2
  13. package/dist/chunks/{fetchFileRequest-CrKd0rD5.js.map → fetchFileRequest-JXhnEi-R.js.map} +1 -1
  14. package/dist/chunks/{live-BCCfTb28.js → live-CApTRvmK.js} +3 -3
  15. package/dist/chunks/{live-BCCfTb28.js.map → live-CApTRvmK.js.map} +1 -1
  16. package/dist/chunks/{mutationExtras-cPXZS6Hf.js → mutationExtras-C2qSSZ2Q.js} +34 -3
  17. package/dist/chunks/mutationExtras-C2qSSZ2Q.js.map +1 -0
  18. package/dist/chunks/{subscriptionStream-CRrAISl8.js → subscriptionStream-DQLW7dTW.js} +2 -2
  19. package/dist/chunks/{subscriptionStream-CRrAISl8.js.map → subscriptionStream-DQLW7dTW.js.map} +1 -1
  20. package/dist/client/QueryManagerContext.d.ts +2 -0
  21. package/dist/client/QueryManagerContext.d.ts.map +1 -1
  22. package/dist/client/index.d.ts +2 -1
  23. package/dist/client/index.d.ts.map +1 -1
  24. package/dist/client/index.js +63 -8
  25. package/dist/client/index.js.map +1 -1
  26. package/dist/client/islands.d.ts.map +1 -1
  27. package/dist/client/mutationExtras.d.ts +1 -1
  28. package/dist/client/mutationExtras.d.ts.map +1 -1
  29. package/dist/client/queryUpdates.d.ts +8 -0
  30. package/dist/client/queryUpdates.d.ts.map +1 -1
  31. package/dist/client/useInvalidate.d.ts +13 -0
  32. package/dist/client/useInvalidate.d.ts.map +1 -0
  33. package/dist/client/useMutation.d.ts +17 -0
  34. package/dist/client/useMutation.d.ts.map +1 -1
  35. package/dist/facades/Prefetch.d.ts +22 -0
  36. package/dist/facades/Prefetch.d.ts.map +1 -1
  37. package/dist/facades/index.js +1 -1
  38. package/dist/http/index.js +1 -1
  39. package/dist/i18n/index.js +1 -1
  40. package/dist/kernel/index.js +1 -1
  41. package/dist/server/index.js +1 -1
  42. package/dist/services/index.js +1 -1
  43. package/dist/services/router/ServerQueryStore.d.ts +8 -0
  44. package/dist/services/router/ServerQueryStore.d.ts.map +1 -1
  45. package/dist/testing/index.js +2 -2
  46. package/dist/utils/invalidation.d.ts +16 -0
  47. package/dist/utils/invalidation.d.ts.map +1 -0
  48. package/package.json +1 -1
  49. package/dist/chunks/ThemeProvider-BO3sQkWl.js.map +0 -1
  50. package/dist/chunks/mutationExtras-cPXZS6Hf.js.map +0 -1
  51. /package/dist/{chunk-y8cj5cap.js.map → chunk-dgy6pf2h.js.map} +0 -0
  52. /package/dist/{chunk-79v94sa6.js.map → chunk-knfvx96p.js.map} +0 -0
  53. /package/dist/{chunk-99216y02.js.map → chunk-rdfatx17.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"islands.d.ts","sourceRoot":"","sources":["../../client/islands.tsx"],"names":[],"mappings":"AA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  export { withMutationErrorHelpers } from "./mutationErrorHelpers";
2
- export { applyQueryUpdates, writeQueryData } from "./queryUpdates";
2
+ export { applyQueryUpdates, invalidateQueries, writeQueryData } from "./queryUpdates";
3
3
  //# sourceMappingURL=mutationExtras.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mutationExtras.d.ts","sourceRoot":"","sources":["../../client/mutationExtras.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"mutationExtras.d.ts","sourceRoot":"","sources":["../../client/mutationExtras.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC"}
@@ -18,5 +18,13 @@ export declare function writeQueryData(getResource: Resolve, routeParams: Record
18
18
  * Write a mutation's `updates` with its answer.
19
19
  */
20
20
  export declare function applyQueryUpdates(getResource: Resolve, routeParams: Record<string, any>, updates: ReadonlyArray<QueryUpdate<any>> | undefined, answer: unknown): void;
21
+ /**
22
+ * Invalidates every cached query a key matches: one a mounted reader is
23
+ * rendering refetches now, any other is marked stale and revalidates when next
24
+ * read. A key is a resolved path (`"/posts"`, every search variant of it), a
25
+ * single variant (`"/posts?status=open"`), or a prefix ending in `*`
26
+ * (`"/posts/*"`).
27
+ */
28
+ export declare function invalidateQueries(resources: Iterable<QueryResource>, keys: ReadonlyArray<string>): void;
21
29
  export {};
22
30
  //# sourceMappingURL=queryUpdates.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"queryUpdates.d.ts","sourceRoot":"","sources":["../../client/queryUpdates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,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EAChC,MAAM,EAAE,WAAW,CAAC,GAAG,CAAC,EACxB,IAAI,EAAE,cAAc,QAsBrB;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,OAAO,EACpB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAChC,OAAO,EAAE,aAAa,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS,EACpD,MAAM,EAAE,OAAO,QAWhB;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,QAAQ,CAAC,aAAa,CAAC,EAClC,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,QA6B5B"}
@@ -0,0 +1,13 @@
1
+ import type { InvalidationKey } from "./useMutation";
2
+ /**
3
+ * Invalidates queries by key from anywhere on the client (#1329): for a change
4
+ * that did not come from a mutation hook, such as an event on a stream. Every
5
+ * mounted `useQuery` reading a matching query refetches; a cached one that is
6
+ * not on screen is marked stale and revalidates when next read.
7
+ *
8
+ * A key is a query's resolved path (`"/posts"`, every search variant of it),
9
+ * one variant (`"/posts?status=open"`), or a prefix ending in `*`
10
+ * (`"/posts/*"`).
11
+ */
12
+ export declare function useInvalidate(): (...keys: InvalidationKey[]) => void;
13
+ //# sourceMappingURL=useInvalidate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useInvalidate.d.ts","sourceRoot":"","sources":["../../client/useInvalidate.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD;;;;;;;;;GASG;AACH,wBAAgB,aAAa,cAMf,eAAe,EAAE,UAc9B"}
@@ -60,7 +60,24 @@ type Config<T, E = never> = {
60
60
  * from it and what is cached (#897).
61
61
  */
62
62
  updates?: ReadonlyArray<QueryUpdate<T>>;
63
+ /**
64
+ * The queries a successful answer makes out of date (#1329). Every mounted
65
+ * `useQuery` reading one refetches; a cached one that is not on screen is
66
+ * marked stale. A key is a query's path (`"/posts"`, every search variant
67
+ * of it), one variant (`"/posts?status=open"`), or a prefix ending in `*`
68
+ * (`"/posts/*"`). `:param` segments are filled from the mutation's params
69
+ * and the route's.
70
+ *
71
+ * The server can name them too, with `Query.invalidate()` in the handler:
72
+ * both are honoured.
73
+ */
74
+ invalidates?: ReadonlyArray<InvalidationKey>;
75
+ };
76
+ type GetPaths = {
77
+ [K in keyof RPC as K extends `GET:${infer P}` ? P : never]: true;
63
78
  };
79
+ /** A query's path, a `path?search` variant, or a prefix ending in `*`. */
80
+ export type InvalidationKey = keyof GetPaths | (string & {});
64
81
  /**
65
82
  * Callbacks for one `trigger` call. They run after the hook's own, and only
66
83
  * when the hook's would: in `"latest"` mode a superseded call runs neither.
@@ -1 +1 @@
1
- {"version":3,"file":"useMutation.d.ts","sourceRoot":"","sources":["../../client/useMutation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGzC,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,wBAAwB,EAC9B,MAAM,iBAAiB,CAAC;AAMzB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAKrD,KAAK,OAAO,GAAG;IACb,IAAI,EAAE;SACH,CAAC,IAAI,MAAM,GAAG,IAAI,CAAC,SAAS,QAAQ,MAAM,CAAC,EAAE,GAAG,CAAC,GAAG,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC;KACpE,CAAC;IACF,GAAG,EAAE;SACF,CAAC,IAAI,MAAM,GAAG,IAAI,CAAC,SAAS,OAAO,MAAM,CAAC,EAAE,GAAG,CAAC,GAAG,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC;KACnE,CAAC;IAC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AC,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC,CAAC;CAChE;;;wBAqCW,QAAQ,GAAG,IAAI,GAAG,IAAI,KAC/B,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;;EA6I1B"}
@@ -9,6 +9,8 @@ type QueryFacadeOptions<T extends keyof GetRPC> = {
9
9
  search?: Record<string, string | number | boolean | null>;
10
10
  params?: Partial<UrlParser<T>>;
11
11
  };
12
+ /** A query's path, a `path?search` variant, or a prefix ending in `*`. */
13
+ type InvalidationKey = keyof GetRPC | (string & {});
12
14
  export declare class Query {
13
15
  private static ensure;
14
16
  /**
@@ -33,6 +35,26 @@ export declare class Query {
33
35
  * can say so instead of being nagged.
34
36
  */
35
37
  static noPrefetch(): void;
38
+ /**
39
+ * Hands the page a query's answer that the handler already has: the client's
40
+ * `useQuery(path, { params, search })` with the same key renders it during
41
+ * SSR and hydrates it into the cache, with no request. The route's handler
42
+ * is not run, so the data is whatever the caller resolved, under its own
43
+ * access rules. Later refetches go to the route as usual.
44
+ *
45
+ * Per request: the data lives in this request's store only.
46
+ */
47
+ static prefill<T extends keyof GetRPC>(path: T, options: QueryFacadeOptions<T>, data: Data<T>): void;
48
+ /**
49
+ * Names the queries this request changed. The answer carries them in a
50
+ * header and the client's mutation hooks refetch every mounted query that
51
+ * matches; a cached one that is not on screen is marked stale.
52
+ *
53
+ * A key is a query's path, with its params applied: `"/posts"` is every
54
+ * search variant of that path, `"/posts?status=open"` that variant alone,
55
+ * and a trailing `*` matches by prefix (`"/posts/*"`).
56
+ */
57
+ static invalidate(...keys: InvalidationKey[]): void;
36
58
  }
37
59
  export {};
38
60
  //# sourceMappingURL=Prefetch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Prefetch.d.ts","sourceRoot":"","sources":["../../facades/Prefetch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAA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AAE,CAAC,OAAO,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC;IAK5C;;;;;;;OAOG;IACH,MAAM,CAAC,UAAU;IAajB;;;;;;;;OAQG;IACH,MAAM,CAAC,OAAO,CAAC,CAAC,SAAS,MAAM,MAAM,EACnC,IAAI,EAAE,CAAC,EACP,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC,EAC9B,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;IAcf;;;;;;;;OAQG;IACH,MAAM,CAAC,UAAU,CAAC,GAAG,IAAI,EAAE,eAAe,EAAE;CAK7C"}
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{$f as l,Eg as r,Fg as s,Gg as t,Hg as u,Lf as a,Of as c,Pf as e,Qf as f,Rf as h,Sf as i,Tf as j,_f as k,ag as m,bg as n,cg as o,dg as p,qh as v,tg as q}from"../chunk-3k4p9agd.js";import"../chunk-j9abwrkv.js";import"../chunk-4v5nwqw6.js";import{Vi as b,uj as d,yj as g}from"../chunk-zcmz311y.js";import"../chunk-h1wmpa03.js";import"../chunk-t586p2g2.js";import"../chunk-qs2xvc8g.js";import"../chunk-2y0nr525.js";import"../chunk-p4v71qfx.js";import"../chunk-anc5v266.js";import"../chunk-wy82t7mz.js";import"../chunk-tac25cnj.js";import"../chunk-0k2r6bep.js";import"../chunk-0av1gyns.js";import"../chunk-zmt5kdpb.js";import"../chunk-rat2827k.js";import"../chunk-yj7pbbnm.js";import"../chunk-37209psn.js";import"../chunk-fqhkkpq3.js";import"../chunk-swmf6w3z.js";import"../chunk-6r7956dh.js";import"../chunk-5mrtgr7q.js";import"../chunk-55btq9c7.js";import"../chunk-3dkv4989.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{$f as l,Eg as r,Fg as s,Gg as t,Hg as u,Lf as a,Of as c,Pf as e,Qf as f,Rf as h,Sf as i,Tf as j,_f as k,ag as m,bg as n,cg as o,dg as p,qh as v,tg as q}from"../chunk-mdg8g8h2.js";import"../chunk-j9abwrkv.js";import"../chunk-4v5nwqw6.js";import{Vi as b,uj as d,yj as g}from"../chunk-zcmz311y.js";import"../chunk-h1wmpa03.js";import"../chunk-t586p2g2.js";import"../chunk-qs2xvc8g.js";import"../chunk-2y0nr525.js";import"../chunk-p4v71qfx.js";import"../chunk-anc5v266.js";import"../chunk-wy82t7mz.js";import"../chunk-tac25cnj.js";import"../chunk-0k2r6bep.js";import"../chunk-0av1gyns.js";import"../chunk-zmt5kdpb.js";import"../chunk-rat2827k.js";import"../chunk-yj7pbbnm.js";import"../chunk-37209psn.js";import"../chunk-fqhkkpq3.js";import"../chunk-swmf6w3z.js";import"../chunk-6r7956dh.js";import"../chunk-5mrtgr7q.js";import"../chunk-55btq9c7.js";import"../chunk-3dkv4989.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=ED0BEE9484FF4EB464756E2164756E21
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{Ah as ha,Bh as ia,Ch as ja,Dh as ka,Eh as la,Fh as ma,Gh as na,Hh as oa,Ih as pa,Jf as J,Jh as qa,Kf as K,Kh as ra,Lh as sa,Mf as L,Mh as ta,Nf as M,Nh as ua,Pg as $,Te as t,Ue as u,Ve as v,We as w,Xe as x,Ye as E,bf as F,ef as G,ff as H,gf as I,rh as aa,sh as ba,th as ca,wh as da,xh as ea,yh as fa,zh as ga}from"../chunk-3k4p9agd.js";import"../chunk-j9abwrkv.js";import"../chunk-4v5nwqw6.js";import{Ai as n,Fi as o,Gi as p,Hi as q,Ii as r,Ni as s,Pi as y,Qi as z,Ri as A,Si as B,Ti as C,Ui as D,dj as N,ej as O,fj as P,gj as Q,hj as R,ij as S,jj as T,kj as U,li as a,lj as V,mi as b,mj as W,ni as d,nj as X,pj as Y,qj as Z,rj as _,si as e,ti as f,ui as g,vi as h,wi as i,xi as j}from"../chunk-zcmz311y.js";import{Cj as c}from"../chunk-h1wmpa03.js";import{Hj as k,Ij as l,Jj as m}from"../chunk-t586p2g2.js";import"../chunk-qs2xvc8g.js";import"../chunk-2y0nr525.js";import"../chunk-p4v71qfx.js";import"../chunk-anc5v266.js";import"../chunk-wy82t7mz.js";import"../chunk-tac25cnj.js";import"../chunk-0k2r6bep.js";import"../chunk-0av1gyns.js";import"../chunk-zmt5kdpb.js";import"../chunk-rat2827k.js";import"../chunk-yj7pbbnm.js";import"../chunk-37209psn.js";import"../chunk-fqhkkpq3.js";import"../chunk-swmf6w3z.js";import"../chunk-6r7956dh.js";import"../chunk-5mrtgr7q.js";import"../chunk-55btq9c7.js";import"../chunk-3dkv4989.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{Ah as ha,Bh as ia,Ch as ja,Dh as ka,Eh as la,Fh as ma,Gh as na,Hh as oa,Ih as pa,Jf as J,Jh as qa,Kf as K,Kh as ra,Lh as sa,Mf as L,Mh as ta,Nf as M,Nh as ua,Pg as $,Te as t,Ue as u,Ve as v,We as w,Xe as x,Ye as E,bf as F,ef as G,ff as H,gf as I,rh as aa,sh as ba,th as ca,wh as da,xh as ea,yh as fa,zh as ga}from"../chunk-mdg8g8h2.js";import"../chunk-j9abwrkv.js";import"../chunk-4v5nwqw6.js";import{Ai as n,Fi as o,Gi as p,Hi as q,Ii as r,Ni as s,Pi as y,Qi as z,Ri as A,Si as B,Ti as C,Ui as D,dj as N,ej as O,fj as P,gj as Q,hj as R,ij as S,jj as T,kj as U,li as a,lj as V,mi as b,mj as W,ni as d,nj as X,pj as Y,qj as Z,rj as _,si as e,ti as f,ui as g,vi as h,wi as i,xi as j}from"../chunk-zcmz311y.js";import{Cj as c}from"../chunk-h1wmpa03.js";import{Hj as k,Ij as l,Jj as m}from"../chunk-t586p2g2.js";import"../chunk-qs2xvc8g.js";import"../chunk-2y0nr525.js";import"../chunk-p4v71qfx.js";import"../chunk-anc5v266.js";import"../chunk-wy82t7mz.js";import"../chunk-tac25cnj.js";import"../chunk-0k2r6bep.js";import"../chunk-0av1gyns.js";import"../chunk-zmt5kdpb.js";import"../chunk-rat2827k.js";import"../chunk-yj7pbbnm.js";import"../chunk-37209psn.js";import"../chunk-fqhkkpq3.js";import"../chunk-swmf6w3z.js";import"../chunk-6r7956dh.js";import"../chunk-5mrtgr7q.js";import"../chunk-55btq9c7.js";import"../chunk-3dkv4989.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=8B789E4706BE86CC64756E2164756E21
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{ra as T}from"../chunk-50791bmz.js";import"../chunk-hke4hzfm.js";import{pb as D}from"../chunk-89egc0h3.js";import{Qe as b,Re as w}from"../chunk-vcw98sp6.js";import"../chunk-qy0k2s5f.js";import{Of as j}from"../chunk-3k4p9agd.js";import"../chunk-j9abwrkv.js";import"../chunk-4v5nwqw6.js";import"../chunk-zcmz311y.js";import"../chunk-h1wmpa03.js";import"../chunk-t586p2g2.js";import"../chunk-qs2xvc8g.js";import"../chunk-2y0nr525.js";import"../chunk-p4v71qfx.js";import"../chunk-anc5v266.js";import"../chunk-wy82t7mz.js";import"../chunk-tac25cnj.js";import"../chunk-0k2r6bep.js";import"../chunk-0av1gyns.js";import"../chunk-zmt5kdpb.js";import"../chunk-rat2827k.js";import{cm as V,dm as X,em as E,fm as L,gm as R,hm as S}from"../chunk-yj7pbbnm.js";import"../chunk-37209psn.js";import"../chunk-fqhkkpq3.js";import"../chunk-swmf6w3z.js";import"../chunk-6r7956dh.js";import"../chunk-5mrtgr7q.js";import"../chunk-55btq9c7.js";import"../chunk-3dkv4989.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-50791bmz.js";import"../chunk-hke4hzfm.js";import{pb as D}from"../chunk-89egc0h3.js";import{Qe as b,Re as w}from"../chunk-vcw98sp6.js";import"../chunk-qy0k2s5f.js";import{Of as j}from"../chunk-mdg8g8h2.js";import"../chunk-j9abwrkv.js";import"../chunk-4v5nwqw6.js";import"../chunk-zcmz311y.js";import"../chunk-h1wmpa03.js";import"../chunk-t586p2g2.js";import"../chunk-qs2xvc8g.js";import"../chunk-2y0nr525.js";import"../chunk-p4v71qfx.js";import"../chunk-anc5v266.js";import"../chunk-wy82t7mz.js";import"../chunk-tac25cnj.js";import"../chunk-0k2r6bep.js";import"../chunk-0av1gyns.js";import"../chunk-zmt5kdpb.js";import"../chunk-rat2827k.js";import{cm as V,dm as X,em as E,fm as L,gm as R,hm as S}from"../chunk-yj7pbbnm.js";import"../chunk-37209psn.js";import"../chunk-fqhkkpq3.js";import"../chunk-swmf6w3z.js";import"../chunk-6r7956dh.js";import"../chunk-5mrtgr7q.js";import"../chunk-55btq9c7.js";import"../chunk-3dkv4989.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=6CED73395995C7C364756E2164756E21
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Ta as E}from"../chunk-b87wvmsz.js";import{ob as l}from"../chunk-snmyjq03.js";import{pb as H}from"../chunk-89egc0h3.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-y8cj5cap.js";import"../chunk-8pz8yzax.js";import"../chunk-kp7wcpx7.js";import"../chunk-rw45xz3f.js";import"../chunk-7xe5vd4w.js";import{Ke as h}from"../chunk-p1ern8r4.js";import"../chunk-vcw98sp6.js";import"../chunk-qy0k2s5f.js";import{Hf as n,If as v,gh as w,kh as A,lf as d,mf as s,oh as R}from"../chunk-3k4p9agd.js";import"../chunk-j9abwrkv.js";import"../chunk-4v5nwqw6.js";import"../chunk-zcmz311y.js";import"../chunk-h1wmpa03.js";import"../chunk-t586p2g2.js";import"../chunk-qs2xvc8g.js";import"../chunk-2y0nr525.js";import{$j as M}from"../chunk-p4v71qfx.js";import"../chunk-anc5v266.js";import"../chunk-wy82t7mz.js";import"../chunk-tac25cnj.js";import"../chunk-0k2r6bep.js";import"../chunk-0av1gyns.js";import"../chunk-zmt5kdpb.js";import"../chunk-rat2827k.js";import"../chunk-t8ygf6zj.js";import"../chunk-yj7pbbnm.js";import{im as O,km as J}from"../chunk-37209psn.js";import"../chunk-fqhkkpq3.js";import"../chunk-swmf6w3z.js";import"../chunk-6r7956dh.js";import"../chunk-5mrtgr7q.js";import"../chunk-55btq9c7.js";import"../chunk-3dkv4989.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-b87wvmsz.js";import{ob as l}from"../chunk-snmyjq03.js";import{pb as H}from"../chunk-89egc0h3.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-dgy6pf2h.js";import"../chunk-8pz8yzax.js";import"../chunk-kp7wcpx7.js";import"../chunk-rw45xz3f.js";import"../chunk-7xe5vd4w.js";import{Ke as h}from"../chunk-p1ern8r4.js";import"../chunk-vcw98sp6.js";import"../chunk-qy0k2s5f.js";import{Hf as n,If as v,gh as w,kh as A,lf as d,mf as s,oh as R}from"../chunk-mdg8g8h2.js";import"../chunk-j9abwrkv.js";import"../chunk-4v5nwqw6.js";import"../chunk-zcmz311y.js";import"../chunk-h1wmpa03.js";import"../chunk-t586p2g2.js";import"../chunk-qs2xvc8g.js";import"../chunk-2y0nr525.js";import{$j as M}from"../chunk-p4v71qfx.js";import"../chunk-anc5v266.js";import"../chunk-wy82t7mz.js";import"../chunk-tac25cnj.js";import"../chunk-0k2r6bep.js";import"../chunk-0av1gyns.js";import"../chunk-zmt5kdpb.js";import"../chunk-rat2827k.js";import"../chunk-t8ygf6zj.js";import"../chunk-yj7pbbnm.js";import{im as O,km as J}from"../chunk-37209psn.js";import"../chunk-fqhkkpq3.js";import"../chunk-swmf6w3z.js";import"../chunk-6r7956dh.js";import"../chunk-5mrtgr7q.js";import"../chunk-55btq9c7.js";import"../chunk-3dkv4989.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-8a3fqcf0.js";import{Am as Z,Bm as P,Cm as y,Dm as S,Em as U,um as Q,wm as q,xm as w}from"../chunk-6r7956dh.js";import{Im as H}from"../chunk-5mrtgr7q.js";import"../chunk-55btq9c7.js";import{Qm as F}from"../chunk-3dkv4989.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-99216y02.js");this.server=await J(this.app,I)}else{f();let{httpDev:J}=await import("../chunk-79v94sa6.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-8a3fqcf0.js";import{Am as Z,Bm as P,Cm as y,Dm as S,Em as U,um as Q,wm as q,xm as w}from"../chunk-6r7956dh.js";import{Im as H}from"../chunk-5mrtgr7q.js";import"../chunk-55btq9c7.js";import{Qm as F}from"../chunk-3dkv4989.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-rdfatx17.js");this.server=await J(this.app,I)}else{f();let{httpDev:J}=await import("../chunk-knfvx96p.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=CD8A86329738E4DD64756E2164756E21
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{rb as J$}from"../chunk-g6tqje74.js";import{$b as t9,Ab as g4,Bb as s1,Cb as F9,Db as L9,Eb as v9,Ib as I9,Jb as f9,Kb as y9,Lb as A9,Mb as g9,Nb as m9,Ob as c9,Pb as u9,Qb as p9,Rb as d9,Sb as l9,Tb as n4,Ub as v6,Vb as h,Wb as n9,Xb as i9,Yb as s9,Zb as o9,_b as a9,ac as r9,bc as e9,cc as W$,dc as Z$,ec as $$,fc as Q$,gc as Y$,hc as K$,sb as z9,tb as G9,ub as X9,vb as B9,wb as j9,xb as u4,yb as M9,zb as E4}from"../chunk-y8cj5cap.js";import{kc as d4}from"../chunk-8pz8yzax.js";import"../chunk-kp7wcpx7.js";import{be as D9,ce as H9,de as N9,ee as U9,fe as x9,ge as R9,he as O9,ie as _9,je as V9,ke as k9,le as C9,me as T9,ne as P9,oe as b9,pe as w9,qe as q9}from"../chunk-rw45xz3f.js";import{re as S9}from"../chunk-7xe5vd4w.js";import{Ae as oZ,Be as aZ,Ce as tZ,De as rZ,Ee as eZ,Fe as W9,Ge as Z9,He as $9,Ie as Q9,Je as Y9,Ke as K9,Pe as J9,se as cZ,te as uZ,ue as pZ,ve as dZ,we as lZ,xe as nZ,ye as iZ,ze as sZ}from"../chunk-p1ern8r4.js";import{Qe as h9,Re as E9}from"../chunk-vcw98sp6.js";import"../chunk-qy0k2s5f.js";import{$e as W8,Af as Y6,Ag as DZ,Ah as yZ,Bf as M8,Bg as HZ,Bh as AZ,Cf as F8,Cg as NZ,Df as L8,Dg as UZ,Ef as D8,Ff as H8,Ig as R,Jg as i,Kg as xZ,Lg as SZ,Mg as RZ,Ng as OZ,Og as _Z,Qg as VZ,Rg as kZ,Sg as CZ,Tg as TZ,Uf as T8,Vf as P8,Vg as PZ,Wf as b8,Xf as w8,Yf as q8,Yg as bZ,Ze as V6,Zf as v8,Zg as wZ,_e as e5,_g as qZ,af as Z8,bh as vZ,cf as $8,eg as e8,fg as q6,gf as k6,gg as WZ,gh as IZ,hf as C4,if as B6,jf as T4,kf as P4,kg as ZZ,kh as fZ,lg as $Z,mg as YZ,of as f6,oh as i4,pf as y6,pg as KZ,ph as z1,qg as JZ,rf as Q8,rg as zZ,sf as Y8,sg as GZ,tf as K8,uf as J8,ug as XZ,vf as z8,vg as BZ,wf as G8,wg as jZ,xf as X8,xg as MZ,yf as B8,yg as FZ,zf as j8,zg as LZ}from"../chunk-3k4p9agd.js";import"../chunk-j9abwrkv.js";import"../chunk-4v5nwqw6.js";import{$i as U8,Ni as h4,Ri as j1,Ti as Y1,Xi as _4,Yi as C1,Zi as p1,_i as N8,aj as x8,bj as S8,cj as R8,oj as mW,pj as cW,sj as O8,ti as k4,tj as _8,ui as O4,vi as k1,vj as V8,wj as k8,xj as C8,zj as d1}from"../chunk-zcmz311y.js";import"../chunk-h1wmpa03.js";import{Fj as q}from"../chunk-t586p2g2.js";import"../chunk-qs2xvc8g.js";import{Rj as g8,Sj as m8,Tj as U,Uj as c8,Vj as b,Wj as u8,Xj as p8}from"../chunk-2y0nr525.js";import{bk as A8,ck as h8,dk as E8}from"../chunk-p4v71qfx.js";import"../chunk-anc5v266.js";import{Mk as QZ}from"../chunk-wy82t7mz.js";import{$k as a8,Ok as I8,Pk as f8,Qk as y8,Rk as d8,Sk as l8,Tk as n8,Uk as i8,Vk as s8,Wk as o8,al as t8,bl as r8}from"../chunk-tac25cnj.js";import"../chunk-0k2r6bep.js";import"../chunk-0av1gyns.js";import"../chunk-zmt5kdpb.js";import"../chunk-rat2827k.js";import{$l as gZ,Yl as w4,Zl as hZ,_l as EZ,bm as mZ}from"../chunk-t8ygf6zj.js";import"../chunk-yj7pbbnm.js";import{lm as C}from"../chunk-37209psn.js";import"../chunk-fqhkkpq3.js";import"../chunk-swmf6w3z.js";import"../chunk-6r7956dh.js";import"../chunk-5mrtgr7q.js";import"../chunk-55btq9c7.js";import{Qm as u1}from"../chunk-3dkv4989.js";import{Buffer as K6}from"buffer";class J6 extends C1{client;config;constructor(...W){super();this.config=W}async connect(){let W=await import("../chunk-nqgeny8m.js");return this.client??=new W.S3Client(...this.config),{sdk:W,client:this.client}}async put(W,{signal:Z}={}){Z?.throwIfAborted();let $,Q,Y,K=process.env.BUCKET_NAME;if(W instanceof Blob)$=W,Y=`${Bun.randomUUIDv7()}.${W.type.split("/")[1].split(";")[0]}`,Q=W.type;else $=W.body,Y=W.name,K=W.bucket??K,Q=W.contentType||($ instanceof Blob||$ instanceof File?$.type:void 0);Q=Q||void 0;let J=$ instanceof K6?$:$ instanceof Blob||$ instanceof File?K6.from(await $.arrayBuffer()):"",{sdk:z,client:G}=await this.connect();return Z?.throwIfAborted(),await G.send(new z.PutObjectCommand({Bucket:K,Key:Y,Body:J,ContentType:Q}),{abortSignal:Z}),Y}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:Q,client:Y}=await this.connect();try{await Y.send(new Q.DeleteObjectCommand({Bucket:$,Key:Z}))}catch(K){if(K?.name==="NoSuchKey"||K?.$metadata?.httpStatusCode===404)return;throw K}}async*pages(W,{bucket:Z,signal:$}){let{sdk:Q,client:Y}=await this.connect(),K;do{$?.throwIfAborted();let J=await Y.send(new Q.ListObjectsV2Command({Bucket:Z??process.env.BUCKET_NAME,Prefix:W,ContinuationToken:K}),{abortSignal:$});yield(J.Contents??[]).map((z)=>({name:z.Key,size:z.Size??0,lastModified:z.LastModified??new Date(0)})),K=J.IsTruncated?J.NextContinuationToken:void 0}while(K)}async*objects(W,Z={}){for await(let $ of this.pages(W,Z))yield*$}async deletePrefix(W,Z={}){_4(W);let $=Z.bucket??process.env.BUCKET_NAME,{sdk:Q,client:Y}=await this.connect(),K=0;for await(let J of this.pages(W,{...Z,bucket:$})){if(J.length===0)continue;Z.signal?.throwIfAborted();let G=(await Y.send(new Q.DeleteObjectsCommand({Bucket:$,Delete:{Objects:J.map((X)=>({Key:X.name})),Quiet:!0}}),{abortSignal:Z.signal}))?.Errors??[];if(G.length>0){let X=G[0];throw Error(`S3 could not delete ${G.length} object(s) under "${W}", e.g. "${X.Key}": ${X.Code??"unknown"} ${X.Message??""}`.trim())}K+=J.length}return K}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,Q;if(typeof W==="string")Q=W;else $=W.bucket??$,Q=W.name;if(!Q)throw Error("Object name has to be specified");let{sdk:Y,client:K}=await this.connect();Z?.throwIfAborted();let J=await K.send(new Y.GetObjectCommand({Bucket:$,Key:Q}),{abortSignal:Z}),z=p1(J.Body.transformToWebStream(),Z);return Z?.throwIfAborted(),new Response(z,{headers:{"Content-Type":J.ContentType,"Content-Length":J.ContentLength.toString(),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":J.LastModified?.toUTCString()||"",ETag:J.ETag||""}})}async read(W){let Z=typeof W==="string"?{name:W}:W,$=Z.bucket??process.env.BUCKET_NAME,{name:Q,range:Y=null}=Z;if(!Q)throw Error("Object name has to be specified");let{sdk:K,client:J}=await this.connect(),z;try{z=await J.send(new K.GetObjectCommand({Bucket:$,Key:Q,Range:Y?O4(Y):void 0}))}catch(j){if(j?.name==="InvalidRange"||j?.$metadata?.httpStatusCode===416)throw new j1(await this.size({name:Q,bucket:$}));if(j?.name==="NoSuchKey"||j?.$metadata?.httpStatusCode===404)throw new Y1(Q);throw j}let G=k1(z.ContentRange),X=Boolean(G)&&z.$metadata?.httpStatusCode===206,B=G?.total??z.ContentLength??0;return{body:z.Body.transformToWebStream(),start:G?.start??0,end:G?.end??B-1,total:B,partial:X,type:z.ContentType??"application/octet-stream",etag:z.ETag||void 0,lastModified:z.LastModified,name:Q}}async size(W){let Z=typeof W==="string"?W:W.name,$=(typeof W==="string"?void 0:W.bucket)??process.env.BUCKET_NAME,{sdk:Q,client:Y}=await this.connect();try{return(await Y.send(new Q.HeadObjectCommand({Bucket:$,Key:Z}))).ContentLength??0}catch(K){if(K?.name==="NotFound"||K?.$metadata?.httpStatusCode===404)throw new Y1(Z);throw K}}}import{Buffer as z6}from"buffer";import{Readable as dW}from"stream";function V4(W){return W?.statusCode===404||W?.details?.errorCode==="BlobNotFound"||W?.code==="BlobNotFound"}function lW(W){return W?.statusCode===416||W?.details?.errorCode==="InvalidRange"||W?.code==="InvalidRange"}class G6 extends C1{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 $,Q,Y,K;if(W instanceof Blob)$=W,Y=`${Bun.randomUUIDv7()}.${W.type.split("/")[1].split(";")[0]}`,Q=W.type;else $=W.body,Y=W.name,K=W.bucket,Q=W.contentType??($ instanceof Blob||$ instanceof File?$.type:void 0);let J=$ instanceof z6?$:z6.from(await $.arrayBuffer()),z=await this.blob(Y,K);return Z?.throwIfAborted(),await z.uploadData(J,{blobHTTPHeaders:Q?{blobContentType:Q}:void 0,abortSignal:Z}),Y}async*objects(W,{bucket:Z,signal:$}={}){$?.throwIfAborted();let Q=Z??this.config.container??process.env.BUCKET_NAME;if(!Q)throw Error("AzureBlobDriver needs a container name, from `bucket`, the `container` config, or BUCKET_NAME.");let K=(await this.serviceClient()).getContainerClient(Q);for await(let J of K.listBlobsFlat({prefix:W}))$?.throwIfAborted(),yield{name:J.name,size:J.properties?.contentLength??0,lastModified:J.properties?.lastModified??new Date(0)}}async list(W){let Z=this.config.container??process.env.BUCKET_NAME,Q=(await this.serviceClient()).getContainerClient(Z),Y=[];for await(let K of Q.listBlobsFlat({prefix:W}))Y.push(K.name);return Y}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:Q,range:Y=null}=W,K=await this.blob($,Q);Z?.throwIfAborted();let J,z,G=Y?.kind==="suffix"||Y?.kind==="offset"&&Y.end===null&&Y.start===0;if(Y&&G){let V=await this.size({name:$,bucket:Q}),Q1=k4(Y,V);if(!Q1)throw new j1(V);J=Q1.start,z=Q1.length}else if(Y?.kind==="offset")J=Y.start,z=Y.end===null?void 0:Y.end-Y.start+1;let X;try{X=await K.download(J,z,Z?{abortSignal:Z}:void 0)}catch(V){if(lW(V))throw new j1(await this.size({name:$,bucket:Q}));if(V4(V))throw new Y1($);throw V}let B=k1(X.contentRange),j=Boolean(B),D=B?.total??X.contentLength??0,x=await nW(X);if(x instanceof ReadableStream)x=p1(x,Z);return Z?.throwIfAborted(),{body:x,start:B?.start??0,end:B?.end??D-1,total:D,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,Q=await this.blob(Z,$);try{return(await Q.getProperties()).contentLength??0}catch(Y){if(V4(Y))throw new Y1(Z);throw Y}}async delete(W){let Z=typeof W==="string"?W:W.name,$=typeof W==="string"?void 0:W.bucket,Q=await this.blob(Z,$);try{await Q.delete()}catch(Y){if(V4(Y))return;throw Y}}}async function nW(W){if(W.blobBody)return await W.blobBody;if(W.readableStreamBody)return dW.toWeb(W.readableStreamBody);return null}function iW(W){return W}class b4 extends Error{code="ERR_RATE_LIMITER_TIMEOUT";constructor(W){super(`RedisRateLimiter: Redis did not answer within ${W}ms.`);this.name="RedisRateLimiterTimeoutError"}}class l1 extends Error{code="ERR_RATE_LIMITER_DISCONNECTED";constructor(){super("RedisRateLimiter: the Redis client is not connected.");this.name="RedisRateLimiterDisconnectedError"}}var X6=1000,sW=60000,oW=`
2
+ import{rb as J$}from"../chunk-g6tqje74.js";import{$b as t9,Ab as g4,Bb as s1,Cb as F9,Db as L9,Eb as v9,Ib as I9,Jb as f9,Kb as y9,Lb as A9,Mb as g9,Nb as m9,Ob as c9,Pb as u9,Qb as p9,Rb as d9,Sb as l9,Tb as n4,Ub as v6,Vb as h,Wb as n9,Xb as i9,Yb as s9,Zb as o9,_b as a9,ac as r9,bc as e9,cc as W$,dc as Z$,ec as $$,fc as Q$,gc as Y$,hc as K$,sb as z9,tb as G9,ub as X9,vb as B9,wb as j9,xb as u4,yb as M9,zb as E4}from"../chunk-dgy6pf2h.js";import{kc as d4}from"../chunk-8pz8yzax.js";import"../chunk-kp7wcpx7.js";import{be as D9,ce as H9,de as N9,ee as U9,fe as x9,ge as R9,he as O9,ie as _9,je as V9,ke as k9,le as C9,me as T9,ne as P9,oe as b9,pe as w9,qe as q9}from"../chunk-rw45xz3f.js";import{re as S9}from"../chunk-7xe5vd4w.js";import{Ae as oZ,Be as aZ,Ce as tZ,De as rZ,Ee as eZ,Fe as W9,Ge as Z9,He as $9,Ie as Q9,Je as Y9,Ke as K9,Pe as J9,se as cZ,te as uZ,ue as pZ,ve as dZ,we as lZ,xe as nZ,ye as iZ,ze as sZ}from"../chunk-p1ern8r4.js";import{Qe as h9,Re as E9}from"../chunk-vcw98sp6.js";import"../chunk-qy0k2s5f.js";import{$e as W8,Af as Y6,Ag as DZ,Ah as yZ,Bf as M8,Bg as HZ,Bh as AZ,Cf as F8,Cg as NZ,Df as L8,Dg as UZ,Ef as D8,Ff as H8,Ig as R,Jg as i,Kg as xZ,Lg as SZ,Mg as RZ,Ng as OZ,Og as _Z,Qg as VZ,Rg as kZ,Sg as CZ,Tg as TZ,Uf as T8,Vf as P8,Vg as PZ,Wf as b8,Xf as w8,Yf as q8,Yg as bZ,Ze as V6,Zf as v8,Zg as wZ,_e as e5,_g as qZ,af as Z8,bh as vZ,cf as $8,eg as e8,fg as q6,gf as k6,gg as WZ,gh as IZ,hf as C4,if as B6,jf as T4,kf as P4,kg as ZZ,kh as fZ,lg as $Z,mg as YZ,of as f6,oh as i4,pf as y6,pg as KZ,ph as z1,qg as JZ,rf as Q8,rg as zZ,sf as Y8,sg as GZ,tf as K8,uf as J8,ug as XZ,vf as z8,vg as BZ,wf as G8,wg as jZ,xf as X8,xg as MZ,yf as B8,yg as FZ,zf as j8,zg as LZ}from"../chunk-mdg8g8h2.js";import"../chunk-j9abwrkv.js";import"../chunk-4v5nwqw6.js";import{$i as U8,Ni as h4,Ri as j1,Ti as Y1,Xi as _4,Yi as C1,Zi as p1,_i as N8,aj as x8,bj as S8,cj as R8,oj as mW,pj as cW,sj as O8,ti as k4,tj as _8,ui as O4,vi as k1,vj as V8,wj as k8,xj as C8,zj as d1}from"../chunk-zcmz311y.js";import"../chunk-h1wmpa03.js";import{Fj as q}from"../chunk-t586p2g2.js";import"../chunk-qs2xvc8g.js";import{Rj as g8,Sj as m8,Tj as U,Uj as c8,Vj as b,Wj as u8,Xj as p8}from"../chunk-2y0nr525.js";import{bk as A8,ck as h8,dk as E8}from"../chunk-p4v71qfx.js";import"../chunk-anc5v266.js";import{Mk as QZ}from"../chunk-wy82t7mz.js";import{$k as a8,Ok as I8,Pk as f8,Qk as y8,Rk as d8,Sk as l8,Tk as n8,Uk as i8,Vk as s8,Wk as o8,al as t8,bl as r8}from"../chunk-tac25cnj.js";import"../chunk-0k2r6bep.js";import"../chunk-0av1gyns.js";import"../chunk-zmt5kdpb.js";import"../chunk-rat2827k.js";import{$l as gZ,Yl as w4,Zl as hZ,_l as EZ,bm as mZ}from"../chunk-t8ygf6zj.js";import"../chunk-yj7pbbnm.js";import{lm as C}from"../chunk-37209psn.js";import"../chunk-fqhkkpq3.js";import"../chunk-swmf6w3z.js";import"../chunk-6r7956dh.js";import"../chunk-5mrtgr7q.js";import"../chunk-55btq9c7.js";import{Qm as u1}from"../chunk-3dkv4989.js";import{Buffer as K6}from"buffer";class J6 extends C1{client;config;constructor(...W){super();this.config=W}async connect(){let W=await import("../chunk-nqgeny8m.js");return this.client??=new W.S3Client(...this.config),{sdk:W,client:this.client}}async put(W,{signal:Z}={}){Z?.throwIfAborted();let $,Q,Y,K=process.env.BUCKET_NAME;if(W instanceof Blob)$=W,Y=`${Bun.randomUUIDv7()}.${W.type.split("/")[1].split(";")[0]}`,Q=W.type;else $=W.body,Y=W.name,K=W.bucket??K,Q=W.contentType||($ instanceof Blob||$ instanceof File?$.type:void 0);Q=Q||void 0;let J=$ instanceof K6?$:$ instanceof Blob||$ instanceof File?K6.from(await $.arrayBuffer()):"",{sdk:z,client:G}=await this.connect();return Z?.throwIfAborted(),await G.send(new z.PutObjectCommand({Bucket:K,Key:Y,Body:J,ContentType:Q}),{abortSignal:Z}),Y}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:Q,client:Y}=await this.connect();try{await Y.send(new Q.DeleteObjectCommand({Bucket:$,Key:Z}))}catch(K){if(K?.name==="NoSuchKey"||K?.$metadata?.httpStatusCode===404)return;throw K}}async*pages(W,{bucket:Z,signal:$}){let{sdk:Q,client:Y}=await this.connect(),K;do{$?.throwIfAborted();let J=await Y.send(new Q.ListObjectsV2Command({Bucket:Z??process.env.BUCKET_NAME,Prefix:W,ContinuationToken:K}),{abortSignal:$});yield(J.Contents??[]).map((z)=>({name:z.Key,size:z.Size??0,lastModified:z.LastModified??new Date(0)})),K=J.IsTruncated?J.NextContinuationToken:void 0}while(K)}async*objects(W,Z={}){for await(let $ of this.pages(W,Z))yield*$}async deletePrefix(W,Z={}){_4(W);let $=Z.bucket??process.env.BUCKET_NAME,{sdk:Q,client:Y}=await this.connect(),K=0;for await(let J of this.pages(W,{...Z,bucket:$})){if(J.length===0)continue;Z.signal?.throwIfAborted();let G=(await Y.send(new Q.DeleteObjectsCommand({Bucket:$,Delete:{Objects:J.map((X)=>({Key:X.name})),Quiet:!0}}),{abortSignal:Z.signal}))?.Errors??[];if(G.length>0){let X=G[0];throw Error(`S3 could not delete ${G.length} object(s) under "${W}", e.g. "${X.Key}": ${X.Code??"unknown"} ${X.Message??""}`.trim())}K+=J.length}return K}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,Q;if(typeof W==="string")Q=W;else $=W.bucket??$,Q=W.name;if(!Q)throw Error("Object name has to be specified");let{sdk:Y,client:K}=await this.connect();Z?.throwIfAborted();let J=await K.send(new Y.GetObjectCommand({Bucket:$,Key:Q}),{abortSignal:Z}),z=p1(J.Body.transformToWebStream(),Z);return Z?.throwIfAborted(),new Response(z,{headers:{"Content-Type":J.ContentType,"Content-Length":J.ContentLength.toString(),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":J.LastModified?.toUTCString()||"",ETag:J.ETag||""}})}async read(W){let Z=typeof W==="string"?{name:W}:W,$=Z.bucket??process.env.BUCKET_NAME,{name:Q,range:Y=null}=Z;if(!Q)throw Error("Object name has to be specified");let{sdk:K,client:J}=await this.connect(),z;try{z=await J.send(new K.GetObjectCommand({Bucket:$,Key:Q,Range:Y?O4(Y):void 0}))}catch(j){if(j?.name==="InvalidRange"||j?.$metadata?.httpStatusCode===416)throw new j1(await this.size({name:Q,bucket:$}));if(j?.name==="NoSuchKey"||j?.$metadata?.httpStatusCode===404)throw new Y1(Q);throw j}let G=k1(z.ContentRange),X=Boolean(G)&&z.$metadata?.httpStatusCode===206,B=G?.total??z.ContentLength??0;return{body:z.Body.transformToWebStream(),start:G?.start??0,end:G?.end??B-1,total:B,partial:X,type:z.ContentType??"application/octet-stream",etag:z.ETag||void 0,lastModified:z.LastModified,name:Q}}async size(W){let Z=typeof W==="string"?W:W.name,$=(typeof W==="string"?void 0:W.bucket)??process.env.BUCKET_NAME,{sdk:Q,client:Y}=await this.connect();try{return(await Y.send(new Q.HeadObjectCommand({Bucket:$,Key:Z}))).ContentLength??0}catch(K){if(K?.name==="NotFound"||K?.$metadata?.httpStatusCode===404)throw new Y1(Z);throw K}}}import{Buffer as z6}from"buffer";import{Readable as dW}from"stream";function V4(W){return W?.statusCode===404||W?.details?.errorCode==="BlobNotFound"||W?.code==="BlobNotFound"}function lW(W){return W?.statusCode===416||W?.details?.errorCode==="InvalidRange"||W?.code==="InvalidRange"}class G6 extends C1{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 $,Q,Y,K;if(W instanceof Blob)$=W,Y=`${Bun.randomUUIDv7()}.${W.type.split("/")[1].split(";")[0]}`,Q=W.type;else $=W.body,Y=W.name,K=W.bucket,Q=W.contentType??($ instanceof Blob||$ instanceof File?$.type:void 0);let J=$ instanceof z6?$:z6.from(await $.arrayBuffer()),z=await this.blob(Y,K);return Z?.throwIfAborted(),await z.uploadData(J,{blobHTTPHeaders:Q?{blobContentType:Q}:void 0,abortSignal:Z}),Y}async*objects(W,{bucket:Z,signal:$}={}){$?.throwIfAborted();let Q=Z??this.config.container??process.env.BUCKET_NAME;if(!Q)throw Error("AzureBlobDriver needs a container name, from `bucket`, the `container` config, or BUCKET_NAME.");let K=(await this.serviceClient()).getContainerClient(Q);for await(let J of K.listBlobsFlat({prefix:W}))$?.throwIfAborted(),yield{name:J.name,size:J.properties?.contentLength??0,lastModified:J.properties?.lastModified??new Date(0)}}async list(W){let Z=this.config.container??process.env.BUCKET_NAME,Q=(await this.serviceClient()).getContainerClient(Z),Y=[];for await(let K of Q.listBlobsFlat({prefix:W}))Y.push(K.name);return Y}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:Q,range:Y=null}=W,K=await this.blob($,Q);Z?.throwIfAborted();let J,z,G=Y?.kind==="suffix"||Y?.kind==="offset"&&Y.end===null&&Y.start===0;if(Y&&G){let V=await this.size({name:$,bucket:Q}),Q1=k4(Y,V);if(!Q1)throw new j1(V);J=Q1.start,z=Q1.length}else if(Y?.kind==="offset")J=Y.start,z=Y.end===null?void 0:Y.end-Y.start+1;let X;try{X=await K.download(J,z,Z?{abortSignal:Z}:void 0)}catch(V){if(lW(V))throw new j1(await this.size({name:$,bucket:Q}));if(V4(V))throw new Y1($);throw V}let B=k1(X.contentRange),j=Boolean(B),D=B?.total??X.contentLength??0,x=await nW(X);if(x instanceof ReadableStream)x=p1(x,Z);return Z?.throwIfAborted(),{body:x,start:B?.start??0,end:B?.end??D-1,total:D,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,Q=await this.blob(Z,$);try{return(await Q.getProperties()).contentLength??0}catch(Y){if(V4(Y))throw new Y1(Z);throw Y}}async delete(W){let Z=typeof W==="string"?W:W.name,$=typeof W==="string"?void 0:W.bucket,Q=await this.blob(Z,$);try{await Q.delete()}catch(Y){if(V4(Y))return;throw Y}}}async function nW(W){if(W.blobBody)return await W.blobBody;if(W.readableStreamBody)return dW.toWeb(W.readableStreamBody);return null}function iW(W){return W}class b4 extends Error{code="ERR_RATE_LIMITER_TIMEOUT";constructor(W){super(`RedisRateLimiter: Redis did not answer within ${W}ms.`);this.name="RedisRateLimiterTimeoutError"}}class l1 extends Error{code="ERR_RATE_LIMITER_DISCONNECTED";constructor(){super("RedisRateLimiter: the Redis client is not connected.");this.name="RedisRateLimiterDisconnectedError"}}var X6=1000,sW=60000,oW=`
3
3
  local currentKey = KEYS[1]
4
4
  local previousKey = KEYS[2]
5
5
  local limit = tonumber(ARGV[1])
@@ -147,6 +147,14 @@ export declare class ServerQueryStore {
147
147
  * retries suspended renders, so idempotence per path + variant is load-bearing.
148
148
  */
149
149
  ensure(patternPath: string, options?: ServerQueryOptions, source?: ServerQuerySource): ServerQueryEntry;
150
+ /**
151
+ * Registers a query as already resolved: `data` is what the request ships
152
+ * for it, and the fetcher never runs. For a handler that produced the data
153
+ * itself, under its own access rules (`Query.prefill`). Like `ensure`, the
154
+ * first registration of a key wins: one already prefetched or prefilled is
155
+ * left as it is.
156
+ */
157
+ prefill(patternPath: string, options: ServerQueryOptions, data: unknown): ServerQueryEntry;
150
158
  /**
151
159
  * Everything currently registered, settled — including entries added while
152
160
  * waiting. The non-streaming paths (`.json` route data responses) sit on
@@ -1 +1 @@
1
- {"version":3,"file":"ServerQueryStore.d.ts","sourceRoot":"","sources":["../../../services/router/ServerQueryStore.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC,CAAC;CAC3D,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,QAAQ,CAAC;AAEtD,MAAM,WAAW,gBAAgB;IAC/B,sEAAsE;IACtE,IAAI,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,WAAW,EAAE,MAAM,CAAC;IACpB,sEAAsE;IACtE,UAAU,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;IAC5C,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ;;;;;;OAMG;IACH,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,oCAAoC;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,kBAAkB,GAAG,CAC/B,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,CAAC,MAAM,EA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EAAE,OAAO,GAAG,gBAAgB;IAoB1F;;;;OAIG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAQjC;;;OAGG;IACH,gBAAgB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAWvD;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI;CAWrD"}
@@ -1,8 +1,8 @@
1
- import { $ as toVariantKey, B as ProgressManager, Ct as Subject, G as RealtimeContext, J as liveModule, N as I18nProvider, P as ServerDataContext, c as ClientRouterContext, et as applyParams, i as RouteTransitionProvider, nt as QueryManagerContext, r as m, rt as QueryManagerProvider, t as ThemeProvider } from "../chunks/ThemeProvider-BO3sQkWl.js";
1
+ import { $ as toVariantKey, B as ProgressManager, Ct as Subject, G as RealtimeContext, J as liveModule, N as I18nProvider, P as ServerDataContext, c as ClientRouterContext, et as applyParams, i as RouteTransitionProvider, nt as QueryManagerContext, r as m, rt as QueryManagerProvider, t as ThemeProvider } from "../chunks/ThemeProvider-bbbE-N3t.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-BCCfTb28.js";
5
+ import { t as followLive } from "../chunks/live-CApTRvmK.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";
@@ -0,0 +1,16 @@
1
+ /**
2
+ * The response header an `/api` answer names the queries it changed in:
3
+ * `Query.invalidate()` on the server writes it, the mutation hooks read it
4
+ * and refetch every mounted query that matches (#1329).
5
+ *
6
+ * A module of its own, importing nothing: the client's copy lands in the
7
+ * entry chunk.
8
+ */
9
+ export declare const INVALIDATE_HEADER = "x-gemi-invalidate";
10
+ /**
11
+ * A header value is ASCII, so the keys travel as percent-encoded JSON.
12
+ */
13
+ export declare function encodeInvalidationKeys(keys: ReadonlyArray<string>): string;
14
+ /** The keys in a header value; none when it is missing or not gemi's. */
15
+ export declare function decodeInvalidationKeys(value: string | null | undefined): string[];
16
+ //# sourceMappingURL=invalidation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invalidation.d.ts","sourceRoot":"","sources":["../../utils/invalidation.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,sBAAsB,CAAC;AAErD;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,MAAM,CAE1E;AAED,yEAAyE;AACzE,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,EAAE,CAQjF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gemi",
3
- "version": "0.224.1",
3
+ "version": "0.225.0",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "Enes Tufekci <enes@gemijs.dev>",