@prisma/orm-framework 8.0.0-rc.14-dev.29 → 8.0.0-rc.14-dev.31

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 (102) hide show
  1. package/dist/{authoring-CQOFIHhF.d.mts → authoring-CUDReFVP.d.mts} +4 -4
  2. package/dist/{authoring-CQOFIHhF.d.mts.map → authoring-CUDReFVP.d.mts.map} +1 -1
  3. package/dist/{authoring-C8hxYYQI.mjs → authoring-Cp71GImA.mjs} +2 -2
  4. package/dist/authoring-Cp71GImA.mjs.map +1 -0
  5. package/dist/{binder-CGmSEQPU-B7utUHdi.d.mts → binder-CGmSEQPU-Celseo4Z.d.mts} +9 -9
  6. package/dist/{binder-CGmSEQPU-B7utUHdi.d.mts.map → binder-CGmSEQPU-Celseo4Z.d.mts.map} +1 -1
  7. package/dist/{capabilities-M-lvaPSE-BMffxZqu.mjs → capabilities-CnCdDH1J-Bq8Zf0nY.mjs} +3 -3
  8. package/dist/{capabilities-M-lvaPSE-BMffxZqu.mjs.map → capabilities-CnCdDH1J-Bq8Zf0nY.mjs.map} +1 -1
  9. package/dist/{codec-DFvi9jo5.d.mts → codec-0XB-9TzG.d.mts} +5 -4
  10. package/dist/codec-0XB-9TzG.d.mts.map +1 -0
  11. package/dist/{codec-B3lumsVx.mjs → codec-Cz-bOon3.mjs} +3 -3
  12. package/dist/codec-Cz-bOon3.mjs.map +1 -0
  13. package/dist/{codec-types-CMqWkP1t-CjK8Cwfr.mjs → codec-types-BXLUbk-Y-DpGfKGK0.mjs} +2 -3
  14. package/dist/{codec-types-CMqWkP1t-CjK8Cwfr.mjs.map → codec-types-BXLUbk-Y-DpGfKGK0.mjs.map} +1 -1
  15. package/dist/{codec-types-DrcxdLlC-CAfu8HRL.d.mts → codec-types-CZ8xRBJy-BMjCsUt1.d.mts} +27 -11
  16. package/dist/codec-types-CZ8xRBJy-BMjCsUt1.d.mts.map +1 -0
  17. package/dist/{components-DFA65tWf.d.mts → components-CRRIFm30.d.mts} +4 -4
  18. package/dist/{components-DFA65tWf.d.mts.map → components-CRRIFm30.d.mts.map} +1 -1
  19. package/dist/{components-0Tccse_E.mjs → components-VMbwq7D8.mjs} +2 -2
  20. package/dist/{components-0Tccse_E.mjs.map → components-VMbwq7D8.mjs.map} +1 -1
  21. package/dist/components.d.mts +17 -17
  22. package/dist/components.mjs +9 -9
  23. package/dist/components__authoring.d.mts +4 -4
  24. package/dist/components__authoring.mjs +3 -3
  25. package/dist/components__codec.d.mts +3 -3
  26. package/dist/components__codec.mjs +4 -4
  27. package/dist/components__components.d.mts +3 -3
  28. package/dist/components__components.mjs +2 -2
  29. package/dist/components__control.d.mts +4 -4
  30. package/dist/components__control.mjs +3 -3
  31. package/dist/components__emission.d.mts +3 -3
  32. package/dist/components__execution.d.mts +1 -1
  33. package/dist/components__psl-ast.d.mts +3 -3
  34. package/dist/components__runtime.d.mts +1 -1
  35. package/dist/{config-types-D5MpuJlm.d.mts → config-types-E4OZwoHK.d.mts} +6 -6
  36. package/dist/{config-types-D5MpuJlm.d.mts.map → config-types-E4OZwoHK.d.mts.map} +1 -1
  37. package/dist/config.d.mts +1 -1
  38. package/dist/config__config-types.d.mts +1 -1
  39. package/dist/contract-authoring.d.mts +5 -5
  40. package/dist/contract-authoring.mjs +3 -2
  41. package/dist/contract-authoring.mjs.map +1 -1
  42. package/dist/{control-DEcjDcjA.mjs → control-D9TxxGse.mjs} +55 -36
  43. package/dist/control-D9TxxGse.mjs.map +1 -0
  44. package/dist/{control-DgoyiMYQ.d.mts → control-DtFLqCvx.d.mts} +26 -25
  45. package/dist/{control-DgoyiMYQ.d.mts.map → control-DtFLqCvx.d.mts.map} +1 -1
  46. package/dist/{declarations-DDT0hm5r-BAMLVwKx.mjs → declarations-DDT0hm5r-D_XDM-WN.mjs} +2 -2
  47. package/dist/{declarations-DDT0hm5r-BAMLVwKx.mjs.map → declarations-DDT0hm5r-D_XDM-WN.mjs.map} +1 -1
  48. package/dist/emission-CKIZBZw3.d.mts +2 -0
  49. package/dist/{emission-types-CND9Xi8O-DKnaAGFS.d.mts → emission-types-CKbNqwUs-hrIslUsL.d.mts} +4 -4
  50. package/dist/{emission-types-CND9Xi8O-DKnaAGFS.d.mts.map → emission-types-CKbNqwUs-hrIslUsL.d.mts.map} +1 -1
  51. package/dist/errors.d.mts +1 -1
  52. package/dist/errors__execution.d.mts +1 -1
  53. package/dist/{execution-BbJTSuvJ.d.mts → execution-DHWSU95b.d.mts} +2 -2
  54. package/dist/{execution-BbJTSuvJ.d.mts.map → execution-DHWSU95b.d.mts.map} +1 -1
  55. package/dist/{execution-D5L9gHoo.d.mts → execution-ZWG0tqRB.d.mts} +2 -2
  56. package/dist/{execution-D5L9gHoo.d.mts.map → execution-ZWG0tqRB.d.mts.map} +1 -1
  57. package/dist/{framework-authoring-BLXTNi9g-CcRc8u9I.d.mts → framework-authoring-BJf_-FTJ-K8fp3V_r.d.mts} +22 -28
  58. package/dist/framework-authoring-BJf_-FTJ-K8fp3V_r.d.mts.map +1 -0
  59. package/dist/{framework-components-CwclBqDh-CBGrY3Ry.d.mts → framework-components-7SQpxVko-BaUd55aP.d.mts} +7 -7
  60. package/dist/{framework-components-CwclBqDh-CBGrY3Ry.d.mts.map → framework-components-7SQpxVko-BaUd55aP.d.mts.map} +1 -1
  61. package/dist/ids.d.mts +1 -1
  62. package/dist/{mutation-default-types-ZfKqVdmf-DATmLFpQ.d.mts → mutation-default-types-CrA6rrwU-BkMgh2pO.d.mts} +3 -3
  63. package/dist/{mutation-default-types-ZfKqVdmf-DATmLFpQ.d.mts.map → mutation-default-types-CrA6rrwU-BkMgh2pO.d.mts.map} +1 -1
  64. package/dist/{parse-eSQ_clQv-D2Mtj0WV.d.mts → parse-eSQ_clQv-BIek6vrj.d.mts} +6 -6
  65. package/dist/{parse-eSQ_clQv-D2Mtj0WV.d.mts.map → parse-eSQ_clQv-BIek6vrj.d.mts.map} +1 -1
  66. package/dist/{parse-ymgXJUnk-CYMEjkGC.mjs → parse-ymgXJUnk-SzrYveCt.mjs} +2 -2
  67. package/dist/{parse-ymgXJUnk-CYMEjkGC.mjs.map → parse-ymgXJUnk-SzrYveCt.mjs.map} +1 -1
  68. package/dist/psl-ast-CcQp_u_l.d.mts +2 -0
  69. package/dist/{psl-ast-CPxYIxM1-XHoHPgRO.d.mts → psl-ast-DtjFlM-c-amCHIsWc.d.mts} +3 -3
  70. package/dist/{psl-ast-CPxYIxM1-XHoHPgRO.d.mts.map → psl-ast-DtjFlM-c-amCHIsWc.d.mts.map} +1 -1
  71. package/dist/psl-parser.d.mts +8 -8
  72. package/dist/psl-parser.mjs +2 -2
  73. package/dist/psl-parser__format.d.mts +1 -1
  74. package/dist/psl-parser__format.mjs +2 -2
  75. package/dist/psl-parser__interpret.d.mts +6 -6
  76. package/dist/psl-parser__interpret.mjs +1 -1
  77. package/dist/psl-parser__syntax.d.mts +1 -1
  78. package/dist/psl-parser__syntax.mjs +2 -2
  79. package/dist/psl-printer.d.mts +4 -4
  80. package/dist/psl-printer.mjs +3 -2
  81. package/dist/psl-printer.mjs.map +1 -1
  82. package/dist/{resolve-codec-CxRICgbr-BLdoRYJc.mjs → resolve-codec-qE0g980d-Ck_gIaTi.mjs} +63 -3
  83. package/dist/resolve-codec-qE0g980d-Ck_gIaTi.mjs.map +1 -0
  84. package/dist/{runtime-BCzeC3dA.d.mts → runtime-BccsLa5m.d.mts} +2 -2
  85. package/dist/{runtime-BCzeC3dA.d.mts.map → runtime-BccsLa5m.d.mts.map} +1 -1
  86. package/dist/{temporal-presets-DzBBD4St-BaL1QaZ7.mjs → temporal-presets-UoKnoAlu-6864WUSv.mjs} +33 -10
  87. package/dist/temporal-presets-UoKnoAlu-6864WUSv.mjs.map +1 -0
  88. package/dist/{temporal-presets-DKHiZVPP-DLAr--Pb.d.mts → temporal-presets-pC0xlwib-Diikns1l.d.mts} +4 -4
  89. package/dist/{temporal-presets-DKHiZVPP-DLAr--Pb.d.mts.map → temporal-presets-pC0xlwib-Diikns1l.d.mts.map} +1 -1
  90. package/dist/{types-import-spec-D-EPunhV-B3y6hGP5.d.mts → types-import-spec-BLFYPur6-QN7ntocb.d.mts} +3 -3
  91. package/dist/{types-import-spec-D-EPunhV-B3y6hGP5.d.mts.map → types-import-spec-BLFYPur6-QN7ntocb.d.mts.map} +1 -1
  92. package/package.json +15 -15
  93. package/dist/authoring-C8hxYYQI.mjs.map +0 -1
  94. package/dist/codec-B3lumsVx.mjs.map +0 -1
  95. package/dist/codec-DFvi9jo5.d.mts.map +0 -1
  96. package/dist/codec-types-DrcxdLlC-CAfu8HRL.d.mts.map +0 -1
  97. package/dist/control-DEcjDcjA.mjs.map +0 -1
  98. package/dist/emission-jG88SNeC.d.mts +0 -2
  99. package/dist/framework-authoring-BLXTNi9g-CcRc8u9I.d.mts.map +0 -1
  100. package/dist/psl-ast-DA_tKWiL.d.mts +0 -2
  101. package/dist/resolve-codec-CxRICgbr-BLdoRYJc.mjs.map +0 -1
  102. package/dist/temporal-presets-DzBBD4St-BaL1QaZ7.mjs.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"codec-types-DrcxdLlC-CAfu8HRL.d.mts","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/codec-types-DrcxdLlC.d.mts"],"mappings":";;;;;;;;;KAQK;WACM;;;;;;KAMN,QAAQ,OAAO,cAAc;;;;;UAKxB;WACC,aAAa;WACb,OAAO,mBAAmB,gBAAgB;;;;;;;KAOhD,mBAAmB,OAAO,cAAc;UACnC;WACC,IAAI;;WAEJ,OAAO,SAAS,OAAO,YAAY;WACnC,WAAW;;;;;WAKX,kBAAkB;;UAEnB;WACC,QAAQ,SAAS,eAAe;WAChC;aACE;aACA,MAAM;;WAER,kBAAkB;;;UAGnB;EACR,IAAI,aAAa;EACjB,IAAI;;;iBAGW,WAAW,aAAa;;iBAExB,SAAS,YAAY,MAAM,eAAe;iBAC1C,qBAAqB,gBAAgB,aAAa;;;;;;;;;;;;;;UAczD,wBAAwB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SAAS;;;;;;;;;UASV;EACR,IAAI,aAAa;EACjB,eAAe;EACf,oBAAoB,YAAY,QAAQ;;EAExC,oBAAoB,YAAY,QAAQ;;EAExC,uBAAuB,YAAY,OAAO,WAAW;;;UAG7C,mCAAmC;;;;EAI3C,cAAc,aAAa;;;;;;;;;;;;;;;UAenB,sBAAsB;EAC9B,YAAY,KAAK,WAAW;EAC5B,UAAU,qBAAqB,eAAe,iBAAiB;;;cAGnD,kBAAkB;;;;;;;;UAQtB;WACC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"control-DEcjDcjA.mjs","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/control.mjs"],"sourcesContent":["import { n as runtimeError } from \"./runtime-error-BA9d7XjZ.mjs\";\nimport { n as codecDescriptorMissing, r as codecForRef, s as createDataTypeLookup } from \"./resolve-codec-CxRICgbr.mjs\";\nimport { n as aggregateDescriptorKey, r as isAggregateDescriptor, t as mergeCapabilityMatrices } from \"./capabilities-M-lvaPSE.mjs\";\nimport { A as mergeAuthoringAttributeSpecs, _ as collectContributedDescriptorPaths, c as TAGGED_LITERAL_MAX_BYTES, f as resolvePslBacktickEscapes, h as assertResolvableTypeConstructorTemplates, j as mergeAuthoringNamespaces, l as canonicalizeTaggedLiteralBody, m as assertNoCrossRegistryCollisions, p as resolveTemplateTagEscapes, s as timestampNowControlDescriptor, u as describeTaggedLiteralFailure, v as collectScalarTypeConstructors } from \"./temporal-presets-DzBBD4St.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { InternalError, isInternalError } from \"@internal/utils/internal-error\";\n//#region src/control/contract-snapshot-layout.ts\nconst CONTRACT_SNAPSHOTS_DIRNAME = \"snapshots\";\nconst STORAGE_HASH_PATTERN = /^[0-9a-f]{64}$/;\n/** Validate a storage hash for use as a directory name. */\nfunction storageHashHex(storageHash) {\n\tif (!STORAGE_HASH_PATTERN.test(storageHash)) throw new InternalError(`Invalid storage hash \"${storageHash}\": expected 64 lowercase hex characters`);\n\treturn storageHash;\n}\n/** Module specifier for the store's `contract.json`, POSIX separators. */\nfunction contractSnapshotJsonSpecifier(snapshotsImportPath, storageHash) {\n\treturn `${snapshotsImportPath}/${storageHashHex(storageHash)}/contract.json`;\n}\n/** Type-only module specifier for the store's `contract.d.ts` (no extension). */\nfunction contractSnapshotTypesSpecifier(snapshotsImportPath, storageHash) {\n\treturn `${snapshotsImportPath}/${storageHashHex(storageHash)}/contract`;\n}\n//#endregion\n//#region src/control/control-capabilities.ts\nfunction hasMigrations(target) {\n\treturn \"migrations\" in target && !!target[\"migrations\"];\n}\nfunction hasSchemaView(instance) {\n\treturn \"toSchemaView\" in instance && typeof instance[\"toSchemaView\"] === \"function\";\n}\nfunction hasPslContractInfer(instance) {\n\treturn \"inferPslContract\" in instance && typeof instance[\"inferPslContract\"] === \"function\";\n}\nfunction hasPslContractBuild(instance) {\n\treturn \"buildPslContract\" in instance && typeof Reflect.get(instance, \"buildPslContract\") === \"function\";\n}\nfunction hasOperationPreview(instance) {\n\treturn \"toOperationPreview\" in instance && typeof instance[\"toOperationPreview\"] === \"function\";\n}\nfunction hasSchemaSubjectClassifier(instance) {\n\treturn \"classifySubjectGranularity\" in instance && typeof instance[\"classifySubjectGranularity\"] === \"function\" && \"classifyEntityKind\" in instance && typeof instance[\"classifyEntityKind\"] === \"function\";\n}\n//#endregion\n//#region src/control/control-operation-results.ts\nconst VERIFY_CODE_MARKER_MISSING = \"CONTRACT.MARKER_MISSING\";\nconst VERIFY_CODE_HASH_MISMATCH = \"CONTRACT.MARKER_MISMATCH\";\nconst VERIFY_CODE_TARGET_MISMATCH = \"CONTRACT.TARGET_MISMATCH\";\nconst VERIFY_CODE_SCHEMA_FAILURE = \"CONTRACT.SCHEMA_VERIFICATION_FAILED\";\n//#endregion\n//#region src/control/control-schema-view.ts\nvar SchemaTreeNode = class {\n\tkind;\n\tid;\n\tlabel;\n\tmeta;\n\tchildren;\n\tconstructor(options) {\n\t\tthis.kind = options.kind;\n\t\tthis.id = options.id;\n\t\tthis.label = options.label;\n\t\tif (options.meta !== void 0) this.meta = options.meta;\n\t\tif (options.children !== void 0) this.children = options.children;\n\t\tObject.freeze(this);\n\t}\n\taccept(visitor) {\n\t\treturn visitor.visit(this);\n\t}\n};\n//#endregion\n//#region src/control/control-spaces.ts\n/**\n* Canonical control-plane identifiers for contract spaces.\n*\n* A contract space is the disjoint `(contract.json, migration-graph)` unit\n* the per-space planner / runner / verifier (project: extension contract\n* spaces, TML-2397) operates on. The application owns one well-known\n* space — the value below — and each loaded extension that contributes\n* schema owns a uniquely-named space.\n*\n* Lives in `framework-components/control` so every layer that has to\n* reason about space identity (the migration tooling, the SQL runtime's\n* marker reader, target-side statement builders, target-side adapters)\n* can import a single value rather than duplicating the literal. Raw\n* `'app'` string literals in framework / target / runtime / adapter\n* source code are forbidden and policed by\n* `scripts/lint-app-space-id.mjs` (wired into `pnpm lint:deps`).\n*\n* @see specs/framework-mechanism.spec.md § 3 — Layout convention (γ).\n*/\nconst APP_SPACE_ID = \"app\";\n//#endregion\n//#region src/control/control-stack.ts\nfunction addUniqueId(ids, seen, id) {\n\tif (!seen.has(id)) {\n\t\tids.push(id);\n\t\tseen.add(id);\n\t}\n}\nfunction assertUniqueCodecOwner(options) {\n\tconst existingOwner = options.owners.get(options.codecId);\n\tif (existingOwner !== void 0) throw new InternalError(`Duplicate ${options.entityLabel} for codecId \"${options.codecId}\". Descriptor \"${options.descriptorId}\" conflicts with \"${existingOwner}\". Each codecId can only have one ${options.entityOwnershipLabel}.`);\n}\nfunction extractCodecTypeImports(descriptors) {\n\tconst imports = [];\n\tfor (const descriptor of descriptors) {\n\t\tconst codecTypes = descriptor.types?.codecTypes;\n\t\tif (codecTypes?.import) imports.push(codecTypes.import);\n\t\tif (codecTypes?.typeImports) imports.push(...codecTypes.typeImports);\n\t}\n\treturn imports;\n}\nfunction extractQueryOperationTypeImports(descriptors) {\n\tconst imports = [];\n\tfor (const descriptor of descriptors) {\n\t\tconst queryOperationTypes = descriptor.types?.queryOperationTypes;\n\t\tif (queryOperationTypes?.import) imports.push(queryOperationTypes.import);\n\t}\n\treturn imports;\n}\nfunction extractComponentIds(family, target, adapter, extensions) {\n\tconst ids = [];\n\tconst seen = /* @__PURE__ */ new Set();\n\taddUniqueId(ids, seen, family.id);\n\taddUniqueId(ids, seen, target.id);\n\tif (adapter) addUniqueId(ids, seen, adapter.id);\n\tfor (const ext of extensions) addUniqueId(ids, seen, ext.id);\n\treturn ids;\n}\nfunction assembleAuthoringContributions(descriptors) {\n\tconst field = {};\n\tconst type = {};\n\tconst entityTypes = {};\n\tconst pslBlockDescriptors = {};\n\tconst modelAttributes = {};\n\tconst attributeSpecs = {\n\t\tmodel: {},\n\t\tfield: {}\n\t};\n\tconst attributeSpecOwners = /* @__PURE__ */ new Map();\n\tconst pathOwners = /* @__PURE__ */ new Map();\n\tconst claimContributedPaths = (namespace, descriptorKind, label, descriptorId) => {\n\t\tfor (const path of collectContributedDescriptorPaths(namespace, descriptorKind)) {\n\t\t\tconst key = `${label}:${path}`;\n\t\t\tconst existingOwner = pathOwners.get(key);\n\t\t\tif (existingOwner !== void 0) throw new InternalError(`Duplicate authoring ${label} helper \"${path}\". Descriptor \"${descriptorId}\" conflicts with \"${existingOwner}\".`);\n\t\t\tpathOwners.set(key, descriptorId);\n\t\t}\n\t};\n\tlet valueObjectStorageDeclaration;\n\tfor (const descriptor of descriptors) {\n\t\tconst descriptorId = descriptor.id ?? \"<unknown>\";\n\t\tconst declaredValueObjectStorageType = descriptor.authoring?.valueObjectStorageType;\n\t\tif (declaredValueObjectStorageType !== void 0) {\n\t\t\tif (valueObjectStorageDeclaration !== void 0) throw new InternalError(`Duplicate authoring valueObjectStorageType declaration. Descriptor \"${descriptorId}\" conflicts with \"${valueObjectStorageDeclaration.ownerId}\". Exactly one composed component may declare the value-object storage type.`);\n\t\t\tvalueObjectStorageDeclaration = {\n\t\t\t\tname: declaredValueObjectStorageType,\n\t\t\t\townerId: descriptorId\n\t\t\t};\n\t\t}\n\t\tif (descriptor.authoring?.field) {\n\t\t\tclaimContributedPaths(descriptor.authoring.field, \"fieldPreset\", \"field\", descriptorId);\n\t\t\tmergeAuthoringNamespaces(field, descriptor.authoring.field, [], \"fieldPreset\", \"field\");\n\t\t}\n\t\tif (descriptor.authoring?.type) {\n\t\t\tclaimContributedPaths(descriptor.authoring.type, \"typeConstructor\", \"type\", descriptorId);\n\t\t\tassertResolvableTypeConstructorTemplates(descriptor.authoring.type, descriptorId);\n\t\t\tmergeAuthoringNamespaces(type, descriptor.authoring.type, [], \"typeConstructor\", \"type\");\n\t\t}\n\t\tif (descriptor.authoring?.entityTypes) {\n\t\t\tclaimContributedPaths(descriptor.authoring.entityTypes, \"entity\", \"entity\", descriptorId);\n\t\t\tmergeAuthoringNamespaces(entityTypes, descriptor.authoring.entityTypes, [], \"entity\", \"entity\");\n\t\t}\n\t\tif (descriptor.authoring?.pslBlockDescriptors) {\n\t\t\tclaimContributedPaths(descriptor.authoring.pslBlockDescriptors, \"pslBlock\", \"pslBlock\", descriptorId);\n\t\t\tmergeAuthoringNamespaces(pslBlockDescriptors, descriptor.authoring.pslBlockDescriptors, [], \"pslBlock\", \"pslBlock\");\n\t\t}\n\t\tif (descriptor.authoring?.modelAttributes) mergeAuthoringNamespaces(modelAttributes, descriptor.authoring.modelAttributes, [], \"modelAttribute\", \"modelAttribute\");\n\t\tif (descriptor.authoring?.attributeSpecs) mergeAuthoringAttributeSpecs(attributeSpecs, descriptor.authoring.attributeSpecs, descriptorId, attributeSpecOwners);\n\t}\n\tconst fieldNamespace = field;\n\tconst typeNamespace = type;\n\tconst entityTypeNamespace = entityTypes;\n\tconst pslBlockDescriptorNamespace = blindCast(pslBlockDescriptors);\n\tconst modelAttributeNamespace = blindCast(modelAttributes);\n\tassertNoCrossRegistryCollisions(typeNamespace, fieldNamespace, entityTypeNamespace, pslBlockDescriptorNamespace, modelAttributeNamespace);\n\tif (valueObjectStorageDeclaration !== void 0 && !collectScalarTypeConstructors(typeNamespace).has(valueObjectStorageDeclaration.name)) throw new InternalError(`Invalid authoring valueObjectStorageType \"${valueObjectStorageDeclaration.name}\" declared by descriptor \"${valueObjectStorageDeclaration.ownerId}\". The name must be a top-level bare-eligible type constructor in the assembled authoring namespace.`);\n\treturn {\n\t\tdataTypes: assembleAuthoringDataTypes(descriptors),\n\t\tfield: fieldNamespace,\n\t\ttype: typeNamespace,\n\t\tentityTypes: entityTypeNamespace,\n\t\tpslBlockDescriptors: pslBlockDescriptorNamespace,\n\t\tmodelAttributes: modelAttributeNamespace,\n\t\tattributeSpecs,\n\t\t...valueObjectStorageDeclaration !== void 0 ? { valueObjectStorageType: valueObjectStorageDeclaration.name } : {}\n\t};\n}\n/** Collect every data type the composed components register, refusing two declarations of one id. */\nfunction assembleDataTypes(descriptors) {\n\tconst declared = [];\n\tconst owners = /* @__PURE__ */ new Map();\n\tfor (const descriptor of descriptors) {\n\t\tconst contributedBy = descriptor.id ?? \"<unknown>\";\n\t\tfor (const type of descriptor.dataTypes ?? []) {\n\t\t\tconst existingOwner = owners.get(type.id);\n\t\t\tif (existingOwner !== void 0) throw runtimeError(\"CONTRACT.DATA_TYPE_DUPLICATE\", `Duplicate data type \"${type.id}\". Component \"${contributedBy}\" conflicts with \"${existingOwner}\". Each data type has exactly one owner across the composed stack.`, {\n\t\t\t\tdataType: type.id,\n\t\t\t\tcontributedBy,\n\t\t\t\towner: existingOwner\n\t\t\t});\n\t\t\towners.set(type.id, contributedBy);\n\t\t\tdeclared.push({\n\t\t\t\ttype,\n\t\t\t\tcontributedBy\n\t\t\t});\n\t\t}\n\t}\n\treturn {\n\t\tlookup: createDataTypeLookup(declared.map((entry) => entry.type)),\n\t\tdeclared\n\t};\n}\n/** Merge every component's PSL support for its data types, refusing two claims on one key. */\nfunction assembleAuthoringDataTypes(descriptors) {\n\tconst merged = {};\n\tconst owners = /* @__PURE__ */ new Map();\n\tfor (const descriptor of descriptors) {\n\t\tconst contributedBy = descriptor.id ?? \"<unknown>\";\n\t\tfor (const [key, entry] of Object.entries(descriptor.authoring?.dataTypes ?? {})) {\n\t\t\tconst existingOwner = owners.get(key);\n\t\t\tif (existingOwner !== void 0) throw runtimeError(\"CONTRACT.DATA_TYPE_ENTRY_DUPLICATE\", `Duplicate authoring entry for \"${key}\". Component \"${contributedBy}\" conflicts with \"${existingOwner}\".`, {\n\t\t\t\tkey,\n\t\t\t\tcontributedBy,\n\t\t\t\towner: existingOwner\n\t\t\t});\n\t\t\towners.set(key, contributedBy);\n\t\t\tmerged[key] = entry;\n\t\t}\n\t}\n\treturn merged;\n}\n/**\n* The four things assembly checks across packs, each naming the component and the id at fault:\n*\n* 1. every codec names a registered data type;\n* 2. every authoring entry, and every type a cast takes values of, names a registered data type;\n* 3. no two entries claim one tag or one plain form;\n* 4. every type a cast takes values of can be written, because a cast from a type nobody can write\n* is never exercised.\n*/\nfunction enforceDataTypeInvariants(input) {\n\tconst unregistered = (contributedBy, id, what) => {\n\t\tthrow runtimeError(\"CONTRACT.DATA_TYPE_UNREGISTERED\", `${what} names data type \"${id}\", which no component registers. Contributed by \"${contributedBy}\".`, {\n\t\t\tdataType: id,\n\t\t\tcontributedBy\n\t\t});\n\t};\n\tfor (const codec of input.codecs) if (!input.lookup.has(codec.dataType)) unregistered(codec.contributedBy, codec.dataType, `Codec \"${codec.codecId}\"`);\n\tfor (const { key, entry, contributedBy } of input.authoringEntries) {\n\t\tif (!input.lookup.has(key)) unregistered(contributedBy, key, \"Authoring entry\");\n\t\tif (entry.written.kind === \"plain\" && entry.written.syntax === \"number\") {\n\t\t\tfor (const classified of entry.written.types) if (!input.lookup.has(classified)) unregistered(contributedBy, classified, `The classifier of authoring entry \"${key}\"`);\n\t\t}\n\t}\n\tconst writable = new Set(input.authoringEntries.flatMap(({ key, entry }) => [key, ...entry.written.kind === \"plain\" && entry.written.syntax === \"number\" ? entry.written.types : []]));\n\tfor (const { type, contributedBy } of input.declaredTypes) {\n\t\tconst sources = [...Object.keys(type.casts), ...type.listCast?.of ?? []];\n\t\tfor (const source of sources) {\n\t\t\tif (!input.lookup.has(source)) unregistered(contributedBy, source, `The casts of data type \"${type.id}\"`);\n\t\t\tif (!writable.has(source)) throw runtimeError(\"CONTRACT.DATA_TYPE_NOT_WRITABLE\", `Data type \"${type.id}\" casts from \"${source}\", which no contract source can write, so the cast is never exercised. Contributed by \"${contributedBy}\".`, {\n\t\t\t\tdataType: type.id,\n\t\t\t\tsource,\n\t\t\t\tcontributedBy\n\t\t\t});\n\t\t}\n\t}\n\tconst claimants = /* @__PURE__ */ new Map();\n\tfor (const { key, entry, contributedBy } of input.authoringEntries) {\n\t\tconst written = entry.written;\n\t\tconst claim = written.kind === \"tag\" ? `tag \"${written.tag}\"` : `plain ${written.syntax}`;\n\t\tconst existing = claimants.get(claim);\n\t\tif (existing !== void 0) throw runtimeError(\"CONTRACT.DATA_TYPE_WRITTEN_FORM_DUPLICATE\", `Two authoring entries claim the ${claim}: \"${key}\" from \"${contributedBy}\" conflicts with \"${existing.key}\" from \"${existing.contributedBy}\".`, {\n\t\t\tclaim,\n\t\t\tkey,\n\t\t\tcontributedBy,\n\t\t\towner: existing.key,\n\t\t\townerContributedBy: existing.contributedBy\n\t\t});\n\t\tclaimants.set(claim, {\n\t\t\tkey,\n\t\t\tcontributedBy\n\t\t});\n\t}\n}\nfunction assembleControlMutationDefaults(descriptors) {\n\tconst defaultFunctionRegistry = /* @__PURE__ */ new Map();\n\tconst functionOwners = /* @__PURE__ */ new Map();\n\tconst generatorMap = /* @__PURE__ */ new Map();\n\tconst generatorOwners = /* @__PURE__ */ new Map();\n\tfor (const descriptor of descriptors) {\n\t\tconst contributions = descriptor.controlMutationDefaults;\n\t\tif (!contributions) continue;\n\t\tconst descriptorId = descriptor.id ?? \"<unknown>\";\n\t\tfor (const generatorDescriptor of contributions.generatorDescriptors) {\n\t\t\tconst existingOwner = generatorOwners.get(generatorDescriptor.id);\n\t\t\tif (existingOwner !== void 0) throw new InternalError(`Duplicate mutation default generator id \"${generatorDescriptor.id}\". Descriptor \"${descriptorId}\" conflicts with \"${existingOwner}\".`);\n\t\t\tgeneratorMap.set(generatorDescriptor.id, generatorDescriptor);\n\t\t\tgeneratorOwners.set(generatorDescriptor.id, descriptorId);\n\t\t}\n\t\tfor (const [functionName, handler] of contributions.defaultFunctionRegistry) {\n\t\t\tconst existingOwner = functionOwners.get(functionName);\n\t\t\tif (existingOwner !== void 0) throw new InternalError(`Duplicate mutation default function \"${functionName}\". Descriptor \"${descriptorId}\" conflicts with \"${existingOwner}\".`);\n\t\t\tdefaultFunctionRegistry.set(functionName, handler);\n\t\t\tfunctionOwners.set(functionName, descriptorId);\n\t\t}\n\t}\n\treturn {\n\t\tdefaultFunctionRegistry,\n\t\tgeneratorDescriptors: Array.from(generatorMap.values())\n\t};\n}\n/**\n* Collect every contributed {@link AggregateDescriptor} across the composed components, rejecting malformed shapes and second claims on one `(operation, input)` overload.\n*\n* Both planes read the same contribution slot: emission derives result types from these descriptors, and family runtimes build their resolution registry from them. Rejections are user-facing — an extension author's bad contribution surfaces here first, during `contract emit` — so a malformed shape raises `CONTRACT.AGGREGATE_DESCRIPTOR_INVALID` and a second claim raises `CONTRACT.AGGREGATE_DESCRIPTOR_DUPLICATE`, each naming the contributing component.\n*/\nfunction collectAggregateDescriptors(descriptors) {\n\tconst collected = [];\n\tconst owners = /* @__PURE__ */ new Map();\n\tfor (const descriptor of descriptors) {\n\t\tconst descriptorId = descriptor.id ?? \"<unknown>\";\n\t\tfor (const contributed of descriptor.types?.aggregateDescriptors ?? []) {\n\t\t\tif (!isAggregateDescriptor(contributed)) throw runtimeError(\"CONTRACT.AGGREGATE_DESCRIPTOR_INVALID\", `Malformed aggregate descriptor contributed by \"${descriptorId}\". A descriptor declares a non-empty \\`operation\\`, an \\`input\\` match of kind \\`none\\`/\\`any\\`/\\`codec\\`/\\`trait\\`, an \\`output\\` of kind \\`self\\`/\\`codec\\`, and a boolean \\`nullable\\` — plus \\`emptyResultJson\\`, in the result codec's canonical JSON, where \\`nullable\\` is false; a \\`self\\` output needs an input to reuse.`, {\n\t\t\t\tcontributedBy: descriptorId,\n\t\t\t\tdescriptor: contributed\n\t\t\t});\n\t\t\tconst key = aggregateDescriptorKey(contributed);\n\t\t\tconst existingOwner = owners.get(key);\n\t\t\tif (existingOwner !== void 0) throw runtimeError(\"CONTRACT.AGGREGATE_DESCRIPTOR_DUPLICATE\", `Duplicate aggregate descriptor for \"${key}\". Descriptor \"${descriptorId}\" conflicts with \"${existingOwner}\". Each operation/input pair can only have one provider.`, {\n\t\t\t\tkey,\n\t\t\t\tcontributedBy: descriptorId,\n\t\t\t\towner: existingOwner\n\t\t\t});\n\t\t\towners.set(key, descriptorId);\n\t\t\tcollected.push(contributed);\n\t\t}\n\t}\n\treturn collected;\n}\n/**\n* Flatten the codec descriptors the composed components contribute.\n*\n* A component may know a codec and still withhold it — an adapter that cannot name a codec's emitted type contributes the rest without it — so the contributed set is not always the set some component's own registry holds. Consumers whose output must agree with what the runtime resolves read this list rather than any one component's registry.\n*/\nfunction collectCodecDescriptors(descriptors) {\n\treturn descriptors.flatMap((descriptor) => descriptor.types?.codecTypes?.codecDescriptors ?? []);\n}\nfunction extractCodecLookup(descriptors) {\n\tconst byId = /* @__PURE__ */ new Map();\n\tconst descriptorsById = /* @__PURE__ */ new Map();\n\tconst targetTypesById = /* @__PURE__ */ new Map();\n\tconst renderersById = /* @__PURE__ */ new Map();\n\tconst inputRenderersById = /* @__PURE__ */ new Map();\n\tconst valueLiteralRenderersById = /* @__PURE__ */ new Map();\n\tconst owners = /* @__PURE__ */ new Map();\n\tfor (const descriptor of descriptors) {\n\t\tconst codecTypes = descriptor.types?.codecTypes;\n\t\tconst descriptorId = descriptor.id;\n\t\tfor (const codecDescriptor of codecTypes?.codecDescriptors ?? []) {\n\t\t\tassertUniqueCodecOwner({\n\t\t\t\tcodecId: codecDescriptor.codecId,\n\t\t\t\towners,\n\t\t\t\tdescriptorId,\n\t\t\t\tentityLabel: \"codec descriptor\",\n\t\t\t\tentityOwnershipLabel: \"codec descriptor provider\"\n\t\t\t});\n\t\t\towners.set(codecDescriptor.codecId, descriptorId);\n\t\t\tdescriptorsById.set(codecDescriptor.codecId, codecDescriptor);\n\t\t\tif (Array.isArray(codecDescriptor.targetTypes)) targetTypesById.set(codecDescriptor.codecId, codecDescriptor.targetTypes);\n\t\t\tif (typeof codecDescriptor.renderOutputType === \"function\") renderersById.set(codecDescriptor.codecId, codecDescriptor.renderOutputType);\n\t\t\tif (typeof codecDescriptor.renderInputType === \"function\") inputRenderersById.set(codecDescriptor.codecId, codecDescriptor.renderInputType);\n\t\t\tif (typeof codecDescriptor.renderValueLiteral === \"function\") valueLiteralRenderersById.set(codecDescriptor.codecId, codecDescriptor.renderValueLiteral);\n\t\t\tif (!byId.has(codecDescriptor.codecId)) if (codecDescriptor.isParameterized) try {\n\t\t\t\tconst representative = codecDescriptor.factory({})({ name: `<lookup:${codecDescriptor.codecId}>` });\n\t\t\t\tbyId.set(codecDescriptor.codecId, representative);\n\t\t\t} catch (error) {\n\t\t\t\tif (isInternalError(error)) throw error;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconst representative = codecDescriptor.factory(void 0)({ name: `<lookup:${codecDescriptor.codecId}>` });\n\t\t\t\tbyId.set(codecDescriptor.codecId, representative);\n\t\t\t}\n\t\t}\n\t}\n\tconst registry = {\n\t\tget: (id) => byId.get(id),\n\t\tforCodecRef(ref) {\n\t\t\treturn codecForRef(registry, ref) ?? codecDescriptorMissing(ref, \"CONTRACT.CODEC_DESCRIPTOR_MISSING\");\n\t\t},\n\t\tforColumn: () => void 0,\n\t\ttargetTypesFor: (id) => targetTypesById.get(id),\n\t\trenderOutputTypeFor: (id, params) => renderersById.get(id)?.(params),\n\t\trenderInputTypeFor: (id, params) => inputRenderersById.get(id)?.(params),\n\t\trenderValueLiteralFor: (id, value, side) => valueLiteralRenderersById.get(id)?.(value, side),\n\t\tdescriptorFor: (id) => descriptorsById.get(id)\n\t};\n\treturn registry;\n}\nfunction assembleExtensionContracts(extensions) {\n\tconst result = /* @__PURE__ */ new Map();\n\tfor (const ext of extensions) {\n\t\tif (ext.contractSpace === void 0) continue;\n\t\tresult.set(ext.id, ext.contractSpace.contractJson);\n\t}\n\treturn result;\n}\nfunction readDeclaredDependencyIds(descriptor) {\n\tconst packs = descriptor.contractSpace?.contractJson?.extensions;\n\tif (packs === null || typeof packs !== \"object\") return [];\n\treturn Object.keys(packs);\n}\n/**\n* Builds a dependency-respecting load order for the given extension descriptors\n* using Kahn's topological sort algorithm. Dependencies (packs declared in\n* `contractSpace.contractJson.extensions`) are placed before the extensions\n* that depend on them.\n*\n* Throws if the dependency graph contains a cycle, with an error message that\n* names every extension involved in the cycle.\n*\n* Throws if any extension declares a dependency on a pack ID that is not present\n* in the provided list — add the missing pack to the `extensions` list to\n* resolve the error.\n*/\nfunction buildExtensionLoadOrder(extensions) {\n\tif (extensions.length === 0) return [];\n\tconst idSet = new Set(extensions.map((e) => e.id));\n\tconst inDegree = /* @__PURE__ */ new Map();\n\tconst dependents = /* @__PURE__ */ new Map();\n\tfor (const ext of extensions) {\n\t\tif (!inDegree.has(ext.id)) inDegree.set(ext.id, 0);\n\t\tif (!dependents.has(ext.id)) dependents.set(ext.id, []);\n\t}\n\tfor (const ext of extensions) for (const depId of readDeclaredDependencyIds(ext)) {\n\t\tif (!idSet.has(depId)) throw new InternalError(`Extension \"${ext.id}\" declares a dependency on \"${depId}\", but \"${depId}\" is not in the provided extension set. Add the missing space to extensions.`);\n\t\tinDegree.set(ext.id, (inDegree.get(ext.id) ?? 0) + 1);\n\t\tconst list = dependents.get(depId);\n\t\tif (list !== void 0) list.push(ext.id);\n\t}\n\tconst queue = [];\n\tfor (const [id, deg] of inDegree) if (deg === 0) queue.push(id);\n\tqueue.sort();\n\tconst result = [];\n\twhile (queue.length > 0) {\n\t\tconst id = queue.shift();\n\t\tif (id === void 0) break;\n\t\tresult.push(id);\n\t\tconst children = dependents.get(id) ?? [];\n\t\tchildren.sort();\n\t\tfor (const childId of children) {\n\t\t\tconst newDeg = (inDegree.get(childId) ?? 1) - 1;\n\t\t\tinDegree.set(childId, newDeg);\n\t\t\tif (newDeg === 0) queue.push(childId);\n\t\t}\n\t}\n\tif (result.length < extensions.length) throw new InternalError(`Extension dependency cycle detected. Cycle members: ${extensions.map((e) => e.id).filter((id) => !result.includes(id)).sort().map((id) => `\"${id}\"`).join(\", \")}.`);\n\treturn result;\n}\nfunction createControlStack(input) {\n\tconst { family, target, adapter, driver, extensions = [] } = input;\n\tconst orderedIds = buildExtensionLoadOrder(extensions);\n\tconst extensionById = new Map(extensions.map((ext) => [ext.id, ext]));\n\tconst orderedExtensions = orderedIds.map((id) => extensionById.get(id)).filter((ext) => ext !== void 0);\n\tconst allDescriptors = [\n\t\tfamily,\n\t\ttarget,\n\t\t...adapter ? [adapter] : [],\n\t\t...orderedExtensions\n\t];\n\tconst codecLookup = extractCodecLookup(allDescriptors);\n\tconst authoringContributions = assembleAuthoringContributions(allDescriptors);\n\tconst codecDescriptors = collectCodecDescriptors(allDescriptors);\n\tconst dataTypes = assembleDataTypes(allDescriptors);\n\tenforceDataTypeInvariants({\n\t\tlookup: dataTypes.lookup,\n\t\tdeclaredTypes: dataTypes.declared,\n\t\tcodecs: allDescriptors.flatMap((descriptor) => (descriptor.types?.codecTypes?.codecDescriptors ?? []).map((codecDescriptor) => ({\n\t\t\tcodecId: codecDescriptor.codecId,\n\t\t\tdataType: codecDescriptor.dataType,\n\t\t\tcontributedBy: descriptor.id\n\t\t}))),\n\t\tauthoringEntries: allDescriptors.flatMap((descriptor) => Object.entries(descriptor.authoring?.dataTypes ?? {}).map(([key, entry]) => ({\n\t\t\tkey,\n\t\t\tentry,\n\t\t\tcontributedBy: descriptor.id\n\t\t})))\n\t});\n\treturn {\n\t\tfamily,\n\t\ttarget,\n\t\tadapter,\n\t\tdriver,\n\t\textensions: orderedExtensions,\n\t\textensionContracts: assembleExtensionContracts(orderedExtensions),\n\t\tcodecTypeImports: extractCodecTypeImports(allDescriptors),\n\t\tqueryOperationTypeImports: extractQueryOperationTypeImports(allDescriptors),\n\t\textensionIds: extractComponentIds(family, target, adapter, orderedExtensions),\n\t\tcodecLookup,\n\t\tcodecDescriptors,\n\t\tdataTypeLookup: dataTypes.lookup,\n\t\tdeclaredDataTypes: dataTypes.declared,\n\t\taggregateDescriptors: collectAggregateDescriptors(allDescriptors),\n\t\tauthoringContributions,\n\t\tscalarTypes: [...collectScalarTypeConstructors(authoringContributions.type).keys()],\n\t\tcontrolMutationDefaults: assembleControlMutationDefaults(allDescriptors),\n\t\tcapabilities: mergeCapabilityMatrices({}, [\n\t\t\ttarget,\n\t\t\t...adapter ? [adapter] : [],\n\t\t\t...orderedExtensions\n\t\t])\n\t};\n}\n//#endregion\n//#region src/control/order-issues-by-dependencies.ts\nconst PATH_DELIMITER = \" \";\nfunction pathKey(path) {\n\treturn path.join(PATH_DELIMITER);\n}\n/**\n* Whether an issue's op builds its subject up (create or alter) rather than\n* only tearing it down. The differ sets `expected` on every create (`not-found`)\n* and alter (`not-equal`) issue and leaves it absent on a pure drop\n* (`not-expected`). This is the single signal the ordering law reads for edge\n* direction — never `reason`.\n*/\nfunction buildsUp(issue) {\n\treturn issue.expected !== void 0;\n}\n/**\n* The nearest strict-ancestor bucket of `path` — the surviving parent entity a\n* child is contained by. Walks the path's proper prefixes from longest to\n* shortest and returns the first prefix that maps to a bucket; a gap (a prefix\n* with no bucket) is skipped so containment always attaches to the closest real\n* parent.\n*\n* Returns a list because a path prefix can be shared by two siblings of\n* different `nodeKind` (a role and a namespace named alike); linking the child\n* to every candidate over-constrains safely (the extra edge points at a same-\n* direction op and never forms a cycle, since a parent never depends on its\n* child) rather than risk picking the wrong one.\n*/\nfunction nearestAncestors(path, byPath) {\n\tfor (let end = path.length - 1; end >= 1; end -= 1) {\n\t\tconst bucket = byPath.get(pathKey(path.slice(0, end)));\n\t\tif (bucket !== void 0) return bucket;\n\t}\n\treturn [];\n}\n/**\n* Orders schema-diff issues so that every dependency's op precedes its\n* dependent on the way up and follows it on the way down, breaking ties\n* deterministically by path.\n*\n* Edges come from two sources:\n* - **`dependsOn` cross-links** — the resolved issue-to-issue paths the differ\n* mirrors onto each issue (a node's declared structural prerequisites). A\n* path that resolves to no issue in this list is skipped (the dependency is\n* satisfied by reality); a path shared by two same-id/different-kind siblings\n* links to every match, over-constraining safely.\n* - **containment** — every issue depends on its nearest strict-ancestor issue\n* (a child entity on the parent entity that owns it). Subtree coalescing has\n* already removed the descendants of a whole create/drop, so this only links\n* the parent/child pairs that legitimately survive together.\n*\n* The ordering law reads each dependent's presence for direction: an issue that\n* builds up (`expected` present — a create or alter) needs its dependency\n* first; a pure drop needs its dependent removed first, so the edge reverses.\n* The graph is a DAG by construction (dependencies point from dependents to\n* their prerequisites, and prerequisites never point back), so a cycle is a\n* derivation or authoring bug: the topological sort asserts acyclicity and\n* throws, naming the issues it could not place.\n*/\nfunction orderIssuesByDependencies(issues) {\n\tif (issues.length <= 1) return issues;\n\tconst nodes = issues.map((issue) => ({\n\t\tissue,\n\t\tkey: pathKey(issue.path),\n\t\tbuildsUp: buildsUp(issue),\n\t\toutgoing: /* @__PURE__ */ new Set(),\n\t\tinDegree: 0\n\t}));\n\tconst nodesByPath = /* @__PURE__ */ new Map();\n\tfor (const node of nodes) {\n\t\tconst bucket = nodesByPath.get(node.key);\n\t\tif (bucket === void 0) nodesByPath.set(node.key, [node]);\n\t\telse bucket.push(node);\n\t}\n\tconst addEdge = (before, after) => {\n\t\tif (before.outgoing.has(after)) return;\n\t\tbefore.outgoing.add(after);\n\t\tafter.inDegree += 1;\n\t};\n\tconst addDependency = (dependent, dependency) => {\n\t\tif (dependent === dependency) return;\n\t\tif (dependent.buildsUp) addEdge(dependency, dependent);\n\t\telse addEdge(dependent, dependency);\n\t};\n\tfor (const node of nodes) {\n\t\tfor (const targetPath of node.issue.dependsOn ?? []) for (const target of nodesByPath.get(pathKey(targetPath)) ?? []) addDependency(node, target);\n\t\tfor (const ancestor of nearestAncestors(node.issue.path, nodesByPath)) addDependency(node, ancestor);\n\t}\n\tconst ready = nodes.filter((node) => node.inDegree === 0);\n\tconst order = [];\n\twhile (ready.length > 0) {\n\t\tlet best;\n\t\tfor (const candidate of ready) if (best === void 0 || candidate.key < best.key) best = candidate;\n\t\tif (best === void 0) break;\n\t\tready.splice(ready.indexOf(best), 1);\n\t\torder.push(best);\n\t\tfor (const next of best.outgoing) {\n\t\t\tnext.inDegree -= 1;\n\t\t\tif (next.inDegree === 0) ready.push(next);\n\t\t}\n\t}\n\tif (order.length !== nodes.length) {\n\t\tconst placed = new Set(order);\n\t\tthrow new InternalError(`orderIssuesByDependencies: dependency cycle among schema-diff issues (unresolved: ${nodes.filter((node) => !placed.has(node)).map((node) => node.issue.path.join(\"/\")).join(\", \")})`);\n\t}\n\treturn order.map((node) => node.issue);\n}\n//#endregion\n//#region src/control/schema-diff.ts\n/**\n* The outcome an issue represents, discriminated by presence rather than any\n* stored field — the single source of truth every consumer reads. An issue\n* always carries at least one side by construction; neither is a malformed\n* issue and throws.\n*/\nfunction issueOutcome(issue) {\n\tconst hasExpected = issue.expected !== void 0;\n\tconst hasActual = issue.actual !== void 0;\n\tif (hasExpected && hasActual) return \"not-equal\";\n\tif (hasExpected) return \"not-found\";\n\tif (hasActual) return \"not-expected\";\n\tthrow new InternalError(`issueOutcome: issue at \"${issue.path.join(\"/\")}\" carries neither an expected nor an actual node`);\n}\nfunction siblingKey(node) {\n\treturn JSON.stringify([node.nodeKind, node.id]);\n}\nfunction insertNode(map, node) {\n\tconst key = siblingKey(node);\n\tif (map.has(key)) throw new InternalError(`diffSchemas: duplicate id among siblings: ${node.nodeKind}/${node.id}`);\n\tmap.set(key, node);\n}\nfunction emitMissingSubtree(node, parentPath) {\n\tconst path = [...parentPath, node.id];\n\treturn [{\n\t\tpath,\n\t\texpected: node,\n\t\t...ifDefined(\"explanation\", node.explainMismatch?.(void 0))\n\t}, ...node.children().flatMap((c) => emitMissingSubtree(c, path))];\n}\nfunction emitExtraSubtree(node, parentPath) {\n\tconst path = [...parentPath, node.id];\n\treturn [{\n\t\tpath,\n\t\tactual: node\n\t}, ...node.children().flatMap((c) => emitExtraSubtree(c, path))];\n}\n/**\n* Diff two schema trees starting from their roots.\n*\n* The differ is **total**: every node-level difference is reported. An unmatched\n* non-leaf node emits its own issue and descends, emitting an issue for every\n* node in the missing/extra subtree. Coalescing a parent change over its\n* children is the planner's responsibility. Ownership filtering (dropping `extra`\n* issues in namespaces a contract doesn't own) is the caller's responsibility.\n*/\nfunction diffSchemas(expected, actual) {\n\treturn mirrorDependsOnOntoIssues(diffPair(expected, actual, []));\n}\nfunction schemaNodeRefKey(ref) {\n\treturn JSON.stringify(ref.map((step) => step.id));\n}\nfunction issuePathKey(path) {\n\treturn JSON.stringify(path);\n}\nfunction terminalNodeKind(issue) {\n\treturn (issue.expected ?? issue.actual)?.nodeKind;\n}\n/**\n* Copies each issue's node's `dependsOn` refs onto the issue itself, as\n* issue-to-issue path references. A ref is kept only when some emitted issue\n* sits at that exact path AND that issue's node `nodeKind` matches the ref's\n* last step — otherwise the ref is dropped (its target either didn't\n* change, or was never part of either tree; either way the dependency is\n* satisfied by reality, not by an operation this diff will produce).\n*\n* The path index is a multimap: two siblings may share an `id` under\n* different `nodeKind`s (a role and a namespace named alike), so an id-path\n* alone is ambiguous. The ref's terminal `nodeKind` disambiguates — the ref\n* resolves only against a same-path issue whose own node carries that kind.\n*/\nfunction mirrorDependsOnOntoIssues(issues) {\n\tconst issuesByPath = /* @__PURE__ */ new Map();\n\tfor (const issue of issues) {\n\t\tconst key = issuePathKey(issue.path);\n\t\tconst bucket = issuesByPath.get(key);\n\t\tif (bucket === void 0) issuesByPath.set(key, [issue]);\n\t\telse bucket.push(issue);\n\t}\n\treturn issues.map((issue) => {\n\t\tconst refs = (issue.expected ?? issue.actual)?.dependsOn;\n\t\tif (refs === void 0 || refs.length === 0) return issue;\n\t\tconst dependsOn = refs.flatMap((ref) => {\n\t\t\tconst lastStep = ref[ref.length - 1];\n\t\t\tif (lastStep === void 0) return [];\n\t\t\tif (!(issuesByPath.get(schemaNodeRefKey(ref)) ?? []).some((c) => terminalNodeKind(c) === lastStep.nodeKind)) return [];\n\t\t\treturn [ref.map((step) => step.id)];\n\t\t});\n\t\tif (dependsOn.length === 0) return issue;\n\t\treturn {\n\t\t\t...issue,\n\t\t\tdependsOn\n\t\t};\n\t});\n}\nfunction diffPair(expected, actual, parentPath) {\n\tconst path = [...parentPath, expected.id];\n\tconst issues = [];\n\tif (!expected.isEqualTo(actual)) issues.push({\n\t\tpath,\n\t\texpected,\n\t\tactual,\n\t\t...ifDefined(\"explanation\", expected.explainMismatch?.(actual))\n\t});\n\tissues.push(...diffChildren(expected.children(), actual.children(), path));\n\treturn issues;\n}\n/**\n* Align one level of nodes by `(nodeKind, id)`; emit issues in input order\n* and recurse.\n*\n* A missing node emits one issue for itself and one for every node in its\n* subtree (total descent). Same for extra nodes. A matched pair recurses via\n* `diffPair`.\n*/\nfunction diffChildren(expected, actual, parentPath) {\n\tconst expectedMap = /* @__PURE__ */ new Map();\n\tfor (const node of expected) insertNode(expectedMap, node);\n\tconst actualMap = /* @__PURE__ */ new Map();\n\tfor (const node of actual) insertNode(actualMap, node);\n\tconst issues = [];\n\tfor (const [key, expectedNode] of expectedMap) {\n\t\tconst actualNode = actualMap.get(key);\n\t\tif (actualNode === void 0) issues.push(...emitMissingSubtree(expectedNode, parentPath));\n\t\telse issues.push(...diffPair(expectedNode, actualNode, parentPath));\n\t}\n\tfor (const [key, actualNode] of actualMap) if (!expectedMap.has(key)) issues.push(...emitExtraSubtree(actualNode, parentPath));\n\treturn issues;\n}\n/**\n* The result of diffing a contract's expected schema against the introspected\n* actual schema: one node-typed issue list. Carries no verdict, verification\n* tree, or counts — those are the verifier's own presentation, built from the\n* same underlying comparison.\n*\n* `TNode` is the concrete schema-IR node the issues carry; it defaults to\n* `DiffableNode`, so this is purely additive — a caller that wants the\n* concrete node opts in (the Postgres planner uses the concrete node type),\n* everyone else keeps the default unchanged.\n*/\nvar SchemaDiff = class SchemaDiff {\n\tissues;\n\tconstructor(issues) {\n\t\tthis.issues = issues;\n\t}\n\t/** Returns a new `SchemaDiff` narrowed to the issues `keep` returns true for. */\n\tfilter(keep) {\n\t\treturn new SchemaDiff(this.issues.filter(keep));\n\t}\n};\n//#endregion\n//#region src/control/verifier-disposition.ts\n/**\n* Grades a target-neutral issue category against a control policy.\n*\n* - `observed` warns on everything.\n* - `tolerated` suppresses only an extra nested element (everything else fails).\n* - `external` suppresses every extra category and value drift (existence and\n* declared-shape divergences still fail).\n* - `managed` (and any other) fails.\n*/\nfunction dispositionForCategory(controlPolicy, category) {\n\tif (controlPolicy === \"observed\") return \"warn\";\n\tif (controlPolicy === \"tolerated\" && category === \"extraNestedElement\") return \"suppress\";\n\tif (controlPolicy === \"external\") {\n\t\tif (category === \"extraNestedElement\" || category === \"extraAuxiliary\" || category === \"extraTopLevelObject\" || category === \"valueDrift\") return \"suppress\";\n\t}\n\treturn \"fail\";\n}\n//#endregion\nexport { APP_SPACE_ID, CONTRACT_SNAPSHOTS_DIRNAME, SchemaDiff, SchemaTreeNode, TAGGED_LITERAL_MAX_BYTES, VERIFY_CODE_HASH_MISMATCH, VERIFY_CODE_MARKER_MISSING, VERIFY_CODE_SCHEMA_FAILURE, VERIFY_CODE_TARGET_MISMATCH, assembleAuthoringContributions, assembleAuthoringDataTypes, assembleControlMutationDefaults, assembleDataTypes, assertUniqueCodecOwner, buildExtensionLoadOrder, canonicalizeTaggedLiteralBody, contractSnapshotJsonSpecifier, contractSnapshotTypesSpecifier, createControlStack, describeTaggedLiteralFailure, diffSchemas, dispositionForCategory, enforceDataTypeInvariants, extractCodecLookup, extractCodecTypeImports, extractComponentIds, extractQueryOperationTypeImports, hasMigrations, hasOperationPreview, hasPslContractBuild, hasPslContractInfer, hasSchemaSubjectClassifier, hasSchemaView, issueOutcome, orderIssuesByDependencies, resolvePslBacktickE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;CAC/C;AACD;;;;;;;;;;AAYA,SAAS,uBAAuB,eAAe,UAAU;CACxD,IAAI,kBAAkB,YAAY,OAAO;CACzC,IAAI,kBAAkB,eAAe,aAAa,sBAAsB,OAAO;CAC/E,IAAI,kBAAkB,YACjB;MAAA,aAAa,wBAAwB,aAAa,oBAAoB,aAAa,yBAAyB,aAAa,cAAc,OAAO;CAAA;CAEnJ,OAAO;AACR"}
