@lunora/server 1.0.0-alpha.261 → 1.0.0-alpha.263

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 (31) hide show
  1. package/dist/in-process.d.mts +18 -4
  2. package/dist/in-process.d.ts +18 -4
  3. package/dist/in-process.mjs +1 -1
  4. package/dist/index.d.mts +104 -36
  5. package/dist/index.d.ts +104 -36
  6. package/dist/index.mjs +1 -1
  7. package/dist/otel.d.mts +1 -1
  8. package/dist/otel.d.ts +1 -1
  9. package/dist/packem_shared/{ACTION_CACHE_DEFAULT_TTL_MS-DU87Okaj.mjs → ACTION_CACHE_DEFAULT_TTL_MS-DMYtb827.mjs} +1 -1
  10. package/dist/packem_shared/{DOCUMENT_HISTORY_REDACTED_FIELDS-DHn50G0w.mjs → DOCUMENT_HISTORY_REDACTED_FIELDS-MUPXbAHR.mjs} +1 -1
  11. package/dist/packem_shared/PRESENCE_DEFAULT_TTL_MS-CKPKoWy_.mjs +1 -0
  12. package/dist/packem_shared/PROCEDURE_META-DVzrXpfa.mjs +1 -0
  13. package/dist/packem_shared/{assertShapesDeclareReadPolicies-CHqQ2eDy.mjs → assertShapesDeclareReadPolicies-BfxqaO3Z.mjs} +1 -1
  14. package/dist/packem_shared/beginDeferredSchedules--FVDtp-M.mjs +1 -0
  15. package/dist/packem_shared/{defineShape-CjBBjn-S.mjs → defineShape-JcqUI9iZ.mjs} +1 -1
  16. package/dist/packem_shared/initLunora-DcvCGLL_.mjs +1 -0
  17. package/dist/packem_shared/mask-Wqcb6WNS.mjs +1 -0
  18. package/dist/packem_shared/middleware-D4Z_QWhU.mjs +1 -0
  19. package/dist/packem_shared/{rls-CJ-lKTG6.mjs → rls-BoRrGSvO.mjs} +1 -1
  20. package/dist/packem_shared/{storageRules-5NQpFz_N.mjs → storageRules-DmYr_Gi9.mjs} +1 -1
  21. package/dist/packem_shared/{types.d-BOnXpMCp.d.mts → types.d-BM3crF47.d.mts} +53 -15
  22. package/dist/packem_shared/{types.d-BOnXpMCp.d.ts → types.d-BM3crF47.d.ts} +53 -15
  23. package/dist/rls/testing.mjs +1 -1
  24. package/dist/types.d.mts +1 -1
  25. package/dist/types.d.ts +1 -1
  26. package/package.json +4 -4
  27. package/dist/packem_shared/PRESENCE_DEFAULT_TTL_MS-BtGG52OZ.mjs +0 -1
  28. package/dist/packem_shared/beginDeferredSchedules-C7QLYr6C.mjs +0 -1
  29. package/dist/packem_shared/initLunora-DH7k24N0.mjs +0 -1
  30. package/dist/packem_shared/mask-BFPGwDqW.mjs +0 -1
  31. package/dist/packem_shared/middleware-mzWrOTEE.mjs +0 -1
@@ -1,6 +1,11 @@
1
- import { SqlExec } from '@lunora/shard-engine';
2
- import { D as DatabaseWriter, S as Schema } from "./packem_shared/types.d-BOnXpMCp.mjs";
1
+ import { TransactionHeadroomTracker, SqlExec } from '@lunora/shard-engine';
2
+ import { D as DatabaseWriter, S as Schema } from "./packem_shared/types.d-BM3crF47.mjs";
3
3
  import '@lunora/values';
4
+ /** Where the current dispatch's tracker lives: an `AsyncLocalStorage` fits, and so does any stand-in. */
5
+ interface HeadroomScope {
6
+ getStore: () => TransactionHeadroomTracker | undefined;
7
+ run: <R>(store: TransactionHeadroomTracker, body: () => R) => R;
8
+ }
4
9
  /** The kind of a registered Lunora function. */
5
10
  type FunctionKind = "action" | "mutation" | "query";
6
11
  /**
@@ -38,6 +43,12 @@ interface InProcessRuntimeOptions {
38
43
  * @default true
39
44
  */
40
45
  enforceRls?: boolean;
46
+ /**
47
+ * Where each dispatch's resource budget lives. Supply an `AsyncLocalStorage` when queries or
48
+ * actions can overlap, so a dispatch resumed after an await keeps its own budget; without one
49
+ * the budget is swapped at each entry, which is only right for entries that do not overlap.
50
+ */
51
+ headroomScope?: HeadroomScope;
41
52
  /**
42
53
  * The `ctx.scheduler` the consumer installs, when it installs one. A
43
54
  * scheduler wrapped with `withDeferredSchedules` has the jobs a mutation
@@ -59,8 +70,6 @@ interface InProcessRuntime {
59
70
  database: DatabaseWriter;
60
71
  rawDatabase: DatabaseWriter;
61
72
  };
62
- /** Start a new top-level dispatch with a full resource budget. Call before every query/action entry. */
63
- resetHeadroom: () => void;
64
73
  /**
65
74
  * Run `body` as one top-level entry: serialized behind every other entry that
66
75
  * came through here, inside a BEGIN/COMMIT span that rolls back on a throw,
@@ -68,6 +77,11 @@ interface InProcessRuntime {
68
77
  * must not observe another entry's uncommitted writes may use it too.
69
78
  */
70
79
  runInTransaction: <R>(body: () => Promise<R> | R) => Promise<R>;
80
+ /**
81
+ * Run `body` as one top-level dispatch with a full resource budget. Wrap every query/action entry.
82
+ * Replaces `resetHeadroom()`: call `runWithBudget(() => run())` where you called `resetHeadroom(); run()`.
83
+ */
84
+ runWithBudget: <R>(body: () => R) => R;
71
85
  }
72
86
  /**
73
87
  * Migrate `schema` onto `options.sql` and return the dispatch wiring around it.
@@ -1,6 +1,11 @@
1
- import { SqlExec } from '@lunora/shard-engine';
2
- import { D as DatabaseWriter, S as Schema } from "./packem_shared/types.d-BOnXpMCp.js";
1
+ import { TransactionHeadroomTracker, SqlExec } from '@lunora/shard-engine';
2
+ import { D as DatabaseWriter, S as Schema } from "./packem_shared/types.d-BM3crF47.js";
3
3
  import '@lunora/values';
4
+ /** Where the current dispatch's tracker lives: an `AsyncLocalStorage` fits, and so does any stand-in. */
5
+ interface HeadroomScope {
6
+ getStore: () => TransactionHeadroomTracker | undefined;
7
+ run: <R>(store: TransactionHeadroomTracker, body: () => R) => R;
8
+ }
4
9
  /** The kind of a registered Lunora function. */
5
10
  type FunctionKind = "action" | "mutation" | "query";
6
11
  /**
@@ -38,6 +43,12 @@ interface InProcessRuntimeOptions {
38
43
  * @default true
39
44
  */
40
45
  enforceRls?: boolean;
