@lunora/server 1.0.0-alpha.29 → 1.0.0-alpha.291

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 (104) hide show
  1. package/LICENSE.md +414 -104
  2. package/README.md +21 -15
  3. package/dist/data-model.d.mts +328 -78
  4. package/dist/data-model.d.ts +328 -78
  5. package/dist/data-model.mjs +0 -1
  6. package/dist/drizzle.mjs +1 -1
  7. package/dist/in-process.d.mts +115 -0
  8. package/dist/in-process.d.ts +115 -0
  9. package/dist/in-process.mjs +1 -0
  10. package/dist/index.d.mts +3615 -1125
  11. package/dist/index.d.ts +3615 -1125
  12. package/dist/index.mjs +1 -29
  13. package/dist/otel.d.mts +649 -0
  14. package/dist/otel.d.ts +649 -0
  15. package/dist/otel.mjs +1 -0
  16. package/dist/packem_shared/ACTION_CACHE_DEFAULT_TTL_MS-Dv4DKrj0.mjs +1 -0
  17. package/dist/packem_shared/DEFAULT_LIMIT-z7HB19s7.mjs +1 -0
  18. package/dist/packem_shared/DOCUMENT_HISTORY_REDACTED_FIELDS-BCa6sLSJ.mjs +1 -0
  19. package/dist/packem_shared/LunoraEnvError-06_Zc4yc.mjs +3 -0
  20. package/dist/packem_shared/PRESENCE_DEFAULT_TTL_MS-aj9Ec70J.mjs +1 -0
  21. package/dist/packem_shared/PROCEDURE_META-DVzrXpfa.mjs +1 -0
  22. package/dist/packem_shared/allowAll-DkRAgItV.mjs +1 -0
  23. package/dist/packem_shared/apply-output-C5wZ5EAL.mjs +1 -0
  24. package/dist/packem_shared/asBucketStorage-DoGYOjq3.mjs +1 -0
  25. package/dist/packem_shared/assertShapesDeclareReadPolicies-B9Kat3xb.mjs +1 -0
  26. package/dist/packem_shared/authorize-CVLZJxf_.mjs +1 -0
  27. package/dist/packem_shared/beginDeferredDeletes-DhwFBbvs.mjs +1 -0
  28. package/dist/packem_shared/beginDeferredSchedules-BOsY07vZ.mjs +1 -0
  29. package/dist/packem_shared/bindOrm-DjpQXKLX.mjs +1 -0
  30. package/dist/packem_shared/buildMaskRegistry-DpWMtalG.mjs +1 -0
  31. package/dist/packem_shared/compose-middleware-BK9FlblN.mjs +1 -0
  32. package/dist/packem_shared/composePluginMiddleware-3e7F9JIa.mjs +1 -0
  33. package/dist/packem_shared/context-identity-B2XYGA0B.mjs +1 -0
  34. package/dist/packem_shared/createPolicyDsl-BZa6SqLJ.mjs +1 -0
  35. package/dist/packem_shared/createSecrets-D6rLB42U.mjs +1 -0
  36. package/dist/packem_shared/createServices-IJvoqi0e.mjs +1 -0
  37. package/dist/packem_shared/defineAggregateIndex-C3xWV-Dr.mjs +1 -0
  38. package/dist/packem_shared/defineIdentity-DwkNKwYa.mjs +1 -0
  39. package/dist/packem_shared/defineIdentityGuard-Bt8N65Zs.mjs +1 -0
  40. package/dist/packem_shared/defineLiveStream-D3xRvNDy.mjs +1 -0
  41. package/dist/packem_shared/defineMigration-CXOS0Bvq.mjs +1 -0
  42. package/dist/packem_shared/defineModule-OecXWM3U.mjs +1 -0
  43. package/dist/packem_shared/defineMutator-DlLFSWbO.mjs +1 -0
  44. package/dist/packem_shared/defineRoom-CoGi-xwm.mjs +1 -0
  45. package/dist/packem_shared/defineShape-BE1Drcby.mjs +1 -0
  46. package/dist/packem_shared/defineStorageRule-Dv4nJE0H.mjs +1 -0
  47. package/dist/packem_shared/defineWebSocket-BHoy6_ox.mjs +1 -0
  48. package/dist/packem_shared/fnv1a-D3ueNTWB.mjs +1 -0
  49. package/dist/packem_shared/functions-QFoBUe9t.mjs +1 -0
  50. package/dist/packem_shared/httpAction-DD8h1jcf.mjs +1 -0
  51. package/dist/packem_shared/initLunora-DcvCGLL_.mjs +1 -0
  52. package/dist/packem_shared/isPerDispatchMiddleware-DDQPatSm.mjs +1 -0
  53. package/dist/packem_shared/isSafeHeaderValue-DswDADFy.mjs +6 -0
  54. package/dist/packem_shared/mask-BdHDaOeI.mjs +1 -0
  55. package/dist/packem_shared/middleware-6q14NoEG.mjs +1 -0
  56. package/dist/packem_shared/onConnect-BLRoOpv2.mjs +1 -0
  57. package/dist/packem_shared/onQueryChange-iuLzmyPs.mjs +1 -0
  58. package/dist/packem_shared/onWhisper-CfDbFLQh.mjs +1 -0
  59. package/dist/packem_shared/platformAdmin-kczXQme8.mjs +1 -0
  60. package/dist/packem_shared/plugin-CyLqvCB9.mjs +1 -0
  61. package/dist/packem_shared/policy-tag-V0lqFzgS.mjs +1 -0
  62. package/dist/packem_shared/protectPublic-Bi5_95aP.mjs +1 -0
  63. package/dist/packem_shared/redact-secrets-BpatNz48.mjs +2 -0
  64. package/dist/packem_shared/redactSecrets-Dmh9pHZu.mjs +1 -0
  65. package/dist/packem_shared/rls-QoHmZEia.mjs +1 -0
  66. package/dist/packem_shared/run-middleware-BefYq7Xd.mjs +1 -0
  67. package/dist/packem_shared/serveStorageObject-CLz3qhNI.mjs +1 -0
  68. package/dist/packem_shared/storageRules-gnLtvRbZ.mjs +1 -0
  69. package/dist/packem_shared/types.d--zaGh3rX.d.mts +3025 -0
  70. package/dist/packem_shared/types.d--zaGh3rX.d.ts +3025 -0
  71. package/dist/packem_shared/{types.d-C4CMJK8x.d.mts → types.d-B7FLdYUD.d.mts} +15 -8
  72. package/dist/packem_shared/{types.d-DdYF8E18.d.ts → types.d-BCtjbIzl.d.ts} +15 -8
  73. package/dist/rls/testing.d.mts +13 -5
  74. package/dist/rls/testing.d.ts +13 -5
  75. package/dist/rls/testing.mjs +1 -49
  76. package/dist/types.d.mts +2 -1468
  77. package/dist/types.d.ts +2 -1468
  78. package/dist/types.mjs +0 -31
  79. package/package.json +28 -8
  80. package/dist/packem_shared/LunoraEnvError-BGmd1Qs0.mjs +0 -187
  81. package/dist/packem_shared/LunoraError-WbxmrpxR.mjs +0 -9
  82. package/dist/packem_shared/PRESENCE_DEFAULT_TTL_MS-Cv1UPaJj.mjs +0 -114
  83. package/dist/packem_shared/asBucketStorage-Cnxd9y2q.mjs +0 -11
  84. package/dist/packem_shared/bindOrm-Bfgl7f-Q.mjs +0 -146
  85. package/dist/packem_shared/buildRlsReadRegistry-D54vUQe4.mjs +0 -107
  86. package/dist/packem_shared/composePluginMiddleware-z62dttBo.mjs +0 -103
  87. package/dist/packem_shared/createPolicyDsl-By3QB4he.mjs +0 -32
  88. package/dist/packem_shared/createSecrets-DwaR2rNG.mjs +0 -58
  89. package/dist/packem_shared/defineAggregateIndex-DTULzh09.mjs +0 -333
  90. package/dist/packem_shared/defineIdentity-DiX4zM9x.mjs +0 -35
  91. package/dist/packem_shared/defineMigration-Hx01yIht.mjs +0 -10
  92. package/dist/packem_shared/defineMutator-EIXAWhs9.mjs +0 -11
  93. package/dist/packem_shared/defineShape-C5scNOrf.mjs +0 -18
  94. package/dist/packem_shared/defineStorageRule-B5nL4Z1P.mjs +0 -23
  95. package/dist/packem_shared/functions-Di9FUNkf.mjs +0 -5
  96. package/dist/packem_shared/httpAction-DCXoYPIk.mjs +0 -355
  97. package/dist/packem_shared/initLunora-CmMVk4i7.mjs +0 -107
  98. package/dist/packem_shared/mask-CZuu9WAF.mjs +0 -331
  99. package/dist/packem_shared/onConnect-CIPXKPyw.mjs +0 -13
  100. package/dist/packem_shared/policy-tag-DvpVH2tv.mjs +0 -13
  101. package/dist/packem_shared/protectPublic-BlcGpiRc.mjs +0 -15
  102. package/dist/packem_shared/rls-B_ZWgslr.mjs +0 -595
  103. package/dist/packem_shared/run-middleware-I6EiQfxL.mjs +0 -20
  104. package/dist/packem_shared/storageRules-6QxzDOcx.mjs +0 -88
