@prisma/orm-family-sql 8.0.0-rc.19-dev.11 → 8.0.0-rc.19-dev.12

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 (32) hide show
  1. package/dist/{attribute-specs-D7QylDnB.d.mts → attribute-specs-DA_RwQFB.d.mts} +2 -2
  2. package/dist/{attribute-specs-D7QylDnB.d.mts.map → attribute-specs-DA_RwQFB.d.mts.map} +1 -1
  3. package/dist/{contract-builder-C3l_q1H-.mjs → contract-builder-50lF0kz1.mjs} +25 -23
  4. package/dist/contract-builder-50lF0kz1.mjs.map +1 -0
  5. package/dist/contract-prisma7__provider.mjs +1 -1
  6. package/dist/contract-psl.mjs +1 -1
  7. package/dist/contract-psl__attribute-specs.d.mts +1 -1
  8. package/dist/contract-psl__provider.mjs +1 -1
  9. package/dist/contract-psl__provider.mjs.map +1 -1
  10. package/dist/contract-ts.mjs +1 -1
  11. package/dist/contract-ts__contract-builder.mjs +1 -1
  12. package/dist/{control-DxyXflhj.mjs → control-BK50zF6c.mjs} +2 -2
  13. package/dist/{control-DxyXflhj.mjs.map → control-BK50zF6c.mjs.map} +1 -1
  14. package/dist/{control-R-s5YQP9.d.mts → control-ChAUdOOu.d.mts} +3 -3
  15. package/dist/{control-R-s5YQP9.d.mts.map → control-ChAUdOOu.d.mts.map} +1 -1
  16. package/dist/family.d.mts +2 -2
  17. package/dist/family.mjs +3 -3
  18. package/dist/family__control.d.mts +1 -1
  19. package/dist/family__control.mjs +1 -1
  20. package/dist/family__pack.d.mts +1 -1
  21. package/dist/family__pack.mjs +2 -2
  22. package/dist/{generator-functions-D_qdqBV--B1cUxXC8.mjs → generator-functions-D_qdqBV--Bq296cED.mjs} +2 -2
  23. package/dist/{generator-functions-D_qdqBV--B1cUxXC8.mjs.map → generator-functions-D_qdqBV--Bq296cED.mjs.map} +1 -1
  24. package/dist/{interpreter-BDpym-rc-C3-vTcej.mjs → interpreter-D5qk4B---CG0C7kdx.mjs} +17 -18
  25. package/dist/interpreter-D5qk4B---CG0C7kdx.mjs.map +1 -0
  26. package/dist/{pack-CTJJsiO6.d.mts → pack-DA8HZ2mo.d.mts} +2 -2
  27. package/dist/{pack-CTJJsiO6.d.mts.map → pack-DA8HZ2mo.d.mts.map} +1 -1
  28. package/dist/{pack-B8LTPfkw.mjs → pack-gSvGQWqs.mjs} +2 -2
  29. package/dist/{pack-B8LTPfkw.mjs.map → pack-gSvGQWqs.mjs.map} +1 -1
  30. package/package.json +18 -18
  31. package/dist/contract-builder-C3l_q1H-.mjs.map +0 -1
  32. package/dist/interpreter-BDpym-rc-C3-vTcej.mjs.map +0 -1
@@ -2,9 +2,9 @@ import "./contract-builder-C_Zi57iD.mjs";
2
2
  import "./psl-column-resolution-ChZqioOc-BREg4J7d.mjs";
3
3
  import { DataTypeSupport } from "@prisma/orm-framework/components/authoring";
4
4
  import { PslSources } from "@prisma/orm-framework/psl-parser/syntax";
5
+ import "@prisma/orm-framework/components/psl-ast";
5
6
  import { ControlMutationDefaultEntry } from "@prisma/orm-framework/components/control";
6
7
  import { ArgType, AttributeCtx, AttributeSpec, AttributeSpecContext, DescribeUnsupportedAttribute, FieldAttributeCtx, FieldAttributeSpecContext, FuncCallSig, ModelAttributeCtx, ModelSymbol, ParsedWrittenList, ParsedWrittenScalar, PslSpan, TypedFuncCall } from "@prisma/orm-framework/psl-parser";
7
- import "@prisma/orm-framework/components/psl-ast";
8
8
  //#region ../../../2-sql-family/2-authoring/contract-psl/dist/sql-attribute-specs-CK9iRCBj.d.mts
9
9
  //#region src/sql-attribute-specs.d.ts
10
10
  interface EnumMemberDefault {
@@ -111,4 +111,4 @@ declare const sqlAttributeSpecs: {
111
111
  declare function describeUnsupportedSqlAttribute(sources: PslSources): DescribeUnsupportedAttribute;
112
112
  //#endregion
113
113
  export { EnumMemberListDefault as a, sqlAttributeSpecs as c, EnumMemberDefault as i, DefaultFunctionCall as n, ParsedNullLiteral as o, DefaultFunctionSignature as r, defaultFunctionCall as s, describeUnsupportedSqlAttribute as t };
114
- //# sourceMappingURL=attribute-specs-D7QylDnB.d.mts.map
114
+ //# sourceMappingURL=attribute-specs-DA_RwQFB.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"attribute-specs-D7QylDnB.d.mts","names":[],"sources":["../../../../2-sql-family/2-authoring/contract-psl/dist/sql-attribute-specs-CK9iRCBj.d.mts","../../../../2-sql-family/2-authoring/contract-psl/dist/attribute-specs.d.mts"],"mappings":";;;;;;;;;UAOU;WACC;WACA;;;UAGD;WACC;WACA,MAAM;;;UAGP;WACC;WACA,oBAAoB,oBAAoB;;;UAGzC;WACC;WACA,MAAM;;KAEZ,kBAAkB,sBAAsB,oBAAoB,kBAAkB,sBAAsB,qBAAqB,sBAAsB,oBAAoB;;KAEnK,2BAA2B,gBAAgB,WAAW,oBAAoB;;;;iBAI9D,oBAAoB,cAAc,OAAO,6BAA6B,WAAW,kBAAkB,QAAQ,eAAe;iBAC1H,eAAe,KAAK,uBAAuB;EAC1D;WACS,4CAA4C;WAC5C,uCAAuC;WACvC;WACA;WACA;WACA;WACA,UAAU;GAClB;iBACc,eAAe,KAAK,uBAAuB;WACjD,2CAA2C;WAC3C;WACA;GACR;;cAEW;WACH;aACE,MAAM,MAAM,yBAAyB;MAC5C;OACC;aACM,KAAK,MAAM,yBAAyB;MAC3C;eACS;OACR;aACM,SAAS,MAAM,yBAAyB;MAC/C;eACS;OACR;aACM,cAAc;aACd,cAAc;aACd,UAAU,MAAM,yBAAyB;MAChD;OACC;aACM,gBAAgB,MAAM,yBAAyB;MACtD;OACC;aACM,OAAO,MAAM,yBAAyB;MAC7C,qCAAqC,wBAAwB;MAC7D,OAAO;OACN;;WAEI;aACE,MAAM,MAAM,8BAA8B;MACjD;OACC;aACM,KAAK,MAAM,8BAA8B;eACvC;OACR;aACM,SAAS,MAAM,8BAA8B;eAC3C;OACR;aACM,WAAW,MAAM,8BAA8B;MACtD;eACS;eACA;eACA;eACA;eACA;eACA;OACR;aACM,UAAU,KAAK,8BAA8B;MACpD,OAAO;OACN;aACM,WAAW,KAAK,8BAA8B;MACrD,OAAO;OACN;aACM,WAAW,KAAK,8BAA8B;MACrD,OAAO;OACN;;;;;;iBC3FU,gCAAgC,SAAS,aAAa"}
1
+ {"version":3,"file":"attribute-specs-DA_RwQFB.d.mts","names":[],"sources":["../../../../2-sql-family/2-authoring/contract-psl/dist/sql-attribute-specs-CK9iRCBj.d.mts","../../../../2-sql-family/2-authoring/contract-psl/dist/attribute-specs.d.mts"],"mappings":";;;;;;;;;UAOU;WACC;WACA;;;UAGD;WACC;WACA,MAAM;;;UAGP;WACC;WACA,oBAAoB,oBAAoB;;;UAGzC;WACC;WACA,MAAM;;KAEZ,kBAAkB,sBAAsB,oBAAoB,kBAAkB,sBAAsB,qBAAqB,sBAAsB,oBAAoB;;KAEnK,2BAA2B,gBAAgB,WAAW,oBAAoB;;;;iBAI9D,oBAAoB,cAAc,OAAO,6BAA6B,WAAW,kBAAkB,QAAQ,eAAe;iBAC1H,eAAe,KAAK,uBAAuB;EAC1D;WACS,4CAA4C;WAC5C,uCAAuC;WACvC;WACA;WACA;WACA;WACA,UAAU;GAClB;iBACc,eAAe,KAAK,uBAAuB;WACjD,2CAA2C;WAC3C;WACA;GACR;;cAEW;WACH;aACE,MAAM,MAAM,yBAAyB;MAC5C;OACC;aACM,KAAK,MAAM,yBAAyB;MAC3C;eACS;OACR;aACM,SAAS,MAAM,yBAAyB;MAC/C;eACS;OACR;aACM,cAAc;aACd,cAAc;aACd,UAAU,MAAM,yBAAyB;MAChD;OACC;aACM,gBAAgB,MAAM,yBAAyB;MACtD;OACC;aACM,OAAO,MAAM,yBAAyB;MAC7C,qCAAqC,wBAAwB;MAC7D,OAAO;OACN;;WAEI;aACE,MAAM,MAAM,8BAA8B;MACjD;OACC;aACM,KAAK,MAAM,8BAA8B;eACvC;OACR;aACM,SAAS,MAAM,8BAA8B;eAC3C;OACR;aACM,WAAW,MAAM,8BAA8B;MACtD;eACS;eACA;eACA;eACA;eACA;eACA;OACR;aACM,UAAU,KAAK,8BAA8B;MACpD,OAAO;OACN;aACM,WAAW,KAAK,8BAA8B;MACrD,OAAO;OACN;aACM,WAAW,KAAK,8BAA8B;MACrD,OAAO;OACN;;;;;;iBC3FU,gCAAgC,SAAS,aAAa"}
@@ -13,6 +13,7 @@ import { InternalError } from "@prisma/orm-framework/utils/internal-error";
13
13
  import { isColumnDefault } from "@prisma/orm-framework/contract/types";
14
14
  import { assembleGeneratorFunctions, createGeneratorHelpers } from "@prisma/orm-framework/components/components";
15
15
  import { assertSafeAuthoringHelperKey, bindEnumType, composePackAuthoringNamespace, createEntityHelpersFromNamespace, createFieldHelpersFromNamespace, enumType, isEnumTypeHandle, member, resolveToOneRelationNullable } from "@prisma/orm-framework/contract-authoring";
16
+ import { UNBOUND_PSL_NAMESPACE_NAME } from "@prisma/orm-framework/components/psl-ast";
16
17
  //#region ../../../2-sql-family/2-authoring/contract-ts/dist/contract-builder.mjs
17
18
  /** The written value a TypeScript argument stands for: a number, string or boolean as written in PSL, and a `sql` value as a `sql` literal of its text. */
18
19
  function writtenValueOf(value) {
@@ -1677,6 +1678,9 @@ function validateTargetPackRef(family, target) {
1677
1678
  contractFamilyId: family.familyId
1678
1679
  } });
1679
1680
  }
1681
+ function targetNameOf(target) {
1682
+ return target.displayName ?? target.targetId;
1683
+ }
1680
1684
  /**
1681
1685
  * Per-target reserved namespace names enforced by `defineContract` for
1682
1686
  * SQL family contracts. Two categories:
@@ -1685,16 +1689,16 @@ function validateTargetPackRef(family, target) {
1685
1689
  * every SQL target. The double-underscore decoration marks them as
1686
1690
  * framework-reserved coordinates; user code must not declare them
1687
1691
  * explicitly.
1688
- * 2. **Target-specific PSL keywords** — Postgres reserves the bare
1689
- * `unbound` identifier for the late-binding opt-in
1690
- * (`namespace unbound { … }`) so the TS surface must reject it from
1691
- * `defineContract({ namespaces })` lists. SQLite has no schema
1692
- * concept and rejects every non-empty namespaces list outright;
1693
- * callers should declare `namespaces: []` or omit the field.
1692
+ * 2. **The PSL keyword `unbound`** — the name PSL writes for the
1693
+ * late-binding opt-in (`namespace unbound { … }`), so the TS surface
1694
+ * rejects it from `defineContract({ namespaces })` lists on every
1695
+ * target that accepts namespaces. A target whose `supportsNamespaces` is false rejects every
1696
+ * non-empty namespaces list outright; callers should declare
1697
+ * `namespaces: []` or omit the field.
1694
1698
  */