46
+ /**
47
+ * Where each dispatch's resource budget lives. Supply an `AsyncLocalStorage` when queries or
48
+ * actions can overlap, so a dispatch resumed after an await keeps its own budget; without one
49
+ * the budget is swapped at each entry, which is only right for entries that do not overlap.
50
+ */
51
+ headroomScope?: HeadroomScope;
41
52
  /**
42
53
  * The `ctx.scheduler` the consumer installs, when it installs one. A
43
54
  * scheduler wrapped with `withDeferredSchedules` has the jobs a mutation
@@ -59,8 +70,6 @@ interface InProcessRuntime {
59
70
  database: DatabaseWriter;
60
71
  rawDatabase: DatabaseWriter;
61
72
  };
62
- /** Start a new top-level dispatch with a full resource budget. Call before every query/action entry. */
63
- resetHeadroom: () => void;
64
73
  /**
65
74
  * Run `body` as one top-level entry: serialized behind every other entry that
66
75
  * came through here, inside a BEGIN/COMMIT span that rolls back on a throw,
@@ -68,6 +77,11 @@ interface InProcessRuntime {
68
77
  * must not observe another entry's uncommitted writes may use it too.
69
78
  */
70
79
  runInTransaction: <R>(body: () => Promise<R> | R) => Promise<R>;
80
+ /**
81
+ * Run `body` as one top-level dispatch with a full resource budget. Wrap every query/action entry.
82
+ * Replaces `resetHeadroom()`: call `runWithBudget(() => run())` where you called `resetHeadroom(); run()`.
83
+ */
84
+ runWithBudget: <R>(body: () => R) => R;
71
85
  }