@@ -0,0 +1,115 @@
1
+ import { TransactionHeadroomTracker, SqlExec } from '@lunora/shard-engine';
2
+ import { D as DatabaseWriter, S as Schema } from "./packem_shared/types.d--zaGh3rX.mjs";
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
+ }
9
+ /** The kind of a registered Lunora function. */
10
+ type FunctionKind = "action" | "mutation" | "query";
11
+ /**
12
+ * A caller-supplied identity. `userId` is the subject a handler reads from
13
+ * `ctx.auth.userId`; every other field is returned from
14
+ * `ctx.auth.getIdentity()` (mirroring a decoded JWT's claims).
15
+ */
16
+ interface InProcessIdentity extends Record<string, unknown> {
17
+ userId?: null | string;
18
+ }
19
+ /** The `userId` + claims a dispatch runs under, after production's normalisation. */
20
+ interface ResolvedIdentity {
21
+ readonly claims: Record<string, unknown> | null;
22
+ readonly userId: null | string;
23
+ }
24
+ /**
25
+ * Reduce a caller-supplied {@link InProcessIdentity} to what production would
26
+ * actually hand a shard.
27
+ *
28
+ * Mirrors `@lunora/runtime`'s `create-worker.ts` identity forwarding: an identity
29
+ * whose `userId` is not a non-empty string is dropped to anonymous outright, and
30
+ * the forwarded claims are the identity MINUS `userId` (`null` when nothing is
31
+ * left), because the shard reads the subject from its own header and surfaces
32
+ * only the remaining claims through `ctx.auth.getIdentity()`.
33
+ * @param identity the caller-supplied identity, or `null` for anonymous
34
+ * @returns the identity production would forward
35
+ */
36
+ declare const resolveInProcessIdentity: (identity: InProcessIdentity | null) => ResolvedIdentity;
37
+ /** Options accepted by {@link createInProcessRuntime}. */
38
+ interface InProcessRuntimeOptions {
39
+ /**
40
+ * Enforce the secure-by-default RLS guard on {@link InProcessRuntime.createWriters}'s
41
+ * `database` — the same `enforceRls: true` production's generated
42
+ * `buildCtx` always passes. A no-op unless the schema is `.rls("required")`.
43
+ * @default true
44
+ */
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;
52
+ /**
53
+ * The `ctx.scheduler` the consumer installs, when it installs one. A
54
+ * scheduler wrapped with `withDeferredSchedules` has the jobs a mutation
55
+ * schedules held until its COMMIT and dropped on its ROLLBACK, exactly as the
56
+ * generated shard's `runMutationTransaction` does.
57
+ */
58
+ scheduler?: unknown;
59
+ /** The synchronous SQLite engine the store runs on. */
60
+ sql: SqlExec;
61
+ }
62
+ /** The engine-bound half of a function dispatch, shared by every identity view. */
63
+ interface InProcessRuntime {
64
+ /**
65
+ * The guarded `ctx.db` writer for one identity, plus the trusted, UNGUARDED
66
+ * writer behind it (`rawDatabase` — what production's admin/migration paths
67
+ * use). Both carry the per-table facade (`ctx.db.<table>`).
68
+ */
69
+ createWriters: (identity: ResolvedIdentity) => {
70
+ database: DatabaseWriter;
71
+ rawDatabase: DatabaseWriter;
72
+ };
73
+ /**
74
+ * Run `body` as one top-level entry: serialized behind every other entry that
75
+ * came through here, inside a BEGIN/COMMIT span that rolls back on a throw,
76
+ * with a fresh resource budget. Every mutation entry must use it; a read that
77
+ * must not observe another entry's uncommitted writes may use it too.
78
+ */
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;
85
+ }
86
+ /**
87
+ * Migrate `schema` onto `options.sql` and return the dispatch wiring around it.
88
+ * @param schema the app schema from `defineSchema`
89
+ * @param options the engine, plus the RLS and scheduler settings
90
+ * @returns the writer factory and the mutation transaction runner
91
+ */
92
+ declare const createInProcessRuntime: (schema: Schema, options: InProcessRuntimeOptions) => InProcessRuntime;
93
+ /**
94
+ * The kind of a registered function object, or `undefined` for anything else
95
+ * (an inline callback, a plain value).
96
+ * @param value the candidate reference
97
+ * @returns its kind, when it is a registered function
98
+ */
99
+ declare const registeredFunctionKind: (value: unknown) => FunctionKind | undefined;
100
+ /**
101
+ * Invoke a registered function's handler, refusing a reference of the wrong
102
+ * kind and — unless `allowInternal` — an `internal*` function, which is
103
+ * unreachable from the external RPC boundary in production.
104
+ * @param expected which kind of function the call site dispatches
105
+ * @param reference the registered function object
106
+ * @param reference.handler its handler, invoked with `(context, args)`
107
+ * @param context the `ctx` to hand the handler
108
+ * @param args the call's arguments (`{}` when absent)
109
+ * @param allowInternal whether this is a server-to-server (`ctx.run*`) dispatch
110
+ * @returns the handler's result
111
+ */
112
+ declare const runRegisteredFunction: (expected: FunctionKind, reference: {
113
+ handler: (context: unknown, args: never) => unknown;
114
+ }, context: unknown, args: unknown, allowInternal: boolean) => Promise<unknown>;
115
+ export { type FunctionKind, type InProcessIdentity, type InProcessRuntime, type InProcessRuntimeOptions, type ResolvedIdentity, createInProcessRuntime, registeredFunctionKind, resolveInProcessIdentity, runRegisteredFunction };
@@ -0,0 +1,115 @@
1
+ import { TransactionHeadroomTracker, SqlExec } from '@lunora/shard-engine';
2
+ import { D as DatabaseWriter, S as Schema } from "./packem_shared/types.d--zaGh3rX.js";
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
+ }
9
+ /** The kind of a registered Lunora function. */
10
+ type FunctionKind = "action" | "mutation" | "query";
11
+ /**
12
+ * A caller-supplied identity. `userId` is the subject a handler reads from
13
+ * `ctx.auth.userId`; every other field is returned from
14
+ * `ctx.auth.getIdentity()` (mirroring a decoded JWT's claims).
15
+ */
16
+ interface InProcessIdentity extends Record<string, unknown> {
17
+ userId?: null | string;
18
+ }
19
+ /** The `userId` + claims a dispatch runs under, after production's normalisation. */
20
+ interface ResolvedIdentity {
21
+ readonly claims: Record<string, unknown> | null;
22
+ readonly userId: null | string;
23
+ }
24
+ /**
25
+ * Reduce a caller-supplied {@link InProcessIdentity} to what production would
26
+ * actually hand a shard.
27
+ *
28
+ * Mirrors `@lunora/runtime`'s `create-worker.ts` identity forwarding: an identity
29
+ * whose `userId` is not a non-empty string is dropped to anonymous outright, and
30
+ * the forwarded claims are the identity MINUS `userId` (`null` when nothing is
31
+ * left), because the shard reads the subject from its own header and surfaces
32
+ * only the remaining claims through `ctx.auth.getIdentity()`.
33
+ * @param identity the caller-supplied identity, or `null` for anonymous
34
+ * @returns the identity production would forward
35
+ */
36
+ declare const resolveInProcessIdentity: (identity: InProcessIdentity | null) => ResolvedIdentity;
37
+ /** Options accepted by {@link createInProcessRuntime}. */
38
+ interface InProcessRuntimeOptions {
39
+ /**
40
+ * Enforce the secure-by-default RLS guard on {@link InProcessRuntime.createWriters}'s
41
+ * `database` — the same `enforceRls: true` production's generated
42
+ * `buildCtx` always passes. A no-op unless the schema is `.rls("required")`.
43
+ * @default true
44
+ */
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;
52
+ /**
53
+ * The `ctx.scheduler` the consumer installs, when it installs one. A
54
+ * scheduler wrapped with `withDeferredSchedules` has the jobs a mutation
55
+ * schedules held until its COMMIT and dropped on its ROLLBACK, exactly as the
56
+ * generated shard's `runMutationTransaction` does.
57
+ */
58
+ scheduler?: unknown;
59
+ /** The synchronous SQLite engine the store runs on. */
60
+ sql: SqlExec;
61
+ }
62
+ /** The engine-bound half of a function dispatch, shared by every identity view. */
63
+ interface InProcessRuntime {
64
+ /**
65
+ * The guarded `ctx.db` writer for one identity, plus the trusted, UNGUARDED
66
+ * writer behind it (`rawDatabase` — what production's admin/migration paths
67
+ * use). Both carry the per-table facade (`ctx.db.<table>`).
68
+ */
69
+ createWriters: (identity: ResolvedIdentity) => {
70
+ database: DatabaseWriter;
71
+ rawDatabase: DatabaseWriter;
72
+ };
73
+ /**
74
+ * Run `body` as one top-level entry: serialized behind every other entry that
75
+ * came through here, inside a BEGIN/COMMIT span that rolls back on a throw,
76
+ * with a fresh resource budget. Every mutation entry must use it; a read that
77
+ * must not observe another entry's uncommitted writes may use it too.
78
+ */
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;
85
+ }
86
+ /**
87
+ * Migrate `schema` onto `options.sql` and return the dispatch wiring around it.
88
+ * @param schema the app schema from `defineSchema`
89
+ * @param options the engine, plus the RLS and scheduler settings
90
+ * @returns the writer factory and the mutation transaction runner
91
+ */
92
+ declare const createInProcessRuntime: (schema: Schema, options: InProcessRuntimeOptions) => InProcessRuntime;
93
+ /**
94
+ * The kind of a registered function object, or `undefined` for anything else
95
+ * (an inline callback, a plain value).
96
+ * @param value the candidate reference
97
+ * @returns its kind, when it is a registered function
98
+ */
99
+ declare const registeredFunctionKind: (value: unknown) => FunctionKind | undefined;
100
+ /**
101
+ * Invoke a registered function's handler, refusing a reference of the wrong
102
+ * kind and — unless `allowInternal` — an `internal*` function, which is
103
+ * unreachable from the external RPC boundary in production.
104
+ * @param expected which kind of function the call site dispatches
105
+ * @param reference the registered function object
106
+ * @param reference.handler its handler, invoked with `(context, args)`
107
+ * @param context the `ctx` to hand the handler
108
+ * @param args the call's arguments (`{}` when absent)
109
+ * @param allowInternal whether this is a server-to-server (`ctx.run*`) dispatch
110
+ * @returns the handler's result
111
+ */
112
+ declare const runRegisteredFunction: (expected: FunctionKind, reference: {
113
+ handler: (context: unknown, args: never) => unknown;
114
+ }, context: unknown, args: unknown, allowInternal: boolean) => Promise<unknown>;
115
+ export { type FunctionKind, type InProcessIdentity, type InProcessRuntime, type InProcessRuntimeOptions, type ResolvedIdentity, createInProcessRuntime, registeredFunctionKind, resolveInProcessIdentity, runRegisteredFunction };
@@ -0,0 +1 @@
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-BOsY07vZ.mjs";import{bindTableFacade as S}from"./packem_shared/bindOrm-DjpQXKLX.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};