@prisma/orm-framework 8.0.0-rc.18-dev.27 → 8.0.0-rc.18-dev.29
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.
- package/dist/{apply-specifier-default-control-policy-Dq8t6SUs.d.mts → apply-specifier-default-control-policy-Dlz0iwnK.d.mts} +2 -2
- package/dist/apply-specifier-default-control-policy-Dlz0iwnK.d.mts.map +1 -0
- package/dist/{authoring-Bgq2xYhn.mjs → authoring-Cj8fyHRX.mjs} +2 -2
- package/dist/{authoring-Bgq2xYhn.mjs.map → authoring-Cj8fyHRX.mjs.map} +1 -1
- package/dist/{binder-BfzoRtNz-LGJyV1PO.d.mts → binder-BfzoRtNz-BKfkevTT.d.mts} +4 -4
- package/dist/{binder-BfzoRtNz-LGJyV1PO.d.mts.map → binder-BfzoRtNz-BKfkevTT.d.mts.map} +1 -1
- package/dist/{canonicalization-Cd9oGzy7-2SoDBziD.d.mts → canonicalization-CyrrXGmj-CeKUkht1.d.mts} +3 -3
- package/dist/{canonicalization-Cd9oGzy7-2SoDBziD.d.mts.map → canonicalization-CyrrXGmj-CeKUkht1.d.mts.map} +1 -1
- package/dist/components.d.mts +4 -4
- package/dist/components.mjs +4 -4
- package/dist/components__authoring.mjs +2 -2
- package/dist/components__control.d.mts +1 -1
- package/dist/components__control.mjs +2 -2
- package/dist/components__emission.d.mts +2 -2
- package/dist/components__runtime.d.mts +1 -1
- package/dist/components__runtime.mjs +1 -1
- package/dist/{config-types-B6jmUYbH.d.mts → config-types-EWAkvPlg.d.mts} +3 -3
- package/dist/{config-types-B6jmUYbH.d.mts.map → config-types-EWAkvPlg.d.mts.map} +1 -1
- package/dist/config.d.mts +1 -1
- package/dist/config__config-types.d.mts +1 -1
- package/dist/contract-authoring.d.mts +1 -1
- package/dist/contract-authoring.mjs +3 -3
- package/dist/{contract-types-Mp9HNgyy-zkcDkGuS.d.mts → contract-types-DEIEpzU_-DvAVuBr5.d.mts} +9 -3
- package/dist/contract-types-DEIEpzU_-DvAVuBr5.d.mts.map +1 -0
- package/dist/contract.d.mts +8 -8
- package/dist/contract.mjs +2 -2
- package/dist/contract__apply-specifier-default-control-policy.d.mts +1 -1
- package/dist/contract__enum-accessor.d.mts +1 -1
- package/dist/contract__hashing-utils.d.mts +1 -1
- package/dist/contract__hashing.d.mts +2 -2
- package/dist/contract__types.d.mts +3 -3
- package/dist/contract__types.mjs +2 -2
- package/dist/{control-CUHu82WN.d.mts → control-B8VnqrE0.d.mts} +4 -4
- package/dist/{control-CUHu82WN.d.mts.map → control-B8VnqrE0.d.mts.map} +1 -1
- package/dist/{control-Bv8UK63M-DSYx-1Xr.mjs → control-Bv8UK63M-CQqlgvYt.mjs} +2 -2
- package/dist/{control-Bv8UK63M-DSYx-1Xr.mjs.map → control-Bv8UK63M-CQqlgvYt.mjs.map} +1 -1
- package/dist/control-COKTlMDX.d.mts +1 -0
- package/dist/{control-C_zs63JQ-Drfjty0L.d.mts → control-C_zs63JQ-BjpDlKtD.d.mts} +2 -2
- package/dist/{control-C_zs63JQ-Drfjty0L.d.mts.map → control-C_zs63JQ-BjpDlKtD.d.mts.map} +1 -1
- package/dist/{control-GBn6rSAO.mjs → control-xgQMivcm.mjs} +2 -2
- package/dist/{control-GBn6rSAO.mjs.map → control-xgQMivcm.mjs.map} +1 -1
- package/dist/{declarations-DuSbyF44-Dmu71nd-.mjs → declarations-DuSbyF44-DXPe97O9.mjs} +2 -2
- package/dist/{declarations-DuSbyF44-Dmu71nd-.mjs.map → declarations-DuSbyF44-DXPe97O9.mjs.map} +1 -1
- package/dist/{emission-nLoTbaCU.d.mts → emission-D9fjPyAg.d.mts} +1 -1
- package/dist/{emission-types-CH6r1DQ8-BB_7dBvp.d.mts → emission-types-CH6r1DQ8-eg79TO6Y.d.mts} +2 -2
- package/dist/{emission-types-CH6r1DQ8-BB_7dBvp.d.mts.map → emission-types-CH6r1DQ8-eg79TO6Y.d.mts.map} +1 -1
- package/dist/{enum-accessor-GZPV-WpP.d.mts → enum-accessor-BUVBc6ZH.d.mts} +2 -2
- package/dist/{enum-accessor-GZPV-WpP.d.mts.map → enum-accessor-BUVBc6ZH.d.mts.map} +1 -1
- package/dist/errors.d.mts +4 -4
- package/dist/errors.mjs +3 -3
- package/dist/errors__control.d.mts +2 -2
- package/dist/errors__control.mjs +1 -1
- package/dist/errors__execution.d.mts +1 -1
- package/dist/errors__execution.mjs +1 -1
- package/dist/errors__migration.d.mts +1 -1
- package/dist/errors__migration.mjs +1 -1
- package/dist/{execution-Dya-n_dQ.d.mts → execution-DEujfQj7.d.mts} +3 -3
- package/dist/{execution-Dya-n_dQ.d.mts.map → execution-DEujfQj7.d.mts.map} +1 -1
- package/dist/{execution-CCaUAQue.mjs → execution-Jca11rjy.mjs} +2 -2
- package/dist/{execution-CCaUAQue.mjs.map → execution-Jca11rjy.mjs.map} +1 -1
- package/dist/{hashing-Bva28lrB.d.mts → hashing-D-DHz0zl.d.mts} +3 -3
- package/dist/{hashing-Bva28lrB.d.mts.map → hashing-D-DHz0zl.d.mts.map} +1 -1
- package/dist/{hashing-utils-ZiNLX0QQ.d.mts → hashing-utils-DiGHKd3b.d.mts} +2 -2
- package/dist/{hashing-utils-ZiNLX0QQ.d.mts.map → hashing-utils-DiGHKd3b.d.mts.map} +1 -1
- package/dist/{migration-D5r4nNRY.mjs → migration-DIM1Hl3K.mjs} +2 -2
- package/dist/{migration-D5r4nNRY.mjs.map → migration-DIM1Hl3K.mjs.map} +1 -1
- package/dist/{migration-DGDETB62.d.mts → migration-dimjwpNp.d.mts} +2 -2
- package/dist/{migration-DGDETB62.d.mts.map → migration-dimjwpNp.d.mts.map} +1 -1
- package/dist/{parse-BxcaGLV1-hxuk2zDI.mjs → parse-BxcaGLV1-DdAqqkvr.mjs} +2 -2
- package/dist/{parse-BxcaGLV1-hxuk2zDI.mjs.map → parse-BxcaGLV1-DdAqqkvr.mjs.map} +1 -1
- package/dist/{parse-CJtBvEYy-CT6L3Gsh.d.mts → parse-CJtBvEYy-CM5fFbro.d.mts} +2 -2
- package/dist/{parse-CJtBvEYy-CT6L3Gsh.d.mts.map → parse-CJtBvEYy-CM5fFbro.d.mts.map} +1 -1
- package/dist/psl-parser.d.mts +3 -3
- package/dist/psl-parser.mjs +3 -3
- package/dist/psl-parser__format.d.mts +1 -1
- package/dist/psl-parser__format.mjs +2 -2
- package/dist/psl-parser__interpret.d.mts +4 -4
- package/dist/psl-parser__interpret.mjs +1 -1
- package/dist/psl-parser__syntax.d.mts +1 -1
- package/dist/psl-parser__syntax.mjs +2 -2
- package/dist/psl-printer.mjs +1 -1
- package/dist/{runtime-CBIxeFGU.d.mts → runtime-CsMROQco.d.mts} +2 -2
- package/dist/{runtime-CBIxeFGU.d.mts.map → runtime-CsMROQco.d.mts.map} +1 -1
- package/dist/{runtime-DAB3uLpb.mjs → runtime-DSYSc98Y.mjs} +11 -7
- package/dist/runtime-DSYSc98Y.mjs.map +1 -0
- package/dist/{temporal-presets-woCv6gic-DW1VcyKs.mjs → temporal-presets-woCv6gic-CdzSAygr.mjs} +2 -2
- package/dist/{temporal-presets-woCv6gic-DW1VcyKs.mjs.map → temporal-presets-woCv6gic-CdzSAygr.mjs.map} +1 -1
- package/dist/{types-QyibIZST.mjs → types-B8ULzMAX.mjs} +9 -2
- package/dist/types-B8ULzMAX.mjs.map +1 -0
- package/dist/{types-C0eTDwgl.d.mts → types-BBb-tMcj.d.mts} +2 -2
- package/dist/{types-C0eTDwgl.d.mts.map → types-BBb-tMcj.d.mts.map} +1 -1
- package/package.json +15 -15
- package/dist/apply-specifier-default-control-policy-Dq8t6SUs.d.mts.map +0 -1
- package/dist/contract-types-Mp9HNgyy-zkcDkGuS.d.mts.map +0 -1
- package/dist/control-DScCIe85.d.mts +0 -1
- package/dist/runtime-DAB3uLpb.mjs.map +0 -1
- package/dist/types-QyibIZST.mjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-DAB3uLpb.mjs","names":["#options","#open","#held","#finalized","#record","#children","#slot","#everythingBeneathCommitted","#intercepted","#ended","#middleware","#parent","#endedResult","#runStartedAt","#source","#rowCount","#stats","#aStatementFailed","#acceptingChildren","#finalizedResult","#kind","#terminalName","#annotations"],"sources":["../../../../1-framework/1-core/framework-components/dist/runtime.mjs"],"sourcesContent":["import { n as runtimeError, t as isRuntimeError } from \"./runtime-error-BA9d7XjZ.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { canonicalStringify } from \"@internal/utils/canonical-stringify\";\n//#region src/execution/runtime-error.ts\n/**\n* Stable code emitted by the runtime when an in-flight `execute()`\n* is cancelled via the per-query `AbortSignal`. The envelope's\n* `details.phase` distinguishes where the abort was observed:\n*\n* - `'encode'` — abort fired during `encodeParams` (SQL) or\n* `resolveValue` (Mongo).\n* - `'decode'` — abort fired during `decodeRow` / `decodeField`.\n* - `'stream'` — abort fired between rows or before any codec call\n* (already-aborted at entry).\n* - `'beforeEncode'` / `'onRow'` — abort fired on entry to or during\n* the corresponding middleware phase\n* (cooperative cancellation per the param-transform seam).\n*/\nconst RUNTIME_ABORTED = \"RUNTIME.ABORTED\";\n/**\n* Construct a `RUNTIME.ABORTED` envelope. Phase distinguishes where the\n* abort was observed — codec call sites (`encode` / `decode` / `stream`)\n* or operation-specific middleware seams, as\n* enumerated on {@link RuntimeAbortedPhase}. Cause carries\n* `signal.reason` verbatim from the platform — native abort produces a\n* `DOMException`, explicit `controller.abort(reason)` produces whatever\n* the caller passed. No synthesis happens here.\n*/\nfunction runtimeAborted(phase, cause) {\n\tconst envelope = runtimeError(RUNTIME_ABORTED, `Operation aborted during ${phase}`, { phase });\n\treturn Object.assign(envelope, { cause });\n}\n//#endregion\n//#region src/annotations.ts\n/**\n* Defines a typed annotation handle.\n*\n* Two-step call form. The first step takes the `Payload` type argument\n* (TypeScript cannot infer `Payload` from anything in the options, so it\n* must be supplied explicitly); the second step takes the runtime options\n* and infers `Kinds` from the `applicableTo` array via a `const` type\n* parameter, so the operation kinds appear exactly once at the call site.\n*\n* @example\n* ```typescript\n* // Read-only annotation. Lane terminals like `db.User.first(...)` accept\n* // it; `db.User.create(...)` rejects it at the type level.\n* const cacheAnnotation = defineAnnotation<{ ttl?: number; skip?: boolean }>()({\n* namespace: 'cache',\n* applicableTo: ['read'],\n* }); // Kinds inferred as 'read'\n*\n* // Write-only annotation. Mirror image.\n* const auditAnnotation = defineAnnotation<{ actor: string }>()({\n* namespace: 'audit',\n* applicableTo: ['write'],\n* }); // Kinds inferred as 'write'\n*\n* // Annotation applicable to both kinds (e.g. tracing).\n* const otelAnnotation = defineAnnotation<{ traceId: string }>()({\n* namespace: 'otel',\n* applicableTo: ['read', 'write'],\n* }); // Kinds inferred as 'read' | 'write'\n* ```\n*\n* **Reserved namespaces.** See `DefineAnnotationOptions.namespace` for the\n* list of framework-internal namespaces (`codecs`, target-specific keys).\n* `defineAnnotation` does not structurally prevent a user from naming a\n* reserved namespace, but the framework makes no compatibility guarantee\n* about handles that do.\n*/\nfunction defineAnnotation() {\n\treturn (options) => {\n\t\tconst namespace = options.namespace;\n\t\tconst applicableTo = Object.freeze(new Set(options.applicableTo));\n\t\tfunction handle(value) {\n\t\t\treturn Object.freeze({\n\t\t\t\t__annotation: true,\n\t\t\t\tnamespace,\n\t\t\t\tvalue,\n\t\t\t\tapplicableTo\n\t\t\t});\n\t\t}\n\t\tfunction read(source) {\n\t\t\tconst stored = \"meta\" in source ? source.meta.annotations?.[namespace] : source.annotations.get(namespace);\n\t\t\tif (!isAnnotationValue(stored)) return;\n\t\t\tif (stored.namespace !== namespace) return;\n\t\t\treturn stored.value;\n\t\t}\n\t\treturn Object.freeze(Object.assign(handle, {\n\t\t\tnamespace,\n\t\t\tapplicableTo,\n\t\t\tread\n\t\t}));\n\t};\n}\n/**\n* Runtime applicability gate. Throws `RUNTIME.ANNOTATION_INAPPLICABLE` if\n* any annotation in `annotations` declares an `applicableTo` set that does\n* not include `kind`. Used by lane terminals (SQL DSL builders' `.build()`,\n* ORM `Collection` terminals) to fail closed when the type-level\n* `ValidAnnotations` gate is bypassed via cast / `any` / dynamic\n* invocation.\n*\n* Passes silently on:\n* - empty arrays\n* - annotations whose `applicableTo` includes `kind`\n*\n* Throws on:\n* - any annotation whose `applicableTo` does not include `kind`. The\n* error names the offending annotation's `namespace` and the\n* `terminalName` so users can locate the misuse.\n*\n* @example\n* ```typescript\n* // Inside an ORM read terminal:\n* assertAnnotationsApplicable(annotations, 'read', 'first');\n* ```\n*/\nfunction assertAnnotationsApplicable(annotations, kind, terminalName) {\n\tfor (const annotation of annotations) if (!annotation.applicableTo.has(kind)) throw runtimeError(\"RUNTIME.ANNOTATION_INAPPLICABLE\", `Annotation '${annotation.namespace}' is not applicable to '${kind}' operations (terminal: '${terminalName}'). The annotation declares applicableTo = [${Array.from(annotation.applicableTo).map((k) => `'${k}'`).join(\", \")}].`, {\n\t\tnamespace: annotation.namespace,\n\t\tterminalName,\n\t\tkind,\n\t\tapplicableTo: Array.from(annotation.applicableTo)\n\t});\n}\nconst noAnnotations = /* @__PURE__ */ new Map();\n/** The branded annotation values in a plan's `meta.annotations`, keyed by namespace. */\nfunction brandedAnnotations(annotations) {\n\tif (annotations === void 0) return noAnnotations;\n\tlet branded;\n\tfor (const [namespace, value] of Object.entries(annotations)) {\n\t\tif (!isAnnotationValue(value)) continue;\n\t\tbranded ??= /* @__PURE__ */ new Map();\n\t\tbranded.set(namespace, value);\n\t}\n\treturn branded ?? noAnnotations;\n}\n/**\n* Type guard for branded annotation values stored in `plan.meta.annotations`.\n*\n* Internal — used by `AnnotationHandle.read` to distinguish user\n* annotations (created by calling a handle returned from\n* `defineAnnotation(...)`) from framework-internal metadata that may\n* happen to live under the same namespace key.\n*/\nfunction isAnnotationValue(value) {\n\tif (value === null || typeof value !== \"object\") return false;\n\treturn value.__annotation === true;\n}\n//#endregion\n//#region src/execution/activity-lifecycle.ts\nconst resolved = Promise.resolve();\n/** The children of a transaction or a client activity: which are open, and which have ended and wait to be finalized. */\nvar ActivityChildren = class {\n\t#options;\n\t#held = [];\n\t#open = 0;\n\t#finalized;\n\tconstructor(options) {\n\t\tthis.#options = options;\n\t}\n\t/** The children that have started and not ended. */\n\tget open() {\n\t\treturn this.#open;\n\t}\n\tadd(child) {\n\t\tconst options = this.#options;\n\t\tconst entry = options.inTransaction && options.holdFinishedChildren ? {\n\t\t\tchild,\n\t\t\tended: false\n\t\t} : void 0;\n\t\tif (entry !== void 0) this.#held.push(entry);\n\t\tthis.#open++;\n\t\tlet ended = false;\n\t\treturn {\n\t\t\tstatementFailed: options.statementFailed,\n\t\t\ttransactionAcceptsChildren: options.transactionAcceptsChildren,\n\t\t\tended: async (own) => {\n\t\t\t\tif (ended) return;\n\t\t\t\tended = true;\n\t\t\t\tthis.#open--;\n\t\t\t\tif (!options.inTransaction) {\n\t\t\t\t\toptions.childFinalized(own);\n\t\t\t\t\tawait child.finalize(own);\n\t\t\t\t} else if (this.#finalized !== void 0) await child.finalize(this.#finalized);\n\t\t\t\telse if (entry !== void 0) entry.ended = true;\n\t\t\t}\n\t\t};\n\t}\n\t/** Finalizes the children that have ended, in start order, with `result`; a child that ends later is finalized with it then. `undefined` when no ended child waited. */\n\tfinalize(result) {\n\t\tif (this.#finalized !== void 0) return void 0;\n\t\tthis.#finalized = result;\n\t\tconst held = this.#held.splice(0);\n\t\tif (held.length === 0) return void 0;\n\t\treturn (async () => {\n\t\t\tfor (const { child, ended } of held) if (ended) await child.finalize(result);\n\t\t})();\n\t}\n};\nfunction notAcceptingChildrenError(parent, reason) {\n\treturn runtimeError(\"RUNTIME.ACTIVITY_NOT_ACCEPTING_CHILDREN\", `An activity was started beneath ${parent.kind === \"transaction\" ? \"a transaction\" : `a '${parent.kind}' activity`} ${parent.kind === \"transaction\" ? \"that no longer accepts children: its commit() or rollback() has been called\" : reason === \"parent\" ? \"that has ended\" : \"whose transaction no longer accepts children\"}`, {\n\t\tparentKind: parent.kind,\n\t\tparentId: parent.id\n\t});\n}\nfunction createStateStore() {\n\tlet states;\n\treturn {\n\t\tstate(key) {\n\t\t\tstates ??= /* @__PURE__ */ new Map();\n\t\t\tlet state = states.get(key);\n\t\t\tif (state === void 0) {\n\t\t\t\tstate = {};\n\t\t\t\tstates.set(key, state);\n\t\t\t}\n\t\t\treturn state;\n\t\t},\n\t\tclear() {\n\t\t\tstates = void 0;\n\t\t}\n\t};\n}\nfunction hooksOf(middleware) {\n\tconst hooks = {\n\t\tanyStarted: false,\n\t\tanyEnded: false,\n\t\tanyFinalized: false\n\t};\n\tfor (const mw of middleware) {\n\t\thooks.anyStarted ||= mw.activityStarted !== void 0;\n\t\thooks.anyEnded ||= mw.activityEnded !== void 0;\n\t\thooks.anyFinalized ||= mw.activityFinalized !== void 0;\n\t}\n\treturn hooks;\n}\nfunction createActivityRecord(middleware, activity, fields, parent) {\n\tconst store = createStateStore();\n\tlet finalized = false;\n\tlet started = middleware.length;\n\tconst ctx = contextBeneath(fields, parent, store);\n\tconst { anyStarted, anyEnded, anyFinalized } = hooksOf(middleware);\n\treturn {\n\t\tactivity,\n\t\tctx,\n\t\tstarted() {\n\t\t\tif (!anyStarted) return resolved;\n\t\t\treturn (async () => {\n\t\t\t\tfor (let index = 0; index < middleware.length; index++) {\n\t\t\t\t\tconst mw = middleware[index];\n\t\t\t\t\tif (!mw?.activityStarted) continue;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait mw.activityStarted(activity, ctx);\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tstarted = index + 1;\n\t\t\t\t\t\tthrow error;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})();\n\t\t},\n\t\tended(result) {\n\t\t\tif (!anyEnded) return void 0;\n\t\t\treturn (async () => {\n\t\t\t\tlet firstError;\n\t\t\t\tfor (let index = 0; index < started; index++) {\n\t\t\t\t\tconst mw = middleware[index];\n\t\t\t\t\tif (!mw?.activityEnded) continue;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait mw.activityEnded(activity, result, ctx);\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tif (result.outcome === \"succeeded\") firstError ??= { error };\n\t\t\t\t\t\telse logHookError(ctx, \"middleware.activityEnded.error\", mw.name, error);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (firstError !== void 0) throw firstError.error;\n\t\t\t})();\n\t\t},\n\t\tfinalize(result) {\n\t\t\tif (finalized) return resolved;\n\t\t\tfinalized = true;\n\t\t\tif (!anyFinalized) {\n\t\t\t\tstore.clear();\n\t\t\t\treturn resolved;\n\t\t\t}\n\t\t\treturn (async () => {\n\t\t\t\tfor (let index = 0; index < started; index++) {\n\t\t\t\t\tconst mw = middleware[index];\n\t\t\t\t\tif (!mw?.activityFinalized) continue;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait mw.activityFinalized(activity, result, ctx);\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tlogHookError(ctx, \"middleware.activityFinalized.error\", mw.name, error);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tstore.clear();\n\t\t\t})();\n\t\t}\n\t};\n}\n/**\n* The context of work that belongs to no activity but runs beneath `parent`, such as compiling a plan outside any statement: `parent` and `inTransaction()` as a child of `parent` would have them, and state of its own.\n*/\nfunction createContextBeneath(fields, parent) {\n\treturn contextBeneath(fields, parent, createStateStore());\n}\nfunction contextBeneath(fields, parent, store) {\n\tconst parentCtx = parent?.ctx;\n\tconst parentIsTransaction = parent?.activity.kind === \"transaction\";\n\treturn blindCast({\n\t\t...fields,\n\t\tparent: parentCtx,\n\t\tstate: store.state,\n\t\tinTransaction: () => parentIsTransaction || (parentCtx?.inTransaction() ?? false)\n\t});\n}\nfunction logHookError(ctx, event, middleware, error) {\n\ttry {\n\t\tctx.log.error({\n\t\t\tevent,\n\t\t\tmiddleware,\n\t\t\terror\n\t\t});\n\t} catch {}\n}\n/**\n* Ends an activity: its `activityEnded` hooks, then its finalization, which its parent holds or performs, or which happens at once with `own` when it has no parent. The finalization runs even when an `activityEnded` hook fails the activity; that error is rethrown afterwards.\n*/\nfunction endActivity(record, result, own, slot, finalize) {\n\tconst ended = record.ended(result);\n\tif (ended === void 0) return slot === void 0 ? finalize(own) : slot.ended(own);\n\treturn finishAfterEndedHooks(ended, own, slot, finalize);\n}\nasync function finishAfterEndedHooks(ended, own, slot, finalize) {\n\tlet endedError;\n\ttry {\n\t\tawait ended;\n\t} catch (error) {\n\t\tendedError = { error };\n\t}\n\tif (slot === void 0) await finalize(own);\n\telse await slot.ended(own);\n\tif (endedError !== void 0) throw endedError.error;\n}\n//#endregion\n//#region src/execution/async-iterable-result.ts\nvar AsyncIterableResult = class {\n\tgenerator;\n\tconsumed = false;\n\tconsumedBy;\n\tbufferedArrayPromise;\n\tconstructor(generator) {\n\t\tthis.generator = generator;\n\t}\n\t[Symbol.asyncIterator]() {\n\t\tif (this.consumed) throw runtimeError(\"RUNTIME.ITERATOR_CONSUMED\", `AsyncIterableResult iterator has already been consumed via ${this.consumedBy === \"bufferedArray\" ? \"toArray()/then()\" : \"for-await loop\"}. Each AsyncIterableResult can only be iterated once.`, {\n\t\t\tconsumedBy: this.consumedBy,\n\t\t\tsuggestion: this.consumedBy === \"bufferedArray\" ? \"If you need to iterate multiple times, store the results from toArray() in a variable and reuse that.\" : \"If you need to iterate multiple times, use toArray() to collect all results first.\"\n\t\t});\n\t\tthis.consumed = true;\n\t\tthis.consumedBy = \"iterator\";\n\t\treturn this.generator;\n\t}\n\ttoArray() {\n\t\tif (this.consumedBy === \"iterator\") return Promise.reject(runtimeError(\"RUNTIME.ITERATOR_CONSUMED\", \"AsyncIterableResult iterator has already been consumed via for-await loop. Each AsyncIterableResult can only be iterated once.\", {\n\t\t\tconsumedBy: this.consumedBy,\n\t\t\tsuggestion: \"The iterator was already consumed by a for-await loop. Use toArray() or await the result before iterating.\"\n\t\t}));\n\t\tif (this.bufferedArrayPromise) return this.bufferedArrayPromise;\n\t\tthis.consumed = true;\n\t\tthis.consumedBy = \"bufferedArray\";\n\t\tthis.bufferedArrayPromise = (async () => {\n\t\t\tconst out = [];\n\t\t\tfor await (const item of this.generator) out.push(item);\n\t\t\treturn out;\n\t\t})();\n\t\treturn this.bufferedArrayPromise;\n\t}\n\tasync first() {\n\t\treturn (await this.toArray())[0] ?? null;\n\t}\n\tasync firstOrThrow() {\n\t\tconst row = await this.first();\n\t\tif (row === null) throw runtimeError(\"RUNTIME.NO_ROWS\", \"Expected at least one row, but none were returned\", {});\n\t\treturn row;\n\t}\n\tthen(onfulfilled, onrejected) {\n\t\treturn this.toArray().then(onfulfilled, onrejected);\n\t}\n};\n//#endregion\n//#region src/execution/client-activity.ts\n/**\n* Starts a client activity: its `activityStarted` hooks, then each `intercept.onActivity` handler in registration order until one returns a result. When a hook or a handler throws, the activity ends `failed`, is finalized, and the error is rethrown. Rejects at once, running no hook, when `kind` has no hyphen (such as `statement` or `transaction`) or when `parent` no longer accepts children.\n*/\nasync function startClientActivity(activity, options) {\n\tconst kind = activity.kind;\n\tif (!kind.includes(\"-\")) throw runtimeError(\"RUNTIME.ACTIVITY_KIND_RESERVED\", `A client activity kind contains a hyphen, such as 'orm-call', and '${kind}' does not. Kinds without one, such as 'statement' and 'transaction', belong to the runtime.`, { kind });\n\tconst run = new ClientActivityRunImpl(activity, options);\n\ttry {\n\t\tawait run.start();\n\t} catch (error) {\n\t\tawait run.finish({\n\t\t\toutcome: \"failed\",\n\t\t\tsource: \"client\"\n\t\t});\n\t\tthrow error;\n\t}\n\tfor (const mw of options.middleware) {\n\t\tconst intercept = mw.intercept;\n\t\tif (intercept?.onActivity === void 0) continue;\n\t\tlet intercepted;\n\t\ttry {\n\t\t\tintercepted = await intercept.onActivity(run.activity, run.ctx);\n\t\t} catch (error) {\n\t\t\tawait run.finish({\n\t\t\t\toutcome: \"failed\",\n\t\t\t\tsource: \"middleware\"\n\t\t\t});\n\t\t\tthrow error;\n\t\t}\n\t\tif (intercepted === void 0) continue;\n\t\trun.ctx.log.debug?.({\n\t\t\tevent: \"middleware.intercept.onActivity\",\n\t\t\tmiddleware: mw.name\n\t\t});\n\t\trun.intercept(intercepted.result);\n\t\tbreak;\n\t}\n\treturn run;\n}\nvar ClientActivityRunImpl = class {\n\tactivity;\n\tctx;\n\t#record;\n\t#children;\n\t#slot;\n\t#intercepted;\n\t#ended = false;\n\t#everythingBeneathCommitted = true;\n\tconstructor(activity, options) {\n\t\tconst computeContentHash = activity.contentHash;\n\t\tlet contentHash;\n\t\tlet id;\n\t\tthis.activity = {\n\t\t\tget id() {\n\t\t\t\tid ??= crypto.randomUUID();\n\t\t\t\treturn id;\n\t\t\t},\n\t\t\tkind: activity.kind,\n\t\t\tcontentHash: () => {\n\t\t\t\tcontentHash ??= computeContentHash();\n\t\t\t\treturn contentHash;\n\t\t\t},\n\t\t\tannotations: activity.annotations ?? brandedAnnotations(void 0)\n\t\t};\n\t\tthis.#record = createActivityRecord(options.middleware, this.activity, options.context, options.parent);\n\t\tthis.ctx = this.#record.ctx;\n\t\tthis.#children = new ActivityChildren({\n\t\t\tinTransaction: this.ctx.inTransaction(),\n\t\t\tholdFinishedChildren: options.holdFinishedChildren,\n\t\t\tstatementFailed: () => this.#slot?.statementFailed(),\n\t\t\ttransactionAcceptsChildren: () => this.#slot?.transactionAcceptsChildren() ?? true,\n\t\t\tchildFinalized: (result) => {\n\t\t\t\tif (result.outcome !== \"committed\") this.#everythingBeneathCommitted = false;\n\t\t\t}\n\t\t});\n\t\tthis.#slot = options.parent?.adopt(this);\n\t}\n\tget intercepted() {\n\t\treturn this.#intercepted;\n\t}\n\tstart() {\n\t\treturn this.#record.started();\n\t}\n\tintercept(result) {\n\t\tthis.#intercepted = { result: blindCast(result) };\n\t}\n\tacceptsChildren() {\n\t\treturn !this.#ended && (this.#slot?.transactionAcceptsChildren() ?? true);\n\t}\n\tassertAcceptsChildren() {\n\t\tif (this.#ended) throw notAcceptingChildrenError(this.activity, \"parent\");\n\t\tif (!(this.#slot?.transactionAcceptsChildren() ?? true)) throw notAcceptingChildrenError(this.activity, \"transaction\");\n\t}\n\tadopt(child) {\n\t\tthis.assertAcceptsChildren();\n\t\treturn this.#children.add(child);\n\t}\n\tend(end) {\n\t\tif (this.#ended) return Promise.reject(runtimeError(\"RUNTIME.ACTIVITY_ALREADY_ENDED\", `The '${this.activity.kind}' activity has already ended`, {\n\t\t\tkind: this.activity.kind,\n\t\t\tid: this.activity.id\n\t\t}));\n\t\tconst openChildren = this.#children.open;\n\t\tif (openChildren > 0) return this.finish({\n\t\t\toutcome: \"failed\",\n\t\t\tsource: \"client\"\n\t\t}).then(() => {\n\t\t\tthrow runtimeError(\"RUNTIME.ACTIVITY_CHILDREN_OPEN\", `The '${this.activity.kind}' activity ended while ${openChildren} ${openChildren === 1 ? \"activity\" : \"activities\"} beneath it had not ended`, {\n\t\t\t\tkind: this.activity.kind,\n\t\t\t\tid: this.activity.id,\n\t\t\t\topenChildren\n\t\t\t});\n\t\t});\n\t\tconst intercepted = this.#intercepted;\n\t\tif (end.result === void 0 && intercepted !== void 0) return this.finish({\n\t\t\toutcome: end.outcome,\n\t\t\tsource: \"middleware\",\n\t\t\tresult: intercepted.result\n\t\t});\n\t\treturn this.finish({\n\t\t\toutcome: end.outcome,\n\t\t\tsource: \"client\",\n\t\t\tresult: end.result\n\t\t});\n\t}\n\tfinish(ended) {\n\t\tthis.#ended = true;\n\t\tconst { kind } = this.activity;\n\t\tconst result = ended.result === void 0 ? {\n\t\t\tkind,\n\t\t\toutcome: ended.outcome,\n\t\t\tsource: ended.source\n\t\t} : {\n\t\t\tkind,\n\t\t\toutcome: ended.outcome,\n\t\t\tsource: ended.source,\n\t\t\tresult: ended.result\n\t\t};\n\t\tconst own = { outcome: ended.outcome === \"succeeded\" && this.#everythingBeneathCommitted ? \"committed\" : \"unknown\" };\n\t\treturn endActivity(this.#record, result, own, this.#slot, (finalized) => this.finalize(finalized));\n\t}\n\tfinalize(result) {\n\t\tconst children = this.#children.finalize(result);\n\t\treturn children === void 0 ? this.#record.finalize(result) : children.then(() => this.#record.finalize(result));\n\t}\n};\n//#endregion\n//#region src/execution/mutation-defaults.ts\n/** Registers every generator the contributors provide, by id. Two contributors providing one id is an error naming both. */\nfunction collectMutationDefaultGenerators(contributors) {\n\tconst generators = /* @__PURE__ */ new Map();\n\tconst owners = /* @__PURE__ */ new Map();\n\tfor (const contributor of contributors) {\n\t\tconst nextGenerators = contributor.mutationDefaultGenerators?.() ?? [];\n\t\tfor (const generator of nextGenerators) {\n\t\t\tconst existingOwner = owners.get(generator.id);\n\t\t\tif (existingOwner !== void 0) throw runtimeError(\"RUNTIME.DUPLICATE_MUTATION_DEFAULT_GENERATOR\", `Duplicate mutation default generator '${generator.id}'.`, {\n\t\t\t\tid: generator.id,\n\t\t\t\texistingOwner,\n\t\t\t\tincomingOwner: contributor.id\n\t\t\t});\n\t\t\tgenerators.set(generator.id, generator);\n\t\t\towners.set(generator.id, contributor.id);\n\t\t}\n\t}\n\treturn generators;\n}\n/** Fails when the contract's mutation defaults name a generator the registry does not hold, listing every missing id and the fields that need it. */\nfunction assertMutationDefaultGeneratorsAvailable(execution, generatorRegistry) {\n\tconst defaults = execution?.mutations.defaults ?? [];\n\tif (defaults.length === 0) return;\n\tconst fieldsById = /* @__PURE__ */ new Map();\n\tfor (const mutationDefault of defaults) {\n\t\tconst phaseIds = new Set([mutationDefault.onCreate, mutationDefault.onUpdate].flatMap((phase) => phase?.kind === \"generator\" && !generatorRegistry.has(phase.id) ? [phase.id] : []));\n\t\tfor (const id of phaseIds) {\n\t\t\tconst fields = fieldsById.get(id) ?? [];\n\t\t\tfields.push(`${mutationDefault.ref.entry}.${mutationDefault.ref.field}`);\n\t\t\tfieldsById.set(id, fields);\n\t\t}\n\t}\n\tif (fieldsById.size === 0) return;\n\tconst ids = [...fieldsById.keys()];\n\tconst needs = [...fieldsById].map(([id, fields]) => `'${id}' for ${listInProse(fields)}`);\n\tthrow runtimeError(\"RUNTIME.MUTATION_DEFAULT_GENERATOR_MISSING\", `${ids.length === 1 ? `Contract requires mutation default generator ${needs[0]}, but no runtime component in the execution stack provides it.` : `Contract requires mutation default generators ${listInProse(needs)}, but no runtime component in the execution stack provides them.`} ${WHERE_GENERATORS_COME_FROM}`, {\n\t\tids,\n\t\tfields: [...fieldsById.values()].flat()\n\t});\n}\nconst WHERE_GENERATORS_COME_FROM = \"Built-in generators such as 'timestampNow' come from the database adapter's runtime descriptor, and others from the extension pack that defines them; include that component in the execution stack.\";\nfunction listInProse(items) {\n\treturn items.length > 1 ? `${items.slice(0, -1).join(\", \")} and ${items.at(-1)}` : items.join(\"\");\n}\nfunction computeExecutionDefaultValue(spec, generatorRegistry) {\n\tconst generator = generatorRegistry.get(spec.id);\n\tif (!generator) throw runtimeError(\"RUNTIME.MUTATION_DEFAULT_GENERATOR_MISSING\", `Contract references mutation default generator '${spec.id}' but no runtime component in the execution stack provides it. ${WHERE_GENERATORS_COME_FROM}`, { id: spec.id });\n\treturn generator.generate(spec.params);\n}\n/**\n* The defaults to write for one record: for each mutation default of the entry and namespace whose phase matches `op`, the generated value of every field the values do not carry. An update with no keys gets none.\n*/\nfunction applyMutationDefaults(execution, generatorRegistry, options) {\n\tconst defaults = execution?.mutations.defaults ?? [];\n\tif (defaults.length === 0) return [];\n\tconst isEmptyUpdate = options.op === \"update\" && Object.keys(options.values).length === 0;\n\tconst applied = [];\n\tconst appliedFields = /* @__PURE__ */ new Set();\n\tconst rowCache = /* @__PURE__ */ new Map();\n\tfor (const mutationDefault of defaults) {\n\t\tif (mutationDefault.ref.entry !== options.entry) continue;\n\t\tif (mutationDefault.ref.namespace !== options.namespace) continue;\n\t\tconst defaultSpec = options.op === \"create\" ? mutationDefault.onCreate : mutationDefault.onUpdate;\n\t\tif (!defaultSpec) continue;\n\t\tif (isEmptyUpdate) continue;\n\t\tconst fieldName = mutationDefault.ref.field;\n\t\tif (Object.hasOwn(options.values, fieldName) || appliedFields.has(fieldName)) continue;\n\t\tapplied.push({\n\t\t\tfield: fieldName,\n\t\t\tvalue: resolveScopedValue(defaultSpec, generatorRegistry, rowCache, options.defaultValueCache)\n\t\t});\n\t\tappliedFields.add(fieldName);\n\t}\n\treturn applied;\n}\nfunction resolveScopedValue(spec, generatorRegistry, rowCache, queryCache) {\n\tconst cache = scopedCache(generatorRegistry.get(spec.id)?.stability, rowCache, queryCache);\n\tif (!cache) return computeExecutionDefaultValue(spec, generatorRegistry);\n\tconst key = spec.params === void 0 ? spec.id : `${spec.id} ${canonicalStringify(spec.params)}`;\n\tif (cache.has(key)) return cache.get(key);\n\tconst value = computeExecutionDefaultValue(spec, generatorRegistry);\n\tcache.set(key, value);\n\treturn value;\n}\nfunction scopedCache(stability, rowCache, queryCache) {\n\tswitch (stability) {\n\t\tcase \"row\": return rowCache;\n\t\tcase \"query\": return queryCache;\n\t\tdefault: return;\n\t}\n}\n//#endregion\n//#region src/execution/race-against-abort.ts\n/**\n* Throw a phase-tagged `RUNTIME.ABORTED` envelope if the supplied\n* context is already aborted at the precheck site. Centralises the\n* `if (ctx.signal?.aborted) throw runtimeAborted(...)` pattern that\n* every codec dispatch site (and the `beforeEncode` middleware phase)\n* repeats. Accepts both the framework `CodecCallContext` and the\n* `ActivityContext`; both expose `signal?: AbortSignal`.\n*/\nfunction checkAborted(ctx, phase) {\n\tif (ctx.signal?.aborted) throw runtimeAborted(phase, ctx.signal.reason);\n}\n/**\n* Race a per-cell `Promise.all` (or any other in-flight work promise) against\n* the supplied abort signal so the runtime returns `RUNTIME.ABORTED` promptly\n* even when codec bodies ignore the signal. In-flight bodies that ignore the\n* signal are abandoned and run to completion in the background — the\n* cooperative-cancellation contract documented in ADR 204.\n*\n* Call sites still SHOULD pre-check `signal.aborted` and short-circuit with\n* a phase-tagged `RUNTIME.ABORTED` envelope before invoking this helper —\n* that path is the canonical \"aborted at entry\" surface and avoids\n* scheduling the work promise. As a defensive belt-and-braces, this helper\n* also handles the already-aborted case internally: `AbortSignal` does not\n* replay past abort events to listeners registered after the abort, so we\n* inspect `signal.aborted` synchronously and reject with the sentinel\n* before installing the listener. The rejection is still attributed to the\n* abort path via the sentinel-identity check.\n*\n* Distinguishing the rejection source is load-bearing for AC-ERR4\n* (`RUNTIME.ENCODE_FAILED` / `RUNTIME.DECODE_FAILED` pass through unchanged).\n* The semantically equivalent `abortable(signal)` helper in\n* `@internal/utils` rejects with `signal.reason ?? new DOMException(...)`,\n* which is not stably distinguishable from a codec-thrown error by identity\n* alone (a fresh fallback DOMException is allocated per call). We instead\n* track abort attribution with a unique sentinel: only the `onAbort` listener\n* installed here ever rejects with the sentinel, so an `error === sentinel`\n* identity check after the race is unambiguous.\n*\n* Lives in `framework-components` (rather than the SQL family, where it\n* originated in m2) so every family runtime that needs cooperative\n* cancellation around a codec-dispatch `Promise.all` (SQL encode + decode\n* today, Mongo encode in m3) shares the same attribution logic.\n*/\nasync function raceAgainstAbort(work, signal, phase) {\n\tif (signal === void 0) return await work;\n\tconst sentinel = { reason: void 0 };\n\tlet onAbort;\n\tconst abortPromise = new Promise((_, reject) => {\n\t\tif (signal.aborted) {\n\t\t\tsentinel.reason = signal.reason;\n\t\t\treject(sentinel);\n\t\t\treturn;\n\t\t}\n\t\tonAbort = () => {\n\t\t\tsentinel.reason = signal.reason;\n\t\t\treject(sentinel);\n\t\t};\n\t\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\t});\n\ttry {\n\t\treturn await Promise.race([work, abortPromise]);\n\t} catch (error) {\n\t\tif (error === sentinel) throw runtimeAborted(phase, sentinel.reason);\n\t\tthrow error;\n\t} finally {\n\t\tif (onAbort) signal.removeEventListener(\"abort\", onAbort);\n\t}\n}\n//#endregion\n//#region src/execution/run-with-middleware.ts\n/**\n* Runs one `query()` statement as an activity. The activity starts on the first `next()`: `activityStarted`, then `body`'s rows, then `activityEnded` and, unless a transaction holds it, `activityFinalized`. Each fires exactly once, whether the body succeeds, throws (`failed`) or the caller stops reading (`stopped`). When the parent no longer accepts work, the first `next()` rejects and no hook runs.\n*/\nfunction streamStatement(options, body) {\n\treturn { [Symbol.asyncIterator]() {\n\t\tlet thrownByCaller;\n\t\tconst generator = streamStatementRows(options, body, (error) => thrownByCaller !== void 0 && thrownByCaller.error === error);\n\t\treturn {\n\t\t\tnext: () => generator.next(),\n\t\t\treturn: () => generator.return(void 0),\n\t\t\tthrow: (error) => {\n\t\t\t\tthrownByCaller = { error };\n\t\t\t\treturn generator.throw(error);\n\t\t\t}\n\t\t};\n\t} };\n}\nasync function* streamStatementRows(options, body, isThrownByCaller) {\n\tconst statement = new StatementActivityRunImpl(options, \"rows\");\n\tstatement.attach();\n\tlet outcome = \"stopped\";\n\ttry {\n\t\tawait statement.start();\n\t\tyield* body(statement);\n\t\toutcome = \"succeeded\";\n\t} catch (error) {\n\t\tif (!isThrownByCaller(error)) outcome = \"failed\";\n\t\tthrow error;\n\t} finally {\n\t\tawait statement.end(outcome);\n\t}\n}\n/**\n* Runs one `execute()` statement as an activity: `activityStarted`, then `body`, then `activityEnded` and, unless a transaction holds it, `activityFinalized`, each exactly once. When the parent no longer accepts work, it rejects and no hook runs.\n*/\nasync function executeStatement(options, body) {\n\tconst statement = new StatementActivityRunImpl(options, \"stats\");\n\tstatement.attach();\n\tlet outcome = \"failed\";\n\ttry {\n\t\tawait statement.start();\n\t\tconst stats = await body(statement);\n\t\toutcome = \"succeeded\";\n\t\treturn stats;\n\t} finally {\n\t\tawait statement.end(outcome);\n\t}\n}\nvar StatementActivityRunImpl = class {\n\tactivity;\n\tctx;\n\t#middleware;\n\t#parent;\n\t#record;\n\t#slot;\n\t#runStartedAt;\n\t#source = \"driver\";\n\t#rowCount = 0;\n\t#stats;\n\tconstructor(options, returns) {\n\t\tconst { plan } = options;\n\t\tlet annotations;\n\t\tthis.activity = {\n\t\t\tid: crypto.randomUUID(),\n\t\t\tkind: \"statement\",\n\t\t\treturns,\n\t\t\tplan,\n\t\t\tget annotations() {\n\t\t\t\tannotations ??= brandedAnnotations(plan.meta.annotations);\n\t\t\t\treturn annotations;\n\t\t\t}\n\t\t};\n\t\tthis.#middleware = options.middleware;\n\t\tthis.#parent = options.parent;\n\t\tthis.#record = createActivityRecord(options.middleware, this.activity, options.context, options.parent);\n\t\tthis.ctx = this.#record.ctx;\n\t}\n\t/** Adopts the statement into its parent; throws when the parent no longer accepts work. */\n\tattach() {\n\t\tthis.#slot = this.#parent?.adopt(this.#record);\n\t}\n\tstart() {\n\t\treturn this.#record.started();\n\t}\n\tend(outcome) {\n\t\tif (outcome === \"failed\") this.#slot?.statementFailed();\n\t\treturn endActivity(this.#record, this.#endedResult(outcome), { outcome: outcome === \"succeeded\" ? \"committed\" : \"unknown\" }, this.#slot, this.#record.finalize);\n\t}\n\tasync beforeEncode(draft, params) {\n\t\tfor (const mw of this.#middleware) {\n\t\t\tif (!mw.beforeEncode) continue;\n\t\t\tcheckAborted(this.ctx, \"beforeEncode\");\n\t\t\tconst work = mw.beforeEncode(draft, this.ctx, params);\n\t\t\tif (work !== void 0) await raceAgainstAbort(Promise.resolve(work), this.ctx.signal, \"beforeEncode\");\n\t\t}\n\t}\n\tasync *runQuery(exec, runDriver) {\n\t\tthis.#runStartedAt = Date.now();\n\t\tlet rows;\n\t\tfor (const mw of this.#middleware) {\n\t\t\tconst intercept = mw.intercept;\n\t\t\tif (intercept?.onQuery === void 0) continue;\n\t\t\tthis.#source = \"middleware\";\n\t\t\tconst result = await intercept.onQuery(exec, this.ctx);\n\t\t\tif (result === void 0) {\n\t\t\t\tthis.#source = \"driver\";\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tthis.ctx.log.debug?.({\n\t\t\t\tevent: \"middleware.intercept.onQuery\",\n\t\t\t\tmiddleware: mw.name\n\t\t\t});\n\t\t\trows = blindCast(result.rows);\n\t\t\tbreak;\n\t\t}\n\t\tif (rows === void 0) {\n\t\t\tfor await (const row of runDriver()) {\n\t\t\t\tfor (const mw of this.#middleware) if (mw.onRow) await mw.onRow(blindCast(row), exec, this.ctx);\n\t\t\t\tthis.#rowCount++;\n\t\t\t\tyield row;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tfor await (const row of rows) {\n\t\t\tthis.#rowCount++;\n\t\t\tyield row;\n\t\t}\n\t}\n\tasync runExecute(exec, runDriver) {\n\t\tthis.#runStartedAt = Date.now();\n\t\tfor (const mw of this.#middleware) {\n\t\t\tconst intercept = mw.intercept;\n\t\t\tif (intercept?.onExecute === void 0) continue;\n\t\t\tthis.#source = \"middleware\";\n\t\t\tconst result = await intercept.onExecute(exec, this.ctx);\n\t\t\tif (result === void 0) {\n\t\t\t\tthis.#source = \"driver\";\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tthis.ctx.log.debug?.({\n\t\t\t\tevent: \"middleware.intercept.onExecute\",\n\t\t\t\tmiddleware: mw.name\n\t\t\t});\n\t\t\tthis.#stats = result.stats;\n\t\t\treturn result.stats;\n\t\t}\n\t\tthis.#stats = await runDriver();\n\t\treturn this.#stats;\n\t}\n\t#endedResult(outcome) {\n\t\tconst base = {\n\t\t\tkind: \"statement\",\n\t\t\toutcome,\n\t\t\tlatencyMs: this.#runStartedAt === void 0 ? 0 : Date.now() - this.#runStartedAt,\n\t\t\tsource: this.#source\n\t\t};\n\t\tif (this.activity.returns === \"rows\") return {\n\t\t\t...base,\n\t\t\treturns: \"rows\",\n\t\t\trowCount: this.#rowCount\n\t\t};\n\t\treturn outcome === \"succeeded\" && this.#stats !== void 0 ? {\n\t\t\t...base,\n\t\t\treturns: \"stats\",\n\t\t\tstats: this.#stats\n\t\t} : {\n\t\t\t...base,\n\t\t\treturns: \"stats\"\n\t\t};\n\t}\n};\n//#endregion\n//#region src/execution/runtime-core.ts\n/**\n* Family-agnostic abstract runtime base. Each `query()` and `execute()` call is one statement activity, run in this order: `activityStarted`, `runBeforeCompile`, `lower`, `beforeEncode`, `intercept`, the driver with `onRow`, `activityEnded`, then `activityFinalized`. It has no parent, so it is finalized right after it ends.\n*\n* Concrete subclasses implement `lower`, `runDriver`, `runExecute` and `close`.\n*/\nvar RuntimeCore = class {\n\tmiddleware;\n\tctx;\n\tconstructor(options) {\n\t\tthis.middleware = [...options.middleware];\n\t\tthis.ctx = options.ctx;\n\t}\n\t/** Pre-lowering hook for plan rewriting. Defaults to identity. */\n\trunBeforeCompile(plan) {\n\t\treturn plan;\n\t}\n\tquery(plan, options) {\n\t\tconst self = this;\n\t\tconst codecCtx = codecContextOf(options);\n\t\tconst statement = streamStatement({\n\t\t\tmiddleware: this.middleware,\n\t\t\tplan,\n\t\t\tcontext: this.contextFieldsFor(codecCtx, options),\n\t\t\tparent: void 0\n\t\t}, async function* (run) {\n\t\t\tcheckAborted(codecCtx, \"stream\");\n\t\t\tconst compiled = await self.runBeforeCompile(plan);\n\t\t\tconst exec = await self.lower(compiled, codecCtx);\n\t\t\tawait run.beforeEncode(exec);\n\t\t\tyield* run.runQuery(exec, () => blindCast(self.runDriver(exec)));\n\t\t});\n\t\tasync function* generator() {\n\t\t\tyield* statement;\n\t\t}\n\t\treturn new AsyncIterableResult(generator());\n\t}\n\texecute(plan, options) {\n\t\tconst codecCtx = codecContextOf(options);\n\t\treturn executeStatement({\n\t\t\tmiddleware: this.middleware,\n\t\t\tplan,\n\t\t\tcontext: this.contextFieldsFor(codecCtx, options),\n\t\t\tparent: void 0\n\t\t}, async (run) => {\n\t\t\tcheckAborted(codecCtx, \"stream\");\n\t\t\tconst compiled = await this.runBeforeCompile(plan);\n\t\t\tconst exec = await this.lower(compiled, codecCtx);\n\t\t\tawait run.beforeEncode(exec);\n\t\t\treturn run.runExecute(exec, () => this.runExecute(exec));\n\t\t});\n\t}\n\tcontextFieldsFor(codecCtx, options) {\n\t\treturn {\n\t\t\t...this.ctx,\n\t\t\t...codecCtx,\n\t\t\tscope: options?.scope ?? this.ctx.scope\n\t\t};\n\t}\n};\nfunction codecContextOf(options) {\n\tconst signal = options?.signal;\n\treturn signal === void 0 ? {} : { signal };\n}\n//#endregion\n//#region src/execution/runtime-middleware.ts\nfunction checkMiddlewareCompatibility(middleware, runtimeFamilyId, runtimeTargetId) {\n\tif (middleware.targetId !== void 0 && middleware.familyId === void 0) throw runtimeError(\"RUNTIME.MIDDLEWARE_INCOMPATIBLE\", `Middleware '${middleware.name}' specifies targetId '${middleware.targetId}' without familyId`, {\n\t\tmiddleware: middleware.name,\n\t\ttargetId: middleware.targetId\n\t});\n\tif (middleware.familyId !== void 0 && middleware.familyId !== runtimeFamilyId) throw runtimeError(\"RUNTIME.MIDDLEWARE_FAMILY_MISMATCH\", `Middleware '${middleware.name}' requires family '${middleware.familyId}' but the runtime is configured for family '${runtimeFamilyId}'`, {\n\t\tmiddleware: middleware.name,\n\t\tmiddlewareFamilyId: middleware.familyId,\n\t\truntimeFamilyId\n\t});\n\tif (middleware.targetId !== void 0 && middleware.targetId !== runtimeTargetId) throw runtimeError(\"RUNTIME.MIDDLEWARE_TARGET_MISMATCH\", `Middleware '${middleware.name}' requires target '${middleware.targetId}' but the runtime is configured for target '${runtimeTargetId}'`, {\n\t\tmiddleware: middleware.name,\n\t\tmiddlewareTargetId: middleware.targetId,\n\t\truntimeTargetId\n\t});\n}\n//#endregion\n//#region src/execution/shape.ts\n/**\n* Phantom key an emitted model type carries to name its relation properties.\n* Never present at runtime; `Scalars` and `Shape` read it to tell relations from fields.\n*/\nconst RelationKeys = Symbol(\"RelationKeys\");\n//#endregion\n//#region src/execution/transaction-activity.ts\n/**\n* Starts a transaction activity and runs its `activityStarted` hooks. When one of them throws, the transaction ends `failed`, is finalized `rolled-back`, and the error is rethrown. Rejects at once, running no hook, when `parent` no longer accepts children.\n*/\nasync function startTransactionActivity(options) {\n\tconst run = new TransactionActivityRunImpl(options);\n\ttry {\n\t\tawait run.start();\n\t} catch (error) {\n\t\tawait run.end({\n\t\t\tby: \"rollback\",\n\t\t\toutcome: \"failed\",\n\t\t\tcommitAttempted: false\n\t\t});\n\t\tthrow error;\n\t}\n\treturn run;\n}\nvar TransactionActivityRunImpl = class {\n\tactivity;\n\tctx;\n\t#record;\n\t#children;\n\t#slot;\n\t#aStatementFailed = false;\n\t#ended = false;\n\t#acceptingChildren = true;\n\tconstructor(options) {\n\t\tthis.activity = {\n\t\t\tid: crypto.randomUUID(),\n\t\t\tkind: \"transaction\",\n\t\t\tannotations: brandedAnnotations(void 0)\n\t\t};\n\t\tthis.#record = createActivityRecord(options.middleware, this.activity, options.context, options.parent);\n\t\tthis.ctx = this.#record.ctx;\n\t\tthis.#children = new ActivityChildren({\n\t\t\tinTransaction: true,\n\t\t\tholdFinishedChildren: options.holdFinishedChildren,\n\t\t\tstatementFailed: () => {\n\t\t\t\tthis.#aStatementFailed = true;\n\t\t\t},\n\t\t\ttransactionAcceptsChildren: () => this.#acceptingChildren,\n\t\t\tchildFinalized: () => {}\n\t\t});\n\t\tthis.#slot = options.parent?.adopt(this);\n\t}\n\tstart() {\n\t\treturn this.#record.started();\n\t}\n\tacceptsChildren() {\n\t\treturn this.#acceptingChildren;\n\t}\n\tadopt(child) {\n\t\tif (!this.#acceptingChildren) throw notAcceptingChildrenError(this.activity, \"parent\");\n\t\treturn this.#children.add(child);\n\t}\n\tstopAcceptingChildren() {\n\t\tthis.#acceptingChildren = false;\n\t}\n\tasync end(settlement) {\n\t\tif (this.#ended) return;\n\t\tthis.#ended = true;\n\t\tthis.#acceptingChildren = false;\n\t\tawait endActivity(this.#record, {\n\t\t\tkind: \"transaction\",\n\t\t\toutcome: settlement.outcome\n\t\t}, this.#finalizedResult(settlement), this.#slot, (result) => this.finalize(result));\n\t}\n\tasync finalize(result) {\n\t\tawait this.#children.finalize(result);\n\t\tawait this.#record.finalize(result);\n\t}\n\t#finalizedResult(settlement) {\n\t\tif (settlement.by === \"rollback\") return { outcome: settlement.commitAttempted ? \"unknown\" : \"rolled-back\" };\n\t\treturn { outcome: settlement.outcome === \"succeeded\" && !this.#aStatementFailed ? \"committed\" : \"unknown\" };\n\t}\n};\n//#endregion\n//#region src/meta-builder.ts\nvar MetaBuilderImpl = class {\n\t#kind;\n\t#terminalName;\n\t#annotations = /* @__PURE__ */ new Map();\n\tconstructor(kind, terminalName) {\n\t\tthis.#kind = kind;\n\t\tthis.#terminalName = terminalName;\n\t}\n\tget annotations() {\n\t\treturn this.#annotations;\n\t}\n\tannotate(annotation) {\n\t\tconst value = annotation;\n\t\tassertAnnotationsApplicable([value], this.#kind, this.#terminalName);\n\t\tthis.#annotations.set(value.namespace, value);\n\t\treturn this;\n\t}\n};\n/**\n* Construct a lane-side meta builder for a terminal of operation kind `K`.\n*\n* Lane terminals call this with their `kind` (`'read'` or `'write'`) and a\n* `terminalName` for error messages, hand the resulting builder to the\n* user-supplied configurator callback (typed as `MetaBuilder<K>`, the\n* narrower public view), and read `meta.annotations` afterwards to thread\n* the recorded values into `plan.meta.annotations`.\n*/\nfunction createMetaBuilder(kind, terminalName) {\n\treturn new MetaBuilderImpl(kind, terminalName);\n}\n//#endregion\nexport { AsyncIterableResult, RUNTIME_ABORTED, RelationKeys, RuntimeCore, applyMutationDefaults, assertAnnotationsApplicable, assertMutationDefaultGeneratorsAvailable, checkAborted, checkMiddlewareCompatibility, collectMutationDefaultGenerators, createContextBeneath, createMetaBuilder, createStateStore, defineAnnotation, executeStatement, isRuntimeError, raceAgainstAbort, runtimeAborted, runtimeError, startClientActivity, startTransactionActivity, streamStatement };\n\n//# sourceMappingURL=runtime.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,MAAM,kBAAkB;;;;;;;;;;AAUxB,SAAS,eAAe,OAAO,OAAO;CACrC,MAAM,WAAW,aAAa,iBAAiB,4BAA4B,SAAS,EAAE,MAAM,CAAC;CAC7F,OAAO,OAAO,OAAO,UAAU,EAAE,MAAM,CAAC;AACzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA,SAAS,mBAAmB;CAC3B,QAAQ,YAAY;EACnB,MAAM,YAAY,QAAQ;EAC1B,MAAM,eAAe,OAAO,OAAO,IAAI,IAAI,QAAQ,YAAY,CAAC;EAChE,SAAS,OAAO,OAAO;GACtB,OAAO,OAAO,OAAO;IACpB,cAAc;IACd;IACA;IACA;GACD,CAAC;EACF;EACA,SAAS,KAAK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M,YAAY;AAC9C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types-QyibIZST.mjs","names":[],"sources":["../../../../1-framework/0-foundation/contract/dist/types.mjs"],"sourcesContent":["import { n as soleDomainNamespaceId, r as contractError, t as UNBOUND_DOMAIN_NAMESPACE_ID } from \"./default-namespace-D4vCwkXg.mjs\";\nimport { t as resolveDomainModel } from \"./resolve-domain-model-BovPAsW2.mjs\";\nimport { t as asNamespaceId } from \"./namespace-id-asbWpwMw.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { type } from \"arktype\";\n//#region src/control-policy.ts\n/**\n* Resolves the effective control policy for a storage-plane node.\n*\n* Precedence: node-level value → contract default → `'managed'`.\n*\n* Both parameters are optional raw values so this function stays node-type-agnostic\n* and can be called by any consumer (verifier, planner, etc.) without importing IR classes.\n*/\nfunction effectiveControlPolicy(nodeControl, defaultControlPolicy) {\n\treturn nodeControl ?? defaultControlPolicy ?? \"managed\";\n}\n//#endregion\n//#region src/cross-reference.ts\nconst CrossReferenceSchema = /* @__PURE__ */ blindCast(/* @__PURE__ */ type({\n\t\"+\": \"reject\",\n\tnamespace: \"string\",\n\tmodel: \"string\",\n\t\"space?\": \"string\"\n}));\nconst DEFAULT_CROSS_REF_NAMESPACE = \"__unbound__\";\nfunction crossRef(model, namespace = DEFAULT_CROSS_REF_NAMESPACE, space) {\n\treturn {\n\t\tnamespace: asNamespaceId(namespace),\n\t\tmodel,\n\t\t...space !== void 0 ? { space } : {}\n\t};\n}\n//#endregion\n//#region src/domain-namespace-access.ts\n/**\n* Models map for the contract's single domain namespace. Throws when the\n* contract does not declare exactly one namespace — bare-name access is\n* ambiguous across namespaces and must be qualified explicitly (TML-2550).\n*/\nfunction domainModelsAtDefaultNamespace(domain) {\n\tconst namespaceId = soleDomainNamespaceId(domain);\n\tconst domainNamespace = domain.namespaces[namespaceId];\n\tif (domainNamespace === void 0) throw contractError(\"CONTRACT.NAMESPACE_INVALID\", `domain namespace \"${namespaceId}\" is not present on the contract`, { meta: {\n\t\treason: \"domain-namespace-missing\",\n\t\tnamespaceId\n\t} });\n\treturn domainNamespace.models;\n}\n/**\n* Value objects for the contract's single domain namespace, when present.\n* Throws when the contract does not declare exactly one namespace.\n*/\nfunction domainValueObjectsAtDefaultNamespace(domain) {\n\treturn domain.namespaces[soleDomainNamespaceId(domain)]?.valueObjects;\n}\n//#endregion\n//#region src/execution-section-schema.ts\nconst ExecutionMutationDefaultValueSchema = type({\n\t\"+\": \"reject\",\n\tkind: \"'generator'\",\n\tid: type(\"string\").narrow((value, ctx) => {\n\t\treturn /^[A-Za-z0-9][A-Za-z0-9_-]*$/.test(value) ? true : ctx.mustBe(\"a flat generator id\");\n\t}),\n\t\"params?\": \"Record<string, unknown>\"\n});\nconst ContractExecutionSectionSchema = /* @__PURE__ */ blindCast(/* @__PURE__ */ type({\n\t\"+\": \"reject\",\n\texecutionHash: \"string\",\n\tmutations: {\n\t\t\"+\": \"reject\",\n\t\tdefaults: type({\n\t\t\t\"+\": \"reject\",\n\t\t\tref: {\n\t\t\t\t\"+\": \"reject\",\n\t\t\t\tnamespace: \"string\",\n\t\t\t\tentry: \"string\",\n\t\t\t\tfield: \"string\"\n\t\t\t},\n\t\t\t\"onCreate?\": ExecutionMutationDefaultValueSchema,\n\t\t\t\"onUpdate?\": ExecutionMutationDefaultValueSchema\n\t\t}).array().readonly()\n\t}\n}));\n//#endregion\n//#region src/types.ts\nfunction executionHash(value) {\n\treturn value;\n}\nfunction coreHash(value) {\n\treturn value;\n}\nfunction profileHash(value) {\n\treturn value;\n}\n/**\n* Runtime predicate for `ColumnDefaultLiteralInputValue`. Authoring layers\n* resolve template values from caller-supplied args (typed `unknown` at the\n* boundary) and need to validate before constructing a `ColumnDefault`.\n* Accepts JSON primitives, plain arrays/objects of JSON values, and `Date`\n* instances. Rejects functions, class instances (other than `Date`),\n* `undefined`, `bigint`, `symbol`, and arrays/objects containing those.\n*/\nfunction isColumnDefaultLiteralInputValue(value) {\n\tif (value === null) return true;\n\tconst t = typeof value;\n\tif (t === \"string\" || t === \"number\" || t === \"boolean\") return true;\n\tif (value instanceof Date) return true;\n\tif (Array.isArray(value)) return value.every(isColumnDefaultLiteralInputValue);\n\tif (t === \"object\" && Object.getPrototypeOf(value) === Object.prototype) return Object.values(value).every(isColumnDefaultLiteralInputValue);\n\treturn false;\n}\nfunction isColumnDefault(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tconst kind = value.kind;\n\tif (kind === \"literal\") return \"value\" in value;\n\tif (kind === \"function\") return typeof value.expression === \"string\";\n\treturn false;\n}\nfunction isExecutionMutationDefaultValue(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tconst candidate = value;\n\tif (candidate.kind !== \"generator\") return false;\n\tif (typeof candidate.id !== \"string\") return false;\n\tif (candidate.params !== void 0 && (typeof candidate.params !== \"object\" || candidate.params === null || Array.isArray(candidate.params))) return false;\n\treturn true;\n}\n//#endregion\nexport { ContractExecutionSectionSchema, CrossReferenceSchema, UNBOUND_DOMAIN_NAMESPACE_ID, asNamespaceId, coreHash, crossRef, domainModelsAtDefaultNamespace, domainValueObjectsAtDefaultNamespace, effectiveControlPolicy, executionHash, isColumnDefault, isColumnDefaultLiteralInputValue, isExecutionMutationDefaultValue, profileHash, resolveDomainModel, soleDomainNamespaceId };\n\n//# sourceMappingURL=types.mjs.map"],"mappings":";;;;;;;;;;;;;AAcA,SAAS,uBAAuB,aAAa,sBAAsB;CAClE,OAAO,eAAe,wBAAwB;AAC/C;AAGA,MAAM,uBAAuC,0BAA0B,qBAAK;CAC3E,KAAK;CACL,WAAW;CACX,OAAO;CACP,UAAU;AACX,CAAC,CAAC;AACF,MAAM,8BAA8B;AACpC,SAAS,SAAS,OAAO,YAAY,6BAA6B,OAAO;CACxE,OAAO;EACN,WAAW,cAAc,SAAS;EAClC;EACA,GAAG,UAAU,KAAK,IAAI,EAAE,MAAM,IAAI,CAAC;CACpC;AACD;;;;;;AAQA,SAAS,+BAA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