72
86
  /**
73
87
  * Migrate `schema` onto `options.sql` and return the dispatch wiring around it.
@@ -1 +1 @@
1
- import{LunoraError as I}from"@lunora/errors";import{runShardMigrations as R,TransactionHeadroomTracker as h,createShardCtxDb as T,RLS_UNWRAP_SYMBOL as g}from"@lunora/shard-engine";import{beginDeferredSchedules as p}from"./packem_shared/beginDeferredSchedules-C7QLYr6C.mjs";import{bindTableFacade as y}from"./packem_shared/bindOrm-D5mVDvbi.mjs";const k=e=>{if(e===null||typeof e.userId!="string"||e.userId.length===0)return{claims:null,userId:null};const{userId:r,...s}=e;return{claims:Object.keys(s).length>0?s:null,userId:r}};class S extends h{current=new h;reset(){this.current=new h}headroom(){return this.current.headroom()}recordRead(r){this.current.recordRead(r)}recordWrite(r){this.current.recordWrite(r)}}const x=(e,r)=>{const{scheduler:s,sql:a}=r,i=e;R(a,i);const c=new S,m=t=>{const n=t;for(const o of Object.keys(i.tables))n[o]=y(t,o);return t};let u=!1;const w=t=>{const n=T({auth:{identity:t.claims,userId:t.userId},enforceRls:r.enforceRls??!0,headroom:c,inTransaction:()=>u,schema:i,sql:a}),o=n[g]??n;return{database:m(n),rawDatabase:m(o)}},l=t=>{a.exec.call(a,t)};let f=Promise.resolve();return{createWriters:w,resetHeadroom:()=>{c.reset()},runInTransaction:t=>{const n=async()=>{const b=p({scheduler:s});c.reset(),l("BEGIN"),u=!0;try{const d=await t();return l("COMMIT"),u=!1,await b(!0),d}catch(d){u=!1;try{l("ROLLBACK")}catch{}throw await b(!1),d}},o=f.then(n);return f=o.then(()=>{},()=>{}),o}}},v=e=>{if(typeof e!="object"||e===null)return;const{kind:r}=e;if(r==="query"||r==="mutation"||r==="action")return r},A=(e,r,s,a,i)=>{const c=v(r);if(c!==e)throw new I("INTERNAL",`expected a registered ${e}, received a ${c??"non-function"} reference`);if(!i&&r.visibility==="internal")throw new I("INTERNAL",`This ${e} is an internal function — it is unreachable from the external RPC boundary in production. Call it through ctx.run${e.charAt(0).toUpperCase()}${e.slice(1)} from another function instead.`);return Promise.resolve(r.handler(s,a??{}))};export{x as createInProcessRuntime,v as registeredFunctionKind,k as resolveInProcessIdentity,A as runRegisteredFunction};
1
+ import{LunoraError as R}from"@lunora/errors";import{TransactionHeadroomTracker as l,runShardMigrations as p,createShardCtxDb as w,RLS_UNWRAP_SYMBOL as T}from"@lunora/shard-engine";import{beginDeferredSchedules as g}from"./packem_shared/beginDeferredSchedules--FVDtp-M.mjs";import{bindTableFacade as S}from"./packem_shared/bindOrm-D5mVDvbi.mjs";class y extends l{fallback=new l;scope;constructor(r){super(),this.scope=r}run(r){return this.scope===void 0?(this.fallback=new l,r()):this.scope.run(new l,r)}headroom(){return this.current().headroom()}recordRead(r){this.current().recordRead(r)}recordReadBytes(r){this.current().recordReadBytes(r)}recordDocumentRead(r,n){this.current().recordDocumentRead(r,n)}recordWrite(r){this.current().recordWrite(r)}current(){return this.scope?.getStore()??this.fallback}}const C=e=>{if(e===null||typeof e.userId!="string"||e.userId.length===0)return{claims:null,userId:null};const{userId:r,...n}=e;return{claims:Object.keys(n).length>0?n:null,userId:r}},O=(e,r)=>{const{scheduler:n,sql:a}=r,i=e;p(a,i);const c=new y(r.headroomScope),m=t=>{const o=t;for(const s of Object.keys(i.tables))o[s]=S(t,s);return t};let u=!1;const I=t=>{const o=w({auth:{identity:t.claims,userId:t.userId},enforceRls:r.enforceRls??!0,headroom:c,inTransaction:()=>u,schema:i,sql:a}),s=o[T]??o;return{database:m(o),rawDatabase:m(s)}},d=t=>{a.exec.call(a,t)};let f=Promise.resolve();return{createWriters:I,runWithBudget:t=>c.run(t),runInTransaction:t=>{const o=async()=>{const b=g({scheduler:n});d("BEGIN"),u=!0;try{const h=await t();return d("COMMIT"),u=!1,await b(!0),h}catch(h){u=!1;try{d("ROLLBACK")}catch{}throw await b(!1),h}},s=f.then(()=>c.run(o));return f=s.then(()=>{},()=>{}),s}}},k=e=>{if(typeof e!="object"||e===null)return;const{kind:r}=e;if(r==="query"||r==="mutation"||r==="action")return r},P=(e,r,n,a,i)=>{const c=k(r);if(c!==e)throw new R("INTERNAL",`expected a registered ${e}, received a ${c??"non-function"} reference`);if(!i&&r.visibility==="internal")throw new R("INTERNAL",`This ${e} is an internal function — it is unreachable from the external RPC boundary in production. Call it through ctx.run${e.charAt(0).toUpperCase()}${e.slice(1)} from another function instead.`);return Promise.resolve(r.handler(n,a??{}))};export{O as createInProcessRuntime,k as registeredFunctionKind,C as resolveInProcessIdentity,P as runRegisteredFunction};
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
- import { Validator, Infer, ColumnValidator, v, Id, ValidatorMap, InferValidatorMap } from '@lunora/values';
1
+ import { Validator, Infer, ColumnValidator, Id, StringColumnValidator, ValidatorMap, InferValidatorMap } from '@lunora/values';
2
2
  export { type ColumnValidator, type GeoPoint, type Id, type Infer, ValidationError, type Validator, type ValidatorKind, v } from '@lunora/values';
3
- import { A as ArgsValidator, I as InferArgs, R as RegisteredAction, E as ExposeConfig, X as X402ProcedureConfig, b as ActionCtx, M as MutationCtx, c as RegisteredMutation, Q as QueryCtx, d as RegisteredQuery, e as DurableStreamOptions, f as RegisteredStream, F as FunctionKind, T as TableDefinition, g as RegisteredFunction, V as VectorIndexDefinition, S as Schema, h as AggregateOp, G as GlobalBackend, K as KeyedRelationDefinition, i as RelationThrough, j as ThroughRelationDefinition, O as OnDeleteAction, k as RelationDefinition, l as SearchLanguage, m as SearchStrategy, n as ExternalSourceDefinition, o as TriggerBuilder, p as TriggerDefinition, q as VectorEmbedder, r as VectorMetric, s as DurableObjectJurisdiction, t as AggregateIndexDefinition, u as RankIndexDefinition, v as Secrets, w as LiveTopicRef, x as LifecycleEvent, y as ShardInitEvent, z as RegisteredLifecycleHook, W as WhisperEvent } from "./packem_shared/types.d-BOnXpMCp.mjs";
4
- export type { B as AuthState, C as CachePurge, H as DatabaseReader, D as DatabaseWriter, J as FunctionVisibility, N as GeoBoundingBox, P as GeoFilterBuilder, U as GeoIndexDefinition, Y as GeoPointInput, Z as IndexDefinition, _ as IndexRangeBuilder, $ as LifecycleEventKind, a0 as LogFields, a1 as LunoraLogMethod, a2 as LunoraLogger, a3 as LunoraMetrics, L as LunoraTracer, a4 as LunoraWideEvent, a5 as MutationStorage, a6 as PaginationOptions, a7 as PaginationResult, a8 as PatchIfResult, a9 as RankSortKey, aa as ReadOnlyStorage, ab as RelatedDirection, ac as RelatedNode, ad as RelatedOptions, ae as RelatedPage, af as RelatedStart, ag as RelatedStartReference, ah as RestCacheConfig, ai as RetryPolicy, aj as RunQueryOptions, ak as ScheduledFunctionDoc, al as ScheduledJob, am as ScheduledJobState, an as ScheduledJobView, ao as Scheduler, ap as SearchFilterBuilder, aq as SearchIndexDefinition, ar as ShardMode, as as SpanContextIds, at as SpanEvaluation, a as SpanHandle, au as SpanIdentity, av as SpanKind, aw as SpanLink, ax as SpanOptions, ay as Storage, az as StorageListOptions, aA as StorageListResult, aB as StorageMetadata, aC as StorageMultipartUpload, aD as StorageMultipartUploadOptions, aE as StorageObjectBody, aF as StorageObjectHead, aG as StorageRange, aH as StorageUploadBody, aI as StorageUploadOptions, aJ as StorageUploadResult, aK as StorageUploadedPart, aL as SystemDatabaseReader, aM as SystemDoc, aN as SystemQuery, aO as SystemTableName, aP as TableReader, aQ as TableVectorIndex, aR as TriggerAggregateOptions, aS as TriggerCtx, aT as TriggerDatabase, aU as TriggerDeleteEvent, aV as TriggerEvent, aW as TriggerGroupByEntry, aX as TriggerGroupByOptions, aY as TriggerHandler, aZ as TriggerInsertEvent, a_ as TriggerOp, a$ as TriggerQueryArgs, b0 as TriggerQueryPage, b1 as TriggerRankOptions, b2 as TriggerRankPageOptions, b3 as TriggerRankResult, b4 as TriggerRow, b5 as TriggerTiming, b6 as TriggerUpdateEvent, b7 as TtlDefinition, b8 as VectorMatch, b9 as VectorMatches, ba as VectorQueryInput, bb as VectorRecord, bc as VectorSearch, bd as VectorSearchReader, be as VectorUpsertInput, bf as WorkflowCreateOptions, bg as WorkflowEventDefinition, bh as WorkflowHandle, bi as WorkflowInstance, bj as WorkflowInstanceEvent, bk as WorkflowInstanceStatus, bl as WorkflowStatusResult, bm as Workflows } from "./packem_shared/types.d-BOnXpMCp.mjs";
3
+ import { A as ArgsValidator, I as InferArgs, R as RegisteredAction, E as ExposeConfig, X as X402ProcedureConfig, b as ActionCtx, c as RegisteredInternalAction, M as MutationCtx, d as RegisteredInternalMutation, Q as QueryCtx, e as RegisteredInternalQuery, f as DurableStreamOptions, g as RegisteredInternalStream, h as RegisteredMutation, i as RegisteredQuery, j as RegisteredStream, F as FunctionKind, T as TableDefinition, k as RegisteredFunction, V as VectorIndexDefinition, S as Schema, l as AggregateOp, G as GlobalBackend, K as KeyedRelationDefinition, m as RelationThrough, n as ThroughRelationDefinition, O as OnDeleteAction, o as RelationDefinition, p as SearchLanguage, q as SearchStrategy, r as ExternalSourceDefinition, s as TriggerBuilder, t as TriggerDefinition, u as VectorEmbedder, v as VectorMetric, w as DurableObjectJurisdiction, x as AggregateIndexDefinition, y as RankIndexDefinition, z as Secrets, B as LiveTopicRef, C as LifecycleEvent, H as ShardInitEvent, J as RegisteredLifecycleHook, W as WhisperEvent } from "./packem_shared/types.d-BM3crF47.mjs";
4
+ export type { N as AuthState, P as CachePurge, U as DatabaseReader, D as DatabaseWriter, Y as FunctionVisibility, Z as GeoBoundingBox, _ as GeoFilterBuilder, $ as GeoIndexDefinition, a0 as GeoPointInput, a1 as IndexDefinition, a2 as IndexRangeBuilder, a3 as LifecycleEventKind, a4 as LogFields, a5 as LunoraLogMethod, a6 as LunoraLogger, a7 as LunoraMetrics, L as LunoraTracer, a8 as LunoraWideEvent, a9 as MutationStorage, aa as PaginationOptions, ab as PaginationResult, ac as PatchIfResult, ad as RankSortKey, ae as ReadOnlyStorage, af as RelatedDirection, ag as RelatedNode, ah as RelatedOptions, ai as RelatedPage, aj as RelatedStart, ak as RelatedStartReference, al as RestCacheConfig, am as RetryPolicy, an as RunQueryOptions, ao as ScheduleRunOptions, ap as ScheduledFunctionDoc, aq as ScheduledJob, ar as ScheduledJobState, as as ScheduledJobView, at as Scheduler, au as SearchFilterBuilder, av as SearchIndexDefinition, aw as ShardMode, ax as SpanContextIds, ay as SpanEvaluation, a as SpanHandle, az as SpanIdentity, aA as SpanKind, aB as SpanLink, aC as SpanOptions, aD as Storage, aE as StorageListOptions, aF as StorageListResult, aG as StorageMetadata, aH as StorageMultipartUpload, aI as StorageMultipartUploadOptions, aJ as StorageObjectBody, aK as StorageObjectHead, aL as StorageRange, aM as StorageUploadBody, aN as StorageUploadOptions, aO as StorageUploadResult, aP as StorageUploadedPart, aQ as SystemDatabaseReader, aR as SystemDoc, aS as SystemQuery, aT as SystemTableName, aU as TableReader, aV as TableVectorIndex, aW as TriggerAggregateOptions, aX as TriggerCtx, aY as TriggerDatabase, aZ as TriggerDeleteEvent, a_ as TriggerEvent, a$ as TriggerGroupByEntry, b0 as TriggerGroupByOptions, b1 as TriggerHandler, b2 as TriggerInsertEvent, b3 as TriggerOp, b4 as TriggerQueryArgs, b5 as TriggerQueryPage, b6 as TriggerRankOptions, b7 as TriggerRankPageOptions, b8 as TriggerRankResult, b9 as TriggerRow, ba as TriggerTiming, bb as TriggerUpdateEvent, bc as TtlDefinition, bd as VectorMatch, be as VectorMatches, bf as VectorQueryInput, bg as VectorRecord, bh as VectorSearch, bi as VectorSearchReader, bj as VectorUpsertInput, bk as WorkflowCreateOptions, bl as WorkflowEventDefinition, bm as WorkflowHandle, bn as WorkflowInstance, bo as WorkflowInstanceEvent, bp as WorkflowInstanceStatus, bq as WorkflowStatusResult, br as Workflows } from "./packem_shared/types.d-BM3crF47.mjs";
5
5
  import { LunoraError } from '@lunora/errors';
6
6
  export { LunoraError, type LunoraErrorCode } from '@lunora/errors';
7
7
  import { Context, Hono, ExecutionContext } from 'hono';
@@ -40,6 +40,24 @@ type Middleware<ContextIn, ContextOut> = (options: {
40
40
  ctx: ContextIn;
41
41
  next: MiddlewareNext<ContextIn>;
42
42
  }) => ContextOut | Promise<ContextOut>;
43
+ /**
44
+ * What a policy middleware (`rls()`, `mask()`) returns: a middleware generic over
45
+ * the procedure context it is attached to, handing that same context on.
46
+ *
47
+ * Generic so `.use()` instantiates it with the builder's own context: a generated
48
+ * `QueryCtx` / `MutationCtx` carries a typed `db` facade that is not assignable to
49
+ * the untyped writer shape a policy module projects. Keeping the caller's type is
50
+ * sound because the runtime only swaps `db` (and `orm`) for wrappers of the same
51
+ * facade. `Required` is everything else the policies read (`auth`, a `tenantId`
52
+ * an earlier middleware adds), so attaching them where it is missing is still a
53
+ * type error rather than an `undefined` at request time.
54
+ */
55
+ type PolicyMiddleware<Required = unknown> = <Context extends Required & {
56
+ db: object;
57
+ }>(options: {
58
+ ctx: Context;
59
+ next: MiddlewareNext<Context>;
60
+ }) => Promise<Context>;
43
61
  /**
44
62
  * The context a `.use(...)` step actually receives: the procedure context plus
45
63
  * `args`, the call's arguments as declared by `.input(...)` up to this point in
@@ -247,16 +265,16 @@ interface InternalQueryBuilder<Context, Args extends ArgsValidator, Output = und
247
265
  query: [Output] extends [undefined] ? <R>(handler: (options: {
248
266
  args: InferArgs<Args>;
249
267
  ctx: Context;
250
- }) => Promise<R> | R) => RegisteredQuery<Args, Awaited<R>> : (handler: (options: {
268
+ }) => Promise<R> | R) => RegisteredInternalQuery<Args, Awaited<R>> : (handler: (options: {
251
269
  args: InferArgs<Args>;
252
270
  ctx: Context;
253
- }) => Output | Promise<Output>) => RegisteredQuery<Args, Output>;
271
+ }) => Output | Promise<Output>) => RegisteredInternalQuery<Args, Output>;
254
272
  /** See {@link QueryBuilder.stream}; the internal variant routes the registration into `internal` instead of `api`. */