1695
1699
  function validateNamespaceDeclarations(target, namespaces) {
1696
1700
  if (!namespaces) return;
1697
- if (target.targetId === "sqlite" && namespaces.length > 0) throw contractError("CONTRACT.NAMESPACE_UNSUPPORTED", `defineContract: SQLite contracts cannot declare namespaces (SQLite has no schema concept; emitted DDL is always unqualified). Received namespaces: [${namespaces.map((name) => `"${name}"`).join(", ")}].`, { meta: {
1701
+ if (target.supportsNamespaces === false && namespaces.length > 0) throw contractError("CONTRACT.NAMESPACE_UNSUPPORTED", `defineContract: ${targetNameOf(target)} contracts cannot declare namespaces. Received namespaces: [${namespaces.map((name) => `"${name}"`).join(", ")}].`, { meta: {
1698
1702
  namespaces,
1699
1703
  targetId: target.targetId
1700
1704
  } });
@@ -1712,9 +1716,10 @@ function validateNamespaceDeclarations(target, namespaces) {
1712
1716
  namespace,
1713
1717
  reason: "reserved-ir-sentinel"
1714
1718
  } });
1715
- if (target.targetId === "postgres" && namespace === "unbound") throw contractError("CONTRACT.NAMESPACE_INVALID", `defineContract: namespace name "unbound" is reserved by Postgres for the late-binding opt-in (use \`namespace unbound { … }\` in PSL instead of declaring it as a regular schema).`, { meta: {
1719
+ if (namespace === UNBOUND_PSL_NAMESPACE_NAME) throw contractError("CONTRACT.NAMESPACE_INVALID", `defineContract: namespace name "${namespace}" is reserved by ${targetNameOf(target)} for the late-binding opt-in (use \`namespace ${namespace} { … }\` in PSL instead of declaring it as a regular schema).`, { meta: {
1716
1720
  namespace,
1717
- reason: "reserved-by-postgres"
1721
+ reason: "reserved-psl-keyword",
1722
+ targetId: target.targetId
1718
1723
  } });
1719
1724
  if (seen.has(namespace)) throw contractError("CONTRACT.NAME_DUPLICATE", `defineContract: namespaces list contains duplicate entry "${namespace}".`, { meta: {
1720
1725
  kind: "namespace",
@@ -1731,25 +1736,21 @@ function validateNamespaceDeclarations(target, namespaces) {
1731
1736
  *
1732
1737
  * - `__unbound__` / `__unspecified__` — reserved IR sentinels on
1733
1738
  * every SQL target.
1734
- * - `unbound` on Postgres — reserved for the PSL
1735
- * `namespace unbound { … }` opt-in.
1739
+ * - The PSL keyword `unbound` — reserved for the PSL late-binding
1740
+ * opt-in, which the TS builder has no surface for.
1736
1741
  *
1737
- * Additionally enforces that each per-model `namespace` either
1738
- * references an entry in the contract's declared `namespaces` list or
1739
- * names the Postgres late-binding keyword (`unbound`) — the latter is
1740
- * not a "declared namespace" but is a legal opt-in only via PSL today,
1741
- * so the TS surface also rejects it on the per-model side and points
1742
- * authors at the PSL `namespace unbound { … }` block.
1742
+ * Additionally enforces that each per-model `namespace` references an
1743
+ * entry in the contract's declared `namespaces` list.
1743
1744
  *
1744
- * The SQLite per-model `namespace` field is rejected outright (SQLite
1745
- * has no schema concept).
1745
+ * A target whose `supportsNamespaces` is false rejects the per-model
1746
+ * `namespace` field outright.
1746
1747
  */
1747
1748
  function validatePerModelNamespaces(target, namespaces, models) {
1748
1749
  const declaredNamespaces = new Set(namespaces ?? []);
1749
1750
  for (const [modelKey, modelBuilder] of Object.entries(models)) {
1750
1751
  const perModelNamespace = modelBuilder.stageOne.namespace;
1751
1752
  if (perModelNamespace === void 0) continue;
1752
- if (target.targetId === "sqlite") throw contractError("CONTRACT.NAMESPACE_UNSUPPORTED", `defineContract: model "${modelKey}" sets \`namespace: "${perModelNamespace}"\` but the target is SQLite (SQLite has no schema concept; remove the per-model \`namespace\` field).`, { meta: {
1753
+ if (target.supportsNamespaces === false) throw contractError("CONTRACT.NAMESPACE_UNSUPPORTED", `defineContract: model "${modelKey}" sets \`namespace: "${perModelNamespace}"\` but the target is ${targetNameOf(target)}, which does not support namespaces (remove the per-model \`namespace\` field).`, { meta: {
1753
1754
  modelKey,
1754
1755
  namespace: perModelNamespace,
1755
1756
  targetId: target.targetId
@@ -1759,10 +1760,11 @@ function validatePerModelNamespaces(target, namespaces, models) {
1759
1760
  namespace: perModelNamespace,
1760
1761
  reason: "reserved-ir-sentinel"
1761
1762
  } });
1762
- if (target.targetId === "postgres" && perModelNamespace === "unbound") throw contractError("CONTRACT.NAMESPACE_INVALID", `defineContract: model "${modelKey}" sets \`namespace: "unbound"\` but that name is reserved by Postgres for the late-binding opt-in (use \`namespace unbound { … }\` in PSL instead — there is no equivalent surface in the TS builder today).`, { meta: {
1763
+ if (perModelNamespace === UNBOUND_PSL_NAMESPACE_NAME) throw contractError("CONTRACT.NAMESPACE_INVALID", `defineContract: model "${modelKey}" sets \`namespace: "${perModelNamespace}"\` but that name is reserved by ${targetNameOf(target)} for the late-binding opt-in (use \`namespace ${perModelNamespace} { … }\` in PSL instead — there is no equivalent surface in the TS builder today).`, { meta: {
1763
1764
  modelKey,
1764
1765
  namespace: perModelNamespace,
1765
- reason: "reserved-by-postgres"
1766
+ reason: "reserved-psl-keyword",
1767
+ targetId: target.targetId
1766
1768
  } });
1767
1769
  if (!declaredNamespaces.has(perModelNamespace)) throw contractError("CONTRACT.NAMESPACE_UNKNOWN", `defineContract: model "${modelKey}" references namespace "${perModelNamespace}" but that name does not appear in the contract's declared \`namespaces\` list.${declaredNamespaces.size > 0 ? ` Declared namespaces: [${[...declaredNamespaces].map((name) => `"${name}"`).join(", ")}].` : " The contract does not declare any namespaces; add `namespaces: [\"…\"]` to `defineContract` first."}`, { meta: {
1768
1770
  modelKey,
@@ -1850,4 +1852,4 @@ function autoincrement() {
1850
1852
  //#endregion
1851
1853
  export { check as a, enumType as c, member as d, model as f, buildContractDefinition as i, extensionModel as l, rel as m, bindEnumType as n, createComposedAuthoringHelpers as o, now as p, buildBoundContract as r, defineContract as s, autoincrement as t, field as u };
1852
1854
 
1853
- //# sourceMappingURL=contract-builder-C3l_q1H-.mjs.map
1855
+ //# sourceMappingURL=contract-builder-50lF0kz1.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract-builder-50lF0kz1.mjs","names":["#handle"],"sources":["../../../../2-sql-family/2-authoring/contract-ts/dist/contract-builder.mjs"],"sourcesContent":["import { a as isValueObjectMember, i as toOneNullabilityContradictionMessage, n as buildSqlContractFromDefinition, o as storedAsListColumn, r as refuseTypesKey, s as contractError, t as applySqlSpecifierControlPolicy } from \"./derived-checks-D5HVRvqN.mjs\";\nimport { SQL_EXPRESSION_TAG, SqlExpression, isSqlExpression, readSqlExpression, requireSqlExpression, sql } from \"@internal/sql-contract/sql-expression\";\nimport { assertSafeAuthoringHelperKey, bindEnumType, composePackAuthoringNamespace, createEntityHelpersFromNamespace, createFieldHelpersFromNamespace, enumType, isEnumTypeHandle, member, resolveToOneRelationNullable } from \"@internal/contract-authoring\";\nimport { assembleDataTypeSupport, assertNoCrossRegistryCollisions, assertTypeAliasesValid, describeAdmittedForms, instantiateAuthoringFieldPreset, instantiateAuthoringTypeAlias, instantiateAuthoringTypeConstructor, isAuthoringEntityTypeDescriptor, isAuthoringTypeAliasDescriptor, isAuthoringTypeConstructorDescriptor, readWrittenValueAs, validateAuthoringHelperArguments, validateAuthoringTypeParams } from \"@internal/framework-components/authoring\";\nimport { assembleGeneratorFunctions, createGeneratorHelpers } from \"@internal/framework-components/components\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { dataTypeId, numeralText } from \"@internal/framework-components/codec\";\nimport { CODEC_INSTANCE_KIND } from \"@internal/sql-contract/types\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { isStructuredError } from \"@internal/utils/structured-error\";\nimport { isColumnDefault } from \"@internal/contract/types\";\nimport { checkSqlDefaultText, reservedSqlDefaultText } from \"@internal/sql-contract/validators\";\nimport { UNBOUND_PSL_NAMESPACE_NAME } from \"@internal/framework-components/psl-ast\";\nimport { sqlColumnLength } from \"@internal/sql-contract/data-type\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { providesEntityHandleLowering } from \"@internal/sql-contract/entity-handle-lowering-hook\";\n//#region src/authoring-helper-runtime.ts\n/** The written value a TypeScript argument stands for: a number, string or boolean as written in PSL, and a `sql` value as a `sql` literal of its text. */\nfunction writtenValueOf(value) {\n\tif (typeof value === \"number\") return {\n\t\tkind: \"number\",\n\t\ttext: numeralText(value)\n\t};\n\tif (typeof value === \"string\") return {\n\t\tkind: \"string\",\n\t\ttext: value\n\t};\n\tif (typeof value === \"boolean\") return {\n\t\tkind: \"boolean\",\n\t\tvalue\n\t};\n\tconst expression = readSqlExpression(value);\n\treturn expression === void 0 ? void 0 : {\n\t\tkind: \"tag\",\n\t\ttag: SQL_EXPRESSION_TAG,\n\t\ttext: expression.text\n\t};\n}\nfunction readValueArgument(label, value, dataType, dataTypes) {\n\tconst refuse = (message) => {\n\t\tthrow contractError(\"CONTRACT.ARGUMENT_INVALID\", `${label}: ${message}`, { meta: { dataType } });\n\t};\n\tconst written = writtenValueOf(value);\n\tif (written === void 0) return refuse(`Expected ${describeAdmittedForms(dataTypes, dataType)}`);\n\tconst read = readWrittenValueAs(dataTypes, dataType, written);\n\treturn read.ok ? read.value.value : refuse(read.failure.message);\n}\n/**\n* The arguments of a type constructor or field preset call as the constructor receives them: each `value` argument read as a value of its data type, through the same read and cast as a PSL argument, so both give the same parameters. ADR 129, ADR 254.\n*/\nfunction readValueArguments(helperPath, descriptors, args, dataTypes) {\n\treturn args.map((value, index) => {\n\t\tconst descriptor = descriptors?.[index];\n\t\tif (descriptor?.kind !== \"value\" || value === void 0) return value;\n\t\treturn readValueArgument(descriptor.name === void 0 ? `Argument #${index + 1} of ${helperPath}` : `Argument \"${descriptor.name}\" of ${helperPath}`, value, dataTypeId(descriptor.dataType), dataTypes);\n\t});\n}\nfunction isNamedConstraintOptionsLike(value) {\n\tif (typeof value !== \"object\" || value === null || Array.isArray(value)) return false;\n\tif (Object.keys(value).some((key) => key !== \"name\")) return false;\n\tconst name = value.name;\n\treturn name === void 0 || typeof name === \"string\";\n}\nfunction createTypeHelpersFromNamespace(namespace, lookups, path = []) {\n\tconst helpers = {};\n\tfor (const [key, value] of Object.entries(namespace)) {\n\t\tassertSafeAuthoringHelperKey(key, path);\n\t\tconst currentPath = [...path, key];\n\t\tif (isAuthoringTypeConstructorDescriptor(value)) {\n\t\t\tconst helperPath = currentPath.join(\".\");\n\t\t\thelpers[key] = (...written) => {\n\t\t\t\tvalidateAuthoringHelperArguments(helperPath, value.args, written);\n\t\t\t\tconst args = readValueArguments(helperPath, value.args, written, lookups.dataTypes);\n\t\t\t\tconst output = instantiateAuthoringTypeConstructor(value, args);\n\t\t\t\tvalidateAuthoringTypeParams(helperPath, value.output, output.typeParams, lookups.codecLookup.descriptorFor(output.codecId)?.paramsSchema);\n\t\t\t\treturn {\n\t\t\t\t\tkind: CODEC_INSTANCE_KIND,\n\t\t\t\t\tcodecId: output.codecId,\n\t\t\t\t\ttypeParams: output.typeParams ?? {}\n\t\t\t\t};\n\t\t\t};\n\t\t\tcontinue;\n\t\t}\n\t\tif (isAuthoringTypeAliasDescriptor(value)) {\n\t\t\tconst helperPath = currentPath.join(\".\");\n\t\t\thelpers[key] = (...args) => {\n\t\t\t\tvalidateAuthoringHelperArguments(helperPath, [], args);\n\t\t\t\tconst { type, onCreate, onUpdate } = instantiateAuthoringTypeAlias(value);\n\t\t\t\tconst generatorCalls = {\n\t\t\t\t\t...ifDefined(\"onCreate\", onCreate),\n\t\t\t\t\t...ifDefined(\"onUpdate\", onUpdate)\n\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\tkind: CODEC_INSTANCE_KIND,\n\t\t\t\t\tcodecId: type.codecId,\n\t\t\t\t\ttypeParams: type.typeParams ?? {},\n\t\t\t\t\t...Object.keys(generatorCalls).length === 0 ? {} : { generatorCalls }\n\t\t\t\t};\n\t\t\t};\n\t\t\tcontinue;\n\t\t}\n\t\thelpers[key] = createTypeHelpersFromNamespace(value, lookups, currentPath);\n\t}\n\treturn helpers;\n}\nfunction createFieldPresetHelper(options) {\n\treturn (...rawArgs) => {\n\t\tconst acceptsNamedConstraintOptions = options.descriptor.output.id === true || options.descriptor.output.unique === true;\n\t\tconst declaredArguments = options.descriptor.args ?? [];\n\t\tif (acceptsNamedConstraintOptions && rawArgs.length > declaredArguments.length + 1) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", `${options.helperPath} expects at most ${declaredArguments.length + 1} argument(s), received ${rawArgs.length}`, { meta: {\n\t\t\thelperPath: options.helperPath,\n\t\t\texpected: declaredArguments.length + 1,\n\t\t\treceived: rawArgs.length\n\t\t} });\n\t\tlet args = rawArgs;\n\t\tlet namedConstraintOptions;\n\t\tif (acceptsNamedConstraintOptions && rawArgs.length === declaredArguments.length + 1) {\n\t\t\tconst maybeNamedConstraintOptions = rawArgs.at(-1);\n\t\t\tif (!isNamedConstraintOptionsLike(maybeNamedConstraintOptions)) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", `${options.helperPath} accepts an optional trailing { name?: string } constraint options object`, { meta: { helperPath: options.helperPath } });\n\t\t\tnamedConstraintOptions = maybeNamedConstraintOptions;\n\t\t\targs = rawArgs.slice(0, -1);\n\t\t}\n\t\tvalidateAuthoringHelperArguments(options.helperPath, options.descriptor.args, args);\n\t\tconst values = readValueArguments(options.helperPath, options.descriptor.args, args, options.dataTypes);\n\t\tconst output = options.descriptor.output;\n\t\tvalidateAuthoringTypeParams(options.helperPath, output, instantiateAuthoringFieldPreset(options.descriptor, values).descriptor.typeParams, options.codecLookup.descriptorFor(output.codecId)?.paramsSchema);\n\t\treturn options.build({\n\t\t\targs: values,\n\t\t\t...namedConstraintOptions ? { namedConstraintOptions } : {}\n\t\t});\n\t};\n}\n//#endregion\n//#region src/contract-dsl.ts\nfunction withGeneratorCall(state, phase, call) {\n\tif (state.generatorCalls?.[phase] !== void 0 || state.executionDefaults?.[phase] !== void 0) throw contractError(\"CONTRACT.DEFAULT_INVALID\", `.${phase}() is called on a field that already generates a value ${phase === \"onCreate\" ? \"on create\" : \"on update\"}. Set each phase once, and do not combine .${phase}() with a field preset, type alias or alias constant that sets it.`, { meta: {\n\t\treason: \"generator-phase-set-twice\",\n\t\tphase\n\t} });\n\treturn {\n\t\t...state,\n\t\tgeneratorCalls: {\n\t\t\t...state.generatorCalls,\n\t\t\t[phase]: call\n\t\t}\n\t};\n}\nfunction withColumnDefault(state, columnDefault) {\n\tif (state.default !== void 0) throw contractError(\"CONTRACT.DEFAULT_INVALID\", \".default() is called on a field that already has a default. Set the default once, and do not combine .default() with a field preset or alias constant that sets one.\", { meta: { reason: \"default-set-twice\" } });\n\treturn {\n\t\t...state,\n\t\tdefault: columnDefault\n\t};\n}\nfunction toColumnDefault(value) {\n\tconst expression = readSqlExpression(value);\n\tif (expression !== void 0) return sqlExpressionDefault(expression);\n\tif (isColumnDefault(value)) return value;\n\treturn {\n\t\tkind: \"literal\",\n\t\tvalue\n\t};\n}\nfunction sqlExpressionDefault(value) {\n\tconst reserved = reservedSqlDefaultText(value.text);\n\tif (reserved !== void 0) throw contractError(\"CONTRACT.DEFAULT_INVALID\", `Write .default(${reserved}()) instead of sql\\`${reserved}()\\`; ${reserved}() is a Prisma default function, not raw SQL.`, { meta: {\n\t\treason: \"reserved-function\",\n\t\texpression: value.text\n\t} });\n\tconst unsafe = checkSqlDefaultText(value.text);\n\tif (unsafe !== void 0) throw contractError(\"CONTRACT.DEFAULT_INVALID\", unsafe, { meta: {\n\t\treason: \"unsafe-sql\",\n\t\texpression: value.text\n\t} });\n\treturn {\n\t\tkind: \"function\",\n\t\texpression: value.text\n\t};\n}\nvar ScalarFieldBuilder = class ScalarFieldBuilder {\n\tstate;\n\tconstructor(state) {\n\t\tthis.state = state;\n\t}\n\t/**\n\t* Returns the physical column name when `.column(name)` was called, or\n\t* `undefined` when the field uses the default (logical field name) mapping.\n\t* Used by cross-space FK lowering to stamp the physical column name onto\n\t* `TargetFieldRef.columnName` so FK target columns are resolved correctly.\n\t*/\n\tget physicalColumnName() {\n\t\treturn this.state.columnName;\n\t}\n\toptional() {\n\t\treturn new ScalarFieldBuilder(blindCast({\n\t\t\t...this.state,\n\t\t\tnullable: true\n\t\t}));\n\t}\n\tcolumn(name) {\n\t\treturn new ScalarFieldBuilder(blindCast({\n\t\t\t...this.state,\n\t\t\tcolumnName: name\n\t\t}));\n\t}\n\tmany(options) {\n\t\treturn new ScalarFieldBuilder(blindCast({\n\t\t\t...this.state,\n\t\t\tmany: { elementNullable: options?.elementsNullable === true }\n\t\t}));\n\t}\n\tdefault(value) {\n\t\treturn blindCast(new ScalarFieldBuilder(withColumnDefault(this.state, toColumnDefault(value))));\n\t}\n\t/** Generates the field's value in the client when a row is created without one, with a call from `gen`, such as `gen.uuid()`. */\n\tonCreate(call) {\n\t\treturn blindCast(new ScalarFieldBuilder(withGeneratorCall(this.state, \"onCreate\", call)));\n\t}\n\t/** Generates the field's value in the client every time a row is updated, with a call from `gen`, such as `gen.now()`. */\n\tonUpdate(call) {\n\t\treturn blindCast(new ScalarFieldBuilder(withGeneratorCall(this.state, \"onUpdate\", call)));\n\t}\n\t/**\n\t* @deprecated Write `.default(now())` or `.default(autoincrement())`, or `` .default(sql`...`) `` for any other SQL. Removed in 8.0.0.\n\t*/\n\tdefaultSql(expression) {\n\t\treturn blindCast(new ScalarFieldBuilder(withColumnDefault(this.state, {\n\t\t\tkind: \"function\",\n\t\t\texpression\n\t\t})));\n\t}\n\tid(options) {\n\t\treturn new ScalarFieldBuilder(blindCast({\n\t\t\t...this.state,\n\t\t\tid: options?.name ? { name: options.name } : {}\n\t\t}));\n\t}\n\tunique(options) {\n\t\treturn new ScalarFieldBuilder(blindCast({\n\t\t\t...this.state,\n\t\t\tunique: options?.name ? { name: options.name } : {}\n\t\t}));\n\t}\n\tsql(spec) {\n\t\tconst idSpec = \"id\" in spec ? spec.id : void 0;\n\t\tconst uniqueSpec = \"unique\" in spec ? spec.unique : void 0;\n\t\tif (idSpec && !this.state.id) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", \"field.sql({ id }) requires an existing inline .id(...) declaration.\");\n\t\tif (uniqueSpec && !this.state.unique) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", \"field.sql({ unique }) requires an existing inline .unique(...) declaration.\");\n\t\treturn new ScalarFieldBuilder(blindCast({\n\t\t\t...this.state,\n\t\t\t...spec.column ? { columnName: spec.column } : {},\n\t\t\t...idSpec ? { id: { name: idSpec.name } } : {},\n\t\t\t...uniqueSpec ? { unique: { name: uniqueSpec.name } } : {}\n\t\t}));\n\t}\n\tbuild() {\n\t\treturn this.state;\n\t}\n};\nvar EnumScalarFieldBuilder = class EnumScalarFieldBuilder extends ScalarFieldBuilder {\n\t#handle;\n\tconstructor(state, handle) {\n\t\tsuper(state);\n\t\tthis.#handle = handle;\n\t}\n\tdefault(value) {\n\t\treturn blindCast(new EnumScalarFieldBuilder(withColumnDefault(this.build(), {\n\t\t\tkind: \"literal\",\n\t\t\tvalue\n\t\t}), this.#handle));\n\t}\n\tdefaultSql(_expression) {\n\t\tthrow contractError(\"CONTRACT.DEFAULT_INVALID\", \"defaultSql is not available on an enum field; use .default(members.X) instead\", { meta: { reason: \"defaultSql-on-enum-field\" } });\n\t}\n};\nfunction isTypeAliasColumnType(descriptor) {\n\treturn \"generatorCalls\" in descriptor;\n}\nconst columnField = (descriptor) => {\n\tif (!isTypeAliasColumnType(descriptor)) return new ScalarFieldBuilder({\n\t\tkind: \"scalar\",\n\t\tdescriptor,\n\t\tnullable: false,\n\t\tmany: false\n\t});\n\tconst { generatorCalls, ...columnType } = descriptor;\n\treturn new ScalarFieldBuilder({\n\t\tkind: \"scalar\",\n\t\tdescriptor: blindCast(columnType),\n\t\tnullable: false,\n\t\tmany: false,\n\t\t...ifDefined(\"generatorCalls\", generatorCalls)\n\t});\n};\nfunction generatedField(spec) {\n\treturn new ScalarFieldBuilder({\n\t\tkind: \"scalar\",\n\t\tdescriptor: blindCast({\n\t\t\t...spec.type,\n\t\t\t...spec.typeParams ? { typeParams: spec.typeParams } : {}\n\t\t}),\n\t\tnullable: false,\n\t\tmany: false,\n\t\texecutionDefaults: { onCreate: spec.generated }\n\t});\n}\nconst namedTypeField = (handle) => new EnumScalarFieldBuilder(blindCast({\n\tkind: \"scalar\",\n\tenumHandle: handle,\n\tnullable: false,\n\tmany: false\n}), handle);\nfunction buildFieldPreset(descriptor, args, namedConstraintOptions) {\n\tconst preset = instantiateAuthoringFieldPreset(descriptor, args);\n\treturn new ScalarFieldBuilder({\n\t\tkind: \"scalar\",\n\t\tdescriptor: preset.descriptor,\n\t\tnullable: preset.nullable,\n\t\tmany: false,\n\t\t...ifDefined(\"default\", preset.default),\n\t\t...ifDefined(\"executionDefaults\", preset.executionDefaults),\n\t\t...preset.id ? { id: namedConstraintOptions?.name ? { name: namedConstraintOptions.name } : {} } : {},\n\t\t...preset.unique ? { unique: namedConstraintOptions?.name ? { name: namedConstraintOptions.name } : {} } : {}\n\t});\n}\nvar RelationBuilder = class RelationBuilder {\n\tstate;\n\tconstructor(state) {\n\t\tthis.state = state;\n\t}\n\tsql(spec) {\n\t\tif (this.state.kind !== \"belongsTo\") throw contractError(\"CONTRACT.RELATION_INVALID\", \"relation.sql(...) is only supported for belongsTo relations.\", { meta: { relationKind: this.state.kind } });\n\t\treturn new RelationBuilder({\n\t\t\t...this.state,\n\t\t\tsql: spec\n\t\t});\n\t}\n\tbuild() {\n\t\treturn this.state;\n\t}\n};\nfunction normalizeFieldRefInput(input) {\n\treturn (Array.isArray(input) ? input : [input]).map((ref) => ref.fieldName);\n}\nfunction normalizeTargetFieldRefInput(input) {\n\tconst refs = Array.isArray(input) ? input : [input];\n\tconst [first] = refs;\n\tif (!first) throw contractError(\"CONTRACT.FOREIGN_KEY_INVALID\", \"Expected at least one target ref\", { meta: { reason: \"empty-target-refs\" } });\n\tif (refs.some((ref) => ref.modelName !== first.modelName)) throw contractError(\"CONTRACT.FOREIGN_KEY_INVALID\", \"All target refs in a foreign key must point to the same model\", { meta: {\n\t\tmismatch: \"modelName\",\n\t\tmodels: refs.map((ref) => ref.modelName)\n\t} });\n\tif (refs.some((ref) => ref.spaceId !== first.spaceId)) throw contractError(\"CONTRACT.FOREIGN_KEY_INVALID\", `All target refs in a compound foreign key must share the same spaceId (found mismatch: \"${first.spaceId ?? \"<local>\"}\" vs \"${refs.find((r) => r.spaceId !== first.spaceId)?.spaceId ?? \"<local>\"}\")`, { meta: {\n\t\tmismatch: \"spaceId\",\n\t\tfirst: first.spaceId,\n\t\tsecond: refs.find((r) => r.spaceId !== first.spaceId)?.spaceId\n\t} });\n\tif (refs.some((ref) => ref.namespaceId !== first.namespaceId)) throw contractError(\"CONTRACT.FOREIGN_KEY_INVALID\", \"All target refs in a compound foreign key must share the same namespaceId (found mismatch)\", { meta: { mismatch: \"namespaceId\" } });\n\tif (refs.some((ref) => ref.tableName !== first.tableName)) throw contractError(\"CONTRACT.FOREIGN_KEY_INVALID\", \"All target refs in a compound foreign key must share the same tableName (found mismatch)\", { meta: { mismatch: \"tableName\" } });\n\treturn {\n\t\tmodelName: first.modelName,\n\t\tfieldNames: refs.map((ref) => ref.columnName ?? ref.fieldName),\n\t\tsource: refs.some((ref) => ref.source === \"string\") ? \"string\" : \"token\",\n\t\tspaceId: first.spaceId,\n\t\tnamespaceId: first.namespaceId,\n\t\ttableName: first.tableName\n\t};\n}\nfunction createConstraintsDsl() {\n\tfunction ref(modelName, fieldName) {\n\t\treturn {\n\t\t\tkind: \"targetFieldRef\",\n\t\t\tsource: \"string\",\n\t\t\tmodelName,\n\t\t\tfieldName\n\t\t};\n\t}\n\tfunction id(fieldOrFields, options) {\n\t\treturn {\n\t\t\tkind: \"id\",\n\t\t\tfields: normalizeFieldRefInput(fieldOrFields),\n\t\t\t...options?.name ? { name: options.name } : {}\n\t\t};\n\t}\n\tfunction unique(fieldOrFields, options) {\n\t\treturn {\n\t\t\tkind: \"unique\",\n\t\t\tfields: normalizeFieldRefInput(fieldOrFields),\n\t\t\t...options?.name ? { name: options.name } : {}\n\t\t};\n\t}\n\tfunction index(fieldsOrOptions, options) {\n\t\tconst isExpressionForm = !Array.isArray(fieldsOrOptions) && typeof fieldsOrOptions === \"object\" && \"expression\" in fieldsOrOptions;\n\t\tconst opts = isExpressionForm ? fieldsOrOptions : options;\n\t\tconst carried = {\n\t\t\tkind: \"index\",\n\t\t\t...opts?.name !== void 0 ? { name: opts.name } : {},\n\t\t\t...opts?.map !== void 0 ? { map: opts.map } : {},\n\t\t\t...opts?.where !== void 0 ? { where: opts.where } : {},\n\t\t\t...opts?.unique !== void 0 ? { unique: opts.unique } : {},\n\t\t\t...opts?.type !== void 0 ? { type: opts.type } : {},\n\t\t\t...opts?.options !== void 0 ? { options: blindCast(opts.options) } : {}\n\t\t};\n\t\treturn isExpressionForm ? {\n\t\t\t...carried,\n\t\t\texpression: fieldsOrOptions.expression\n\t\t} : {\n\t\t\t...carried,\n\t\t\tfields: normalizeFieldRefInput(fieldsOrOptions)\n\t\t};\n\t}\n\tfunction foreignKey(fieldOrFields, target, options) {\n\t\tconst normalizedTarget = normalizeTargetFieldRefInput(target);\n\t\treturn {\n\t\t\tkind: \"fk\",\n\t\t\tfields: normalizeFieldRefInput(fieldOrFields),\n\t\t\ttargetModel: normalizedTarget.modelName,\n\t\t\ttargetFields: normalizedTarget.fieldNames,\n\t\t\ttargetSource: normalizedTarget.source,\n\t\t\t...normalizedTarget.spaceId !== void 0 ? { targetSpaceId: normalizedTarget.spaceId } : {},\n\t\t\t...normalizedTarget.namespaceId !== void 0 ? { targetNamespaceId: normalizedTarget.namespaceId } : {},\n\t\t\t...normalizedTarget.tableName !== void 0 ? { targetTableName: normalizedTarget.tableName } : {},\n\t\t\t...options?.name ? { name: options.name } : {},\n\t\t\t...options?.onDelete ? { onDelete: options.onDelete } : {},\n\t\t\t...options?.onUpdate ? { onUpdate: options.onUpdate } : {},\n\t\t\t...options?.constraint !== void 0 ? { constraint: options.constraint } : {},\n\t\t\t...options?.index !== void 0 ? { index: options.index } : {}\n\t\t};\n\t}\n\treturn {\n\t\tref,\n\t\tid,\n\t\tunique,\n\t\tindex,\n\t\tforeignKey\n\t};\n}\n/**\n* Declares an authored CHECK constraint for a model's `.sql({ checks: [...] })`.\n* Unlike `index()`, `check()` names no column tuple — the predicate is opaque\n* SQL — so it needs no field-ref context and is a plain top-level function\n* rather than a method on `constraints`.\n*/\nfunction check(input) {\n\treturn {\n\t\tkind: \"check\",\n\t\texpression: input.expression,\n\t\t...input.name !== void 0 ? { name: input.name } : {},\n\t\t...input.map !== void 0 ? { map: input.map } : {}\n\t};\n}\nfunction createFieldRefs(fields) {\n\tconst refs = {};\n\tfor (const fieldName of Object.keys(fields)) refs[fieldName] = {\n\t\tkind: \"columnRef\",\n\t\tfieldName\n\t};\n\treturn refs;\n}\nfunction createModelTokenRefs(modelName, fields, crossSpaceCoordinate) {\n\tconst refs = {};\n\tfor (const [fieldName, fieldBuilder] of Object.entries(fields)) {\n\t\tconst physicalColumn = crossSpaceCoordinate !== void 0 ? fieldBuilder.physicalColumnName : void 0;\n\t\trefs[fieldName] = {\n\t\t\tkind: \"targetFieldRef\",\n\t\t\tsource: \"token\",\n\t\t\tmodelName,\n\t\t\tfieldName,\n\t\t\t...crossSpaceCoordinate !== void 0 ? {\n\t\t\t\tspaceId: crossSpaceCoordinate.spaceId,\n\t\t\t\t...crossSpaceCoordinate.namespaceId !== void 0 ? { namespaceId: crossSpaceCoordinate.namespaceId } : {},\n\t\t\t\t...crossSpaceCoordinate.tableName !== void 0 ? { tableName: crossSpaceCoordinate.tableName } : {},\n\t\t\t\t...physicalColumn !== void 0 ? { columnName: physicalColumn } : {}\n\t\t\t} : {}\n\t\t};\n\t}\n\treturn refs;\n}\nfunction buildStageSpec(stageInput, context) {\n\tif (typeof stageInput === \"function\") return stageInput(context);\n\treturn stageInput;\n}\nfunction createAttributeConstraintsDsl() {\n\tconst constraints = createConstraintsDsl();\n\treturn {\n\t\tid: constraints.id,\n\t\tunique: constraints.unique\n\t};\n}\nfunction createSqlConstraintsDsl() {\n\tconst constraints = createConstraintsDsl();\n\treturn {\n\t\tindex: constraints.index,\n\t\tforeignKey: constraints.foreignKey,\n\t\tref: constraints.ref\n\t};\n}\nfunction createColumnRefs(fields) {\n\treturn createFieldRefs(fields);\n}\nfunction findDuplicateRelationName(existingRelations, nextRelations) {\n\treturn Object.keys(nextRelations).find((relationName) => Object.hasOwn(existingRelations, relationName));\n}\nvar ContractModelBuilder = class ContractModelBuilder {\n\tstageOne;\n\tattributesFactory;\n\tsqlFactory;\n\tspaceId;\n\ttableName;\n\trefs;\n\tconstructor(stageOne, attributesFactory, sqlFactory, spaceId, tableName) {\n\t\tthis.stageOne = stageOne;\n\t\tthis.attributesFactory = attributesFactory;\n\t\tthis.sqlFactory = sqlFactory;\n\t\tthis.spaceId = spaceId;\n\t\tthis.tableName = tableName;\n\t\tconst crossSpaceCoordinate = spaceId !== void 0 ? {\n\t\t\tspaceId,\n\t\t\t...stageOne.namespace !== void 0 ? { namespaceId: stageOne.namespace } : {},\n\t\t\t...tableName !== void 0 ? { tableName } : {}\n\t\t} : void 0;\n\t\tthis.refs = blindCast(stageOne.modelName ? createModelTokenRefs(stageOne.modelName, stageOne.fields, crossSpaceCoordinate) : void 0);\n\t}\n\tref(fieldName) {\n\t\tconst modelName = this.stageOne.modelName;\n\t\tif (!modelName) throw contractError(\"CONTRACT.MODEL_TOKEN_INVALID\", \"Model tokens require model(\\\"ModelName\\\", ...) before calling .ref(...)\");\n\t\treturn {\n\t\t\tkind: \"targetFieldRef\",\n\t\t\tsource: \"token\",\n\t\t\tmodelName,\n\t\t\tfieldName\n\t\t};\n\t}\n\trelations(relations) {\n\t\tconst duplicateRelationName = findDuplicateRelationName(this.stageOne.relations, relations);\n\t\tif (duplicateRelationName) throw contractError(\"CONTRACT.NAME_DUPLICATE\", `Model \"${this.stageOne.modelName ?? \"<anonymous>\"}\" already defines relation \"${duplicateRelationName}\".`, { meta: {\n\t\t\tkind: \"relation\",\n\t\t\tname: duplicateRelationName,\n\t\t\tmodelName: this.stageOne.modelName\n\t\t} });\n\t\treturn new ContractModelBuilder({\n\t\t\t...this.stageOne,\n\t\t\trelations: {\n\t\t\t\t...this.stageOne.relations,\n\t\t\t\t...relations\n\t\t\t}\n\t\t}, this.attributesFactory, this.sqlFactory, this.spaceId, this.tableName);\n\t}\n\tattributes(specOrFactory) {\n\t\treturn blindCast(new ContractModelBuilder(this.stageOne, specOrFactory, this.sqlFactory, this.spaceId, this.tableName));\n\t}\n\tsql(specOrFactory) {\n\t\tconst nextTableName = typeof specOrFactory !== \"function\" ? specOrFactory.table : this.tableName;\n\t\treturn blindCast(new ContractModelBuilder(this.stageOne, this.attributesFactory, specOrFactory, this.spaceId, nextTableName));\n\t}\n\tbuildAttributesSpec() {\n\t\tif (!this.attributesFactory) return;\n\t\treturn buildStageSpec(this.attributesFactory, {\n\t\t\tfields: createFieldRefs(this.stageOne.fields),\n\t\t\tconstraints: createAttributeConstraintsDsl()\n\t\t});\n\t}\n\tbuildSqlSpec() {\n\t\tif (!this.sqlFactory) return;\n\t\treturn buildStageSpec(this.sqlFactory, {\n\t\t\tcols: createColumnRefs(this.stageOne.fields),\n\t\t\tconstraints: createSqlConstraintsDsl()\n\t\t});\n\t}\n};\nfunction isLazyRelationModelName(value) {\n\treturn typeof value === \"object\" && value !== null && \"kind\" in value && value.kind === \"lazyRelationModelName\" && \"resolve\" in value && typeof value.resolve === \"function\";\n}\nfunction resolveNamedModelTokenName(token) {\n\tconst modelName = token.stageOne.modelName;\n\tif (!modelName) throw contractError(\"CONTRACT.MODEL_TOKEN_INVALID\", \"Relation targets require named model tokens. Use model(\\\"ModelName\\\", ...) before passing a token to rel.*(...).\");\n\treturn modelName;\n}\nfunction normalizeRelationModelSource(target) {\n\tif (typeof target === \"string\") return {\n\t\tkind: \"relationModelName\",\n\t\tsource: \"string\",\n\t\tmodelName: target\n\t};\n\tif (typeof target === \"function\") return {\n\t\tkind: \"lazyRelationModelName\",\n\t\tsource: \"lazyToken\",\n\t\tresolve: () => resolveNamedModelTokenName(target())\n\t};\n\treturn {\n\t\tkind: \"relationModelName\",\n\t\tsource: \"token\",\n\t\tmodelName: resolveNamedModelTokenName(target)\n\t};\n}\nfunction model(modelNameOrInput, maybeInput) {\n\tconst input = typeof modelNameOrInput === \"string\" ? maybeInput : modelNameOrInput;\n\tif (!input) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", \"model(\\\"ModelName\\\", ...) requires a model definition.\");\n\treturn new ContractModelBuilder({\n\t\t...typeof modelNameOrInput === \"string\" ? { modelName: modelNameOrInput } : {},\n\t\t...input.namespace !== void 0 ? { namespace: input.namespace } : {},\n\t\tfields: input.fields,\n\t\trelations: input.relations ?? {}\n\t});\n}\n/**\n* Factory for building a standalone branded extension model handle.\n*\n* Use this instead of `new ContractModelBuilder(…)` when constructing handles\n* for models that live in a foreign contract space (e.g. a Supabase extension\n* model referenced by a user's contract). The `spaceId` brands the returned\n* handle so `refs.<field>.spaceId` carries the foreign space identifier.\n*\n* @param name - The domain model name as declared in the foreign contract\n* (e.g. `'AuthUser'`, not a bare table alias like `'User'`).\n* @param input.namespace - The namespace within the foreign space (e.g. `'auth'`).\n* @param input.fields - Field definitions (use `field.column(…)`).\n* @param input.table - The physical table name in the foreign schema.\n* @param spaceId - The extension space identifier (e.g. `'supabase'`).\n*/\nfunction extensionModel(name, input, spaceId) {\n\treturn new ContractModelBuilder({\n\t\tmodelName: name,\n\t\tnamespace: input.namespace,\n\t\tfields: input.fields,\n\t\trelations: {}\n\t}, void 0, void 0, spaceId, input.table);\n}\nfunction isCrossSpaceHandle(value) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tconst rec = blindCast(value);\n\treturn typeof rec[\"spaceId\"] === \"string\" && typeof rec[\"stageOne\"] === \"object\" && rec[\"stageOne\"] !== null;\n}\nfunction belongsTo(toModel, options) {\n\tconst resolvedModel = typeof toModel === \"function\" ? toModel() : toModel;\n\tconst crossSpaceCoordinate = isCrossSpaceHandle(resolvedModel) ? {\n\t\tspaceId: resolvedModel.spaceId,\n\t\t...resolvedModel.tableName !== void 0 ? { tableName: resolvedModel.tableName } : {},\n\t\t...resolvedModel.stageOne.namespace !== void 0 ? { namespaceId: resolvedModel.stageOne.namespace } : {}\n\t} : void 0;\n\treturn new RelationBuilder({\n\t\tkind: \"belongsTo\",\n\t\ttoModel: normalizeRelationModelSource(toModel),\n\t\tfrom: options.from,\n\t\tto: options.to,\n\t\t...ifDefined(\"optional\", options.optional),\n\t\t...crossSpaceCoordinate !== void 0 ? crossSpaceCoordinate : {}\n\t});\n}\nfunction hasMany(toModel, options) {\n\treturn new RelationBuilder({\n\t\tkind: \"hasMany\",\n\t\ttoModel: normalizeRelationModelSource(toModel),\n\t\tby: options.by\n\t});\n}\nfunction hasOne(toModel, options) {\n\treturn new RelationBuilder({\n\t\tkind: \"hasOne\",\n\t\ttoModel: normalizeRelationModelSource(toModel),\n\t\tby: options.by\n\t});\n}\nfunction manyToMany(toModel, options) {\n\treturn new RelationBuilder({\n\t\tkind: \"manyToMany\",\n\t\ttoModel: normalizeRelationModelSource(toModel),\n\t\tthrough: normalizeRelationModelSource(options.through),\n\t\tfrom: options.from,\n\t\tto: options.to\n\t});\n}\nconst rel = {\n\tbelongsTo,\n\thasMany,\n\thasOne,\n\tmanyToMany\n};\nconst field = {\n\tcolumn: columnField,\n\tgenerated: generatedField,\n\tnamedType: namedTypeField\n};\nfunction isContractInput(value) {\n\tif (typeof value !== \"object\" || value === null || !(\"target\" in value) || !(\"family\" in value)) return false;\n\tconst target = value.target;\n\tconst family = value.family;\n\treturn typeof target === \"object\" && target !== null && \"kind\" in target && target.kind === \"target\" && typeof family === \"object\" && family !== null && \"kind\" in family && family.kind === \"family\";\n}\nfunction isRelationFieldArray(value) {\n\treturn Array.isArray(value);\n}\nfunction normalizeRelationFieldNames(value) {\n\tif (isRelationFieldArray(value)) return value;\n\treturn [value];\n}\nfunction resolveRelationModelName(value) {\n\tif (isLazyRelationModelName(value)) return value.resolve();\n\treturn value.modelName;\n}\nfunction applyNaming(name, strategy) {\n\tif (!strategy || strategy === \"identity\") return name;\n\tlet result = \"\";\n\tfor (let index = 0; index < name.length; index += 1) {\n\t\tconst char = name[index];\n\t\tif (!char) continue;\n\t\tconst lower = char.toLowerCase();\n\t\tif (char !== lower && index > 0) {\n\t\t\tconst prev = name[index - 1];\n\t\t\tconst next = name[index + 1];\n\t\t\tconst prevIsLower = !!prev && prev === prev.toLowerCase();\n\t\t\tconst nextIsLower = !!next && next === next.toLowerCase();\n\t\t\tif (prevIsLower || nextIsLower) result += \"_\";\n\t\t}\n\t\tresult += lower;\n\t}\n\treturn result;\n}\n//#endregion\n//#region src/composed-authoring-helpers.ts\nfunction composeTypeNamespace(components) {\n\treturn composePackAuthoringNamespace(components, \"type\");\n}\nfunction composeFieldNamespace(components) {\n\treturn composePackAuthoringNamespace(components, \"field\");\n}\nfunction composeEntityNamespace(components) {\n\treturn composePackAuthoringNamespace(components, \"entityTypes\");\n}\n/**\n* Reserved top-level keys on the composed helpers surface — the\n* built-in `model` / `rel` helpers, the `field` / `type` / `gen` namespace\n* objects. Pack-contributed entity types are flattened to the same\n* top-level shape (e.g. `helpers.enum({...})`), so a pack cannot\n* contribute an entity type whose name collides with one of these\n* reserved keys without silently overwriting at runtime. Detect the\n* collision at compose time and fail loudly with a guidance message.\n*/\nconst RESERVED_HELPER_KEYS = [\n\t\"field\",\n\t\"model\",\n\t\"rel\",\n\t\"type\",\n\t\"gen\"\n];\nfunction assertNoBuiltInEntityCollisions(namespace) {\n\tconst collisions = Object.keys(namespace).filter((name) => RESERVED_HELPER_KEYS.includes(name));\n\tif (collisions.length > 0) throw contractError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Pack-contributed entity type(s) ${collisions.map((c) => `\"${c}\"`).join(\", \")} collide with the reserved built-in helper key(s) on the composed helpers surface. Reserved keys: ${RESERVED_HELPER_KEYS.map((k) => `\"${k}\"`).join(\", \")}.`, { meta: {\n\t\tcollisions,\n\t\treservedKeys: RESERVED_HELPER_KEYS\n\t} });\n}\nfunction createComposedFieldHelpers(fieldNamespace, lookups) {\n\tconst helperNamespace = createFieldHelpersFromNamespace(fieldNamespace, ({ helperPath, descriptor }) => createFieldPresetHelper({\n\t\thelperPath,\n\t\tdescriptor,\n\t\tcodecLookup: lookups.codecLookup,\n\t\tdataTypes: lookups.dataTypes,\n\t\tbuild: ({ args, namedConstraintOptions }) => buildFieldPreset(descriptor, args, namedConstraintOptions)\n\t}));\n\tconst coreFieldHelpers = {\n\t\tcolumn: field.column,\n\t\tgenerated: field.generated,\n\t\tnamedType: field.namedType\n\t};\n\tconst coreHelperNames = new Set(Object.keys(coreFieldHelpers));\n\tfor (const helperName of Object.keys(helperNamespace)) if (coreHelperNames.has(helperName)) throw contractError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Duplicate authoring field helper \"${helperName}\". Core field helpers reserve that name.`, { meta: { helperName } });\n\treturn {\n\t\t...coreFieldHelpers,\n\t\t...helperNamespace\n\t};\n}\nfunction createComposedAuthoringHelpers(options) {\n\tconst extensionValues = Object.values(options.extensions ?? {});\n\tconst components = [\n\t\toptions.family,\n\t\toptions.target,\n\t\t...extensionValues\n\t];\n\tconst typeNamespace = composeTypeNamespace(components);\n\tconst fieldNamespace = composeFieldNamespace(components);\n\tconst entityNamespace = composeEntityNamespace(components);\n\tassertNoCrossRegistryCollisions(typeNamespace, fieldNamespace, entityNamespace);\n\tassertNoBuiltInEntityCollisions(entityNamespace);\n\tconst { support } = assembleDataTypeSupport(components, (codecId) => options.codecLookup.descriptorFor(codecId)?.dataType);\n\tconst helperLookups = {\n\t\tcodecLookup: options.codecLookup,\n\t\tdataTypes: support\n\t};\n\treturn blindCast({\n\t\t...createEntityHelpersFromNamespace(entityNamespace, { ctx: {\n\t\t\tfamily: options.family.familyId,\n\t\t\ttarget: options.target.targetId,\n\t\t\tcodecLookup: options.codecLookup,\n\t\t\tdataTypes: support\n\t\t} }),\n\t\tfield: createComposedFieldHelpers(fieldNamespace, helperLookups),\n\t\tmodel,\n\t\trel,\n\t\ttype: createTypeHelpersFromNamespace(typeNamespace, helperLookups),\n\t\tgen: createGeneratorHelpers([\n\t\t\toptions.family,\n\t\t\toptions.target,\n\t\t\t...extensionValues\n\t\t])\n\t});\n}\n//#endregion\n//#region src/contract-warnings.ts\nfunction hasNamedModelToken(models, modelName) {\n\treturn models[modelName]?.stageOne.modelName === modelName;\n}\nfunction formatFieldSelection(fieldNames) {\n\tif (fieldNames.length === 1) return `'${fieldNames[0]}'`;\n\treturn `[${fieldNames.map((fieldName) => `'${fieldName}'`).join(\", \")}]`;\n}\nfunction formatTokenFieldSelection(modelName, fieldNames) {\n\tif (fieldNames.length === 1) return `${modelName}.refs.${fieldNames[0]}`;\n\treturn `[${fieldNames.map((fieldName) => `${modelName}.refs.${fieldName}`).join(\", \")}]`;\n}\nfunction formatConstraintsRefCall(modelName, fieldNames) {\n\tif (fieldNames.length === 1) return `constraints.ref('${modelName}', '${fieldNames[0]}')`;\n\treturn `[${fieldNames.map((fieldName) => `constraints.ref('${modelName}', '${fieldName}')`).join(\", \")}]`;\n}\nfunction formatRelationModelDisplay(relationModel) {\n\tif (relationModel.kind === \"lazyRelationModelName\") return `() => ${relationModel.resolve()}`;\n\treturn relationModel.source === \"string\" ? `'${relationModel.modelName}'` : relationModel.modelName;\n}\nfunction formatRelationCall(relation, targetModelDisplay) {\n\tif (relation.kind === \"belongsTo\") return `rel.belongsTo(${targetModelDisplay}, { from: ${formatFieldSelection(normalizeRelationFieldNames(relation.from))}, to: ${formatFieldSelection(normalizeRelationFieldNames(relation.to))} })`;\n\tif (relation.kind === \"hasMany\" || relation.kind === \"hasOne\") {\n\t\tconst by = formatFieldSelection(normalizeRelationFieldNames(relation.by));\n\t\treturn `rel.${relation.kind}(${targetModelDisplay}, { by: ${by} })`;\n\t}\n\treturn `rel.manyToMany(${targetModelDisplay}, { through: ${formatRelationModelDisplay(relation.through)}, from: ${formatFieldSelection(normalizeRelationFieldNames(relation.from))}, to: ${formatFieldSelection(normalizeRelationFieldNames(relation.to))} })`;\n}\nfunction formatManyToManyCallWithThrough(relation, throughDisplay) {\n\treturn `rel.manyToMany(${formatRelationModelDisplay(relation.toModel)}, { through: ${throughDisplay}, from: ${formatFieldSelection(normalizeRelationFieldNames(relation.from))}, to: ${formatFieldSelection(normalizeRelationFieldNames(relation.to))} })`;\n}\nconst WARNING_BATCH_THRESHOLD = 5;\nfunction flushWarnings(warnings) {\n\tif (warnings.length === 0) return;\n\tif (warnings.length <= WARNING_BATCH_THRESHOLD) {\n\t\tfor (const message of warnings) process.emitWarning(message, { code: \"PN_CONTRACT_TYPED_FALLBACK_AVAILABLE\" });\n\t\treturn;\n\t}\n\tprocess.emitWarning(`${warnings.length} contract references use string fallbacks where typed alternatives are available. Use named model tokens for autocomplete and type safety.\n` + warnings.map((w) => ` - ${w}`).join(\"\\n\"), { code: \"PN_CONTRACT_TYPED_FALLBACK_AVAILABLE\" });\n}\nfunction formatFallbackWarning(location, current, suggested) {\n\treturn `Contract ${location} uses ${current}. Use ${suggested} when the named model token is available in the same contract to keep typed relation targets and model refs.`;\n}\nfunction emitTypedCrossModelFallbackWarnings(collection) {\n\tconst warnings = [];\n\tconst warnedKeys = /* @__PURE__ */ new Set();\n\tfor (const spec of collection.modelSpecs.values()) {\n\t\tfor (const [relationName, relationBuilder] of Object.entries(spec.relations)) {\n\t\t\tconst relation = relationBuilder.build();\n\t\t\tif (relation.toModel.kind === \"relationModelName\" && relation.toModel.source === \"string\" && hasNamedModelToken(collection.models, relation.toModel.modelName)) {\n\t\t\t\tconst warningKey = `${spec.modelName}.${relationName}.toModel`;\n\t\t\t\tif (!warnedKeys.has(warningKey)) {\n\t\t\t\t\twarnedKeys.add(warningKey);\n\t\t\t\t\tconst current = formatRelationCall(relation, `'${relation.toModel.modelName}'`);\n\t\t\t\t\tconst suggested = formatRelationCall(relation, relation.toModel.modelName);\n\t\t\t\t\twarnings.push(formatFallbackWarning(`relation \"${spec.modelName}.${relationName}\"`, current, suggested));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (relation.kind === \"manyToMany\" && relation.through.kind === \"relationModelName\" && relation.through.source === \"string\" && hasNamedModelToken(collection.models, relation.through.modelName)) {\n\t\t\t\tconst warningKey = `${spec.modelName}.${relationName}.through`;\n\t\t\t\tif (!warnedKeys.has(warningKey)) {\n\t\t\t\t\twarnedKeys.add(warningKey);\n\t\t\t\t\tconst current = formatManyToManyCallWithThrough(relation, `'${relation.through.modelName}'`);\n\t\t\t\t\tconst suggested = formatManyToManyCallWithThrough(relation, relation.through.modelName);\n\t\t\t\t\twarnings.push(formatFallbackWarning(`relation \"${spec.modelName}.${relationName}\"`, current, suggested));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (const [foreignKeyIndex, foreignKey] of (spec.sqlSpec?.foreignKeys ?? []).entries()) {\n\t\t\tif (foreignKey.targetSource !== \"string\" || !hasNamedModelToken(collection.models, foreignKey.targetModel)) continue;\n\t\t\tconst warningKey = `${spec.modelName}.sql.foreignKeys.${foreignKeyIndex}`;\n\t\t\tif (warnedKeys.has(warningKey)) continue;\n\t\t\twarnedKeys.add(warningKey);\n\t\t\tconst current = formatConstraintsRefCall(foreignKey.targetModel, foreignKey.targetFields);\n\t\t\tconst suggested = formatTokenFieldSelection(foreignKey.targetModel, foreignKey.targetFields);\n\t\t\twarnings.push(formatFallbackWarning(`model \"${spec.modelName}\"`, `${current} in .sql(...)`, suggested));\n\t\t}\n\t}\n\tflushWarnings(warnings);\n}\n//#endregion\n//#region src/contract-lowering.ts\n/** A column stores no `typeParams` when it has none, as PSL writes it (ADR 246). */\nfunction withoutEmptyTypeParams(descriptor) {\n\tconst { typeParams, ...rest } = descriptor;\n\treturn typeParams === void 0 || Object.keys(typeParams).length > 0 ? descriptor : rest;\n}\nfunction resolveFieldDescriptor(modelName, fieldName, fieldState) {\n\tif (\"descriptor\" in fieldState && fieldState.descriptor) return withoutEmptyTypeParams(fieldState.descriptor);\n\tif (\"enumHandle\" in fieldState && isEnumTypeHandle(fieldState.enumHandle)) return { codecId: fieldState.enumHandle.codecId };\n\tthrow contractError(\"CONTRACT.TYPE_UNKNOWN\", `Field \"${modelName}.${fieldName}\" does not resolve to a storage descriptor`, { meta: {\n\t\tmodelName,\n\t\tfieldName,\n\t\treason: \"unresolved-storage-descriptor\"\n\t} });\n}\nfunction mapFieldNamesToColumnNames(modelName, fieldNames, fieldToColumn) {\n\treturn fieldNames.map((fieldName) => {\n\t\tconst columnName = fieldToColumn[fieldName];\n\t\tif (!columnName) throw contractError(\"CONTRACT.FIELD_UNKNOWN\", `Unknown field \"${modelName}.${fieldName}\" in contract definition`, { meta: {\n\t\t\tmodelName,\n\t\t\tfieldName\n\t\t} });\n\t\treturn columnName;\n\t});\n}\nfunction assertRelationFieldArity(params) {\n\tif (params.leftFields.length === params.rightFields.length) return;\n\tthrow contractError(\"CONTRACT.RELATION_INVALID\", `Relation \"${params.modelName}.${params.relationName}\" maps ${params.leftFields.length} ${params.leftLabel} field(s) to ${params.rightFields.length} ${params.rightLabel} field(s).`, { meta: {\n\t\tmodelName: params.modelName,\n\t\trelationName: params.relationName,\n\t\treason: \"field-count-mismatch\"\n\t} });\n}\nfunction resolveInlineIdConstraint(spec) {\n\tconst inlineIdFields = [];\n\tlet idName;\n\tfor (const [fieldName, fieldBuilder] of Object.entries(spec.fieldBuilders)) {\n\t\tconst fieldState = fieldBuilder.build();\n\t\tif (!fieldState.id) continue;\n\t\tinlineIdFields.push(fieldName);\n\t\tif (fieldState.id.name) idName = fieldState.id.name;\n\t}\n\tif (inlineIdFields.length === 0) return;\n\tif (inlineIdFields.length > 1) throw contractError(\"CONTRACT.IDENTITY_INVALID\", `Model \"${spec.modelName}\" marks multiple fields with .id(). Use .attributes(...) for compound identities.`, { meta: {\n\t\tmodelName: spec.modelName,\n\t\treason: \"multiple-inline-ids\",\n\t\tfields: inlineIdFields\n\t} });\n\tconst [inlineIdField] = inlineIdFields;\n\tif (!inlineIdField) return;\n\treturn {\n\t\tkind: \"id\",\n\t\tfields: [inlineIdField],\n\t\t...idName ? { name: idName } : {}\n\t};\n}\nfunction collectInlineUniqueConstraints(spec) {\n\tconst constraints = [];\n\tfor (const [fieldName, fieldBuilder] of Object.entries(spec.fieldBuilders)) {\n\t\tconst fieldState = fieldBuilder.build();\n\t\tif (!fieldState.unique) continue;\n\t\tconstraints.push({\n\t\t\tkind: \"unique\",\n\t\t\tfields: [fieldName],\n\t\t\t...fieldState.unique.name ? { name: fieldState.unique.name } : {}\n\t\t});\n\t}\n\treturn constraints;\n}\nfunction resolveModelIdConstraint(spec) {\n\tconst inlineId = resolveInlineIdConstraint(spec);\n\tconst attributeId = spec.attributesSpec?.id;\n\tif (inlineId && attributeId) throw contractError(\"CONTRACT.IDENTITY_INVALID\", `Model \"${spec.modelName}\" defines identity both inline and in .attributes(...). Pick one identity style.`, { meta: {\n\t\tmodelName: spec.modelName,\n\t\treason: \"inline-and-attributes\"\n\t} });\n\tconst resolvedId = attributeId ?? inlineId;\n\tif (resolvedId && resolvedId.fields.length === 0) throw contractError(\"CONTRACT.IDENTITY_INVALID\", `Model \"${spec.modelName}\" defines an empty identity. Add at least one field.`, { meta: {\n\t\tmodelName: spec.modelName,\n\t\treason: \"empty-identity\"\n\t} });\n\treturn resolvedId;\n}\nfunction resolveModelUniqueConstraints(spec) {\n\tconst attributeUniques = spec.attributesSpec?.uniques ?? [];\n\tfor (const unique of attributeUniques) if (unique.fields.length === 0) throw contractError(\"CONTRACT.CONSTRAINT_INVALID\", `Model \"${spec.modelName}\" defines an empty unique constraint. Add at least one field.`, { meta: { modelName: spec.modelName } });\n\treturn [...collectInlineUniqueConstraints(spec), ...attributeUniques];\n}\nfunction resolveRelationForeignKeys(spec, allSpecs) {\n\tconst foreignKeys = [];\n\tfor (const [relationName, relationBuilder] of Object.entries(spec.relations)) {\n\t\tconst relation = relationBuilder.build();\n\t\tif (relation.kind !== \"belongsTo\" || !relation.sql?.fk) continue;\n\t\tconst targetModelName = resolveRelationModelName(relation.toModel);\n\t\tif (relation.spaceId !== void 0) {\n\t\t\tconst fields = normalizeRelationFieldNames(relation.from);\n\t\t\tconst targetFields = normalizeRelationFieldNames(relation.to);\n\t\t\tassertRelationFieldArity({\n\t\t\t\tmodelName: spec.modelName,\n\t\t\t\trelationName,\n\t\t\t\tleftLabel: \"source\",\n\t\t\t\tleftFields: fields,\n\t\t\t\trightLabel: \"target\",\n\t\t\t\trightFields: targetFields\n\t\t\t});\n\t\t\tforeignKeys.push({\n\t\t\t\tkind: \"fk\",\n\t\t\t\tfields,\n\t\t\t\ttargetModel: targetModelName,\n\t\t\t\ttargetFields,\n\t\t\t\ttargetSpaceId: relation.spaceId,\n\t\t\t\t...relation.namespaceId !== void 0 ? { targetNamespaceId: relation.namespaceId } : {},\n\t\t\t\t...relation.tableName !== void 0 ? { targetTableName: relation.tableName } : {},\n\t\t\t\t...relation.sql.fk.name ? { name: relation.sql.fk.name } : {},\n\t\t\t\t...relation.sql.fk.onDelete ? { onDelete: relation.sql.fk.onDelete } : {},\n\t\t\t\t...relation.sql.fk.onUpdate ? { onUpdate: relation.sql.fk.onUpdate } : {},\n\t\t\t\t...relation.sql.fk.constraint !== void 0 ? { constraint: relation.sql.fk.constraint } : {},\n\t\t\t\t...relation.sql.fk.index !== void 0 ? { index: relation.sql.fk.index } : {}\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (!allSpecs.has(targetModelName)) throw contractError(\"CONTRACT.MODEL_UNKNOWN\", `Relation \"${spec.modelName}.${relationName}\" references unknown model \"${targetModelName}\"`, { meta: {\n\t\t\tsourceModel: spec.modelName,\n\t\t\trelationName,\n\t\t\ttargetModel: targetModelName\n\t\t} });\n\t\tconst fields = normalizeRelationFieldNames(relation.from);\n\t\tconst targetFields = normalizeRelationFieldNames(relation.to);\n\t\tassertRelationFieldArity({\n\t\t\tmodelName: spec.modelName,\n\t\t\trelationName,\n\t\t\tleftLabel: \"source\",\n\t\t\tleftFields: fields,\n\t\t\trightLabel: \"target\",\n\t\t\trightFields: targetFields\n\t\t});\n\t\tforeignKeys.push({\n\t\t\tkind: \"fk\",\n\t\t\tfields,\n\t\t\ttargetModel: targetModelName,\n\t\t\ttargetFields,\n\t\t\t...relation.sql.fk.name ? { name: relation.sql.fk.name } : {},\n\t\t\t...relation.sql.fk.onDelete ? { onDelete: relation.sql.fk.onDelete } : {},\n\t\t\t...relation.sql.fk.onUpdate ? { onUpdate: relation.sql.fk.onUpdate } : {},\n\t\t\t...relation.sql.fk.constraint !== void 0 ? { constraint: relation.sql.fk.constraint } : {},\n\t\t\t...relation.sql.fk.index !== void 0 ? { index: relation.sql.fk.index } : {}\n\t\t});\n\t}\n\treturn foreignKeys;\n}\nfunction resolveRelationAnchorFields(spec) {\n\tconst idFields = spec.idConstraint?.fields;\n\tif (idFields && idFields.length > 0) return idFields;\n\tif (\"id\" in spec.fieldToColumn) return [\"id\"];\n\tthrow contractError(\"CONTRACT.IDENTITY_INVALID\", `Model \"${spec.modelName}\" needs an explicit id or an \"id\" field to anchor non-owning relations`, { meta: {\n\t\tmodelName: spec.modelName,\n\t\treason: \"missing-anchor-id\"\n\t} });\n}\nfunction belongsToNullable(relationName, declaredNullable, spec, fieldNames) {\n\tconst { nullable, contradiction } = resolveToOneRelationNullable({\n\t\tdeclaredNullable,\n\t\tlocalFieldNullability: fieldNames.map((fieldName) => spec.fieldBuilders[fieldName]?.build().nullable === true),\n\t\townsReference: true\n\t});\n\tif (contradiction !== void 0) throw contractError(\"CONTRACT.RELATION_INVALID\", toOneNullabilityContradictionMessage(`Relation \"${spec.modelName}.${relationName}\"`, contradiction), { meta: {\n\t\tmodelName: spec.modelName,\n\t\trelationName,\n\t\treason: \"to-one-nullability-mismatch\"\n\t} });\n\treturn nullable;\n}\nfunction lowerBelongsToRelation(relationName, relation, currentSpec, allSpecs, extensions) {\n\tconst targetModelName = resolveRelationModelName(relation.toModel);\n\tconst fromFields = normalizeRelationFieldNames(relation.from);\n\tconst toFields = normalizeRelationFieldNames(relation.to);\n\tassertRelationFieldArity({\n\t\tmodelName: currentSpec.modelName,\n\t\trelationName,\n\t\tleftLabel: \"source\",\n\t\tleftFields: fromFields,\n\t\trightLabel: \"target\",\n\t\trightFields: toFields\n\t});\n\tif (relation.spaceId !== void 0) {\n\t\tassertKnownExtensionPack(extensions, relation.spaceId, `Relation \"${currentSpec.modelName}.${relationName}\"`);\n\t\tconst parentColumns = mapFieldNamesToColumnNames(currentSpec.modelName, fromFields, currentSpec.fieldToColumn);\n\t\treturn {\n\t\t\tfieldName: relationName,\n\t\t\ttoModel: targetModelName,\n\t\t\ttoTable: relation.tableName,\n\t\t\tcardinality: \"N:1\",\n\t\t\tnullable: belongsToNullable(relationName, relation.optional, currentSpec, fromFields),\n\t\t\tspaceId: relation.spaceId,\n\t\t\t...relation.namespaceId !== void 0 ? { namespaceId: relation.namespaceId } : {},\n\t\t\ton: {\n\t\t\t\tparentTable: currentSpec.tableName,\n\t\t\t\tparentColumns,\n\t\t\t\tchildTable: relation.tableName,\n\t\t\t\tchildColumns: toFields\n\t\t\t}\n\t\t};\n\t}\n\tconst targetSpec = allSpecs.get(targetModelName);\n\tif (!targetSpec) throw contractError(\"CONTRACT.MODEL_UNKNOWN\", `Relation \"${currentSpec.modelName}.${relationName}\" references unknown model \"${targetModelName}\"`, { meta: {\n\t\tsourceModel: currentSpec.modelName,\n\t\trelationName,\n\t\ttargetModel: targetModelName\n\t} });\n\treturn {\n\t\tfieldName: relationName,\n\t\ttoModel: targetModelName,\n\t\ttoTable: targetSpec.tableName,\n\t\tcardinality: \"N:1\",\n\t\tnullable: belongsToNullable(relationName, relation.optional, currentSpec, fromFields),\n\t\ton: {\n\t\t\tparentTable: currentSpec.tableName,\n\t\t\tparentColumns: mapFieldNamesToColumnNames(currentSpec.modelName, fromFields, currentSpec.fieldToColumn),\n\t\t\tchildTable: targetSpec.tableName,\n\t\t\tchildColumns: mapFieldNamesToColumnNames(targetSpec.modelName, toFields, targetSpec.fieldToColumn)\n\t\t}\n\t};\n}\nfunction lowerHasOwnershipRelation(relationName, relation, currentSpec, allSpecs) {\n\tconst targetModelName = resolveRelationModelName(relation.toModel);\n\tconst targetSpec = allSpecs.get(targetModelName);\n\tif (!targetSpec) throw contractError(\"CONTRACT.MODEL_UNKNOWN\", `Relation \"${currentSpec.modelName}.${relationName}\" references unknown model \"${targetModelName}\"`, { meta: {\n\t\tsourceModel: currentSpec.modelName,\n\t\trelationName,\n\t\ttargetModel: targetModelName\n\t} });\n\tconst parentFields = resolveRelationAnchorFields(currentSpec);\n\tconst childFields = normalizeRelationFieldNames(relation.by);\n\tassertRelationFieldArity({\n\t\tmodelName: currentSpec.modelName,\n\t\trelationName,\n\t\tleftLabel: \"anchor\",\n\t\tleftFields: parentFields,\n\t\trightLabel: \"child\",\n\t\trightFields: childFields\n\t});\n\treturn {\n\t\tfieldName: relationName,\n\t\ttoModel: targetModelName,\n\t\ttoTable: targetSpec.tableName,\n\t\t...relation.kind === \"hasMany\" ? { cardinality: \"1:N\" } : {\n\t\t\tcardinality: \"1:1\",\n\t\t\tnullable: true\n\t\t},\n\t\ton: {\n\t\t\tparentTable: currentSpec.tableName,\n\t\t\tparentColumns: mapFieldNamesToColumnNames(currentSpec.modelName, parentFields, currentSpec.fieldToColumn),\n\t\t\tchildTable: targetSpec.tableName,\n\t\t\tchildColumns: mapFieldNamesToColumnNames(targetSpec.modelName, childFields, targetSpec.fieldToColumn)\n\t\t}\n\t};\n}\nfunction lowerManyToManyRelation(relationName, relation, currentSpec, allSpecs) {\n\tconst targetModelName = resolveRelationModelName(relation.toModel);\n\tconst targetSpec = allSpecs.get(targetModelName);\n\tif (!targetSpec) throw contractError(\"CONTRACT.MODEL_UNKNOWN\", `Relation \"${currentSpec.modelName}.${relationName}\" references unknown model \"${targetModelName}\"`, { meta: {\n\t\tsourceModel: currentSpec.modelName,\n\t\trelationName,\n\t\ttargetModel: targetModelName\n\t} });\n\tconst throughModelName = resolveRelationModelName(relation.through);\n\tconst throughSpec = allSpecs.get(throughModelName);\n\tif (!throughSpec) throw contractError(\"CONTRACT.MODEL_UNKNOWN\", `Relation \"${currentSpec.modelName}.${relationName}\" references unknown through model \"${throughModelName}\"`, { meta: {\n\t\tsourceModel: currentSpec.modelName,\n\t\trelationName,\n\t\ttargetModel: throughModelName\n\t} });\n\tconst currentAnchorFields = resolveRelationAnchorFields(currentSpec);\n\tconst targetAnchorFields = resolveRelationAnchorFields(targetSpec);\n\tconst throughFromFields = normalizeRelationFieldNames(relation.from);\n\tconst throughToFields = normalizeRelationFieldNames(relation.to);\n\tif (currentAnchorFields.length !== throughFromFields.length || targetAnchorFields.length !== throughToFields.length) throw contractError(\"CONTRACT.RELATION_INVALID\", `Relation \"${currentSpec.modelName}.${relationName}\" has mismatched many-to-many field counts.`, { meta: {\n\t\tmodelName: currentSpec.modelName,\n\t\trelationName,\n\t\treason: \"many-to-many-field-count-mismatch\"\n\t} });\n\treturn {\n\t\tfieldName: relationName,\n\t\ttoModel: targetModelName,\n\t\ttoTable: targetSpec.tableName,\n\t\tcardinality: \"N:M\",\n\t\tthrough: {\n\t\t\ttable: throughSpec.tableName,\n\t\t\t...ifDefined(\"namespaceId\", throughSpec.namespace),\n\t\t\tparentColumns: mapFieldNamesToColumnNames(throughSpec.modelName, throughFromFields, throughSpec.fieldToColumn),\n\t\t\tchildColumns: mapFieldNamesToColumnNames(throughSpec.modelName, throughToFields, throughSpec.fieldToColumn)\n\t\t},\n\t\ton: {\n\t\t\tparentTable: currentSpec.tableName,\n\t\t\tparentColumns: mapFieldNamesToColumnNames(currentSpec.modelName, currentAnchorFields, currentSpec.fieldToColumn),\n\t\t\tchildTable: throughSpec.tableName,\n\t\t\tchildColumns: mapFieldNamesToColumnNames(throughSpec.modelName, throughFromFields, throughSpec.fieldToColumn)\n\t\t}\n\t};\n}\nfunction resolveRelationNode(relationName, relation, currentSpec, allSpecs, extensions) {\n\tif (relation.kind === \"belongsTo\") return lowerBelongsToRelation(relationName, relation, currentSpec, allSpecs, extensions);\n\tif (relation.kind === \"hasMany\" || relation.kind === \"hasOne\") return lowerHasOwnershipRelation(relationName, relation, currentSpec, allSpecs);\n\treturn lowerManyToManyRelation(relationName, relation, currentSpec, allSpecs);\n}\nfunction lowerLocalForeignKeyNode(spec, targetSpec, foreignKey) {\n\treturn {\n\t\tcolumns: mapFieldNamesToColumnNames(spec.modelName, foreignKey.fields, spec.fieldToColumn),\n\t\treferences: {\n\t\t\tmodel: targetSpec.modelName,\n\t\t\ttable: targetSpec.tableName,\n\t\t\tcolumns: mapFieldNamesToColumnNames(targetSpec.modelName, foreignKey.targetFields, targetSpec.fieldToColumn)\n\t\t},\n\t\t...foreignKey.name ? { name: foreignKey.name } : {},\n\t\t...foreignKey.onDelete ? { onDelete: foreignKey.onDelete } : {},\n\t\t...foreignKey.onUpdate ? { onUpdate: foreignKey.onUpdate } : {},\n\t\t...foreignKey.constraint !== void 0 ? { constraint: foreignKey.constraint } : {},\n\t\t...foreignKey.index !== void 0 ? { index: foreignKey.index } : {}\n\t};\n}\nfunction lowerCrossSpaceForeignKeyNode(spec, foreignKey) {\n\tif (foreignKey.targetTableName === void 0) throw contractError(\"CONTRACT.FOREIGN_KEY_INVALID\", `Foreign key on \"${spec.modelName}\" references model \"${foreignKey.targetModel}\" in contract space \"${foreignKey.targetSpaceId}\" but the target table name is unknown: the handle's .sql() stage is a factory function, so its table cannot be read statically. Declare the target model's .sql() stage with a static object carrying \\`table\\`.`, { meta: {\n\t\tsourceModel: spec.modelName,\n\t\ttargetModel: foreignKey.targetModel,\n\t\tspaceId: foreignKey.targetSpaceId\n\t} });\n\treturn {\n\t\tcolumns: mapFieldNamesToColumnNames(spec.modelName, foreignKey.fields, spec.fieldToColumn),\n\t\treferences: {\n\t\t\tmodel: foreignKey.targetModel,\n\t\t\ttable: foreignKey.targetTableName,\n\t\t\tcolumns: foreignKey.targetFields,\n\t\t\t...foreignKey.targetNamespaceId !== void 0 ? { namespaceId: foreignKey.targetNamespaceId } : {},\n\t\t\tspaceId: foreignKey.targetSpaceId\n\t\t},\n\t\t...foreignKey.name ? { name: foreignKey.name } : {},\n\t\t...foreignKey.onDelete ? { onDelete: foreignKey.onDelete } : {},\n\t\t...foreignKey.onUpdate ? { onUpdate: foreignKey.onUpdate } : {},\n\t\t...foreignKey.constraint !== void 0 ? { constraint: foreignKey.constraint } : {},\n\t\t...foreignKey.index !== void 0 ? { index: foreignKey.index } : {}\n\t};\n}\nfunction assertKnownExtensionPack(extensions, spaceId, context) {\n\tif (extensions !== void 0 && Object.hasOwn(extensions, spaceId)) return;\n\tthrow contractError(\"CONTRACT.PACK_MISSING\", `${context} references contract space \"${spaceId}\" but \"${spaceId}\" is not declared in extensions. Add the pack to extensions.`, { meta: {\n\t\tspaceId,\n\t\tcontext\n\t} });\n}\nfunction resolveForeignKeyNodes(spec, allSpecs, extensions) {\n\tconst relationForeignKeys = resolveRelationForeignKeys(spec, allSpecs).map((foreignKey) => {\n\t\tif (foreignKey.targetSpaceId !== void 0) {\n\t\t\tassertKnownExtensionPack(extensions, foreignKey.targetSpaceId, `Relation-derived foreign key on \"${spec.modelName}\"`);\n\t\t\treturn lowerCrossSpaceForeignKeyNode(spec, {\n\t\t\t\t...foreignKey,\n\t\t\t\ttargetSpaceId: foreignKey.targetSpaceId\n\t\t\t});\n\t\t}\n\t\tconst targetSpec = allSpecs.get(foreignKey.targetModel);\n\t\tif (!targetSpec) throw contractError(\"CONTRACT.MODEL_UNKNOWN\", `Foreign key on \"${spec.modelName}\" references unknown model \"${foreignKey.targetModel}\"`, { meta: {\n\t\t\tsourceModel: spec.modelName,\n\t\t\ttargetModel: foreignKey.targetModel\n\t\t} });\n\t\treturn lowerLocalForeignKeyNode(spec, targetSpec, foreignKey);\n\t});\n\tconst sqlForeignKeys = (spec.sqlSpec?.foreignKeys ?? []).map((foreignKey) => {\n\t\tif (foreignKey.targetSpaceId !== void 0) {\n\t\t\tassertKnownExtensionPack(extensions, foreignKey.targetSpaceId, `Foreign key on \"${spec.modelName}\"`);\n\t\t\treturn lowerCrossSpaceForeignKeyNode(spec, {\n\t\t\t\t...foreignKey,\n\t\t\t\ttargetSpaceId: foreignKey.targetSpaceId\n\t\t\t});\n\t\t}\n\t\tconst targetSpec = allSpecs.get(foreignKey.targetModel);\n\t\tif (!targetSpec) throw contractError(\"CONTRACT.MODEL_UNKNOWN\", `Foreign key on \"${spec.modelName}\" references unknown model \"${foreignKey.targetModel}\"`, { meta: {\n\t\t\tsourceModel: spec.modelName,\n\t\t\ttargetModel: foreignKey.targetModel\n\t\t} });\n\t\treturn lowerLocalForeignKeyNode(spec, targetSpec, foreignKey);\n\t});\n\treturn [...relationForeignKeys, ...sqlForeignKeys];\n}\n/**\n* Resolves a deferred index expression's field refs the way the field-tuple form\n* resolves its columns, and pairs each with the codec the column stores through\n* so a renderer can refuse a column it cannot express.\n*/\nfunction resolveDeferredColumns(spec, fieldNames, fieldCodecIds) {\n\tconst columnNames = mapFieldNamesToColumnNames(spec.modelName, fieldNames, spec.fieldToColumn);\n\treturn fieldNames.map((fieldName, position) => {\n\t\tconst name = columnNames[position];\n\t\tconst codecId = fieldCodecIds[fieldName];\n\t\tif (name === void 0 || codecId === void 0) throw new InternalError(`Deferred index expression on \"${spec.modelName}\" resolved no column for field \"${fieldName}\"`);\n\t\treturn {\n\t\t\tname,\n\t\t\tcodecId\n\t\t};\n\t});\n}\n/**\n* The text of an index expression. A string has no `render`, and `'render' in` a string throws a\n* `TypeError`, so the `sql` value is recognized first and anything else is refused last.\n*/\nfunction indexExpressionText(spec, expression, fieldCodecIds, owner) {\n\tconst sqlExpression = readSqlExpression(expression);\n\tif (sqlExpression !== void 0) return sqlExpression.text;\n\tif (typeof expression === \"object\" && expression !== null && \"render\" in expression) return renderedSqlText(expression.render(resolveDeferredColumns(spec, expression.fields.map((ref) => ref.fieldName), fieldCodecIds)), `${owner} expression`);\n\treturn requireSqlExpression(expression, `${owner} expression`).text;\n}\nfunction renderedSqlText(rendered, what) {\n\ttry {\n\t\treturn new SqlExpression(rendered).text;\n\t} catch (cause) {\n\t\tif (!isStructuredError(cause) || cause.code !== \"CONTRACT.SQL_EXPRESSION_INVALID\") throw cause;\n\t\tthrow contractError(\"CONTRACT.SQL_EXPRESSION_INVALID\", `${what}: ${cause.message}`, {\n\t\t\tmeta: {\n\t\t\t\twhat,\n\t\t\t\t...cause.meta\n\t\t\t},\n\t\t\tcause\n\t\t});\n\t}\n}\nfunction constraintOwner(kind, modelName, constraint) {\n\tconst name = constraint.name ?? constraint.map;\n\treturn name === void 0 ? `${kind} on \"${modelName}\"` : `${kind} \"${name}\"`;\n}\n/** The fields an index covers, in order: its own, or those of its deferred expression. */\nfunction coveredFieldNames(index) {\n\tif (index.fields !== void 0) return index.fields;\n\tconst { expression } = index;\n\tif (expression === void 0 || isSqlExpression(expression) || typeof expression !== \"object\") return [];\n\treturn expression.fields.map((ref) => ref.fieldName);\n}\n/**\n* The generators a field's `.onCreate(...)` and `.onUpdate(...)` calls resolve to for its column, merged over the phases a field preset or `field.generated(...)` sets.\n*/\nfunction resolveGeneratorCalls(input) {\n\tconst { modelName, fieldName, fieldState, descriptor, generatorFunctions } = input;\n\tconst calls = fieldState.generatorCalls;\n\tif (calls === void 0) return fieldState.executionDefaults;\n\tconst typeParams = descriptor.typeParams;\n\tconst column = {\n\t\tcodecId: descriptor.codecId,\n\t\ttypeParams,\n\t\tlength: input.columnLength(descriptor.codecId, typeParams)\n\t};\n\tconst phases = { ...fieldState.executionDefaults };\n\tfor (const phase of [\"onCreate\", \"onUpdate\"]) {\n\t\tconst call = calls[phase];\n\t\tif (call === void 0) continue;\n\t\tif (fieldState.many !== false) throw contractError(\"CONTRACT.DEFAULT_INVALID\", `Field \"${modelName}.${fieldName}\" is a list and cannot use .${phase}(${call.name}()). Lists have no per-element generated values; remove .${phase}(...).`, { meta: {\n\t\t\tmodelName,\n\t\t\tfieldName,\n\t\t\tcodecId: column.codecId,\n\t\t\tfunction: call.name,\n\t\t\treason: \"generator-on-list\"\n\t\t} });\n\t\tconst resolution = generatorFunctions.resolve(call, column);\n\t\tif (resolution.ok) {\n\t\t\tphases[phase] = resolution.generator;\n\t\t\tcontinue;\n\t\t}\n\t\tconst meta = {\n\t\t\tmodelName,\n\t\t\tfieldName,\n\t\t\tcodecId: column.codecId,\n\t\t\tfunction: call.name\n\t\t};\n\t\tif (resolution.reason === \"unknown-function\") throw contractError(\"CONTRACT.DEFAULT_INVALID\", `Field \"${modelName}.${fieldName}\": no pack in the contract declares the generator function \"${call.name}\".`, { meta: {\n\t\t\t...meta,\n\t\t\treason: \"generator-unknown\"\n\t\t} });\n\t\tconst applying = generatorFunctions.functionsFor(column.codecId).map(({ name }) => `${name}()`);\n\t\tthrow contractError(\"CONTRACT.DEFAULT_INVALID\", resolution.reason === \"refused\" ? `Field \"${modelName}.${fieldName}\": ${resolution.message}` : `Field \"${modelName}.${fieldName}\": ${call.name}() does not apply to codec \"${column.codecId}\". ${applying.length === 0 ? \"No generator function applies to this codec.\" : `Functions that apply: ${applying.join(\", \")}.`}`, { meta: {\n\t\t\t...meta,\n\t\t\treason: \"generator-not-applicable\"\n\t\t} });\n\t}\n\treturn phases;\n}\nfunction resolveModelNode(spec, allSpecs, generatorFunctions, columnLength, extensions) {\n\tconst fields = [];\n\t/** Filled by the field loop below, read by a deferred index expression. */\n\tconst fieldCodecIds = {};\n\tfor (const [fieldName, fieldBuilder] of Object.entries(spec.fieldBuilders)) {\n\t\tconst fieldState = fieldBuilder.build();\n\t\tconst descriptor = resolveFieldDescriptor(spec.modelName, fieldName, fieldState);\n\t\tconst columnName = spec.fieldToColumn[fieldName];\n\t\tif (!columnName) throw new InternalError(`Column name resolution failed for \"${spec.modelName}.${fieldName}\"`);\n\t\tfieldCodecIds[fieldName] = descriptor.codecId;\n\t\tconst enumHandle = \"enumHandle\" in fieldState && isEnumTypeHandle(fieldState.enumHandle) ? fieldState.enumHandle : void 0;\n\t\tconst executionDefaults = resolveGeneratorCalls({\n\t\t\tmodelName: spec.modelName,\n\t\t\tfieldName,\n\t\t\tfieldState,\n\t\t\tdescriptor,\n\t\t\tgeneratorFunctions,\n\t\t\tcolumnLength\n\t\t});\n\t\tfields.push({\n\t\t\tfieldName,\n\t\t\tcolumnName,\n\t\t\tdescriptor,\n\t\t\tnullable: fieldState.nullable,\n\t\t\tmany: fieldState.many !== false,\n\t\t\t...fieldState.many !== false ? { elementNullable: fieldState.many.elementNullable } : {},\n\t\t\t...fieldState.default ? { default: fieldState.default } : {},\n\t\t\t...ifDefined(\"executionDefaults\", executionDefaults),\n\t\t\t...enumHandle !== void 0 ? { enumTypeHandle: enumHandle } : {}\n\t\t});\n\t}\n\tconst { idConstraint } = spec;\n\tconst uniques = resolveModelUniqueConstraints(spec).map((unique) => ({\n\t\tcolumns: mapFieldNamesToColumnNames(spec.modelName, unique.fields, spec.fieldToColumn),\n\t\t...unique.name ? { name: unique.name } : {}\n\t}));\n\tconst indexes = (spec.sqlSpec?.indexes ?? []).map((index) => {\n\t\tconst options = typeof index.options === \"function\" ? index.options(resolveDeferredColumns(spec, coveredFieldNames(index), fieldCodecIds)) : index.options;\n\t\tconst method = blindCast({\n\t\t\ttype: index.type,\n\t\t\toptions\n\t\t});\n\t\tconst owner = constraintOwner(\"Index\", spec.modelName, index);\n\t\tconst carried = {\n\t\t\twhere: index.where === void 0 ? void 0 : requireSqlExpression(index.where, `${owner} where`).text,\n\t\t\tunique: index.unique,\n\t\t\tname: index.name,\n\t\t\tmap: index.map,\n\t\t\t...method\n\t\t};\n\t\treturn index.expression !== void 0 ? {\n\t\t\t...carried,\n\t\t\texpression: indexExpressionText(spec, index.expression, fieldCodecIds, owner)\n\t\t} : {\n\t\t\t...carried,\n\t\t\tcolumns: mapFieldNamesToColumnNames(spec.modelName, index.fields ?? [], spec.fieldToColumn)\n\t\t};\n\t});\n\tconst checks = (spec.sqlSpec?.checks ?? []).map((authoredCheck) => ({\n\t\texpression: requireSqlExpression(authoredCheck.expression, `${constraintOwner(\"Check\", spec.modelName, authoredCheck)} expression`).text,\n\t\tname: authoredCheck.name,\n\t\tmap: authoredCheck.map\n\t}));\n\tconst foreignKeys = resolveForeignKeyNodes(spec, allSpecs, extensions);\n\tconst relations = Object.entries(spec.relations).map(([relationName, relationBuilder]) => resolveRelationNode(relationName, relationBuilder.build(), spec, allSpecs, extensions));\n\treturn {\n\t\tmodelName: spec.modelName,\n\t\ttableName: spec.tableName,\n\t\t...spec.namespace !== void 0 ? { namespaceId: spec.namespace } : {},\n\t\tfields,\n\t\t...idConstraint ? { id: {\n\t\t\tcolumns: mapFieldNamesToColumnNames(spec.modelName, idConstraint.fields, spec.fieldToColumn),\n\t\t\t...idConstraint.name ? { name: idConstraint.name } : {}\n\t\t} } : {},\n\t\t...uniques.length > 0 ? { uniques } : {},\n\t\t...indexes.length > 0 ? { indexes } : {},\n\t\t...checks.length > 0 ? { checks } : {},\n\t\t...foreignKeys.length > 0 ? { foreignKeys } : {},\n\t\t...relations.length > 0 ? { relations } : {},\n\t\t...ifDefined(\"control\", spec.sqlSpec?.control)\n\t};\n}\nfunction columnLengthOf(definition) {\n\tconst { codecLookup, dataTypeLookup } = definition;\n\treturn (codecId, typeParams) => {\n\t\tconst dataTypeId = codecLookup.descriptorFor(codecId)?.dataType;\n\t\treturn sqlColumnLength(dataTypeId === void 0 ? void 0 : dataTypeLookup.get(dataTypeId), typeParams);\n\t};\n}\nfunction collectRuntimeModelSpecs(definition) {\n\tconst databaseTypes = { ...definition.databaseTypes };\n\tconst models = { ...definition.models ?? {} };\n\tconst modelSpecs = /* @__PURE__ */ new Map();\n\tconst tableOwners = /* @__PURE__ */ new Map();\n\tfor (const [modelName, modelDefinition] of Object.entries(models)) {\n\t\tconst tokenModelName = modelDefinition.stageOne.modelName;\n\t\tif (tokenModelName && tokenModelName !== modelName) throw contractError(\"CONTRACT.MODEL_TOKEN_INVALID\", `Model token \"${tokenModelName}\" must be assigned to models.${tokenModelName}. Received models.${modelName}.`, { meta: {\n\t\t\ttokenModelName,\n\t\t\tassignedKey: modelName\n\t\t} });\n\t\tconst attributesSpec = modelDefinition.buildAttributesSpec();\n\t\tconst sqlSpec = modelDefinition.buildSqlSpec();\n\t\tconst tableName = sqlSpec?.table ?? applyNaming(modelName, definition.naming?.tables);\n\t\tconst namespaceId = modelDefinition.stageOne.namespace ?? definition.target.defaultNamespaceId;\n\t\tconst tableKey = JSON.stringify([namespaceId, tableName]);\n\t\tconst existingModel = tableOwners.get(tableKey);\n\t\tif (existingModel) throw contractError(\"CONTRACT.NAME_DUPLICATE\", `Models \"${existingModel}\" and \"${modelName}\" both map to table \"${tableName}\".`, { meta: {\n\t\t\tkind: \"table\",\n\t\t\tname: tableName,\n\t\t\tfirst: existingModel,\n\t\t\tsecond: modelName\n\t\t} });\n\t\ttableOwners.set(tableKey, modelName);\n\t\tconst fieldToColumn = {};\n\t\tconst columnOwners = /* @__PURE__ */ new Map();\n\t\tfor (const [fieldName, fieldBuilder] of Object.entries(modelDefinition.stageOne.fields)) {\n\t\t\tconst columnName = fieldBuilder.build().columnName ?? applyNaming(fieldName, definition.naming?.columns);\n\t\t\tconst existingField = columnOwners.get(columnName);\n\t\t\tif (existingField) throw contractError(\"CONTRACT.NAME_DUPLICATE\", `Model \"${modelName}\" maps both \"${existingField}\" and \"${fieldName}\" to column \"${columnName}\".`, { meta: {\n\t\t\t\tkind: \"column\",\n\t\t\t\tname: columnName,\n\t\t\t\tfirst: existingField,\n\t\t\t\tsecond: fieldName\n\t\t\t} });\n\t\t\tcolumnOwners.set(columnName, fieldName);\n\t\t\tfieldToColumn[fieldName] = columnName;\n\t\t}\n\t\tconst fieldBuilders = modelDefinition.stageOne.fields;\n\t\tconst idConstraint = resolveModelIdConstraint({\n\t\t\tmodelName,\n\t\t\tfieldBuilders,\n\t\t\tattributesSpec\n\t\t});\n\t\tmodelSpecs.set(modelName, {\n\t\t\tmodelName,\n\t\t\ttableName,\n\t\t\tnamespace: modelDefinition.stageOne.namespace,\n\t\t\tfieldBuilders,\n\t\t\tfieldToColumn,\n\t\t\trelations: modelDefinition.stageOne.relations,\n\t\t\tattributesSpec,\n\t\t\tsqlSpec,\n\t\t\tidConstraint\n\t\t});\n\t}\n\treturn {\n\t\tdatabaseTypes,\n\t\tmodels,\n\t\tmodelSpecs\n\t};\n}\nfunction lowerModels(collection, generatorFunctions, columnLength, extensions) {\n\temitTypedCrossModelFallbackWarnings(collection);\n\treturn Array.from(collection.modelSpecs.values()).map((spec) => resolveModelNode(spec, collection.modelSpecs, generatorFunctions, columnLength, extensions));\n}\n/**\n* Kind-agnostic walk over the author-declared `entities` handle list:\n*\n* 1. Index the bound packs' `entityTypes` contributions by discriminator so\n* each handle's `entityKind` maps to the pack that registered it; a\n* handle whose kind no composed pack registers is an error naming the\n* kind.\n* 2. Resolve each handle's declared model refs (`handle.refs`, actual\n* model-handle objects) to storage table coordinates — identity against\n* the contract's `models` record first, then the handle's declared model\n* name against the build's model specs; never by re-deriving a table\n* name. A cross-space (extensionModel) handle resolves to its own\n* coordinate annotated with `spaceId`.\n* 3. Call each owning pack's batch lowering hook once with all of its\n* claimed handles, and fold the returned rows into the namespace-scoped\n* attachments (namespace → kind → key), rejecting two different entities\n* in one slot. The result becomes `ContractDefinition.attachedEntities`.\n*\n* No entity kind is named anywhere in this walk.\n*/\nfunction lowerPackEntityHandles(definition, modelSpecs) {\n\tconst entities = definition.entities;\n\tif (entities === void 0 || entities.length === 0) return void 0;\n\tconst components = [definition.target, ...Object.values(definition.extensions ?? {})];\n\tconst owningComponent = /* @__PURE__ */ new Map();\n\tconst walkEntityTypes = (namespace, component) => {\n\t\tfor (const value of Object.values(namespace)) if (isAuthoringEntityTypeDescriptor(value)) owningComponent.set(value.discriminator, component);\n\t\telse walkEntityTypes(value, component);\n\t};\n\tfor (const component of components) {\n\t\tconst entityTypes = component.authoring?.entityTypes;\n\t\tif (entityTypes !== void 0) walkEntityTypes(entityTypes, component);\n\t}\n\tconst defaultNamespaceId = definition.target.defaultNamespaceId;\n\tconst modelNamesByIdentity = /* @__PURE__ */ new Map();\n\tfor (const [modelName, modelBuilder] of Object.entries(definition.models ?? {})) modelNamesByIdentity.set(modelBuilder, modelName);\n\tconst coordinateOf = (modelName) => {\n\t\tconst spec = modelSpecs.get(modelName);\n\t\tif (spec === void 0) return void 0;\n\t\treturn {\n\t\t\tkind: \"resolved\",\n\t\t\tnamespaceId: spec.namespace ?? defaultNamespaceId,\n\t\t\ttableName: spec.tableName,\n\t\t\tmodelName\n\t\t};\n\t};\n\tconst declaredModelName = (value) => {\n\t\tif (typeof value !== \"object\" || value === null || !(\"stageOne\" in value)) return void 0;\n\t\tconst stageOne = value.stageOne;\n\t\tif (typeof stageOne !== \"object\" || stageOne === null || !(\"modelName\" in stageOne)) return;\n\t\treturn typeof stageOne.modelName === \"string\" ? stageOne.modelName : void 0;\n\t};\n\tconst resolveRef = (value) => {\n\t\tconst modelName = declaredModelName(value);\n\t\tif (isCrossSpaceHandle(value)) {\n\t\t\tconst tableName = value.tableName;\n\t\t\tconst namespaceId = value.stageOne.namespace;\n\t\t\tif (tableName !== void 0 && namespaceId !== void 0) return {\n\t\t\t\tkind: \"cross-space\",\n\t\t\t\tspaceId: value.spaceId,\n\t\t\t\tnamespaceId,\n\t\t\t\ttableName,\n\t\t\t\t...ifDefined(\"modelName\", modelName)\n\t\t\t};\n\t\t\treturn {\n\t\t\t\tkind: \"unresolved\",\n\t\t\t\t...ifDefined(\"modelName\", modelName)\n\t\t\t};\n\t\t}\n\t\tconst identityName = modelNamesByIdentity.get(value);\n\t\treturn (identityName !== void 0 ? coordinateOf(identityName) : void 0) ?? (modelName !== void 0 ? coordinateOf(modelName) : void 0) ?? {\n\t\t\tkind: \"unresolved\",\n\t\t\t...ifDefined(\"modelName\", modelName)\n\t\t};\n\t};\n\tconst claimed = /* @__PURE__ */ new Map();\n\tfor (const handle of entities) {\n\t\tconst component = owningComponent.get(handle.entityKind);\n\t\tif (component === void 0) throw contractError(\"CONTRACT.ENTITY_KIND_UNKNOWN\", `defineContract: entities contains a handle with entityKind \"${handle.entityKind}\", which no composed pack registers. Compose a pack whose entityTypes contribution claims \"${handle.entityKind}\", or remove the handle.`, { meta: { entityKind: handle.entityKind } });\n\t\tconst refs = {};\n\t\tfor (const [refName, refValue] of Object.entries(handle.refs ?? {})) refs[refName] = resolveRef(refValue);\n\t\tconst forComponent = claimed.get(component) ?? [];\n\t\tforComponent.push({\n\t\t\thandle,\n\t\t\trefs\n\t\t});\n\t\tclaimed.set(component, forComponent);\n\t}\n\tconst pack = {};\n\tfor (const [component, handles] of claimed) {\n\t\tconst authoring = component.authoring;\n\t\tif (!providesEntityHandleLowering(authoring)) {\n\t\t\tconst kinds = [...new Set(handles.map((entry) => entry.handle.entityKind))].sort();\n\t\t\tthrow contractError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `defineContract: entityKind(s) ${kinds.map((kind) => `\"${kind}\"`).join(\", \")} are registered by a pack that does not implement entity-handle lowering (no lowerEntityHandles on its authoring contributions).`, { meta: {\n\t\t\t\tentityKinds: kinds,\n\t\t\t\treason: \"missing-lowerEntityHandles\"\n\t\t\t} });\n\t\t}\n\t\tfor (const row of authoring.lowerEntityHandles({\n\t\t\thandles,\n\t\t\tdefaultNamespaceId\n\t\t})) {\n\t\t\tconst forNamespace = pack[row.namespaceId] ?? {};\n\t\t\tpack[row.namespaceId] = forNamespace;\n\t\t\tconst forKind = forNamespace[row.entityKind] ?? {};\n\t\t\tforNamespace[row.entityKind] = forKind;\n\t\t\tconst existing = forKind[row.key];\n\t\t\tif (existing !== void 0 && existing !== row.entity) throw contractError(\"CONTRACT.NAME_DUPLICATE\", `defineContract: two different \"${row.entityKind}\" entities named \"${row.key}\" in namespace \"${row.namespaceId}\" — pack-entity names must be unique per namespace.`, { meta: {\n\t\t\t\tkind: row.entityKind,\n\t\t\t\tname: row.key,\n\t\t\t\tnamespaceId: row.namespaceId\n\t\t\t} });\n\t\t\tforKind[row.key] = row.entity;\n\t\t}\n\t}\n\treturn pack;\n}\nfunction buildContractDefinition(definition) {\n\trefuseTypesKey(definition, \"buildContractDefinition\");\n\tconst collection = collectRuntimeModelSpecs(definition);\n\tconst packs = [\n\t\tdefinition.family,\n\t\tdefinition.target,\n\t\t...Object.values(definition.extensions ?? {})\n\t];\n\tconst generatorFunctions = assembleGeneratorFunctions(packs);\n\tconst columnLength = columnLengthOf(definition);\n\tassertTypeAliasesValid(composePackAuthoringNamespace(packs, \"type\"), {\n\t\tgeneratorFunctions,\n\t\tparamsSchemaOf: (codecId) => definition.codecLookup.descriptorFor(codecId)?.paramsSchema,\n\t\tfieldLength: ({ codecId, typeParams }) => columnLength(codecId, typeParams)\n\t});\n\tconst models = lowerModels(collection, generatorFunctions, columnLength, definition.extensions);\n\tconst attachedEntities = lowerPackEntityHandles(definition, collection.modelSpecs);\n\treturn {\n\t\ttarget: definition.target,\n\t\t...ifDefined(\"defaultControlPolicy\", definition.defaultControlPolicy),\n\t\t...definition.extensions ? { extensions: definition.extensions } : {},\n\t\t...ifDefined(\"capabilities\", definition.adapter?.capabilities),\n\t\t...definition.storageHash ? { storageHash: definition.storageHash } : {},\n\t\t...definition.foreignKeyDefaults ? { foreignKeyDefaults: definition.foreignKeyDefaults } : {},\n\t\t...Object.keys(collection.databaseTypes).length > 0 ? { databaseTypes: collection.databaseTypes } : {},\n\t\t...definition.namespaces ? { namespaces: definition.namespaces } : {},\n\t\twarnings: void 0,\n\t\tcreateNamespace: definition.createNamespace,\n\t\t...definition.enums && Object.keys(definition.enums).length > 0 ? { enums: definition.enums } : {},\n\t\t...attachedEntities && Object.keys(attachedEntities).length > 0 ? { attachedEntities } : {},\n\t\tmodels\n\t};\n}\n//#endregion\n//#region src/contract-builder.ts\nfunction validateTargetPackRef(family, target) {\n\tif (family.familyId !== \"sql\") throw contractError(\"CONTRACT.PACK_FAMILY_MISMATCH\", `defineContract only accepts SQL family packs. Received family \"${family.familyId}\".`, { meta: {\n\t\tpackId: family.id,\n\t\tpackFamilyId: family.familyId,\n\t\tcontractFamilyId: \"sql\"\n\t} });\n\tif (target.familyId !== family.familyId) throw contractError(\"CONTRACT.PACK_FAMILY_MISMATCH\", `target pack \"${target.id}\" targets family \"${target.familyId}\" but contract family is \"${family.familyId}\".`, { meta: {\n\t\tpackId: target.id,\n\t\tpackFamilyId: target.familyId,\n\t\tcontractFamilyId: family.familyId\n\t} });\n}\nfunction targetNameOf(target) {\n\treturn target.displayName ?? target.targetId;\n}\n/**\n* Per-target reserved namespace names enforced by `defineContract` for\n* SQL family contracts. Two categories:\n*\n* 1. **IR sentinels** (`__unbound__`, `__unspecified__`) — reserved on\n* every SQL target. The double-underscore decoration marks them as\n* framework-reserved coordinates; user code must not declare them\n* explicitly.\n* 2. **The PSL keyword `unbound`** — the name PSL writes for the\n* late-binding opt-in (`namespace unbound { … }`), so the TS surface\n* rejects it from `defineContract({ namespaces })` lists on every\n* target that accepts namespaces. A target whose `supportsNamespaces` is false rejects every\n* non-empty namespaces list outright; callers should declare\n* `namespaces: []` or omit the field.\n*/\nfunction validateNamespaceDeclarations(target, namespaces) {\n\tif (!namespaces) return;\n\tif (target.supportsNamespaces === false && namespaces.length > 0) throw contractError(\"CONTRACT.NAMESPACE_UNSUPPORTED\", `defineContract: ${targetNameOf(target)} contracts cannot declare namespaces. Received namespaces: [${namespaces.map((name) => `\"${name}\"`).join(\", \")}].`, { meta: {\n\t\tnamespaces,\n\t\ttargetId: target.targetId\n\t} });\n\tconst seen = /* @__PURE__ */ new Set();\n\tfor (const namespace of namespaces) {\n\t\tif (namespace.length === 0) throw contractError(\"CONTRACT.NAMESPACE_INVALID\", \"defineContract: namespace names cannot be empty.\", { meta: {\n\t\t\tnamespace,\n\t\t\treason: \"empty\"\n\t\t} });\n\t\tif (namespace.trim().length === 0) throw contractError(\"CONTRACT.NAMESPACE_INVALID\", `defineContract: namespace name \"${namespace}\" cannot be whitespace-only.`, { meta: {\n\t\t\tnamespace,\n\t\t\treason: \"whitespace-only\"\n\t\t} });\n\t\tif (namespace === \"__unbound__\" || namespace === \"__unspecified__\") throw contractError(\"CONTRACT.NAMESPACE_INVALID\", `defineContract: namespace name \"${namespace}\" is a reserved IR sentinel and cannot appear in the declared namespaces list.`, { meta: {\n\t\t\tnamespace,\n\t\t\treason: \"reserved-ir-sentinel\"\n\t\t} });\n\t\tif (namespace === UNBOUND_PSL_NAMESPACE_NAME) throw contractError(\"CONTRACT.NAMESPACE_INVALID\", `defineContract: namespace name \"${namespace}\" is reserved by ${targetNameOf(target)} for the late-binding opt-in (use \\`namespace ${namespace} { … }\\` in PSL instead of declaring it as a regular schema).`, { meta: {\n\t\t\tnamespace,\n\t\t\treason: \"reserved-psl-keyword\",\n\t\t\ttargetId: target.targetId\n\t\t} });\n\t\tif (seen.has(namespace)) throw contractError(\"CONTRACT.NAME_DUPLICATE\", `defineContract: namespaces list contains duplicate entry \"${namespace}\".`, { meta: {\n\t\t\tkind: \"namespace\",\n\t\t\tname: namespace\n\t\t} });\n\t\tseen.add(namespace);\n\t}\n}\n/**\n* Per-model `namespace` validation paired with\n* {@link validateNamespaceDeclarations}. Mirrors the reserved-name\n* rules so the per-model surface stays consistent with the contract-\n* level surface:\n*\n* - `__unbound__` / `__unspecified__` — reserved IR sentinels on\n* every SQL target.\n* - The PSL keyword `unbound` — reserved for the PSL late-binding\n* opt-in, which the TS builder has no surface for.\n*\n* Additionally enforces that each per-model `namespace` references an\n* entry in the contract's declared `namespaces` list.\n*\n* A target whose `supportsNamespaces` is false rejects the per-model\n* `namespace` field outright.\n*/\nfunction validatePerModelNamespaces(target, namespaces, models) {\n\tconst declaredNamespaces = new Set(namespaces ?? []);\n\tfor (const [modelKey, modelBuilder] of Object.entries(models)) {\n\t\tconst perModelNamespace = modelBuilder.stageOne.namespace;\n\t\tif (perModelNamespace === void 0) continue;\n\t\tif (target.supportsNamespaces === false) throw contractError(\"CONTRACT.NAMESPACE_UNSUPPORTED\", `defineContract: model \"${modelKey}\" sets \\`namespace: \"${perModelNamespace}\"\\` but the target is ${targetNameOf(target)}, which does not support namespaces (remove the per-model \\`namespace\\` field).`, { meta: {\n\t\t\tmodelKey,\n\t\t\tnamespace: perModelNamespace,\n\t\t\ttargetId: target.targetId\n\t\t} });\n\t\tif (perModelNamespace === \"__unbound__\" || perModelNamespace === \"__unspecified__\") throw contractError(\"CONTRACT.NAMESPACE_INVALID\", `defineContract: model \"${modelKey}\" sets \\`namespace: \"${perModelNamespace}\"\\` but that name is a reserved IR sentinel and cannot appear in user code.`, { meta: {\n\t\t\tmodelKey,\n\t\t\tnamespace: perModelNamespace,\n\t\t\treason: \"reserved-ir-sentinel\"\n\t\t} });\n\t\tif (perModelNamespace === UNBOUND_PSL_NAMESPACE_NAME) throw contractError(\"CONTRACT.NAMESPACE_INVALID\", `defineContract: model \"${modelKey}\" sets \\`namespace: \"${perModelNamespace}\"\\` but that name is reserved by ${targetNameOf(target)} for the late-binding opt-in (use \\`namespace ${perModelNamespace} { … }\\` in PSL instead — there is no equivalent surface in the TS builder today).`, { meta: {\n\t\t\tmodelKey,\n\t\t\tnamespace: perModelNamespace,\n\t\t\treason: \"reserved-psl-keyword\",\n\t\t\ttargetId: target.targetId\n\t\t} });\n\t\tif (!declaredNamespaces.has(perModelNamespace)) throw contractError(\"CONTRACT.NAMESPACE_UNKNOWN\", `defineContract: model \"${modelKey}\" references namespace \"${perModelNamespace}\" but that name does not appear in the contract's declared \\`namespaces\\` list.${declaredNamespaces.size > 0 ? ` Declared namespaces: [${[...declaredNamespaces].map((name) => `\"${name}\"`).join(\", \")}].` : \" The contract does not declare any namespaces; add `namespaces: [\\\"…\\\"]` to `defineContract` first.\"}`, { meta: {\n\t\t\tmodelKey,\n\t\t\tnamespace: perModelNamespace,\n\t\t\tdeclared: [...declaredNamespaces]\n\t\t} });\n\t}\n}\nfunction validateExtensionPackRefs(target, extensions) {\n\tif (!extensions) return;\n\tfor (const packRef of Object.values(extensions)) {\n\t\tif (packRef.kind !== \"extension\") throw contractError(\"CONTRACT.PACK_REF_INVALID\", `defineContract only accepts extension pack refs in extensions. Received kind \"${packRef.kind}\".`, { meta: {\n\t\t\tpackId: packRef.id,\n\t\t\tkind: packRef.kind\n\t\t} });\n\t\tif (packRef.familyId !== target.familyId) throw contractError(\"CONTRACT.PACK_FAMILY_MISMATCH\", `extension pack \"${packRef.id}\" targets family \"${packRef.familyId}\" but contract target family is \"${target.familyId}\".`, { meta: {\n\t\t\tpackId: packRef.id,\n\t\t\tpackFamilyId: packRef.familyId,\n\t\t\tcontractFamilyId: target.familyId\n\t\t} });\n\t\tif (packRef.targetId && packRef.targetId !== target.targetId) throw contractError(\"CONTRACT.PACK_TARGET_MISMATCH\", `extension pack \"${packRef.id}\" targets \"${packRef.targetId}\" but contract target is \"${target.targetId}\".`, { meta: {\n\t\t\tpackId: packRef.id,\n\t\t\tpackTargetId: packRef.targetId,\n\t\t\tcontractTargetId: target.targetId\n\t\t} });\n\t}\n}\nfunction buildContractFromDsl(definition) {\n\tvalidateTargetPackRef(definition.family, definition.target);\n\tvalidateExtensionPackRefs(definition.target, definition.extensions);\n\tvalidateNamespaceDeclarations(definition.target, definition.namespaces);\n\tvalidatePerModelNamespaces(definition.target, definition.namespaces, definition.models ?? {});\n\treturn blindCast(buildSqlContractFromDefinition(buildContractDefinition(definition), definition.codecLookup, definition.dataTypeLookup));\n}\n/** Implementation. */\nfunction buildBoundContract(family, target, definition, factory) {\n\trefuseTypesKey(definition, \"defineContract\");\n\tconst full = {\n\t\t...definition,\n\t\tfamily,\n\t\ttarget\n\t};\n\tif (factory !== void 0) {\n\t\tconst built = factory(createComposedAuthoringHelpers({\n\t\t\tfamily,\n\t\t\ttarget,\n\t\t\textensions: definition.extensions,\n\t\t\tcodecLookup: definition.codecLookup\n\t\t}));\n\t\trefuseTypesKey(built, \"defineContract\");\n\t\tconst mergedEnums = {\n\t\t\t...definition.enums ?? {},\n\t\t\t...built.enums\n\t\t};\n\t\tconst mergedEntities = [...definition.entities ?? [], ...built.entities ?? []];\n\t\treturn buildContractFromDsl({\n\t\t\t...full,\n\t\t\t...ifDefined(\"databaseTypes\", built.databaseTypes),\n\t\t\t...ifDefined(\"models\", built.models),\n\t\t\t...ifDefined(\"enums\", Object.keys(mergedEnums).length > 0 ? mergedEnums : void 0),\n\t\t\t...ifDefined(\"entities\", mergedEntities.length > 0 ? mergedEntities : void 0)\n\t\t});\n\t}\n\treturn buildContractFromDsl(full);\n}\nfunction defineContract(definition, factory) {\n\tif (!isContractInput(definition)) throw contractError(\"CONTRACT.ARGUMENT_INVALID\", \"defineContract expects a contract definition object. Define your contract with defineContract({ family, target, models, ... }).\");\n\tif (factory !== void 0) return buildBoundContract(definition.family, definition.target, definition, factory);\n\treturn buildBoundContract(definition.family, definition.target, definition);\n}\n//#endregion\n//#region src/default-functions.ts\n/** The database's current time, the same default PSL writes as `@default(now())`. */\nfunction now() {\n\treturn {\n\t\tkind: \"function\",\n\t\texpression: \"now()\"\n\t};\n}\n/** A database-assigned sequence value, the same default PSL writes as `@default(autoincrement())`. */\nfunction autoincrement() {\n\treturn {\n\t\tkind: \"function\",\n\t\texpression: \"autoincrement()\"\n\t};\n}\n//#endregion\nexport { applySqlSpecifierControlPolicy, autoincrement, bindEnumType, buildBoundContract, buildContractDefinition, buildSqlContractFromDefinition, check, createComposedAuthoringHelpers, defineContract, enumType, extensionModel, field, isValueObjectMember, member, model, now, rel, sql, storedAsListColumn };\n\n//# sourceMappingURL=contract-builder.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,SAAS,eAAe,OAAO;CAC9B,IAAI,OAAO,UAAU,UAAU,OAAO;EACrC,MAAM;EACN,MAAM,YAAY,KAAK;CACxB;CACA,IAAI,OAAO,UAAU,UAAU,OAAO;EACrC,MAAM;EACN,MAAM;CACP;CACA,IAAI,OAAO,UAAU,WAAW,OAAO;EACtC,MAAM;EACN;CACD;CACA,MAAM,aAAa,kBAAkB,KAAK;CAC1C,OAAO,eAAe,KAAK,IAAI,KAAK,IAAI;EACvC,MAAM;EACN,KAAA;EACA,MAAM,WAAW;CAClB;AACD;AACA,SAAS,kBAAkB,OAAO,O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AAC;AACxI;;AAEA,SAAS,mBAAmB,QAAQ,QAAQ,YAAY,SAAS;CAChE,eAAe,YAAY,gBAAgB;CAC3C,MAAM,OAAO;EACZ,GAAG;EACH;EACA;CACD;CACA,IAAI,YAAY,KAAK,GAAG;EACvB,MAAM,QAAQ,QAAQ,+BAA+B;GACpD;GACA;GACA,YAAY,WAAW;GACvB,aAAa,WAAW;EACzB,CAAC,CAAC;EACF,eAAe,OAAO,gBAAgB;EACtC,MAAM,cAAc;GACnB,GAAG,WAAW,SAAS,CAAC;GACxB,GAAG,MAAM;EACV;EACA,MAAM,iBAAiB,CAAC,GAAG,WAAW,YAAY,CAAC,GAAG,GAAG,MAAM,YAAY,CAAC,CAAC;EAC7E,OAAO,qBAAqB;GAC3B,GAAG;GACH,GAAG,UAAU,iBAAiB,MAAM,aAAa;GACjD,GAAG,UAAU,UAAU,MAAM,MAAM;GACnC,GAAG,UAAU,SAAS,OAAO,KAAK,WAAW,CAAC,CAAC,SAAS,IAAI,cAAc,KAAK,CAAC;GAChF,GAAG,UAAU,YAAY,eAAe,SAAS,IAAI,iBAAiB,KAAK,CAAC;EAC7E,CAAC;CACF;CACA,OAAO,qBAAqB,IAAI;AACjC;AACA,SAAS,eAAe,YAAY,SAAS;CAC5C,IAAI,CAAC,gBAAgB,UAAU,GAAG,MAAM,cAAc,6BAA6B,iIAAiI;CACpN,IAAI,YAAY,KAAK,GAAG,OAAO,mBAAmB,WAAW,QAAQ,WAAW,QAAQ,YAAY,OAAO;CAC3G,OAAO,mBAAmB,WAAW,QAAQ,WAAW,QAAQ,UAAU;AAC3E;;AAIA,SAAS,MAAM;CACd,OAAO;EACN,MAAM;EACN,YAAY;CACb;AACD;;AAEA,SAAS,gBAAgB;CACxB,OAAO;EACN,MAAM;EACN,YAAY;CACb;AACD"}
@@ -6,7 +6,7 @@ import { p as validateSqlStorageConsistency, u as validateModelStorageReferences
6
6
  import { t as deriveValueSetFromEntity } from "./value-set-derivation-hook-HVaxhALD.mjs";
7
7
  import { n as buildSqlContractFromDefinition, t as applySqlSpecifierControlPolicy } from "./derived-checks-D5HVRvqN-BJx1gwPA.mjs";
8
8
  import { c as instantiateFieldTypeConstructor, i as defaultFunctionCall, v as readDataTypeDefault } from "./psl-field-resolution-C5KQ7kzP-B0NwuRWV.mjs";
9
- import { a as normalizeReferentialAction, n as buildEntityTypesByDiscriminator, r as indexFkRelations, t as applyBackrelationCandidates } from "./interpreter-BDpym-rc-C3-vTcej.mjs";
9
+ import { a as normalizeReferentialAction, n as buildEntityTypesByDiscriminator, r as indexFkRelations, t as applyBackrelationCandidates } from "./interpreter-D5qk4B---CG0C7kdx.mjs";
10
10
  import { isStructuredError } from "@prisma/orm-framework/utils/structured-error";
11
11
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
12
12
  import { entryForTag, getAuthoringTypeConstructor, instantiateAuthoringEntityType, instantiateAuthoringTypeConstructorFromValues } from "@prisma/orm-framework/components/authoring";
@@ -1,2 +1,2 @@
1
- import { i as interpretPslDocumentToSqlContract } from "./interpreter-BDpym-rc-C3-vTcej.mjs";
1
+ import { i as interpretPslDocumentToSqlContract } from "./interpreter-D5qk4B---CG0C7kdx.mjs";
2
2
  export { interpretPslDocumentToSqlContract };
@@ -1,2 +1,2 @@
1
- import { a as EnumMemberListDefault, c as sqlAttributeSpecs, i as EnumMemberDefault, n as DefaultFunctionCall, o as ParsedNullLiteral, r as DefaultFunctionSignature, s as defaultFunctionCall, t as describeUnsupportedSqlAttribute } from "./attribute-specs-D7QylDnB.mjs";
1
+ import { a as EnumMemberListDefault, c as sqlAttributeSpecs, i as EnumMemberDefault, n as DefaultFunctionCall, o as ParsedNullLiteral, r as DefaultFunctionSignature, s as defaultFunctionCall, t as describeUnsupportedSqlAttribute } from "./attribute-specs-DA_RwQFB.mjs";
2
2
  export { type DefaultFunctionCall, type DefaultFunctionSignature, type EnumMemberDefault, type EnumMemberListDefault, type ParsedNullLiteral, defaultFunctionCall, describeUnsupportedSqlAttribute, sqlAttributeSpecs };
@@ -1,5 +1,5 @@
1
1
  import { t as applySqlSpecifierControlPolicy } from "./derived-checks-D5HVRvqN-BJx1gwPA.mjs";
2
- import { i as interpretPslDocumentToSqlContract } from "./interpreter-BDpym-rc-C3-vTcej.mjs";
2
+ import { i as interpretPslDocumentToSqlContract } from "./interpreter-D5qk4B---CG0C7kdx.mjs";
3
3
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
4
4
  import { collectScalarTypeConstructors } from "@prisma/orm-framework/components/authoring";
5
5
  import { readFile } from "node:fs/promises";
@@ -1 +1 @@
1
- {"version":3,"file":"contract-psl__provider.mjs","names":[],"sources":["../../../../2-sql-family/2-authoring/contract-psl/dist/provider.mjs"],"sourcesContent":["import { n as interpretPslDocumentToSqlContract } from \"./interpreter-BDpym-rc.mjs\";\nimport { buildSymbolTable, createBinder, isPrismaNextSchema, mapPslDiagnostics } from \"@internal/psl-parser\";\nimport { applySqlSpecifierControlPolicy } from \"@internal/sql-contract-ts/contract-builder\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { assertDefined } from \"@internal/utils/assertions\";\nimport { collectScalarTypeConstructors } from \"@internal/framework-components/authoring\";\nimport { withSeedDiagnostics } from \"@internal/psl-parser/interpret\";\nimport { parse } from \"@internal/psl-parser/syntax\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { readFile } from \"node:fs/promises\";\nimport { basename, extname } from \"pathe\";\nimport { isDynamicPattern } from \"tinyglobby\";\n//#region src/provider.ts\n/**\n* The directory portion of `pattern` before its first glob-magic segment,\n* joined back with `/` (e.g. a `prisma` directory holding a recursive\n* `.prisma` glob derives `./prisma`). A rootless pattern with no static\n* segments yields `''`.\n*/\nfunction staticPrefixDirectory(pattern) {\n\tconst staticSegments = [];\n\tfor (const segment of pattern.replaceAll(\"\\\\\", \"/\").split(\"/\")) {\n\t\tif (isDynamicPattern(segment)) break;\n\t\tstaticSegments.push(segment);\n\t}\n\treturn staticSegments.join(\"/\");\n}\n/**\n* Derives the emit output path from the schema input path so artefacts land\n* colocated with the source (e.g. `src/contract/schema.prisma` →\n* `src/contract/contract.json`). A glob-shaped path derives from its static\n* prefix directory instead (a recursive glob under `prisma` derives\n* `./prisma/contract.json`). The provider owns this because it is the only\n* layer that knows the input path; the upstream `normalizeContractConfig`\n* default is a last-resort fallback for providers that don't carry one.\n*/\nfunction defaultOutputFromSchemaPath(schemaPath) {\n\tif (isDynamicPattern(schemaPath)) {\n\t\tconst prefix = staticPrefixDirectory(schemaPath);\n\t\treturn prefix.length === 0 ? \"contract.json\" : `${prefix}/contract.json`;\n\t}\n\tconst ext = extname(schemaPath);\n\tif (ext.length === 0) return `${schemaPath}.json`;\n\tconst base = schemaPath.slice(0, -ext.length);\n\tif (basename(base) === \"schema\") return `${base.slice(0, -6)}contract.json`;\n\treturn `${base}.json`;\n}\nfunction prismaContract(schemaPath, options) {\n\treturn {\n\t\tsource: {\n\t\t\tformat: \"psl\",\n\t\t\tinputs: [schemaPath],\n\t\t\tinterpret(input, context) {\n\t\t\t\tconst scalarColumnDescriptors = collectScalarTypeConstructors(context.authoringContributions.type);\n\t\t\t\treturn interpretPslDocumentToSqlContract({\n\t\t\t\t\tdocuments: input.documents,\n\t\t\t\t\tsymbolTable: input.symbolTable,\n\t\t\t\t\tsources: input.sources,\n\t\t\t\t\tbinder: input.binder,\n\t\t\t\t\tseedDiagnostics: [],\n\t\t\t\t\ttarget: options.target,\n\t\t\t\t\tauthoringContributions: context.authoringContributions,\n\t\t\t\t\tscalarColumnDescriptors,\n\t\t\t\t\t...ifDefined(\"composedExtensions\", context.composedExtensions.length > 0 ? [...context.composedExtensions] : void 0),\n\t\t\t\t\tcomposedExtensionContracts: context.composedExtensionContracts,\n\t\t\t\t\t...ifDefined(\"composedExtensionPackRefs\", options.composedExtensionPackRefs?.length ? options.composedExtensionPackRefs : void 0),\n\t\t\t\t\tcontrolMutationDefaults: context.controlMutationDefaults,\n\t\t\t\t\tgeneratorFunctions: context.generatorFunctions,\n\t\t\t\t\tcreateNamespace: options.createNamespace,\n\t\t\t\t\tcapabilities: context.capabilities,\n\t\t\t\t\tcodecLookup: context.codecLookup,\n\t\t\t\t\tdataTypes: context.dataTypes,\n\t\t\t\t\t...ifDefined(\"enumInferenceCodecs\", options.enumInferenceCodecs)\n\t\t\t\t});\n\t\t\t},\n\t\t\tasync load(context) {\n\t\t\t\tconst candidates = [...new Set(context.resolvedInputs)].sort();\n\t\t\t\tif (candidates.length === 0) return notOk({\n\t\t\t\t\tsummary: \"No schema files matched the configured contract source\",\n\t\t\t\t\tdiagnostics: [{\n\t\t\t\t\t\tcode: \"PSL_NO_SCHEMA_FILES_MATCHED\",\n\t\t\t\t\t\tmessage: `No files matched the configured pattern \"${schemaPath}\"`,\n\t\t\t\t\t\tsourceId: schemaPath\n\t\t\t\t\t}]\n\t\t\t\t});\n\t\t\t\tconst readDiagnostics = [];\n\t\t\t\tconst members = [];\n\t\t\t\tconst undirected = [];\n\t\t\t\tfor (const path of candidates) {\n\t\t\t\t\tlet text;\n\t\t\t\t\ttry {\n\t\t\t\t\t\ttext = await readFile(path, \"utf-8\");\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tconst message = String(error);\n\t\t\t\t\t\treadDiagnostics.push({\n\t\t\t\t\t\t\tcode: \"PSL_SCHEMA_READ_FAILED\",\n\t\t\t\t\t\t\tmessage,\n\t\t\t\t\t\t\tsourceId: path\n\t\t\t\t\t\t});\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (isPrismaNextSchema(text)) members.push({\n\t\t\t\t\t\tpath,\n\t\t\t\t\t\ttext\n\t\t\t\t\t});\n\t\t\t\t\telse undirected.push(path);\n\t\t\t\t}\n\t\t\t\tif (members.length === 0) {\n\t\t\t\t\tif (undirected.length === 0) return notOk({\n\t\t\t\t\t\tsummary: \"Failed to read Prisma schema files\",\n\t\t\t\t\t\tdiagnostics: readDiagnostics\n\t\t\t\t\t});\n\t\t\t\t\treturn notOk({\n\t\t\t\t\t\tsummary: \"No schema file carries the \\\"// use prisma-8\\\" directive\",\n\t\t\t\t\t\tdiagnostics: [...readDiagnostics, {\n\t\t\t\t\t\t\tcode: \"PSL_NO_OPTED_IN_SCHEMA_FILES\",\n\t\t\t\t\t\t\tmessage: `None of the matched files carry the \"// use prisma-8\" directive: ${undirected.join(\", \")}`,\n\t\t\t\t\t\t\tsourceId: schemaPath\n\t\t\t\t\t\t}]\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tconst parsed = members.map(({ path, text }) => parse(text, path));\n\t\t\t\tconst documents = parsed.map(({ document }) => document);\n\t\t\t\tconst [firstSources, ...restSources] = parsed.map(({ sources }) => sources);\n\t\t\t\tassertDefined(firstSources, \"prismaContract requires at least one parsed schema file\");\n\t\t\t\tconst sources = firstSources.merge(...restSources);\n\t\t\t\tconst seedDiagnostics = [...readDiagnostics, ...mapPslDiagnostics(parsed.flatMap(({ diagnostics }) => diagnostics), sources)];\n\t\t\t\tconst { symbolTable, diagnostics: symbolTableDiagnostics } = buildSymbolTable({\n\t\t\t\t\tdocuments,\n\t\t\t\t\tsources,\n\t\t\t\t\tdefaultNamespaceId: context.defaultNamespaceId\n\t\t\t\t});\n\t\t\t\tconst { binder, diagnostics: binderDiagnostics } = createBinder({\n\t\t\t\t\tsymbolTable,\n\t\t\t\t\tsources,\n\t\t\t\t\tcontext\n\t\t\t\t});\n\t\t\t\tconst interpreted = withSeedDiagnostics(this.interpret({\n\t\t\t\t\tdocuments,\n\t\t\t\t\tsources,\n\t\t\t\t\tsymbolTable,\n\t\t\t\t\tbinder\n\t\t\t\t}, context), [...seedDiagnostics, ...mapPslDiagnostics([...symbolTableDiagnostics, ...binderDiagnostics], sources)]);\n\t\t\t\tif (!interpreted.ok) return interpreted;\n\t\t\t\treturn ok(applySqlSpecifierControlPolicy(interpreted.value, options.defaultControlPolicy, options.createNamespace));\n\t\t\t}\n\t\t},\n\t\toutput: options.output ?? defaultOutputFromSchemaPath(schemaPath)\n\t};\n}\n//#endregion\nexport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E,cAAc,OAAO;IAC1E,cAAc,cAAc,yDAAyD;IACrF,MAAM,UAAU,aAAa,MAAM,GAAG,WAAW;IACjD,MAAM,kBAAkB,CAAC,GAAG,iBAAiB,GAAG,kBAAkB,OAAO,SAAS,EAAE,kBAAkB,WAAW,GAAG,OAAO,CAAC;IAC5H,MAAM,EAAE,aAAa,aAAa,2BAA2B,iBAAiB;KAC7E;KACA;KACA,oBAAoB,QAAQ;IAC7B,CAAC;IACD,MAAM,EAAE,QAAQ,aAAa,sBAAsB,aAAa;KAC/D;KACA;KACA;IACD,CAAC;IACD,MAAM,cAAc,oBAAoB,KAAK,UAAU;KACtD;KACA;KACA;KACA;IACD,GAAG,OAAO,GAAG,CAAC,GAAG,iBAAiB,GAAG,kBAAkB,CAAC,GAAG,wBAAwB,GAAG,iBAAiB,GAAG,OAAO,CAAC,CAAC;IACnH,IAAI,CAAC,YAAY,IAAI,OAAO;IAC5B,OAAO,GAAG,+BAA+B,YAAY,OAAO,QAAQ,sBAAsB,QAAQ,eAAe,CAAC;GACnH;EACD;EACA,QAAQ,QAAQ,UAAU,4BAA4B,UAAU;CACjE;AACD"}
1
+ {"version":3,"file":"contract-psl__provider.mjs","names":[],"sources":["../../../../2-sql-family/2-authoring/contract-psl/dist/provider.mjs"],"sourcesContent":["import { n as interpretPslDocumentToSqlContract } from \"./interpreter-D5qk4B--.mjs\";\nimport { buildSymbolTable, createBinder, isPrismaNextSchema, mapPslDiagnostics } from \"@internal/psl-parser\";\nimport { applySqlSpecifierControlPolicy } from \"@internal/sql-contract-ts/contract-builder\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { assertDefined } from \"@internal/utils/assertions\";\nimport { collectScalarTypeConstructors } from \"@internal/framework-components/authoring\";\nimport { withSeedDiagnostics } from \"@internal/psl-parser/interpret\";\nimport { parse } from \"@internal/psl-parser/syntax\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { readFile } from \"node:fs/promises\";\nimport { basename, extname } from \"pathe\";\nimport { isDynamicPattern } from \"tinyglobby\";\n//#region src/provider.ts\n/**\n* The directory portion of `pattern` before its first glob-magic segment,\n* joined back with `/` (e.g. a `prisma` directory holding a recursive\n* `.prisma` glob derives `./prisma`). A rootless pattern with no static\n* segments yields `''`.\n*/\nfunction staticPrefixDirectory(pattern) {\n\tconst staticSegments = [];\n\tfor (const segment of pattern.replaceAll(\"\\\\\", \"/\").split(\"/\")) {\n\t\tif (isDynamicPattern(segment)) break;\n\t\tstaticSegments.push(segment);\n\t}\n\treturn staticSegments.join(\"/\");\n}\n/**\n* Derives the emit output path from the schema input path so artefacts land\n* colocated with the source (e.g. `src/contract/schema.prisma` →\n* `src/contract/contract.json`). A glob-shaped path derives from its static\n* prefix directory instead (a recursive glob under `prisma` derives\n* `./prisma/contract.json`). The provider owns this because it is the only\n* layer that knows the input path; the upstream `normalizeContractConfig`\n* default is a last-resort fallback for providers that don't carry one.\n*/\nfunction defaultOutputFromSchemaPath(schemaPath) {\n\tif (isDynamicPattern(schemaPath)) {\n\t\tconst prefix = staticPrefixDirectory(schemaPath);\n\t\treturn prefix.length === 0 ? \"contract.json\" : `${prefix}/contract.json`;\n\t}\n\tconst ext = extname(schemaPath);\n\tif (ext.length === 0) return `${schemaPath}.json`;\n\tconst base = schemaPath.slice(0, -ext.length);\n\tif (basename(base) === \"schema\") return `${base.slice(0, -6)}contract.json`;\n\treturn `${base}.json`;\n}\nfunction prismaContract(schemaPath, options) {\n\treturn {\n\t\tsource: {\n\t\t\tformat: \"psl\",\n\t\t\tinputs: [schemaPath],\n\t\t\tinterpret(input, context) {\n\t\t\t\tconst scalarColumnDescriptors = collectScalarTypeConstructors(context.authoringContributions.type);\n\t\t\t\treturn interpretPslDocumentToSqlContract({\n\t\t\t\t\tdocuments: input.documents,\n\t\t\t\t\tsymbolTable: input.symbolTable,\n\t\t\t\t\tsources: input.sources,\n\t\t\t\t\tbinder: input.binder,\n\t\t\t\t\tseedDiagnostics: [],\n\t\t\t\t\ttarget: options.target,\n\t\t\t\t\tauthoringContributions: context.authoringContributions,\n\t\t\t\t\tscalarColumnDescriptors,\n\t\t\t\t\t...ifDefined(\"composedExtensions\", context.composedExtensions.length > 0 ? [...context.composedExtensions] : void 0),\n\t\t\t\t\tcomposedExtensionContracts: context.composedExtensionContracts,\n\t\t\t\t\t...ifDefined(\"composedExtensionPackRefs\", options.composedExtensionPackRefs?.length ? options.composedExtensionPackRefs : void 0),\n\t\t\t\t\tcontrolMutationDefaults: context.controlMutationDefaults,\n\t\t\t\t\tgeneratorFunctions: context.generatorFunctions,\n\t\t\t\t\tcreateNamespace: options.createNamespace,\n\t\t\t\t\tcapabilities: context.capabilities,\n\t\t\t\t\tcodecLookup: context.codecLookup,\n\t\t\t\t\tdataTypes: context.dataTypes,\n\t\t\t\t\t...ifDefined(\"enumInferenceCodecs\", options.enumInferenceCodecs)\n\t\t\t\t});\n\t\t\t},\n\t\t\tasync load(context) {\n\t\t\t\tconst candidates = [...new Set(context.resolvedInputs)].sort();\n\t\t\t\tif (candidates.length === 0) return notOk({\n\t\t\t\t\tsummary: \"No schema files matched the configured contract source\",\n\t\t\t\t\tdiagnostics: [{\n\t\t\t\t\t\tcode: \"PSL_NO_SCHEMA_FILES_MATCHED\",\n\t\t\t\t\t\tmessage: `No files matched the configured pattern \"${schemaPath}\"`,\n\t\t\t\t\t\tsourceId: schemaPath\n\t\t\t\t\t}]\n\t\t\t\t});\n\t\t\t\tconst readDiagnostics = [];\n\t\t\t\tconst members = [];\n\t\t\t\tconst undirected = [];\n\t\t\t\tfor (const path of candidates) {\n\t\t\t\t\tlet text;\n\t\t\t\t\ttry {\n\t\t\t\t\t\ttext = await readFile(path, \"utf-8\");\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tconst message = String(error);\n\t\t\t\t\t\treadDiagnostics.push({\n\t\t\t\t\t\t\tcode: \"PSL_SCHEMA_READ_FAILED\",\n\t\t\t\t\t\t\tmessage,\n\t\t\t\t\t\t\tsourceId: path\n\t\t\t\t\t\t});\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (isPrismaNextSchema(text)) members.push({\n\t\t\t\t\t\tpath,\n\t\t\t\t\t\ttext\n\t\t\t\t\t});\n\t\t\t\t\telse undirected.push(path);\n\t\t\t\t}\n\t\t\t\tif (members.length === 0) {\n\t\t\t\t\tif (undirected.length === 0) return notOk({\n\t\t\t\t\t\tsummary: \"Failed to read Prisma schema files\",\n\t\t\t\t\t\tdiagnostics: readDiagnostics\n\t\t\t\t\t});\n\t\t\t\t\treturn notOk({\n\t\t\t\t\t\tsummary: \"No schema file carries the \\\"// use prisma-8\\\" directive\",\n\t\t\t\t\t\tdiagnostics: [...readDiagnostics, {\n\t\t\t\t\t\t\tcode: \"PSL_NO_OPTED_IN_SCHEMA_FILES\",\n\t\t\t\t\t\t\tmessage: `None of the matched files carry the \"// use prisma-8\" directive: ${undirected.join(\", \")}`,\n\t\t\t\t\t\t\tsourceId: schemaPath\n\t\t\t\t\t\t}]\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tconst parsed = members.map(({ path, text }) => parse(text, path));\n\t\t\t\tconst documents = parsed.map(({ document }) => document);\n\t\t\t\tconst [firstSources, ...restSources] = parsed.map(({ sources }) => sources);\n\t\t\t\tassertDefined(firstSources, \"prismaContract requires at least one parsed schema file\");\n\t\t\t\tconst sources = firstSources.merge(...restSources);\n\t\t\t\tconst seedDiagnostics = [...readDiagnostics, ...mapPslDiagnostics(parsed.flatMap(({ diagnostics }) => diagnostics), sources)];\n\t\t\t\tconst { symbolTable, diagnostics: symbolTableDiagnostics } = buildSymbolTable({\n\t\t\t\t\tdocuments,\n\t\t\t\t\tsources,\n\t\t\t\t\tdefaultNamespaceId: context.defaultNamespaceId\n\t\t\t\t});\n\t\t\t\tconst { binder, diagnostics: binderDiagnostics } = createBinder({\n\t\t\t\t\tsymbolTable,\n\t\t\t\t\tsources,\n\t\t\t\t\tcontext\n\t\t\t\t});\n\t\t\t\tconst interpreted = withSeedDiagnostics(this.interpret({\n\t\t\t\t\tdocuments,\n\t\t\t\t\tsources,\n\t\t\t\t\tsymbolTable,\n\t\t\t\t\tbinder\n\t\t\t\t}, context), [...seedDiagnostics, ...mapPslDiagnostics([...symbolTableDiagnostics, ...binderDiagnostics], sources)]);\n\t\t\t\tif (!interpreted.ok) return interpreted;\n\t\t\t\treturn ok(applySqlSpecifierControlPolicy(interpreted.value, options.defaultControlPolicy, options.createNamespace));\n\t\t\t}\n\t\t},\n\t\toutput: options.output ?? defaultOutputFromSchemaPath(schemaPath)\n\t};\n}\n//#endregion\nexport { prismaContract };\n\n//# sourceMappingURL=provider.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;AAmBA,SAAS,sBAAsB,SAAS;CACvC,MAAM,iBAAiB,CAAC;CACxB,KAAK,MAAM,WAAW,QAAQ,WAAW,MAAM,GAAG,CAAC,CAAC,MAAM,GAAG,GAAG;EAC/D,IAAI,iBAAiB,OAAO,GAAG;EAC/B,eAAe,KAAK,OAAO;CAC5B;CACA,OAAO,eAAe,KAAK,GAAG;AAC/B;;;;;;;;;;AAUA,SAAS,4BAA4B,YAAY;CAChD,IAAI,iBAAiB,UAAU,GAAG;EACjC,MAAM,SAAS,sBAAsB,UAAU;EAC/C,OAAO,OAAO,WAAW,IAAI,kBAAkB,GAAG,OAAO;CAC1D;CACA,MAAM,MAAM,QAAQ,UAAU;CAC9B,IAAI,IAAI,WAAW,GAAG,OAAO,GAAG,WAAW;CAC3C,MAAM,OAAO,WAAW,MAAM,GAAG,CAAC,IAAI,MAAM;CAC5C,IAAI,SAAS,IAAI,MAAM,UAAU,OAAO,GAAG,KAAK,MAAM,GAAG,EAAE,EAAE;CAC7D,OAAO,GAAG,KAAK;AAChB;AACA,SAAS,eAAe,YAAY,SAAS;CAC5C,OAAO;EACN,QAAQ;GACP,QAAQ;GACR,QAAQ,CAAC,UAAU;GACnB,UAAU,OAAO,SAAS;IACzB,MAAM,0BAA0B,8BAA8B,QAAQ,uBAAuB,IAAI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AM;MACzC,SAAS;MACT,aAAa;KACd,CAAC;KACD,OAAO,MAAM;MACZ,SAAS;MACT,aAAa,CAAC,GAAG,iBAAiB;OACjC,MAAM;OACN,SAAS,oEAAoE,WAAW,KAAK,IAAI;OACjG,UAAU;MACX,CAAC;KACF,CAAC;IACF;IACA,MAAM,SAAS,QAAQ,KAAK,EAAE,MAAM,WAAW,MAAM,MAAM,IAAI,CAAC;IAChE,MAAM,YAAY,OAAO,KAAK,EAAE,eAAe,QAAQ;IACvD,MAAM,CAAC,cAAc,GAAG,eAAe,OAAO,KAAK,EAAE,cAAc,OAAO;IAC1E,cAAc,cAAc,yDAAyD;IACrF,MAAM,UAAU,aAAa,MAAM,GAAG,WAAW;IACjD,MAAM,kBAAkB,CAAC,GAAG,iBAAiB,GAAG,kBAAkB,OAAO,SAAS,EAAE,kBAAkB,WAAW,GAAG,OAAO,CAAC;IAC5H,MAAM,EAAE,aAAa,aAAa,2BAA2B,iBAAiB;KAC7E;KACA;KACA,oBAAoB,QAAQ;IAC7B,CAAC;IACD,MAAM,EAAE,QAAQ,aAAa,sBAAsB,aAAa;KAC/D;KACA;KACA;IACD,CAAC;IACD,MAAM,cAAc,oBAAoB,KAAK,UAAU;KACtD;KACA;KACA;KACA;IACD,GAAG,OAAO,GAAG,CAAC,GAAG,iBAAiB,GAAG,kBAAkB,CAAC,GAAG,wBAAwB,GAAG,iBAAiB,GAAG,OAAO,CAAC,CAAC;IACnH,IAAI,CAAC,YAAY,IAAI,OAAO;IAC5B,OAAO,GAAG,+BAA+B,YAAY,OAAO,QAAQ,sBAAsB,QAAQ,eAAe,CAAC;GACnH;EACD;EACA,QAAQ,QAAQ,UAAU,4BAA4B,UAAU;CACjE;AACD"}
@@ -1,5 +1,5 @@
1
1
  import { l as sql } from "./sql-expression-CKgKznXS.mjs";
2
2
  import { i as isValueObjectMember, n as buildSqlContractFromDefinition, o as storedAsListColumn, t as applySqlSpecifierControlPolicy } from "./derived-checks-D5HVRvqN-BJx1gwPA.mjs";
3
- import { a as check, c as enumType, d as member, f as model, i as buildContractDefinition, l as extensionModel, m as rel, n as bindEnumType, o as createComposedAuthoringHelpers, p as now, r as buildBoundContract, s as defineContract, t as autoincrement, u as field } from "./contract-builder-C3l_q1H-.mjs";
3
+ import { a as check, c as enumType, d as member, f as model, i as buildContractDefinition, l as extensionModel, m as rel, n as bindEnumType, o as createComposedAuthoringHelpers, p as now, r as buildBoundContract, s as defineContract, t as autoincrement, u as field } from "./contract-builder-50lF0kz1.mjs";
4
4
  import { n as typescriptContract, r as typescriptContractFromPath, t as emptyContract } from "./config-types-DkEeq_qq.mjs";
5
5
  export { applySqlSpecifierControlPolicy, autoincrement, bindEnumType, buildBoundContract, buildContractDefinition, buildSqlContractFromDefinition, check, createComposedAuthoringHelpers, defineContract, emptyContract, enumType, extensionModel, field, isValueObjectMember, member, model, now, rel, sql, storedAsListColumn, typescriptContract, typescriptContractFromPath };
@@ -1,4 +1,4 @@
1
1
  import { l as sql } from "./sql-expression-CKgKznXS.mjs";
2
2
  import { i as isValueObjectMember, n as buildSqlContractFromDefinition, o as storedAsListColumn, t as applySqlSpecifierControlPolicy } from "./derived-checks-D5HVRvqN-BJx1gwPA.mjs";
3
- import { a as check, c as enumType, d as member, f as model, i as buildContractDefinition, l as extensionModel, m as rel, n as bindEnumType, o as createComposedAuthoringHelpers, p as now, r as buildBoundContract, s as defineContract, t as autoincrement, u as field } from "./contract-builder-C3l_q1H-.mjs";
3
+ import { a as check, c as enumType, d as member, f as model, i as buildContractDefinition, l as extensionModel, m as rel, n as bindEnumType, o as createComposedAuthoringHelpers, p as now, r as buildBoundContract, s as defineContract, t as autoincrement, u as field } from "./contract-builder-50lF0kz1.mjs";
4
4
  export { applySqlSpecifierControlPolicy, autoincrement, bindEnumType, buildBoundContract, buildContractDefinition, buildSqlContractFromDefinition, check, createComposedAuthoringHelpers, defineContract, enumType, extensionModel, field, isValueObjectMember, member, model, now, rel, sql, storedAsListColumn };
@@ -9,7 +9,7 @@ import { g as valueObjectStorageTypeMissingMessage } from "./validators-BwA7ttZM
9
9
  import { a as describeUnsupportedSqlAttribute, b as sqlAttributeSpecs } from "./psl-field-resolution-C5KQ7kzP-B0NwuRWV.mjs";
10
10
  import { t as describeUnresolvedSqlType } from "./diagnostics-RHJxoiIk.mjs";
11
11
  import { t as sqlEmission } from "./dist-C8Y-PPuE.mjs";
12
- import { a as sqlFamilyGeneratorDescriptors, i as sqlFamilyEntityTypes, n as sqlFamilyAuthoringFieldPresets, o as sqlFamilyGeneratorFunctions, r as sqlFamilyAuthoringTypes, s as sqlFamilyPslBlockDescriptors } from "./generator-functions-D_qdqBV--B1cUxXC8.mjs";
12
+ import { a as sqlFamilyGeneratorDescriptors, i as sqlFamilyEntityTypes, n as sqlFamilyAuthoringFieldPresets, o as sqlFamilyGeneratorFunctions, r as sqlFamilyAuthoringTypes, s as sqlFamilyPslBlockDescriptors } from "./generator-functions-D_qdqBV--Bq296cED.mjs";
13
13
  import { c as verifySqlSchemaByDiff, n as classifyDiffSubjectGranularity, o as enforceSqlDataTypeInvariants, t as classifyDiffEntityKind } from "./schema-verify-C3wbdviw-DMjIubOr.mjs";
14
14
  import { t as sqlFamilyError } from "./errors-B5g0xWro-C8plbqga.mjs";
15
15
  import { t as SqlContractSerializer } from "./sql-contract-serializer-sMY3prTx-D2BfrNxs.mjs";
@@ -2718,4 +2718,4 @@ var control_default = new SqlFamilyDescriptor();
2718
2718
  //#endregion
2719
2719
  export { unmatchedColumnRename as $, planFieldEventOperations as A, resolveTableRenameAgainst as B, fieldStatementColumns as C, partitionCallsByControlPolicy as D, otherSpaceDeclaring as E, readReportedDefault as F, slotSource as G, rowsWithoutValueSummary as H, requiredColumnMeta as I, sqlTypeLookupsOf as J, sqlDefaultFunctions as K, requiredColumnOf as L, plannerFailure as M, plannerSuccess as N, partitionIssuesByControlPolicy as O, readColumnDefault as P, unknownCallNames as Q, requiredColumnsOfMigration as R, fieldRenameStorageEffect as S, modelRenameStorageEffect as T, runnerFailure as U, rowsWithoutValueFailure as V, runnerSuccess as W, subjectsOfCalls as X, storageNameOfOperation as Y, unconvertedFieldOf as Z, createSqlTextSources as _, appliedStatementsInOrder as a, fieldEventStorage as b, checkSqlExpressionText as c, contractNamespaceToSchemaIR as d, unmatchedTableRename as et, contractToSchemaIR as f, createMigrationPlan as g, convertedColumnOf as h, TABLE_NAME_CASE_CHANGED_CODE as i, planStatements as j, planFieldEventCalls as k, columnTakesTemporaryValue as l, convertedColumnMeta as m, INIT_ADDITIVE_POLICY as n, assembleAuthoringContributions$1 as o, control_default as p, sqlOfSlot as q, NO_RENAMED_ORIGINS as r, backfillOfDefaultedField as s, COLUMN_RENAME_UNMATCHED_CODE as t, contractColumns as u, detectDestructiveChanges as v, isUnfilledSlot as w, fieldOfColumn as x, detectTableNameCaseChanges as y, resolveColumnRenameAgainst as z };
2720
2720
 
2721
- //# sourceMappingURL=control-DxyXflhj.mjs.map
2721
+ //# sourceMappingURL=control-BK50zF6c.mjs.map