@@ -1,2 +0,0 @@
1
- import "./types-import-spec-D-EPunhV-B3y6hGP5.mjs";
2
- import "./emission-types-CND9Xi8O-DKnaAGFS.mjs";
@@ -1 +0,0 @@
1
- {"version":3,"file":"framework-authoring-BLXTNi9g-CcRc8u9I.d.mts","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/framework-authoring-BLXTNi9g.d.mts"],"mappings":";;;;;UAIU;WACC;WACA;;;;UAID;WACC;WACA;WACA;;UAED;WACC,OAAO;WACP,KAAK;;KAEX;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAuFA;UACK;WACC;WACA,MAAM;;;;;;UAMP;WACC;WACA;WACA,MAAM;;;;;;;;UAQP;WACC;WACA,eAAe;WACf,MAAM;;UAEP;WACC,MAAM,SAAS;WACf,WAAW,SAAS,eAAe;WACnC,MAAM;;UAEP;WACC;;;;;;;WAOA;WACA;WACA,YAAY,eAAe;WAC3B,0BAA0B;WAC1B,MAAM;;UAEP,wBAAwB,SAAS,SAAS;WACzC;WACA;WACA;WACA,QAAQ;WACR,gBAAgB,SAAS,eAAe;WACxC,YAAY,SAAS,eAAe;WACpC,MAAM;;;;KAIZ;WACM;WACA;WACA;WACA,UAAU;;;;;;;;;;;;;;;;UAgBX;WACC;WACA;WACA;WACA,OAAO,SAAS,eAAe;;KAErC,4DAA4D,kBAAkB,8BAA8B;YACrG,cAAc;;UAEhB;WACC;WACA;;KAEN,8BAA8B;WACxB;;WAEA;;WAEA;W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;iBACxP,8BAA8B,UAAU,oCAAoC;iBAC5E,iCAAiC,oBAAoB,sBAAsB,2CAA2C;iBACtH,oCAAoC,YAAY,oCAAoC;WAC1F;WACA;WACA,aAAa;;iBAEP,+BAA+B,mBAAmB,oBAAoB,YAAY,+BAA+B,0BAA0B,KAAK,yBAAyB;iBACzK,gCAAgC,YAAY,gCAAgC;WAClF;aACE;aACA;aACA,aAAa;;WAEf;WACA,UAAU;WACV,oBAAoB;WACpB;WACA"}
@@ -1,2 +0,0 @@
1
- import "./framework-authoring-BLXTNi9g-CcRc8u9I.mjs";
2
- import "./psl-ast-CPxYIxM1-XHoHPgRO.mjs";
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolve-codec-CxRICgbr-BLdoRYJc.mjs","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/resolve-codec-CxRICgbr.mjs"],"sourcesContent":["import { n as runtimeError } from \"./runtime-error-BA9d7XjZ.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\n//#region src/shared/data-type.ts\nconst DATA_TYPE_ID = /^[a-z0-9]+(?:-[a-z0-9]+)*\\/[a-z0-9]+(?:-[a-z0-9]+)*$/;\n/** Read `id` as a data type id, refusing anything that is not `owner/name` in lower case. */\nfunction dataTypeId(id) {\n\tif (!DATA_TYPE_ID.test(id)) throw runtimeError(\"CONTRACT.DATA_TYPE_ID_INVALID\", `\"${id}\" is not a data type id. A data type id is \"owner/name\" in lower case and carries no version, as in \"owner/name\"; a versioned id names a codec.`, { id });\n\treturn blindCast(id);\n}\n/** Declare a data type. Every id it names, its own and each cast's source, is validated here. */\nfunction dataType(id, spec) {\n\tconst casts = {};\n\tfor (const [source, cast] of Object.entries(spec.casts ?? {})) casts[dataTypeId(source)] = cast;\n\tconst listCast = spec.listCast;\n\treturn {\n\t\tid: dataTypeId(id),\n\t\tcasts,\n\t\t...listCast === void 0 ? {} : { listCast: {\n\t\t\tof: listCast.of.map(dataTypeId),\n\t\t\tcast: listCast.cast\n\t\t} },\n\t\t...spec.toCanonicalForm === void 0 ? {} : { toCanonicalForm: spec.toCanonicalForm }\n\t};\n}\nfunction createDataTypeLookup(types) {\n\tconst byId = new Map(types.map((type) => [type.id, type]));\n\treturn {\n\t\tget: (id) => byId.get(id),\n\t\thas: (id) => byId.has(id)\n\t};\n}\n//#endregion\n//#region src/shared/resolve-codec.ts\nconst CONTRACT_CODEC_DESCRIPTOR_MISSING = \"CONTRACT.CODEC_DESCRIPTOR_MISSING\";\n/**\n* Look up a descriptor for `ref.codecId` using `descriptorFor`; throw\n* `code` if none is found. Each plane names its own error path: the control\n* plane resolves contract-stack descriptors (`CONTRACT.*`), the execution\n* plane resolves at query time (`RUNTIME.*`).\n*/\nfunction resolveCodecDescriptorOrThrow(descriptorFor, ref, code) {\n\treturn descriptorFor(ref.codecId) ?? codecDescriptorMissing(ref, code);\n}\n/** Throws the error for a codec reference no descriptor has, under the plane's `code`. */\nfunction codecDescriptorMissing(ref, code) {\n\tthrow runtimeError(code, `No codec descriptor registered for codecId '${ref.codecId}'.`, { codecId: ref.codecId });\n}\nfunction isAbsentOrEmpty(typeParams) {\n\treturn typeParams === void 0 || typeof typeParams === \"object\" && typeParams !== null && !Array.isArray(typeParams) && Object.keys(typeParams).length === 0;\n}\n/**\n* Validates `ref.typeParams` against `descriptor.paramsSchema`.\n*\n* A codec without a `paramsSchema` takes no params: it accepts absent or empty\n* `typeParams` (a bare native-type alias carries `{}`) and rejects anything else.\n* A parameterized codec whose ref omits `typeParams` validates `{}` (mirrors\n* `ast-codec-resolver.ts` semantics). Throws `RUNTIME.TYPE_PARAMS_INVALID` when\n* params are given to a codec without params, or when the validator returns a\n* `Promise` or reports issues.\n*/\nfunction validateCodecTypeParams(descriptor, ref) {\n\tconst schema = descriptor.paramsSchema;\n\tif (schema === void 0) {\n\t\tif (!isAbsentOrEmpty(ref.typeParams)) throw runtimeError(\"RUNTIME.TYPE_PARAMS_INVALID\", `Invalid typeParams for codec '${ref.codecId}': unexpected typeParams for non-parameterized codec`, {\n\t\t\tcodecId: ref.codecId,\n\t\t\ttypeParams: ref.typeParams\n\t\t});\n\t\treturn;\n\t}\n\tconst result = blindCast(schema[\"~standard\"].validate(ref.typeParams ?? {}));\n\tif (result instanceof Promise) throw runtimeError(\"RUNTIME.TYPE_PARAMS_INVALID\", `paramsSchema for codec '${ref.codecId}' returned a Promise; runtime validation requires a synchronous Standard Schema validator.`, {\n\t\tcodecId: ref.codecId,\n\t\ttypeParams: ref.typeParams\n\t});\n\tif (\"issues\" in result && result.issues) {\n\t\tconst messages = result.issues.map((issue) => issue.message).join(\"; \");\n\t\tthrow runtimeError(\"RUNTIME.TYPE_PARAMS_INVALID\", `Invalid typeParams for codec '${ref.codecId}': ${messages}`, {\n\t\t\tcodecId: ref.codecId,\n\t\t\ttypeParams: ref.typeParams\n\t\t});\n\t}\n\treturn blindCast(result).value;\n}\n/**\n* Resolves a `Codec` instance: validates `ref.typeParams` via\n* {@link validateCodecTypeParams} then calls `descriptor.factory(validated)(ctx)`\n* as a method on `descriptor`, preserving `this` for factories that build\n* their returned codec from the descriptor instance (e.g. `new XCodec(this)`).\n*/\nfunction materializeCodec(descriptor, ref, ctx) {\n\tconst validated = validateCodecTypeParams(descriptor, ref);\n\treturn descriptor.factory(validated)(ctx);\n}\n/**\n* Builds the codec a codec reference names with the reference's type parameters, so a parameterized codec checks values against them. `undefined` when no descriptor has the id.\n*/\nfunction codecForRef(lookup, ref) {\n\tconst descriptor = lookup.descriptorFor(ref.codecId);\n\treturn descriptor === void 0 ? void 0 : materializeCodec(descriptor, ref, { name: ref.codecId });\n}\n//#endregion\nexport { resolveCodecDescriptorOrThrow as a, dataType as c, materializeCodec as i, dataTypeId as l, codecDescriptorMissing as n, validateCodecTypeParams as o, codecForRef as r, createDataTypeLookup as s, CONTRACT_CODEC_DESCRIPTOR_MISSING as t };\n\n//# sourceMappingURL=resolve-codec-CxRICgbr.mjs.map"],"mappings":";;;AAGA,MAAM,eAAe;;AAErB,SAAS,WAAW,IAAI;C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CACjD,MAAM,SAAS,WAAW;CAC1B,IAAI,WAAW,KAAK,GAAG;EACtB,IAAI,CAAC,gBAAgB,IAAI,UAAU,GAAG,MAAM,aAAa,+BAA+B,iCAAiC,IAAI,QAAQ,uDAAuD;GAC3L,SAAS,IAAI;GACb,YAAY,IAAI;EACjB,CAAC;EACD;CACD;CACA,MAAM,SAAS,UAAU,OAAO,YAAY,CAAC,SAAS,IAAI,cAAc,CAAC,CAAC,CAAC;CAC3E,IAAI,kBAAkB,SAAS,MAAM,aAAa,+BAA+B,2BAA2B,IAAI,QAAQ,6FAA6F;EACpN,SAAS,IAAI;EACb,YAAY,IAAI;CACjB,CAAC;CACD,IAAI,YAAY,UAAU,OAAO,QAAQ;EACxC,MAAM,WAAW,OAAO,OAAO,KAAK,UAAU,MAAM,OAAO,CAAC,CAAC,KAAK,IAAI;EACtE,MAAM,aAAa,+BAA+B,iCAAiC,IAAI,QAAQ,KAAK,YAAY;GAC/G,SAAS,IAAI;GACb,YAAY,IAAI;EACjB,CAAC;CACF;CACA,OAAO,UAAU,MAAM,CAAC,CAAC;AAC1B;;;;;;;AAOA,SAAS,iBAAiB,YAAY,KAAK,KAAK;CAC/C,MAAM,YAAY,wBAAwB,YAAY,GAAG;CACzD,OAAO,WAAW,QAAQ,SAAS,CAAC,CAAC,GAAG;AACzC;;;;AAIA,SAAS,YAAY,QAAQ,KAAK;CACjC,MAAM,aAAa,OAAO,cAAc,IAAI,OAAO;CACnD,OAAO,eAAe,KAAK,IAAI,KAAK,IAAI,iBAAiB,YAAY,KAAK,EAAE,MAAM,IAAI,QAAQ,CAAC;AAChG"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"temporal-presets-DzBBD4St-BaL1QaZ7.mjs","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/temporal-presets-DzBBD4St.mjs"],"sourcesContent":["import { n as runtimeError } from \"./runtime-error-BA9d7XjZ.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { isColumnDefaultLiteralInputValue, isExecutionMutationDefaultValue } from \"@internal/contract/types\";\nimport { invariant } from \"@internal/utils/assertions\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { InternalError } from \"@internal/utils/internal-error\";\n//#region src/shared/framework-authoring.ts\nconst AUTHORING_WARNING_BATCH_THRESHOLD = 5;\n/**\n* Emits collected authoring warnings once per build, grouped by `code`:\n* a group at or below the threshold itemizes every `message`; above it,\n* one summary — `\"<count> <summary>\"` followed by the `item` lines — so\n* a build with many hits of one kind does not wall-of-text, and warnings\n* of different codes never batch into each other's summary.\n*/\nfunction flushAuthoringWarnings(warnings) {\n\tconst groups = /* @__PURE__ */ new Map();\n\tfor (const warning of warnings) {\n\t\tconst key = JSON.stringify([warning.code, warning.summary]);\n\t\tconst group = groups.get(key) ?? [];\n\t\tgroup.push(warning);\n\t\tgroups.set(key, group);\n\t}\n\tfor (const group of groups.values()) {\n\t\tconst first = group[0];\n\t\tif (first === void 0) continue;\n\t\tif (group.length <= AUTHORING_WARNING_BATCH_THRESHOLD) {\n\t\t\tfor (const warning of group) process.emitWarning(warning.message, { code: warning.code });\n\t\t\tcontinue;\n\t\t}\n\t\tprocess.emitWarning(`${group.length} ${first.summary}\\n${group.map((w) => ` - ${w.item}`).join(\"\\n\")}`, { code: first.code });\n\t}\n}\nfunction classifyEnumMemberType(values) {\n\tlet sawText = false;\n\tlet sawInt = false;\n\tfor (const key of Object.keys(values)) {\n\t\tconst value = values[key];\n\t\tif (value === void 0 || typeof value === \"string\") sawText = true;\n\t\telse if (typeof value === \"number\" && Number.isInteger(value)) sawInt = true;\n\t\telse return null;\n\t}\n\tif (sawText && sawInt) return null;\n\tif (sawText) return \"text\";\n\tif (sawInt) return \"int\";\n\treturn null;\n}\n/**\n* Resolves the codec id for an `enum` block. When `@@type` is absent, the codec\n* is inferred from the members via {@link classifyEnumMemberType}; otherwise the\n* explicit `@@type(\"codec\")` argument is parsed. Pushes the appropriate\n* diagnostic and returns `undefined` when neither yields a codec. `codecSpan` is\n* the span downstream codec-validation diagnostics should anchor to. Shared by\n* every family's enum factory so inference and the explicit path stay identical.\n*/\nfunction resolveEnumCodecId(block, ctx) {\n\tconst sourceId = ctx.sourceId ?? \"unknown\";\n\tconst typeAttr = block.attributes[\"type\"];\n\tif (typeAttr === void 0) {\n\t\tconst inferredKind = classifyEnumMemberType(block.values);\n\t\tif (inferredKind === null || ctx.enumInferenceCodecs === void 0) {\n\t\t\tctx.diagnostics?.push({\n\t\t\t\tcode: \"PSL_ENUM_CANNOT_INFER_TYPE\",\n\t\t\t\tmessage: `cannot infer @@type for enum \"${block.name}\"; add an explicit @@type(...)`,\n\t\t\t\tsourceId,\n\t\t\t\tspan: block.span\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\treturn {\n\t\t\tcodecId: ctx.enumInferenceCodecs[inferredKind],\n\t\t\tcodecSpan: block.span\n\t\t};\n\t}\n\tconst codecId = typeAttr.args[\"codecId\"];\n\tinvariant(typeof codecId === \"string\", \"@@type on an enum block parses one string argument\");\n\treturn {\n\t\tcodecId,\n\t\tcodecSpan: typeAttr.argSpans?.[\"codecId\"] ?? typeAttr.span\n\t};\n}\nfunction isAuthoringArgRef(value) {\n\tif (typeof value !== \"object\" || value === null || value.kind !== \"arg\") return false;\n\tconst { index, path } = value;\n\tif (typeof index !== \"number\" || !Number.isInteger(index) || index < 0) return false;\n\tif (path !== void 0 && (!Array.isArray(path) || path.some((s) => typeof s !== \"string\"))) return false;\n\treturn true;\n}\nfunction isAuthoringSelectRef(value) {\n\tif (!isAuthoringTemplateRecord(value) || value[\"kind\"] !== \"select\") return false;\n\tconst index = value[\"index\"];\n\tconst path = value[\"path\"];\n\tconst cases = value[\"cases\"];\n\tif (typeof index !== \"number\" || !Number.isInteger(index) || index < 0) return false;\n\tif (path !== void 0 && (!Array.isArray(path) || path.some((s) => typeof s !== \"string\"))) return false;\n\treturn typeof cases === \"object\" && cases !== null && !Array.isArray(cases);\n}\nfunction isAuthoringTemplateRecord(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction readTemplateArgumentValue(args, index, path) {\n\tlet value = args[index];\n\tfor (const segment of path ?? []) {\n\t\tif (!isAuthoringTemplateRecord(value) || !Object.hasOwn(value, segment)) return;\n\t\tvalue = value[segment];\n\t}\n\treturn value;\n}\nfunction isAuthoringTypeConstructorDescriptor(value) {\n\treturn \"kind\" in value && value.kind === \"typeConstructor\";\n}\n/** The type constructor at `path` in the contributions' type namespace, or `undefined` when none is there. */\nfunction getAuthoringTypeConstructor(contributions, path) {\n\tlet current = contributions?.type;\n\tfor (const segment of path) {\n\t\tif (typeof current !== \"object\" || current === null || \"kind\" in current) return;\n\t\tcurrent = current[segment];\n\t}\n\treturn current !== void 0 && isAuthoringTypeConstructorDescriptor(current) ? current : void 0;\n}\nfunction isAuthoringFieldPresetDescriptor(value) {\n\treturn \"kind\" in value && value.kind === \"fieldPreset\";\n}\nfunction isAuthoringEntityTypeDescriptor(value) {\n\treturn \"kind\" in value && value.kind === \"entity\";\n}\nfunction isAuthoringPslBlockDescriptor(value) {\n\treturn \"kind\" in value && value.kind === \"pslBlock\";\n}\nfunction isAuthoringModelAttributeDescriptor(value) {\n\treturn \"kind\" in value && value.kind === \"modelAttribute\";\n}\nfunction isCopyableNamespaceObject(value) {\n\tif (typeof value !== \"object\" || value === null || Array.isArray(value)) return false;\n\tconst proto = Object.getPrototypeOf(value);\n\treturn proto === Object.prototype || proto === null;\n}\n/**\n* Deep structural check run only at the composition boundary (the merge and\n* collect walkers) to classify a raw namespace-tree node as a leaf descriptor.\n* A node counts as a leaf iff its `kind` matches `descriptorKind` AND it\n* carries that kind's required fields.\n*\n* This is boundary validation over `unknown`, NOT a type-predicate: the four\n* exported `isAuthoring*Descriptor` predicates deliberately narrow on `kind`\n* alone and trust the static types. The walkers, by contrast, also receive\n* type-bypassing packs (`as unknown as never` in tests, untyped JS at runtime)\n* whose descriptor-shaped-but-incomplete nodes must be rejected rather than\n* silently treated as sub-namespaces — so the well-formedness check lives here.\n*/\nfunction isWellFormedDescriptor(value, descriptorKind) {\n\tif (typeof value !== \"object\" || value === null) return false;\n\tif (!(\"kind\" in value) || value.kind !== descriptorKind) return false;\n\tswitch (descriptorKind) {\n\t\tcase \"typeConstructor\":\n\t\tcase \"fieldPreset\": {\n\t\t\tif (!(\"output\" in value)) return false;\n\t\t\tconst output = value.output;\n\t\t\treturn typeof output === \"object\" && output !== null;\n\t\t}\n\t\tcase \"entity\": {\n\t\t\tif (!(\"discriminator\" in value) || typeof value.discriminator !== \"string\") return false;\n\t\t\tif (value.discriminator.length === 0) return false;\n\t\t\tif (!(\"output\" in value)) return false;\n\t\t\tconst output = value.output;\n\t\t\tif (typeof output !== \"object\" || output === null) return false;\n\t\t\tconst factory = \"factory\" in output ? output.factory : void 0;\n\t\t\tconst template = \"template\" in output ? output.template : void 0;\n\t\t\treturn typeof factory === \"function\" || template !== void 0;\n\t\t}\n\t\tcase \"pslBlock\": {\n\t\t\tif (!(\"keyword\" in value) || typeof value.keyword !== \"string\" || value.keyword.length === 0) return false;\n\t\t\tif (!(\"discriminator\" in value) || typeof value.discriminator !== \"string\" || value.discriminator.length === 0) return false;\n\t\t\tif (!(\"name\" in value)) return false;\n\t\t\tconst name = value.name;\n\t\t\tif (typeof name !== \"object\" || name === null) return false;\n\t\t\tif (!(\"required\" in name) || typeof name.required !== \"boolean\") return false;\n\t\t\tif (!(\"spec\" in value) || typeof value.spec !== \"function\") return false;\n\t\t\tif (!(\"attributes\" in value) || value.attributes === void 0) return true;\n\t\t\tconst attributes = value.attributes;\n\t\t\tif (typeof attributes !== \"object\" || attributes === null || Array.isArray(attributes)) return false;\n\t\t\treturn Object.values(attributes).every((factory) => typeof factory === \"function\");\n\t\t}\n\t\tcase \"modelAttribute\":\n\t\t\tif (!(\"attribute\" in value) || typeof value.attribute !== \"string\" || value.attribute.length === 0) return false;\n\t\t\tif (!(\"spec\" in value)) return false;\n\t\t\treturn \"lower\" in value && typeof value.lower === \"function\";\n\t\tdefault: return false;\n\t}\n}\nfunction deepCopyNamespace(source, descriptorKind) {\n\tconst copy = {};\n\tfor (const [key, value] of Object.entries(source)) copy[key] = isCopyableNamespaceObject(value) && !isWellFormedDescriptor(value, descriptorKind) ? deepCopyNamespace(value, descriptorKind) : value;\n\treturn copy;\n}\n/**\n* Merges `source` into `target` recursively at the descriptor-namespace\n* level. `descriptorKind` is the `kind` value ('typeConstructor',\n* 'fieldPreset', 'entity', or 'pslBlock') that identifies a descriptor\n* (terminal merge point; same-path registrations across components are\n* reported as duplicates) as opposed to a sub-namespace (recursion target).\n*\n* Path segments are validated against prototype-pollution names\n* (`__proto__`, `constructor`, `prototype`). A value that is neither a\n* recognized leaf nor a plain object — e.g. a malformed descriptor\n* where the canonical leaf guard rejected it for missing `output` —\n* is reported as an invalid contribution rather than recursed into,\n* which would either silently mangle state or infinite-loop on\n* primitive properties.\n*\n* Within-registry duplicate detection is this walker's job;\n* cross-registry detection runs separately via\n* `assertNoCrossRegistryCollisions` after merging completes.\n*/\nfunction mergeAuthoringNamespaces(target, source, path, descriptorKind, label) {\n\tconst assertSafePath = (currentPath) => {\n\t\tconst blockedSegment = currentPath.find((segment) => segment === \"__proto__\" || segment === \"constructor\" || segment === \"prototype\");\n\t\tif (blockedSegment) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Invalid authoring ${label} helper \"${currentPath.join(\".\")}\". Helper path segments must not use \"${blockedSegment}\".`);\n\t};\n\tfor (const [key, sourceValue] of Object.entries(source)) {\n\t\tconst currentPath = [...path, key];\n\t\tassertSafePath(currentPath);\n\t\tconst hasExistingValue = Object.hasOwn(target, key);\n\t\tconst existingValue = hasExistingValue ? target[key] : void 0;\n\t\tif (!hasExistingValue) {\n\t\t\ttarget[key] = isCopyableNamespaceObject(sourceValue) && !isWellFormedDescriptor(sourceValue, descriptorKind) ? deepCopyNamespace(sourceValue, descriptorKind) : sourceValue;\n\t\t\tcontinue;\n\t\t}\n\t\tconst existingIsLeaf = isWellFormedDescriptor(existingValue, descriptorKind);\n\t\tconst sourceIsLeaf = isWellFormedDescriptor(sourceValue, descriptorKind);\n\t\tif (existingIsLeaf || sourceIsLeaf) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Duplicate authoring ${label} helper \"${currentPath.join(\".\")}\". Helper names must be unique across composed packs.`);\n\t\tif (!isCopyableNamespaceObject(existingValue) || !isCopyableNamespaceObject(sourceValue)) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Invalid authoring ${label} helper \"${currentPath.join(\".\")}\". Expected a sub-namespace object or a recognized descriptor; received a malformed value.`);\n\t\tmergeAuthoringNamespaces(existingValue, sourceValue, currentPath, descriptorKind, label);\n\t}\n}\nconst ATTRIBUTE_SPEC_LEVELS = [\"model\", \"field\"];\nfunction mergeAuthoringAttributeSpecs(target, source, contributedBy, owners) {\n\tconst invalidContribution = (detail) => runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Invalid authoring attributeSpecs contribution from descriptor \"${contributedBy}\". ${detail}`);\n\tif (!isCopyableNamespaceObject(source)) throw invalidContribution(\"Expected a record carrying a \\\"model\\\" and a \\\"field\\\" level.\");\n\tfor (const level of ATTRIBUTE_SPEC_LEVELS) {\n\t\tconst contributed = source[level];\n\t\tif (!isCopyableNamespaceObject(contributed)) throw invalidContribution(`The \"${level}\" level must be a record of spec factories keyed by attribute name.`);\n\t\tfor (const [attribute, factory] of Object.entries(contributed)) {\n\t\t\tconst entryPath = `${level}.${attribute}`;\n\t\t\tconst invalidEntry = (detail) => runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Invalid authoring attributeSpecs entry \"${entryPath}\" contributed by descriptor \"${contributedBy}\". ${detail}`);\n\t\t\tif (attribute === \"__proto__\" || attribute === \"constructor\" || attribute === \"prototype\") throw invalidEntry(`Attribute names must not use \"${attribute}\".`);\n\t\t\tif (typeof factory !== \"function\") throw invalidEntry(\"Each entry must be a spec factory function.\");\n\t\t\tconst existingOwner = owners.get(entryPath);\n\t\t\tif (existingOwner !== void 0) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Duplicate authoring attributeSpecs entry \"${entryPath}\". Descriptor \"${contributedBy}\" conflicts with \"${existingOwner}\". Each attribute name may be claimed once per level.`);\n\t\t\towners.set(entryPath, contributedBy);\n\t\t\ttarget[level][attribute] = factory;\n\t\t}\n\t}\n}\n/**\n* Collects the full dotted paths of every well-formed descriptor of\n* `descriptorKind` in a raw contribution tree, using the same boundary\n* classification as {@link mergeAuthoringNamespaces}. Lets assembly-level\n* callers attribute each contributed path to its contributing component\n* before merging, so a same-path collision can be reported naming both\n* contributors.\n*/\nfunction collectContributedDescriptorPaths(namespace, descriptorKind, path = []) {\n\tconst paths = [];\n\tfor (const [key, value] of Object.entries(namespace)) {\n\t\tconst currentPath = [...path, key];\n\t\tif (isWellFormedDescriptor(value, descriptorKind)) {\n\t\t\tpaths.push(currentPath.join(\".\"));\n\t\t\tcontinue;\n\t\t}\n\t\tif (isCopyableNamespaceObject(value)) paths.push(...collectContributedDescriptorPaths(value, descriptorKind, currentPath));\n\t}\n\treturn paths;\n}\n/**\n* Derives the scalar view of an assembled authoring type namespace: every\n* **top-level** type constructor that is instantiable with an empty argument\n* list — all declared args optional and no entity-ref argument. A bare type\n* name `T` in a schema is semantically the zero-arg instantiation `T()`, so\n* each entry is exactly what that call produces (defaulted template values\n* applied, absent optional-arg typeParams keys omitted). Constructors\n* registered under a namespace segment, constructors with required args, and\n* entity-ref constructors are not scalars and are excluded.\n*\n* Eligibility needs no template inspection: templates that cannot resolve\n* for their legal call shapes are rejected at the composition boundary by\n* {@link assertResolvableTypeConstructorTemplates}, so the zero-arg\n* instantiation below cannot fail for an eligible constructor.\n*/\nfunction collectScalarTypeConstructors(namespace) {\n\tconst result = /* @__PURE__ */ new Map();\n\tfor (const [name, value] of Object.entries(namespace)) {\n\t\tif (!isAuthoringTypeConstructorDescriptor(value)) continue;\n\t\tif (value.entityRefArg !== void 0) continue;\n\t\tif (value.args?.some((arg) => arg.optional !== true)) continue;\n\t\tresult.set(name, instantiateAuthoringTypeConstructor(value, []));\n\t}\n\treturn result;\n}\nfunction visitTemplateArgRefs(template, visit) {\n\tif (template === void 0) return;\n\tif (isAuthoringArgRef(template)) {\n\t\tvisit(template);\n\t\tvisitTemplateArgRefs(template.default, visit);\n\t\treturn;\n\t}\n\tif (Array.isArray(template)) {\n\t\tfor (const value of template) visitTemplateArgRefs(value, visit);\n\t\treturn;\n\t}\n\tif (typeof template === \"object\" && template !== null) for (const value of Object.values(template)) visitTemplateArgRefs(value, visit);\n}\n/**\n* Boundary validation for a contributed authoring type namespace, called\n* per contributing component at assembly (which supplies `contributedBy`\n* for attribution). Rejects what the types cannot express — entity-ref\n* constructors are skipped (their output derives from the referenced\n* entity): a plain constructor must declare its output storage type name,\n* and every `typeParams` arg-ref (including refs inside arg-ref defaults)\n* must point at a declared argument index.\n*/\nfunction assertResolvableTypeConstructorTemplates(namespace, contributedBy, path = []) {\n\tfor (const [name, value] of Object.entries(namespace)) {\n\t\tconst currentPath = [...path, name];\n\t\tif (!isAuthoringTypeConstructorDescriptor(value)) {\n\t\t\tassertResolvableTypeConstructorTemplates(value, contributedBy, currentPath);\n\t\t\tcontinue;\n\t\t}\n\t\tif (value.entityRefArg !== void 0) continue;\n\t\tconst args = value.args ?? [];\n\t\tconst invalid = (detail) => /* @__PURE__ */ new Error(`Invalid authoring type constructor \"${currentPath.join(\".\")}\" contributed by descriptor \"${contributedBy}\". ${detail}`);\n\t\tif (value.output.nativeType === void 0) throw invalid(\"The output declares no storage type template and no entityRefArg; a plain constructor must declare one.\");\n\t\tfor (const [key, template] of Object.entries(value.output.typeParams ?? {})) visitTemplateArgRefs(template, (ref) => {\n\t\t\tif (args[ref.index] === void 0) throw invalid(`output.typeParams.${key} references argument ${ref.index}, but the constructor declares ${args.length} argument(s). Declare the argument or correct the reference index.`);\n\t\t});\n\t}\n}\nfunction collectDescriptorPaths(namespace, isLeaf, path = []) {\n\tconst paths = [];\n\tfor (const [key, value] of Object.entries(namespace)) {\n\t\tconst currentPath = [...path, key];\n\t\tif (isLeaf(value)) {\n\t\t\tpaths.push(currentPath.join(\".\"));\n\t\t\tcontinue;\n\t\t}\n\t\tif (typeof value === \"object\" && value !== null && !Array.isArray(value)) paths.push(...collectDescriptorPaths(value, isLeaf, currentPath));\n\t}\n\treturn paths;\n}\nfunction collectDescriptorEntries(namespace, isLeaf, descriptorKind, label, path = []) {\n\tconst entries = [];\n\tfor (const [key, value] of Object.entries(namespace)) {\n\t\tconst currentPath = [...path, key];\n\t\tif (isLeaf(value)) {\n\t\t\tif (!isWellFormedDescriptor(value, descriptorKind)) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Malformed authoring ${label} contribution at \"${currentPath.join(\".\")}\". The value carries descriptor keys (kind/keyword/discriminator) but does not satisfy the ${label} descriptor shape. Fix the contribution so it is a complete descriptor, or remove the stray keys if it was meant to be a sub-namespace.`);\n\t\t\tif (value.discriminator.length > 0) entries.push({\n\t\t\t\tpath: currentPath.join(\".\"),\n\t\t\t\tdiscriminator: value.discriminator\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (typeof value === \"object\" && value !== null && !Array.isArray(value)) {\n\t\t\tconst record = blindCast(value);\n\t\t\tif ((record[\"kind\"] !== void 0 || record[\"keyword\"] !== void 0 || record[\"discriminator\"] !== void 0) && !isLeaf(value)) {\n\t\t\t\tconst hasKind = record[\"kind\"] === \"pslBlock\";\n\t\t\t\tconst hasKeyword = typeof record[\"keyword\"] === \"string\";\n\t\t\t\tconst hasDiscriminator = typeof record[\"discriminator\"] === \"string\";\n\t\t\t\tif (hasKind || hasKeyword && hasDiscriminator) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Malformed authoring ${label} contribution at \"${currentPath.join(\".\")}\". The value carries descriptor keys (kind/keyword/discriminator) but does not satisfy the ${label} descriptor shape. Fix the contribution so it is a complete descriptor, or remove the stray keys if it was meant to be a sub-namespace.`);\n\t\t\t}\n\t\t\tentries.push(...collectDescriptorEntries(value, isLeaf, descriptorKind, label, currentPath));\n\t\t}\n\t}\n\treturn entries;\n}\n/**\n* Throws when two or more entries in the same namespace share a key. A\n* duplicate key makes dispatch ambiguous — the caller's lookup dispatches by\n* this key, so one entry would silently shadow the other. Catch duplicates\n* before building any dispatch map.\n*\n* `label` (e.g. `'pslBlock'`, `'entityType'`) names which namespace the\n* duplicate was found in and is carried in the structured error metadata;\n* the key itself is always called `key` in both the message and the\n* metadata, since what it semantically represents (a discriminator for\n* `entityType`, the parser's dispatch keyword for `pslBlock`) is the\n* caller's concern, not this function's.\n*/\nfunction assertUniqueDiscriminators(entries, label) {\n\tconst seen = /* @__PURE__ */ new Map();\n\tfor (const { path, discriminator: key } of entries) {\n\t\tconst existing = seen.get(key);\n\t\tif (existing !== void 0) throw runtimeError(\"RUNTIME.DUPLICATE_AUTHORING_DISCRIMINATOR\", `Duplicate ${label} key \"${key}\" registered at both \"${existing}\" and \"${path}\". Each ${label} contribution must use a unique key.`, {\n\t\t\tlabel,\n\t\t\tkey,\n\t\t\texistingPath: existing,\n\t\t\tpath\n\t\t});\n\t\tseen.set(key, path);\n\t}\n}\nfunction collectPslBlockDescriptorEntries(namespace, path = []) {\n\tconst entries = [];\n\tfor (const [key, value] of Object.entries(namespace)) {\n\t\tconst currentPath = [...path, key];\n\t\tif (isAuthoringPslBlockDescriptor(value)) {\n\t\t\tif (!isWellFormedDescriptor(value, \"pslBlock\")) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Malformed authoring pslBlock contribution at \"${currentPath.join(\".\")}\". The value carries descriptor keys (kind/keyword/discriminator) but does not satisfy the pslBlock descriptor shape. Fix the contribution so it is a complete descriptor, or remove the stray keys if it was meant to be a sub-namespace.`);\n\t\t\tentries.push({\n\t\t\t\tpath: currentPath.join(\".\"),\n\t\t\t\tdiscriminator: value.discriminator,\n\t\t\t\tkeyword: value.keyword\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (typeof value === \"object\" && value !== null && !Array.isArray(value)) {\n\t\t\tconst record = blindCast(value);\n\t\t\tconst hasKind = record[\"kind\"] === \"pslBlock\";\n\t\t\tconst hasKeyword = typeof record[\"keyword\"] === \"string\";\n\t\t\tconst hasDiscriminator = typeof record[\"discriminator\"] === \"string\";\n\t\t\tif (hasKind || hasKeyword && hasDiscriminator) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Malformed authoring pslBlock contribution at \"${currentPath.join(\".\")}\". The value carries descriptor keys (kind/keyword/discriminator) but does not satisfy the pslBlock descriptor shape. Fix the contribution so it is a complete descriptor, or remove the stray keys if it was meant to be a sub-namespace.`);\n\t\t\tentries.push(...collectPslBlockDescriptorEntries(value, currentPath));\n\t\t}\n\t}\n\treturn entries;\n}\n/**\n* Every `pslBlockDescriptors` entry requires a matching `entityTypes` factory\n* with the same discriminator. An `entityTypes` factory may stand alone (e.g.\n* `enum`, reachable from the TypeScript builder without any PSL block).\n*\n* Uniqueness for pslBlock entries is keyed on **keyword**, not discriminator:\n* several keywords (e.g. `policy_select`/`policy_insert`) may legitimately\n* share one discriminator, routing to the same `entityTypes` factory and the\n* same `entries[discriminator]` slot — that N:1 shape is exactly what lets\n* one entity kind be authored through several PSL keywords. What must stay\n* unique is the keyword itself, since that's what the parser dispatches on.\n*/\nfunction assertPslBlocksHaveFactories(entityTypeNamespace, pslBlockNamespace) {\n\tconst blockEntries = collectPslBlockDescriptorEntries(pslBlockNamespace);\n\tconst entityEntries = collectDescriptorEntries(entityTypeNamespace, isAuthoringEntityTypeDescriptor, \"entity\", \"entityType\");\n\tassertUniqueDiscriminators(blockEntries.map((entry) => ({\n\t\tpath: entry.path,\n\t\tdiscriminator: entry.keyword\n\t})), \"pslBlock\");\n\tassertUniqueDiscriminators(entityEntries, \"entityType\");\n\tconst entityDiscriminators = new Set(entityEntries.map((entry) => entry.discriminator));\n\tfor (const block of blockEntries) if (!entityDiscriminators.has(block.discriminator)) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Incomplete extension contribution: pslBlock helper \"${block.path}\" registers discriminator \"${block.discriminator}\" but no entityType contribution shares that discriminator. An extension-contributed PSL block requires a matching entityType factory so the parsed AST node can lower to an IR class instance; add an entityType helper with discriminator \"${block.discriminator}\".`);\n}\nfunction collectModelAttributeEntries(namespace, path = []) {\n\tconst entries = [];\n\tfor (const [key, value] of Object.entries(namespace)) {\n\t\tconst currentPath = [...path, key];\n\t\tif (isAuthoringModelAttributeDescriptor(value)) {\n\t\t\tif (!isWellFormedDescriptor(value, \"modelAttribute\")) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Malformed authoring modelAttribute contribution at \"${currentPath.join(\".\")}\". The value carries descriptor keys (kind/attribute) but does not satisfy the modelAttribute descriptor shape. Fix the contribution so it is a complete descriptor, or remove the stray keys if it was meant to be a sub-namespace.`);\n\t\t\tentries.push({\n\t\t\t\tpath: currentPath.join(\".\"),\n\t\t\t\tdiscriminator: value.attribute\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (typeof value === \"object\" && value !== null && !Array.isArray(value)) {\n\t\t\tconst record = blindCast(value);\n\t\t\tif (typeof record[\"attribute\"] === \"string\" && \"spec\" in record) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Malformed authoring modelAttribute contribution at \"${currentPath.join(\".\")}\". The value carries descriptor keys (kind/attribute) but does not satisfy the modelAttribute descriptor shape. Fix the contribution so it is a complete descriptor, or remove the stray keys if it was meant to be a sub-namespace.`);\n\t\t\tentries.push(...collectModelAttributeEntries(value, currentPath));\n\t\t}\n\t}\n\treturn entries;\n}\n/**\n* Throws when two modelAttribute contributions — at any paths, even\n* different ones — claim the same bare `@@` attribute name. The family\n* interpreter dispatches by attribute name, not by registration path, so\n* two descriptors claiming the same name would have one silently shadow\n* the other.\n*/\nfunction assertUniqueModelAttributeNames(entries) {\n\tconst seen = /* @__PURE__ */ new Map();\n\tfor (const { path, discriminator: attribute } of entries) {\n\t\tconst existing = seen.get(attribute);\n\t\tif (existing !== void 0) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Duplicate modelAttribute \"${attribute}\" registered at both \"${existing}\" and \"${path}\". Each modelAttribute contribution must claim a unique attribute name.`);\n\t\tseen.set(attribute, path);\n\t}\n}\nfunction assertNoCrossRegistryCollisions(typeNamespace, fieldNamespace, entityTypeNamespace = {}, pslBlockNamespace = {}, modelAttributeNamespace = {}) {\n\tconst typePaths = new Set(collectDescriptorPaths(typeNamespace, isAuthoringTypeConstructorDescriptor));\n\tconst fieldPaths = new Set(collectDescriptorPaths(fieldNamespace, isAuthoringFieldPresetDescriptor));\n\tconst entityPaths = new Set(collectDescriptorPaths(entityTypeNamespace, isAuthoringEntityTypeDescriptor));\n\tconst ambiguityHint = \"Register each path in only one of authoringContributions.field / authoringContributions.type / authoringContributions.entityTypes.\";\n\tfor (const fieldPath of fieldPaths) if (typePaths.has(fieldPath)) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Ambiguous authoring registry path \"${fieldPath}\". The same path is registered as both a type constructor and a field preset; PSL resolution would be ambiguous. ${ambiguityHint}`);\n\tfor (const entityPath of entityPaths) if (typePaths.has(entityPath) || fieldPaths.has(entityPath)) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Ambiguous authoring registry path \"${entityPath}\". The same path is registered as an entity contribution AND as a type constructor or field preset; PSL resolution would be ambiguous. ${ambiguityHint}`);\n\tassertPslBlocksHaveFactories(entityTypeNamespace, pslBlockNamespace);\n\tassertUniqueModelAttributeNames(collectModelAttributeEntries(modelAttributeNamespace));\n\tassertSelectTemplatesMatchOptionArgs(typeNamespace, fieldNamespace, entityTypeNamespace);\n}\nfunction collectDescriptorNodes(namespace, isLeaf, path = []) {\n\tconst nodes = [];\n\tfor (const [key, value] of Object.entries(namespace)) {\n\t\tconst currentPath = [...path, key];\n\t\tif (isLeaf(value)) {\n\t\t\tnodes.push([currentPath.join(\".\"), value]);\n\t\t\tcontinue;\n\t\t}\n\t\tif (typeof value === \"object\" && value !== null && !Array.isArray(value)) nodes.push(...collectDescriptorNodes(value, isLeaf, currentPath));\n\t}\n\treturn nodes;\n}\nfunction collectSelectRefs(value, found) {\n\tif (typeof value !== \"object\" || value === null) return;\n\tif (isAuthoringSelectRef(value)) {\n\t\tfound.push(value);\n\t\tfor (const caseTemplate of Object.values(value.cases)) collectSelectRefs(caseTemplate, found);\n\t\treturn;\n\t}\n\tif (isAuthoringArgRef(value)) {\n\t\tcollectSelectRefs(value.default, found);\n\t\treturn;\n\t}\n\tif (Array.isArray(value)) {\n\t\tfor (const entry of value) collectSelectRefs(entry, found);\n\t\treturn;\n\t}\n\tfor (const entry of Object.values(value)) collectSelectRefs(entry, found);\n}\nfunction validateSelectRefsAgainstArgs(label, helperPath, args, templateRoot) {\n\tconst selects = [];\n\tcollectSelectRefs(templateRoot, selects);\n\tfor (const select of selects) {\n\t\tconst position = `#${select.index + 1}`;\n\t\tlet descriptor = args?.[select.index];\n\t\tif (descriptor === void 0) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Authoring ${label} helper \"${helperPath}\" select template references argument ${position}, but the helper declares no argument at that position.`);\n\t\tfor (const segment of select.path ?? []) {\n\t\t\tdescriptor = descriptor.kind === \"object\" ? descriptor.properties[segment] : void 0;\n\t\t\tif (descriptor === void 0) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Authoring ${label} helper \"${helperPath}\" select template references argument ${position} at path \"${(select.path ?? []).join(\".\")}\", which does not resolve to a declared argument property.`);\n\t\t}\n\t\tif (descriptor.kind !== \"option\") throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Authoring ${label} helper \"${helperPath}\" select template references argument ${position}, which is kind \"${descriptor.kind}\"; select requires an option argument.`);\n\t\tconst argumentLabel = descriptor.name !== void 0 ? `\"${descriptor.name}\"` : position;\n\t\tconst missing = descriptor.values.filter((value) => !Object.hasOwn(select.cases, value));\n\t\tif (missing.length > 0) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Authoring ${label} helper \"${helperPath}\" option argument ${argumentLabel} allows [${descriptor.values.join(\", \")}] but the select template has no case for: ${missing.join(\", \")}.`);\n\t\tconst values = descriptor.values;\n\t\tconst unreachable = Object.keys(select.cases).filter((key) => !values.includes(key));\n\t\tif (unreachable.length > 0) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Authoring ${label} helper \"${helperPath}\" select template has case(s) not allowed by option argument ${argumentLabel}: ${unreachable.join(\", \")}. Allowed values: [${values.join(\", \")}].`);\n\t}\n}\n/**\n* Every `select` template node must target an option argument whose `values`\n* exactly cover the node's `cases` — a legal token with no case and a case no\n* token can reach are both declaration bugs, caught here at pack-registration\n* time rather than at first resolution.\n*/\nfunction assertSelectTemplatesMatchOptionArgs(typeNamespace, fieldNamespace, entityTypeNamespace) {\n\tfor (const [helperPath, descriptor] of collectDescriptorNodes(fieldNamespace, isAuthoringFieldPresetDescriptor)) validateSelectRefsAgainstArgs(\"field\", helperPath, descriptor.args, descriptor.output);\n\tfor (const [helperPath, descriptor] of collectDescriptorNodes(typeNamespace, isAuthoringTypeConstructorDescriptor)) validateSelectRefsAgainstArgs(\"type\", helperPath, descriptor.args, descriptor.output);\n\tfor (const [helperPath, descriptor] of collectDescriptorNodes(entityTypeNamespace, isAuthoringEntityTypeDescriptor)) if (\"template\" in descriptor.output) validateSelectRefsAgainstArgs(\"entityType\", helperPath, descriptor.args, descriptor.output.template);\n}\nfunction resolveAuthoringTemplateValue(template, args) {\n\tif (template === void 0) return;\n\tif (isAuthoringArgRef(template)) {\n\t\tconst value = readTemplateArgumentValue(args, template.index, template.path);\n\t\tif (value === void 0 && template.default !== void 0) return resolveAuthoringTemplateValue(template.default, args);\n\t\treturn value;\n\t}\n\tif (isAuthoringSelectRef(template)) {\n\t\tconst value = readTemplateArgumentValue(args, template.index, template.path);\n\t\tif (value === void 0) return;\n\t\tif (typeof value !== \"string\" || !Object.hasOwn(template.cases, value)) throw new InternalError(`Authoring template select has no case for value \"${String(value)}\"`);\n\t\treturn resolveAuthoringTemplateValue(template.cases[value], args);\n\t}\n\tif (Array.isArray(template)) return template.map((value) => resolveAuthoringTemplateValue(value, args));\n\tif (typeof template === \"object\" && template !== null) {\n\t\tconst resolved = {};\n\t\tfor (const [key, value] of Object.entries(template)) {\n\t\t\tconst resolvedValue = resolveAuthoringTemplateValue(value, args);\n\t\t\tif (resolvedValue !== void 0) resolved[key] = resolvedValue;\n\t\t}\n\t\treturn resolved;\n\t}\n\treturn template;\n}\nfunction validateAuthoringArgument(descriptor, value, path) {\n\tif (value === void 0) {\n\t\tif (descriptor.optional) return;\n\t\tthrow runtimeError(\"CONTRACT.ARGUMENT_INVALID\", `${path} is missing`);\n\t}\n\tif (descriptor.kind === \"string\") {\n\t\tif (typeof value !== \"string\") throw runtimeError(\"CONTRACT.ARGUMENT_INVALID\", `${path} must be a string`);\n\t\treturn;\n\t}\n\tif (descriptor.kind === \"boolean\") {\n\t\tif (typeof value !== \"boolean\") throw runtimeError(\"CONTRACT.ARGUMENT_INVALID\", `${path} must be a boolean`);\n\t\treturn;\n\t}\n\tif (descriptor.kind === \"stringArray\") {\n\t\tif (!Array.isArray(value)) throw runtimeError(\"CONTRACT.ARGUMENT_INVALID\", `${path} must be an array of strings`);\n\t\tfor (const entry of value) if (typeof entry !== \"string\") throw runtimeError(\"CONTRACT.ARGUMENT_INVALID\", `${path} must be an array of strings`);\n\t\treturn;\n\t}\n\tif (descriptor.kind === \"object\") {\n\t\tif (typeof value !== \"object\" || value === null || Array.isArray(value)) throw runtimeError(\"CONTRACT.ARGUMENT_INVALID\", `${path} must be an object`);\n\t\tconst input = value;\n\t\tconst expectedKeys = new Set(Object.keys(descriptor.properties));\n\t\tfor (const key of Object.keys(input)) if (!expectedKeys.has(key)) throw runtimeError(\"CONTRACT.ARGUMENT_INVALID\", `${path} contains unknown property \"${key}\"`);\n\t\tfor (const [key, propertyDescriptor] of Object.entries(descriptor.properties)) validateAuthoringArgument(propertyDescriptor, input[key], `${path}.${key}`);\n\t\treturn;\n\t}\n\tif (descriptor.kind === \"option\") {\n\t\tif (typeof value !== \"string\" || !descriptor.values.includes(value)) {\n\t\t\tconst quoted = descriptor.values.map((option) => JSON.stringify(option));\n\t\t\tthrow runtimeError(\"CONTRACT.ARGUMENT_INVALID\", `${path} ${quoted.length === 0 ? \"takes no value\" : `must be ${quoted.length === 1 ? quoted.join(\"\") : `one of ${quoted.join(\", \")}`}`}; received ${describeReceivedArgument(value)}`);\n\t\t}\n\t\treturn;\n\t}\n\tif (typeof value !== \"number\" || Number.isNaN(value)) throw runtimeError(\"CONTRACT.ARGUMENT_INVALID\", `${path} must be a number`);\n\tif (descriptor.integer && !Number.isInteger(value)) throw runtimeError(\"CONTRACT.ARGUMENT_INVALID\", `${path} must be an integer`);\n\tif (descriptor.minimum !== void 0 && value < descriptor.minimum) throw runtimeError(\"CONTRACT.ARGUMENT_INVALID\", `${path} must be >= ${descriptor.minimum}, received ${value}`);\n\tif (descriptor.maximum !== void 0 && value > descriptor.maximum) throw runtimeError(\"CONTRACT.ARGUMENT_INVALID\", `${path} must be <= ${descriptor.maximum}, received ${value}`);\n}\nfunction validateAuthoringHelperArguments(helperPath, descriptors, args) {\n\tconst expected = descriptors ?? [];\n\tconst minimumArgs = expected.reduce((count, descriptor, index) => descriptor.optional ? count : index + 1, 0);\n\tif (args.length < minimumArgs || args.length > expected.length) throw runtimeError(\"CONTRACT.ARGUMENT_INVALID\", `${helperPath} expects ${minimumArgs === expected.length ? expected.length : `${minimumArgs}-${expected.length}`} argument(s), received ${args.length}`);\n\texpected.forEach((descriptor, index) => {\n\t\tvalidateAuthoringArgument(descriptor, args[index], argumentLabel(helperPath, descriptor, index));\n\t});\n}\nfunction argumentLabel(helperPath, descriptor, index) {\n\treturn descriptor.name === void 0 ? `Authoring helper argument at ${helperPath}[${index}]` : `Argument \"${descriptor.name}\" of ${helperPath}`;\n}\nfunction describeReceivedArgument(value) {\n\treturn typeof value === \"string\" ? JSON.stringify(value) : String(value);\n}\nfunction resolveAuthoringStorageTypeTemplate(template, args) {\n\tconst nativeType = template.nativeType;\n\tif (nativeType === void 0) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Authoring output template for codec \"${template.codecId}\" declares no nativeType; only entity-ref constructors may omit it`);\n\tconst typeParams = template.typeParams === void 0 ? void 0 : resolveAuthoringTemplateValue(template.typeParams, args);\n\tif (typeParams !== void 0 && !isAuthoringTemplateRecord(typeParams)) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Resolved authoring typeParams must be an object for codec \"${template.codecId}\", received ${String(typeParams)}`);\n\tconst normalizedTypeParams = typeParams !== void 0 && Object.keys(typeParams).length === 0 ? void 0 : typeParams;\n\treturn {\n\t\tcodecId: template.codecId,\n\t\tnativeType,\n\t\t...ifDefined(\"typeParams\", normalizedTypeParams)\n\t};\n}\nfunction resolveAuthoringColumnDefaultTemplate(template, args) {\n\tif (template.kind === \"literal\") {\n\t\tconst value = resolveAuthoringTemplateValue(template.value, args);\n\t\tif (value === void 0) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", \"Resolved authoring literal default must not be undefined\");\n\t\tif (!isColumnDefaultLiteralInputValue(value)) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Resolved authoring literal default must be a JSON-serializable value or Date, received ${String(value)}`);\n\t\treturn {\n\t\t\tkind: \"literal\",\n\t\t\tvalue\n\t\t};\n\t}\n\tconst expression = resolveAuthoringTemplateValue(template.expression, args);\n\tif (expression === void 0 || typeof expression === \"object\" && expression !== null) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Resolved authoring function default expression must resolve to a primitive, received ${String(expression)}`);\n\treturn {\n\t\tkind: \"function\",\n\t\texpression: String(expression)\n\t};\n}\nfunction resolveExecutionMutationDefaultPhase(phase, template, args) {\n\tconst value = resolveAuthoringTemplateValue(template, args);\n\tif (value === void 0) return;\n\tif (!isExecutionMutationDefaultValue(value)) throw runtimeError(\"CONTRACT.PACK_CONTRIBUTION_INVALID\", `Authoring preset executionDefaults.${phase} did not resolve to a valid generator descriptor (kind: 'generator', id: string).`);\n\treturn value;\n}\nfunction resolveAuthoringExecutionDefaultsTemplate(template, args) {\n\tconst phases = {\n\t\t...ifDefined(\"onCreate\", template.onCreate !== void 0 ? resolveExecutionMutationDefaultPhase(\"onCreate\", template.onCreate, args) : void 0),\n\t\t...ifDefined(\"onUpdate\", template.onUpdate !== void 0 ? resolveExecutionMutationDefaultPhase(\"onUpdate\", template.onUpdate, args) : void 0)\n\t};\n\treturn Object.keys(phases).length === 0 ? void 0 : phases;\n}\nfunction instantiateAuthoringTypeConstructor(descriptor, args) {\n\treturn resolveAuthoringStorageTypeTemplate(descriptor.output, args);\n}\nfunction instantiateAuthoringEntityType(helperPath, descriptor, args, ctx) {\n\tif (\"factory\" in descriptor.output) {\n\t\tconst input = args[0];\n\t\treturn blindCast(descriptor.output.factory)(input, ctx);\n\t}\n\tvalidateAuthoringHelperArguments(helperPath, descriptor.args, args);\n\treturn blindCast(resolveAuthoringTemplateValue(descriptor.output.template, args));\n}\nfunction instantiateAuthoringFieldPreset(descriptor, args) {\n\treturn {\n\t\tdescriptor: resolveAuthoringStorageTypeTemplate(descriptor.output, args),\n\t\tnullable: descriptor.output.nullable ?? false,\n\t\t...ifDefined(\"default\", descriptor.output.default !== void 0 ? resolveAuthoringColumnDefaultTemplate(descriptor.output.default, args) : void 0),\n\t\t...ifDefined(\"executionDefaults\", descriptor.output.executionDefaults !== void 0 ? resolveAuthoringExecutionDefaultsTemplate(descriptor.output.executionDefaults, args) : void 0),\n\t\tid: descriptor.output.id ?? false,\n\t\tunique: descriptor.output.unique ?? false\n\t};\n}\n//#endregion\n//#region src/shared/tagged-literal.ts\nconst TAGGED_LITERAL_MAX_BYTES = 65536;\n/** The message a tagged literal's canonicalization failure is reported with, in PSL and in TypeScript. */\nfunction describeTaggedLiteralFailure(reason) {\n\tswitch (reason) {\n\t\tcase \"nul\": return \"Tagged literals must not contain NUL characters.\";\n\t\tcase \"too-large\": return `Tagged literal exceeds ${TAGGED_LITERAL_MAX_BYTES} bytes.`;\n\t}\n}\nconst PSL_BACKTICK_ESCAPES = /* @__PURE__ */ new Set([\"`\", \"\\\\\"]);\nconst TEMPLATE_TAG_ESCAPES = /* @__PURE__ */ new Set([\n\t\"`\",\n\t\"\\\\\",\n\t\"$\"\n]);\n/** The escapes a PSL backtick string resolves: `` \\` `` and `\\\\`. PSL has no interpolation, so `${` is ordinary text. */\nfunction resolvePslBacktickEscapes(raw) {\n\treturn resolveEscapes(raw, PSL_BACKTICK_ESCAPES);\n}\n/** The escapes a TypeScript template tag resolves: the PSL two plus `\\$`, the only way to write `${` in a template literal. */\nfunction resolveTemplateTagEscapes(raw) {\n\treturn resolveEscapes(raw, TEMPLATE_TAG_ESCAPES);\n}\n/** Every other backslash sequence is kept as written, both characters, so a SQL body may contain `E'\\n'` unchanged. */\nfunction resolveEscapes(raw, escapes) {\n\tlet out = \"\";\n\tlet i = 0;\n\twhile (i < raw.length) {\n\t\tconst ch = raw.charAt(i);\n\t\tconst next = raw.charAt(i + 1);\n\t\tif (ch === \"\\\\\" && escapes.has(next)) {\n\t\t\tout += next;\n\t\t\ti += 2;\n\t\t\tcontinue;\n\t\t}\n\t\tout += ch;\n\t\ti++;\n\t}\n\treturn out;\n}\nconst BLANK_LINE = /^[ \\t]*$/;\nconst LEADING_INDENT = /^[ \\t]*/;\nconst LINE_BREAK = /\\r\\n|\\r|\\n/g;\n/**\n* Turns the escape-resolved text of a tagged literal into its canonical body:\n* newlines become `\\n`, a blank first and last line are dropped, common leading\n* whitespace is removed, internal blank lines become empty, and no trailing\n* newline is added. Fails on a NUL character or when the result is larger than\n* 65536 UTF-8 bytes.\n*/\nfunction canonicalizeTaggedLiteralBody(resolved) {\n\tconst nul = resolved.indexOf(\"\\0\");\n\tif (nul !== -1) return {\n\t\tok: false,\n\t\treason: \"nul\",\n\t\toffset: nul\n\t};\n\tconst lines = splitLines(resolved);\n\tif (lines.length > 0 && BLANK_LINE.test(lines[0]?.text ?? \"\")) lines.shift();\n\tif (lines.length > 0 && BLANK_LINE.test(lines.at(-1)?.text ?? \"\")) lines.pop();\n\tconst indent = commonIndent(lines);\n\tconst bodyLines = lines.map((line) => BLANK_LINE.test(line.text) ? {\n\t\ttext: \"\",\n\t\tstart: line.start\n\t} : {\n\t\ttext: line.text.slice(indent),\n\t\tstart: line.start + indent\n\t});\n\tconst excess = offsetWhereBytesExceed(bodyLines, TAGGED_LITERAL_MAX_BYTES);\n\tif (excess !== void 0) return {\n\t\tok: false,\n\t\treason: \"too-large\",\n\t\toffset: excess\n\t};\n\treturn {\n\t\tok: true,\n\t\tbody: bodyLines.map((line) => line.text).join(\"\\n\")\n\t};\n}\nfunction splitLines(text) {\n\tconst lines = [];\n\tlet start = 0;\n\tfor (const match of text.matchAll(LINE_BREAK)) {\n\t\tlines.push({\n\t\t\ttext: text.slice(start, match.index),\n\t\t\tstart\n\t\t});\n\t\tstart = match.index + match[0].length;\n\t}\n\tlines.push({\n\t\ttext: text.slice(start),\n\t\tstart\n\t});\n\treturn lines;\n}\nfunction commonIndent(lines) {\n\tlet indent = Number.POSITIVE_INFINITY;\n\tfor (const line of lines) {\n\t\tif (BLANK_LINE.test(line.text)) continue;\n\t\tindent = Math.min(indent, LEADING_INDENT.exec(line.text)?.[0].length ?? 0);\n\t}\n\treturn Number.isFinite(indent) ? indent : 0;\n}\n/** The resolved-text offset of the first character that pushes the body past `limit` bytes. */\nfunction offsetWhereBytesExceed(lines, limit) {\n\tlet bytes = 0;\n\tfor (const [index, line] of lines.entries()) {\n\t\tif (index > 0) {\n\t\t\tbytes += 1;\n\t\t\tif (bytes > limit) return line.start;\n\t\t}\n\t\tlet offsetInLine = 0;\n\t\tfor (const char of line.text) {\n\t\t\tbytes += utf8Length(char.codePointAt(0) ?? 0);\n\t\t\tif (bytes > limit) return line.start + offsetInLine;\n\t\t\toffsetInLine += char.length;\n\t\t}\n\t}\n}\nfunction utf8Length(codePoint) {\n\tif (codePoint < 128) return 1;\n\tif (codePoint < 2048) return 2;\n\tif (codePoint < 65536) return 3;\n\treturn 4;\n}\nfunction escapeQuotedText(text) {\n\treturn text.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, \"\\\\\\\"\").replace(/\\n/g, \"\\\\n\").replace(/\\r/g, \"\\\\r\");\n}\n/**\n* The PSL text of a tagged literal whose canonical text is `text`: the backtick form, or the double-quote form when the\n* text holds a backtick, which reads better than escaping each backtick. A multi-line text starts on the line after\n* the opening backtick, so indentation a printer adds to an enclosing block is common to every line and the\n* canonicalization removes it. ADR 129.\n*/\nfunction printTaggedLiteral(tag, text) {\n\tif (text.includes(\"`\")) return `${tag}\"${escapeQuotedText(text)}\"`;\n\tconst fenced = text.replace(/\\\\/g, \"\\\\\\\\\");\n\treturn text.includes(\"\\n\") ? `${tag}\\`\\n${fenced}\\n\\`` : `${tag}\\`${fenced}\\``;\n}\n//#endregion\n//#region src/shared/temporal-presets.ts\n/**\n* Canonical id for the wall-clock-now mutation default generator. It flows to the control-plane descriptor and the temporal field presets below, to each family's runtime generator, and to the authoring surfaces (PSL `temporal.updatedAt()`, TS `field.temporal.updatedAt()`) through the descriptor.\n*/\nconst TIMESTAMP_NOW_GENERATOR_ID = \"timestampNow\";\n/**\n* Builds the control-plane descriptor for the wall-clock-now mutation default generator. Its `id` and `buildPhases` are target-agnostic, so PSL `temporal.updatedAt()` and TS `field.temporal.updatedAt()` lower to byte-identical contracts.\n*\n* `applicableCodecIds` is omitted: `timestampNow` is reachable only through a preset, which co-registers the codec itself, so a compatibility list would be tautological.\n*/\nfunction timestampNowControlDescriptor() {\n\treturn {\n\t\tid: TIMESTAMP_NOW_GENERATOR_ID,\n\t\tbuildPhases: () => ({\n\t\t\tonCreate: {\n\t\t\t\tkind: \"generator\",\n\t\t\t\tid: TIMESTAMP_NOW_GENERATOR_ID\n\t\t\t},\n\t\t\tonUpdate: {\n\t\t\t\tkind: \"generator\",\n\t\t\t\tid: TIMESTAMP_NOW_GENERATOR_ID\n\t\t\t}\n\t\t})\n\t};\n}\n/**\n* Builds the `temporal.{createdAt,updatedAt}` field-preset pair. `createdAt` lowers to an execution generator on `onCreate`; `updatedAt` lowers to the same generator on both `onCreate` and `onUpdate`. The target supplies the storage template of its timestamp codec, which the presets carry through unchanged; everything else is shared, so PSL and TS authoring lower to byte-identical contracts across targets.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction temporalAuthoringPresets(input) {\n\tconst { generatorId: requestedGeneratorId, ...storage } = input;\n\tconst generatorId = requestedGeneratorId ?? \"timestampNow\";\n\treturn {\n\t\tcreatedAt: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\t...storage,\n\t\t\t\texecutionDefaults: { onCreate: {\n\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\tid: generatorId\n\t\t\t\t} }\n\t\t\t}\n\t\t},\n\t\tupdatedAt: {\n\t\t\tkind: \"fieldPreset\",\n\t\t\toutput: {\n\t\t\t\t...storage,\n\t\t\t\texecutionDefaults: {\n\t\t\t\t\tonCreate: {\n\t\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\t\tid: generatorId\n\t\t\t\t\t},\n\t\t\t\t\tonUpdate: {\n\t\t\t\t\t\tkind: \"generator\",\n\t\t\t\t\t\tid: generatorId\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}\nconst TEMPORAL_ON_CREATE_ARG = {\n\tname: \"onCreate\",\n\tkind: \"option\",\n\tvalues: [\"now\"],\n\toptional: true\n};\nconst TEMPORAL_ON_UPDATE_ARG = {\n\tname: \"onUpdate\",\n\tkind: \"option\",\n\tvalues: [\"now\"],\n\toptional: true\n};\n/**\n* Selects a generator descriptor for the preset's `now` token. The token is preset vocabulary; the generator id never appears in a user's spelling (ADR 169 — these generators are preset-only).\n*/\nfunction temporalPhaseTemplate(index, generatorId) {\n\treturn {\n\t\tkind: \"select\",\n\t\tindex,\n\t\tcases: { now: {\n\t\t\tkind: \"generator\",\n\t\t\tid: generatorId\n\t\t} }\n\t};\n}\n/**\n* Builds a `temporal.<codec>` field preset for a codec with no type parameters, carrying the codec's storage template through unchanged. Both phase arguments are optional, and omitting one omits that phase.\n*/\n/* @__NO_SIDE_EFFECTS__ */\nfunction temporalCodecPreset(storage) {\n\treturn {\n\t\tkind: \"fieldPreset\",\n\t\targs: [TEMPORAL_ON_CREATE_ARG, TEMPORAL_ON_UPDATE_ARG],\n\t\toutput: {\n\t\t\t...storage,\n\t\t\texecutionDefaults: {\n\t\t\t\tonCreate: temporalPhaseTemplate(0, TIMESTAMP_NOW_GENERATOR_ID),\n\t\t\t\tonUpdate: temporalPhaseTemplate(1, TIMESTAMP_NOW_GENERATOR_ID)\n\t\t\t}\n\t\t}\n\t};\n}\n//#endregion\nexport { mergeAuthoringAttributeSpecs as A, instantiateAuthoringTypeConstructor as C, isAuthoringModelAttributeDescriptor as D, isAuthoringFieldPresetDescriptor as E, resolveAuthoringTemplateValue as M, resolveEnumCodecId as N, isAuthoringPslBlockDescriptor as O, validateAuthoringHelperArguments as P, instantiateAuthoringFieldPreset as S, isAuthoringEntityTypeDescriptor as T, collectContributedDescriptorPaths as _, temporalCodecPreset as a, getAuthoringTypeConstructor as b, TAGGED_LITERAL_MAX_BYTES as c, printTaggedLiteral as d, resolvePslBacktickEscapes as f, classifyEnumMemberType as g, assertResolvableTypeConstructorTemplates as h, temporalAuthoringPresets as i, mergeAuthoringNamespaces as j, isAuthoringTypeConstructorDescriptor as k, canonicalizeTaggedLiteralBody as l, assertNoCrossRegistryCollisions as m, TEMPORAL_ON_UPDATE_ARG as n, temporalPhaseTemplate as o, resolveTemplateTagEscapes as p, TIMESTAMP_NOW_GENERATOR_ID as r, timestampNowControlDescriptor as s, TEMPORAL_ON_CREATE_ARG as t, describeTaggedLiteralFailure as u, collectScalarTypeConstructors as v, isAuthoringArgRef as w, instantiateAuthoringEntityType as x, flushAuthoringWarnings as y };\n\n//# sourceMappingURL=temporal-presets-DzBBD4St.mjs.map"],"mappings":";;;;;;;AAOA,MAAM,oCAAoC;;;;;;;;AAQ1C,SAAS,uBAAuB,UAAU;CACzC,MAAM,yBAAyB,IAAI,IAAI;CACvC,KAAK,MAAM,WAAW,UAAU;EAC/B,MAAM,MAAM,KAAK,UAAU,CAAC,QAAQ,MAAM,QAAQ,OAAO,CAAC;EAC1D,MAAM,QAAQ,OAAO,IAAI,GAAG,KAAK,CAAC;EAClC,MAAM,KAAK,OAAO;EAClB,OAAO,IAAI,KAAK,KAAK;CACtB;CACA,KAAK,MAAM,SAAS,OAAO,OAAO,GAAG;EACpC,MAAM,QAAQ,MAAM;EACpB,IAAI,UAAU,KAAK,GAAG;EACtB,IAAI,MAAM,UAAU,mCAAmC;GACtD,KAAK,MAAM,WAAW,OAAO,QAAQ,YAAY,QAAQ,SAAS,EAAE,MAAM,QAAQ,KAAK,CAAC;GACxF;EACD;EACA,QAAQ,YAAY,GAAG,MAAM,OAAO,GAAG,MAAM,QAAQ,IAAI,MAAM,KAAK,MAAM,OAAO,EAAE,MAAM,CAAC,CAAC,KAAK,IAAI,KAAK,EAAE,MAAM,MAAM,KAAK,CAAC;CAC9H;AACD;AACA,SAAS,uBAAuB,QAAQ;CACvC,IAAI,UAAU;CACd,IAAI,SAAS;CACb,KAAK,MAAM,OAAO,OAAO,KAAK,MAAM,GAAG;EACtC,MAAM,QAAQ,OAAO;EACrB,IAAI,UAAU,KAAK,KAAK,OAAO,UAAU,UAAU,UAAU;OACxD,IAAI,OAAO,UAAU,YAAY,OAAO,UAAU,KAAK,GAAG,SAAS;OACnE,OAAO;CACb;CACA,IAAI,WAAW,QAAQ,OAAO;CAC9B,IAAI,SAAS,OAAO;CACpB,IAAI,QAAQ,OAA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