255
273
  stream: <R>(handler: (options: {
256
274
  args: InferArgs<Args>;
257
275
  ctx: Context;
258
276
  signal: AbortSignal;
259
- }) => AsyncGenerator<R, void, void> | AsyncIterable<R>, options?: StreamOptions) => RegisteredStream<Args, R>;
277
+ }) => AsyncGenerator<R, void, void> | AsyncIterable<R>, options?: StreamOptions) => RegisteredInternalStream<Args, R>;
260
278
  use: <ContextOut>(middleware: Middleware<MiddlewareContext<Context, Args>, ContextOut>) => InternalQueryBuilder<ContextOut, Args, Output>;
261
279
  }
262
280
  interface InternalMutationBuilder<Context, Args extends ArgsValidator, Output = undefined> {
@@ -280,10 +298,10 @@ interface InternalMutationBuilder<Context, Args extends ArgsValidator, Output =
280
298
  mutation: [Output] extends [undefined] ? <R>(handler: (options: {
281
299
  args: InferArgs<Args>;
282
300
  ctx: Context;
283
- }) => Promise<R> | R) => RegisteredMutation<Args, Awaited<R>> : (handler: (options: {
301
+ }) => Promise<R> | R) => RegisteredInternalMutation<Args, Awaited<R>> : (handler: (options: {
284
302
  args: InferArgs<Args>;
285
303
  ctx: Context;
286
- }) => Output | Promise<Output>) => RegisteredMutation<Args, Output>;
304
+ }) => Output | Promise<Output>) => RegisteredInternalMutation<Args, Output>;
287
305
  output: <V extends Validator>(validator: V) => InternalMutationBuilder<Context, Args, Infer<V>>;
288
306
  use: <ContextOut>(middleware: Middleware<MiddlewareContext<Context, Args>, ContextOut>) => InternalMutationBuilder<ContextOut, Args, Output>;
289
307
  }
@@ -293,10 +311,10 @@ interface InternalActionBuilder<Context, Args extends ArgsValidator, Output = un
293
311
  action: [Output] extends [undefined] ? <R>(handler: (options: {
294
312
  args: InferArgs<Args>;
295
313
  ctx: Context;
296
- }) => Promise<R> | R) => RegisteredAction<Args, Awaited<R>> : (handler: (options: {
314
+ }) => Promise<R> | R) => RegisteredInternalAction<Args, Awaited<R>> : (handler: (options: {
297
315
  args: InferArgs<Args>;
298
316
  ctx: Context;
299
- }) => Output | Promise<Output>) => RegisteredAction<Args, Output>;
317
+ }) => Output | Promise<Output>) => RegisteredInternalAction<Args, Output>;
300
318
  input: <A extends ArgsValidator>(validators: A) => InternalActionBuilder<Context, A & Args, Output>;
301
319
  /**
302
320
  * Attach static, per-procedure metadata. Merges across calls and is readable
@@ -451,7 +469,12 @@ declare const definePlugin: DefinePluginFunction;
451
469
  *
452
470
  * Codegen follows the re-export back to the bundled `query/mutation/action`
453
471
  * call (property access or destructuring both work), so the functions land in
454
- * the generated `api` under the re-exporting file's namespace.
472
+ * the generated `api` under the re-exporting file's namespace. A component
473
+ * installed from npm has no call to follow — only its `.d.ts` — so codegen reads
474
+ * each function off its declared type instead: declare public functions as
475
+ * `RegisteredQuery` / `RegisteredMutation` / `RegisteredAction` and server-only
476
+ * ones as their `RegisteredInternal*` counterparts. A bare `RegisteredFunction`
477
+ * leaves visibility open, and codegen refuses to guess it.
455
478
  */
456
479
  type ComponentFunctions = Readonly<Record<string, RegisteredFunction<any, any, FunctionKind>>>;
457
480
  /**
@@ -1145,8 +1168,8 @@ interface ActionCacheFunctions {
1145
1168
  * again rather than assuming one pass drained the table. A caller-supplied
1146
1169
  * `limit` is clamped — `take()` has no ceiling of its own.
1147
1170
  */
1148
- purgeExpired: RegisteredMutation<{
1149
- limit: ReturnType<typeof v.optional>;
1171
+ purgeExpired: RegisteredInternalMutation<{
1172
+ limit: ColumnValidator<number | undefined, number | undefined>;
1150
1173
  }, {
1151
1174
  deleted: number;
1152
1175
  }>;
@@ -1341,6 +1364,12 @@ interface ScheduleOutbox {
1341
1364
  admit: (target: string) => number | undefined;
1342
1365
  /** Release custody — the scheduler has the job, or the window that owned it was dropped. */
1343
1366
  forget: (id: string) => void;
1367
+ /**
1368
+ * Run one post-commit hand-off under the store's eye and release custody when it lands, so an
1369
+ * operator who drops the entry while the call is still awaiting the scheduler is seen, and the
1370
+ * job is taken back out when it lands. When absent the facade runs the call and `forget`s the id.
1371
+ */
1372
+ handOff?: (id: string, run: () => Promise<unknown>, token?: string) => Promise<void>;
1344
1373
  /**
1345
1374
  * Take custody of one buffered call. Runs INSIDE the transaction, so a throw
1346
1375
  * here rolls the mutation back — which is the right answer, and the only
@@ -1355,7 +1384,7 @@ interface ScheduleOutbox {
1355
1384
  options: Record<string, unknown> | undefined;
1356
1385
  target: unknown;
1357
1386
  when: number;
1358
- }) => void;
1387
+ }) => string | undefined;
1359
1388
  /** Ask the host to wake its retry loop — called when a dispatch left entries behind. */
1360
1389
  wake: () => void;
1361
1390
  }
@@ -1492,10 +1521,10 @@ interface DocumentHistoryFunctions {
1492
1521
  * the last version at or before it, which is what a point-in-time
1493
1522
  * reconstruction needs.
1494
1523
  */
1495
- listForDocument: RegisteredQuery<{
1496
- before: ReturnType<typeof v.optional>;
1497
- documentId: ReturnType<typeof v.string>;
1498
- limit: ReturnType<typeof v.optional>;
1524
+ listForDocument: RegisteredInternalQuery<{
1525
+ before: ColumnValidator<number | undefined, number | undefined>;
1526
+ documentId: StringColumnValidator;
1527
+ limit: ColumnValidator<number | undefined, number | undefined>;
1499
1528
  }, DocumentHistoryEntry[]>;
1500
1529
  /**
1501
1530
  * Internal mutation that deletes entries older than the retention window,
@@ -1504,8 +1533,8 @@ interface DocumentHistoryFunctions {
1504
1533
  * Compare `deleted` against `limit` to decide whether to run again rather
1505
1534
  * than assuming one pass drained the backlog.
1506
1535
  */
1507
- vacuum: RegisteredMutation<{
1508
- limit: ReturnType<typeof v.optional>;
1536
+ vacuum: RegisteredInternalMutation<{
1537
+ limit: ColumnValidator<number | undefined, number | undefined>;
1509
1538
  }, {
1510
1539
  deleted: number;
1511
1540
  }>;
@@ -2400,9 +2429,9 @@ type LifecycleHandler = (context: MutationCtx, event: LifecycleEvent) => Promise
2400
2429
  /** Handler for a shard-init hook. */
2401
2430
  type ShardInitHandler = (context: MutationCtx, event: ShardInitEvent) => Promise<void> | void;
2402
2431
  /** Register a hook that fires once when a client's WebSocket connects. */
2403
- declare const onConnect: (handler: LifecycleHandler) => RegisteredLifecycleHook;
2432
+ declare const onConnect: (handler: LifecycleHandler) => RegisteredLifecycleHook<"connect">;
2404
2433
  /** Register a hook that fires once when a client's WebSocket disconnects. */
2405
- declare const onDisconnect: (handler: LifecycleHandler) => RegisteredLifecycleHook;
2434
+ declare const onDisconnect: (handler: LifecycleHandler) => RegisteredLifecycleHook<"disconnect">;
2406
2435
  /**
2407
2436
  * Register a hook that fires ONCE per Durable Object instance, before any
2408
2437
  * handler on that instance can run — the re-init half of `.memory()` tables.
@@ -2453,7 +2482,7 @@ declare const onDisconnect: (handler: LifecycleHandler) => RegisteredLifecycleHo
2453
2482
  * instance's rows in place: a memory table's rows live in SQLite until they are
2454
2483
  * deleted, so an eviction on its own does not remove them.
2455
2484
  */
2456
- declare const onShardInit: (handler: ShardInitHandler) => RegisteredLifecycleHook;
2485
+ declare const onShardInit: (handler: ShardInitHandler) => RegisteredLifecycleHook<"init">;
2457
2486
  /** Default `limit` when the caller doesn't ask for one. */
2458
2487
  declare const DEFAULT_LIMIT = 25;
2459
2488
  /** Default ceiling on `limit`, so one request can't ask for an unbounded page. */
@@ -3075,7 +3104,7 @@ interface RlsContextIn {
3075
3104
  auth?: AuthLike;
3076
3105
  db: RlsDatabase;
3077
3106
  }
3078
- declare const rls: <Context extends RlsContextIn = RlsContextIn>(policies: ReadonlyArray<Policy<Context>>, options?: RlsOptions) => Middleware<Context, Context>;
3107
+ declare const rls: <Context extends RlsContextIn = RlsContextIn>(policies: ReadonlyArray<Policy<Context>>, options?: RlsOptions) => PolicyMiddleware<Omit<Context, "db">>;
3079
3108
  /**
3080
3109
  * Context handed to a {@link MaskFn} (and to {@link MaskOptions.bypass}). The
3081
3110
  * `auth` shape mirrors RLS's `PolicyContext.auth` one-for-one — same identity
@@ -3336,7 +3365,7 @@ interface MaskContextIn {
3336
3365
  * IMPORTANT: a mask is in scope only for procedures whose builder chain
3337
3366
  * includes this middleware — opt-in, never global (the same invariant as RLS).
3338
3367
  */
3339
- declare const mask: <Context extends MaskContextIn = MaskContextIn>(policies: MaskPolicies<Context>, options?: MaskOptions<Context>) => Middleware<Context, Context>;
3368
+ declare const mask: <Context extends MaskContextIn = MaskContextIn>(policies: MaskPolicies<Context>, options?: MaskOptions<Context>) => PolicyMiddleware<Omit<Context, "db">>;
3340
3369
  /** Project-wide masked-column registry: every table any registered function masks, unioned. */
3341
3370
  type MaskRegistry = ReadonlyMap<string, ReadonlySet<string>>;
3342
3371
  /**
@@ -3641,7 +3670,15 @@ interface DefinePresenceOptions {
3641
3670
  */
3642
3671
  ttlMs?: number;
3643
3672
  }
3644
- /** The registered functions a presence component ships. */
3673
+ /**
3674
+ * The registered functions a presence component ships.
3675
+ *
3676
+ * Installed from npm, this declaration is all codegen can see of them — there is
3677
+ * no `mutation(...)` call to read — so it is what the generated `api` is built
3678
+ * from. Each entry therefore states its argument validators precisely, uses the
3679
+ * internal alias for a server-only function, and narrows a hook's `lifecycle`; a
3680
+ * loose type here becomes a loose client type, or a codegen error.
3681
+ */
3645
3682
  interface PresenceFunctions {
3646
3683
  /**
3647
3684
  * Connection-lifecycle hook: the instant a client's WebSocket drops, hard-
@@ -3653,7 +3690,7 @@ interface PresenceFunctions {
3653
3690
  * member). The TTL filter + `sweep` remain the fallback for ungraceful drops
3654
3691
  * where no `context` was recorded.
3655
3692
  */
3656
- disconnect: RegisteredLifecycleHook;
3693
+ disconnect: RegisteredLifecycleHook<"disconnect">;
3657
3694
  /**
3658
3695
  * Upsert the caller's presence row for `roomId` in their tenant and stamp
3659
3696
  * `lastSeen = now`. Keyed by `(tenantId, roomId, sessionId)` — re-heartbeats
@@ -3664,9 +3701,9 @@ interface PresenceFunctions {
3664
3701
  * data via a guessed `sessionId`.
3665
3702
  */
3666
3703
  heartbeat: RegisteredMutation<{
3667
- data: ReturnType<typeof v.optional>;
3668
- roomId: ReturnType<typeof v.string>;
3669
- sessionId: ReturnType<typeof v.string>;
3704
+ data: ColumnValidator<Record<string, unknown> | undefined, Record<string, unknown> | undefined>;
3705
+ roomId: StringColumnValidator;
3706
+ sessionId: StringColumnValidator;
3670
3707
  }, {
3671
3708
  lastSeen: number;
3672
3709
  }>;
@@ -3676,7 +3713,7 @@ interface PresenceFunctions {
3676
3713
  * here" list.
3677
3714
  */
3678
3715
  listPresent: RegisteredQuery<{
3679
- roomId: ReturnType<typeof v.string>;
3716
+ roomId: StringColumnValidator;
3680
3717
  }, PresenceMember[]>;
3681
3718
  /**
3682
3719
  * Internal mutation that hard-deletes every expired row for `roomId` in
@@ -3687,9 +3724,9 @@ interface PresenceFunctions {
3687
3724
  * that went quiet with stale rows left behind (schedule it on a cron /
3688
3725
  * `runAfter` if you care).
3689
3726
  */
3690
- sweep: RegisteredMutation<{
3691
- roomId: ReturnType<typeof v.string>;
3692
- tenantId: ReturnType<typeof v.string>;
3727
+ sweep: RegisteredInternalMutation<{
3728
+ roomId: StringColumnValidator;
3729
+ tenantId: StringColumnValidator;
3693
3730
  }, {
3694
3731
  deleted: number;
3695
3732
  }>;
@@ -3698,6 +3735,10 @@ interface PresenceFunctions {
3698
3735
  type PresenceComponent = Component<{
3699
3736
  [PRESENCE_BARE_TABLE]: ReturnType<typeof defineTable>;
3700
3737
  }> & {
3738
+ /** Always present (unlike a bare {@link Component}'s), so `.extend(presence.extension)` typechecks. */
3739
+ readonly extension: SchemaExtension<{
3740
+ [PRESENCE_BARE_TABLE]: ReturnType<typeof defineTable>;
3741
+ }, typeof PRESENCE_KEY>;
3701
3742
  functions: PresenceFunctions;
3702
3743
  };
3703
3744
  /**
@@ -3723,6 +3764,33 @@ declare const presenceExtension: SchemaExtension<{
3723
3764
  * @returns a component bundling the extension and the presence functions.
3724
3765
  */
3725
3766
  declare const definePresence: (options?: DefinePresenceOptions) => PresenceComponent;
3767
+ /**
3768
+ * Where a registered function carries its `.meta(...)` declaration.
3769
+ *
3770
+ * A symbol so it cannot collide with a field of the dispatch shape, and
3771
+ * `Symbol.for` so two bundled copies of `@lunora/server` agree on it. ENUMERABLE
3772
+ * on purpose: object spread copies enumerable own symbols, so a wrapper that
3773
+ * re-tags a function (`{ ...fn, visibility }`) keeps its meta — a non-enumerable
3774
+ * stamp would vanish there without a word. `JSON.stringify` still skips it.
3775
+ */
3776
+ declare const PROCEDURE_META: unique symbol;
3777
+ /**
3778
+ * The value a lazily registered stub carries when its function declares a
3779
+ * `.meta(...)` codegen could not copy as a literal. Only loading the module
3780
+ * produces it, so {@link procedureMeta} refuses to answer rather than report
3781
+ * "no meta" for a function that has some.
3782
+ */
3783
+ declare const UNLOADED_META: "unloaded";
3784
+ /**
3785
+ * The `.meta(...)` declaration of a registered function — the same frozen object
3786
+ * its middleware reads as `ctx.meta` — or `undefined` when it declares none.
3787
+ *
3788
+ * The supported way for tooling (an authorization audit, a docs generator) to
3789
+ * read a procedure's metadata: iterate the generated `LUNORA_FUNCTIONS` table, or
3790
+ * pass an imported function, and ask this. Throws for a lazily registered
3791
+ * function whose meta exists but is only available once its module loads.
3792
+ */
3793
+ declare const procedureMeta: (registered: unknown) => Readonly<Record<string, unknown>> | undefined;
3726
3794
  /**
3727
3795
  * The middlewares `protectPublic` chains, in the order they run. Every field is
3728
3796
  * optional, so a bundle can be just a rate limit, just a captcha, or any mix —
@@ -4399,7 +4467,7 @@ type RegisteredWhisperAuthorizer = RegisteredFunction<Record<string, never>, boo
4399
4467
  */
4400
4468
  declare const onWhisper: (handler: WhisperAuthorizeHandler) => RegisteredWhisperAuthorizer;
4401
4469
  declare const VERSION = "0.0.0";
4402
- export { DEFAULT_ACTION_CACHE_TTL_MS as ACTION_CACHE_DEFAULT_TTL_MS, ACTION_CACHE_TABLE, type ActionBuilder, type ActionCacheComponent, type ActionCacheContext, type ActionCacheDatabase, type ActionCacheFunctions, type ActionCtx, type AggregateIndexDefinition, type AggregateIndexOptions, type AggregateOp, type ArgsValidator, type Component, type ComponentFunctions, type CreateOptions, DEFAULT_LIMIT, DEFAULT_MAX_LIMIT, DEFAULT_REDACTED_FIELDS as DOCUMENT_HISTORY_REDACTED_FIELDS, DOCUMENT_HISTORY_TABLE, type DataModelInit, type DeferredDeleteFlushResult, type DefineActionCacheOptions, type DefineComponentOptions, type DefineDocumentHistoryOptions, type DefineIdentityOptions, type DefineListArgsConfig, type DefinePluginOptions, type DefinePolicyInput, type DefinePresenceOptions, type DefineRoomOptions, type DefineStorageRuleInput, type DefineWebSocketOptions, type DocumentHistoryComponent, type DocumentHistoryEntry, type DocumentHistoryFunctions, type DurableObjectJurisdiction, type DurableStreamOptions, type EmptyArgs, type EnvAccessor, type EnvKeyFailure, type EnvShape, type ExposeConfig, type ExtendableSchema, type FacadeEntry, type FacadeWriterLike, type FunctionKind, type HttpActionCtx, type HttpActionHandler, type HttpMethod, type HttpRoute, type HttpRouteBuilder, type HttpRouteFactory, type HttpRouteHandlerOptions, type HttpRunners, type HttpStreamHandlerOptions, type IdentityContract, type IdentityRejectMode, type IdentityValidation, type IndexFieldsByTable, type InferArgs, type InferEnv, type InferIdentity, type InlineAggregateIndexOptions, type InlineRankIndexOptions, type InternalActionBuilder, type InternalMutationBuilder, type InternalQueryBuilder, type LifecycleEvent, type LifecycleHandler, type ListArgsSpec, type ListArgsValidators, type ListArgsValue, type ListFilterOperators, type ListOrderByEntry, type ListWhere, type LivePublishOptions, type LivePublisher, type LiveRouterApp, type LiveRouterFallback, type LiveStream, type LiveStreamConfig, type LiveStreamMount, type LiveSubscribeHandler, type LiveSubscribeOptions, type LiveTopicDeclaration, type LiveTopicKey, type LiveTopicPayload, type LiveTopicRef, type LiveTopics, type LunoraBuilders, LunoraEnvError, type LunoraHttpApp, type LunoraHttpEnv, type LunoraRouteHandler, type ManyRelation, type MaskColumns, type MaskContext, type MaskFn, type MaskOptions, type MaskPolicies, type MaskRegistry, type MaskStrategy, type Middleware, type MiddlewareContext, type MiddlewareNext, type MigrationCovers, type MigrationCtx, type MigrationDefinition, type MigrationDocument, type MigrationReader, type MigrationTransform, type ModuleConfig, type ModuleDefinition, type MutationBuilder, type MutationCtx, type MutatorDefinition, type OnDeleteAction, type OneRelation, type OrmLike, DEFAULT_TTL_MS as PRESENCE_DEFAULT_TTL_MS, PRESENCE_TABLE, type Permission, type PlatformAdminCheck, type Plugin, type Policy, type PrefixedTables, type PresenceComponent, type PresenceFunctions, type PresenceMember, type ProtectPublicOptions, type QueryBuilder, type QueryCtx, type RankIndexDefinition, type RankIndexOptions, type ReactorHandler, type ReactorOutcome, type ReactorSelect, type RegisteredAction, type RegisteredFunction, type RegisteredLifecycleHook, type RegisteredMigration, type RegisteredMutation, type RegisteredMutator, type RegisteredQuery, type RegisteredReactor, type RegisteredRoom, type RegisteredShape, type RegisteredStream, type RegisteredWebSocket, type RegisteredWhisperAuthorizer, type RelationBuilder, type RelationDefinition, type RelationThrough, type RlsOptions, type RlsReadRegistry, type Role, type RoomJoinHandler, type RoomLeaveHandler, type RoomMessageHandler, type RoomMessageOf, type RoomSocket, type Schema, type SchemaExtension, type ServiceBindingSpec, type ServiceFetcher, type ServiceRpc, type ShapeDefinition, type ShapeGuardDeclaration, type ShapeReadWhereRequest, type ShardFetch, type ShardFetchInit, type ShardInitEvent, type ShardInitHandler, type SseEvent, type StorageOperation, type StorageRule, type StorageRuleContext, type StorageRuleDecision, type StorageRulesOptions, type StorageServeAuthorizer, type StorageServeAuthzContext, type TableBuilder, type TableDefinition, type TerminalKind, type TriggerBuilder, type TriggerDefinition, type TypedDefinePolicyInput, VERSION, type VectorEmbedder, type VectorIndexDefinition, type VectorIndexOptions, type VectorMetric, type VectorizeOptions, type WebSocketCloseHandler, type WebSocketHandle, type WebSocketMessageHandler, type WebSocketOpenHandler, type WhereInput, type WhisperAuthorizeHandler, type WhisperEvent, actionCacheExtension, allowAll, asBucketStorage, assertShapesDeclareReadPolicies, beginDeferredDeletes, beginDeferredSchedules, bindOrm, bindTableFacade, buildMaskRegistry, buildRlsReadRegistry, cacheKeyFor, clampLimit, composePluginMiddleware, composeShapeReadWhere, createPolicyDsl, createSecrets, createServices, defineActionCache, defineAggregateIndex, defineComponent, defineDocumentHistory, defineEnv, defineIdentity, defineIdentityGuard, defineLazyFacade, defineListArgs, defineLiveStream, defineMigration, defineModule, defineMutator, definePermission, definePlugin, definePolicies, definePolicy, definePresence, defineRankIndex, defineRole, defineRoom, defineSchema, defineSchemaExtension, defineShape, defineStorageRule, defineStorageRules, defineTable, defineVectorIndex, defineWebSocket, deny, documentHistoryExtension, flushDeferredDeletes,
4470
+ export { DEFAULT_ACTION_CACHE_TTL_MS as ACTION_CACHE_DEFAULT_TTL_MS, ACTION_CACHE_TABLE, type ActionBuilder, type ActionCacheComponent, type ActionCacheContext, type ActionCacheDatabase, type ActionCacheFunctions, type ActionCtx, type AggregateIndexDefinition, type AggregateIndexOptions, type AggregateOp, type ArgsValidator, type Component, type ComponentFunctions, type CreateOptions, DEFAULT_LIMIT, DEFAULT_MAX_LIMIT, DEFAULT_REDACTED_FIELDS as DOCUMENT_HISTORY_REDACTED_FIELDS, DOCUMENT_HISTORY_TABLE, type DataModelInit, type DeferredDeleteFlushResult, type DefineActionCacheOptions, type DefineComponentOptions, type DefineDocumentHistoryOptions, type DefineIdentityOptions, type DefineListArgsConfig, type DefinePluginOptions, type DefinePolicyInput, type DefinePresenceOptions, type DefineRoomOptions, type DefineStorageRuleInput, type DefineWebSocketOptions, type DocumentHistoryComponent, type DocumentHistoryEntry, type DocumentHistoryFunctions, type DurableObjectJurisdiction, type DurableStreamOptions, type EmptyArgs, type EnvAccessor, type EnvKeyFailure, type EnvShape, type ExposeConfig, type ExtendableSchema, type FacadeEntry, type FacadeWriterLike, type FunctionKind, type HttpActionCtx, type HttpActionHandler, type HttpMethod, type HttpRoute, type HttpRouteBuilder, type HttpRouteFactory, type HttpRouteHandlerOptions, type HttpRunners, type HttpStreamHandlerOptions, type IdentityContract, type IdentityRejectMode, type IdentityValidation, type IndexFieldsByTable, type InferArgs, type InferEnv, type InferIdentity, type InlineAggregateIndexOptions, type InlineRankIndexOptions, type InternalActionBuilder, type InternalMutationBuilder, type InternalQueryBuilder, type LifecycleEvent, type LifecycleHandler, type ListArgsSpec, type ListArgsValidators, type ListArgsValue, type ListFilterOperators, type ListOrderByEntry, type ListWhere, type LivePublishOptions, type LivePublisher, type LiveRouterApp, type LiveRouterFallback, type LiveStream, type LiveStreamConfig, type LiveStreamMount, type LiveSubscribeHandler, type LiveSubscribeOptions, type LiveTopicDeclaration, type LiveTopicKey, type LiveTopicPayload, type LiveTopicRef, type LiveTopics, type LunoraBuilders, LunoraEnvError, type LunoraHttpApp, type LunoraHttpEnv, type LunoraRouteHandler, type ManyRelation, type MaskColumns, type MaskContext, type MaskFn, type MaskOptions, type MaskPolicies, type MaskRegistry, type MaskStrategy, type Middleware, type MiddlewareContext, type MiddlewareNext, type MigrationCovers, type MigrationCtx, type MigrationDefinition, type MigrationDocument, type MigrationReader, type MigrationTransform, type ModuleConfig, type ModuleDefinition, type MutationBuilder, type MutationCtx, type MutatorDefinition, type OnDeleteAction, type OneRelation, type OrmLike, DEFAULT_TTL_MS as PRESENCE_DEFAULT_TTL_MS, PRESENCE_TABLE, PROCEDURE_META, type Permission, type PlatformAdminCheck, type Plugin, type Policy, type PolicyMiddleware, type PrefixedTables, type PresenceComponent, type PresenceFunctions, type PresenceMember, type ProtectPublicOptions, type QueryBuilder, type QueryCtx, type RankIndexDefinition, type RankIndexOptions, type ReactorHandler, type ReactorOutcome, type ReactorSelect, type RegisteredAction, type RegisteredFunction, type RegisteredInternalAction, type RegisteredInternalMutation, type RegisteredInternalQuery, type RegisteredInternalStream, type RegisteredLifecycleHook, type RegisteredMigration, type RegisteredMutation, type RegisteredMutator, type RegisteredQuery, type RegisteredReactor, type RegisteredRoom, type RegisteredShape, type RegisteredStream, type RegisteredWebSocket, type RegisteredWhisperAuthorizer, type RelationBuilder, type RelationDefinition, type RelationThrough, type RlsContextIn, type RlsOptions, type RlsReadRegistry, type Role, type RoomJoinHandler, type RoomLeaveHandler, type RoomMessageHandler, type RoomMessageOf, type RoomSocket, type Schema, type SchemaExtension, type ServiceBindingSpec, type ServiceFetcher, type ServiceRpc, type ShapeDefinition, type ShapeGuardDeclaration, type ShapeReadWhereRequest, type ShardFetch, type ShardFetchInit, type ShardInitEvent, type ShardInitHandler, type SseEvent, type StorageOperation, type StorageRule, type StorageRuleContext, type StorageRuleDecision, type StorageRulesOptions, type StorageServeAuthorizer, type StorageServeAuthzContext, type TableBuilder, type TableDefinition, type TerminalKind, type TriggerBuilder, type TriggerDefinition, type TypedDefinePolicyInput, UNLOADED_META, VERSION, type VectorEmbedder, type VectorIndexDefinition, type VectorIndexOptions, type VectorMetric, type VectorizeOptions, type WebSocketCloseHandler, type WebSocketHandle, type WebSocketMessageHandler, type WebSocketOpenHandler, type WhereInput, type WhisperAuthorizeHandler, type WhisperEvent, actionCacheExtension, allowAll, asBucketStorage, assertShapesDeclareReadPolicies, beginDeferredDeletes, beginDeferredSchedules, bindOrm, bindTableFacade, buildMaskRegistry, buildRlsReadRegistry, cacheKeyFor, clampLimit, composePluginMiddleware, composeShapeReadWhere, createPolicyDsl, createSecrets, createServices, defineActionCache, defineAggregateIndex, defineComponent, defineDocumentHistory, defineEnv, defineIdentity, defineIdentityGuard, defineLazyFacade, defineListArgs, defineLiveStream, defineMigration, defineModule, defineMutator, definePermission, definePlugin, definePolicies, definePolicy, definePresence, defineRankIndex, defineRole, defineRoom, defineSchema, defineSchemaExtension, defineShape, defineStorageRule, defineStorageRules, defineTable, defineVectorIndex, defineWebSocket, deny, documentHistoryExtension, flushDeferredDeletes,
4403
4471
  /**
4404
4472
  * True when `value` is safe to use as an HTTP header field-value: no CR, LF, or
4405
4473
  * NUL. Guards against response-header injection / `Headers`-construction throws
@@ -4435,7 +4503,7 @@ httpRouter, indexFieldsFromSchema, initLunora, installPlugins, isDeny, isPerDisp
4435
4503
  * handler can guard a request-derived header value before writing it — the fix the
4436
4504
  * `http_action_response_header_injection` advisor lint points to.
4437
4505
  */
4438
- lastEventId, liveStreamRouter, mask, mergeSchemaExtension, onConnect, onDisconnect, onQueryChange, onShardInit, onWhisper, platformAdmin, presenceExtension, protectPublic, redactSecrets, rls, serveStorageObject,
4506
+ lastEventId, liveStreamRouter, mask, mergeSchemaExtension, onConnect, onDisconnect, onQueryChange, onShardInit, onWhisper, platformAdmin, presenceExtension, procedureMeta, protectPublic, redactSecrets, rls, serveStorageObject,
4439
4507
  /**
4440
4508
  * True when `value` is safe to use as an HTTP header field-value: no CR, LF, or
4441
4509
  * NUL. Guards against response-header injection / `Headers`-construction throws