@prisma/orm-framework 8.0.0-rc.14-dev.41 → 8.0.0-rc.14-dev.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/contract.d.mts +1 -1
- package/dist/contract.mjs +1 -1
- package/dist/contract__validate-domain.d.mts +1 -1
- package/dist/contract__validate-domain.mjs +1 -1
- package/dist/psl-parser.mjs +6 -1
- package/dist/psl-parser.mjs.map +1 -1
- package/dist/{validate-domain-DgY72oWI.mjs → validate-domain-BWxgeXy0.mjs} +12 -1
- package/dist/validate-domain-BWxgeXy0.mjs.map +1 -0
- package/dist/{validate-domain-M93ZRMRA.d.mts → validate-domain-DaAswa8n.d.mts} +3 -3
- package/dist/validate-domain-DaAswa8n.d.mts.map +1 -0
- package/package.json +15 -15
- package/dist/validate-domain-DgY72oWI.mjs.map +0 -1
- package/dist/validate-domain-M93ZRMRA.d.mts.map +0 -1
package/dist/contract.d.mts
CHANGED
|
@@ -10,5 +10,5 @@ import { t as applySpecifierDefaultControlPolicy } from "./apply-specifier-defau
|
|
|
10
10
|
import { n as ContractValidationPhase, t as ContractValidationError } from "./contract-validation-error-R7cMoK04.mjs";
|
|
11
11
|
import { a as EnumValues, c as buildEnumsMapForNamespace, i as EnumMemberNames, l as buildNamespacedEnums, n as EnumAccessor, o as NamespaceEnumAccessors, r as EnumEntriesToAccessors, s as NamespacedEnums, t as ContractEnumAccessor, u as createEnumAccessor } from "./enum-accessor-YBT4SFYM.mjs";
|
|
12
12
|
import { a as compareByNameProperty, c as matchesPathPattern, i as PathSegment$1, n as PathPattern, o as createPreserveEmptyPredicate, r as PathSegment, s as createStorageSort, t as NamedArraySortTarget } from "./hashing-utils-pciIgMxz.mjs";
|
|
13
|
-
import { n as DomainModelShape, r as validateContractDomain, t as DomainContractShape } from "./validate-domain-
|
|
13
|
+
import { n as DomainModelShape, r as validateContractDomain, t as DomainContractShape } from "./validate-domain-DaAswa8n.mjs";
|
|
14
14
|
export { type $, type ApplicationDomain, type ApplicationDomainNamespace, type Brand, type CanonicalizeContractOptions, type ColumnDefault, type ColumnDefaultLiteralInputValue, type ColumnDefaultLiteralValue, type Contract, type ContractDiscriminator, type ContractEmbedRelation, type ContractEnum, type ContractEnumAccessor, type ContractExecutionSection, ContractExecutionSectionSchema, type ContractField, type ContractFieldType, type ContractManyToManyRelation, type ContractMarkerRecord, type ContractModel, type ContractModelBase, type ContractNonJunctionRelation, type ContractReferenceRelation, type ContractRelation, type ContractRelationOn, type ContractRelationThrough, type ContractToManyRelation, type ContractToOneRelation, ContractValidationError, type ContractValidationPhase, type ContractValueObject, type ContractValueObjectDefinitions, type ContractVariantEntry, type ContractWithDomain, type ControlPolicy, type CrossReference, CrossReferenceSchema, type DocCollection, type DocIndex, type DomainContractShape, type DomainModelShape, type EmbedRelationKeys, type EnumAccessor, type EnumEntriesToAccessors, type EnumMemberNames, type EnumValues, type ExecutionHashBase, type ExecutionMutationDefault, type ExecutionMutationDefaultPhases, type ExecutionMutationDefaultValue, type ExecutionSection, type Expr, type FieldType, type GeneratedValueSpec, type JsonPrimitive, type JsonValue, type LedgerEntryRecord, type ModelStorageBase, type NamedArraySortTarget, type NamespaceEnumAccessors, type NamespaceId, type NamespacedEnums, type PathPattern, type PlanMeta, type PathSegment as PreserveEmptyPathSegment, type PreserveEmptyPredicate, type ProfileHashBase, type ReferenceRelationKeys, type ResolvedDomainModel, type ScalarFieldType, type SerializeContract, type Source, type StorageBase, type StorageEntitySlot, type StorageHashBase, type StorageNamespace, type StorageSort, type PathSegment$1 as StorageSortPathSegment, UNBOUND_DOMAIN_NAMESPACE_ID, type UnionFieldType, type ValueObjectFieldType, type ValueSetRef, applySpecifierDefaultControlPolicy, asNamespaceId, buildEnumsMapForNamespace, buildExecutionSection, buildNamespacedEnums, canonicalizeContract, canonicalizeContractToObject, compareByNameProperty, computeExecutionHash, computeProfileHash, computeStorageHash, coreHash, createEnumAccessor, createPreserveEmptyPredicate, createStorageSort, crossRef, domainModelsAtDefaultNamespace, domainValueObjectsAtDefaultNamespace, effectiveControlPolicy, executionHash, isColumnDefault, isColumnDefaultLiteralInputValue, isExecutionMutationDefaultValue, isPlainRecord, matchesPathPattern, profileHash, resolveDomainModel, soleDomainNamespaceId, validateContractDomain };
|
package/dist/contract.mjs
CHANGED
|
@@ -8,5 +8,5 @@ import { a as computeProfileHash, i as computeExecutionHash, n as canonicalizeCo
|
|
|
8
8
|
import { t as resolveDomainModel } from "./resolve-domain-model-BovPAsW2-8rwyzjxp.mjs";
|
|
9
9
|
import { t as asNamespaceId } from "./namespace-id-asbWpwMw-3yxn-tRe.mjs";
|
|
10
10
|
import { a as domainModelsAtDefaultNamespace, c as executionHash, d as isExecutionMutationDefaultValue, f as profileHash, i as crossRef, l as isColumnDefault, n as CrossReferenceSchema, o as domainValueObjectsAtDefaultNamespace, r as coreHash, s as effectiveControlPolicy, t as ContractExecutionSectionSchema, u as isColumnDefaultLiteralInputValue } from "./types-QyibIZST.mjs";
|
|
11
|
-
import { t as validateContractDomain } from "./validate-domain-
|
|
11
|
+
import { t as validateContractDomain } from "./validate-domain-BWxgeXy0.mjs";
|
|
12
12
|
export { ContractExecutionSectionSchema, ContractValidationError, CrossReferenceSchema, UNBOUND_DOMAIN_NAMESPACE_ID, applySpecifierDefaultControlPolicy, asNamespaceId, buildEnumsMapForNamespace, buildExecutionSection, buildNamespacedEnums, canonicalizeContract, canonicalizeContractToObject, compareByNameProperty, computeExecutionHash, computeProfileHash, computeStorageHash, coreHash, createEnumAccessor, createPreserveEmptyPredicate, createStorageSort, crossRef, domainModelsAtDefaultNamespace, domainValueObjectsAtDefaultNamespace, effectiveControlPolicy, executionHash, isColumnDefault, isColumnDefaultLiteralInputValue, isExecutionMutationDefaultValue, isPlainRecord, matchesPathPattern, profileHash, resolveDomainModel, soleDomainNamespaceId, validateContractDomain };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as DomainModelShape, r as validateContractDomain, t as DomainContractShape } from "./validate-domain-
|
|
1
|
+
import { n as DomainModelShape, r as validateContractDomain, t as DomainContractShape } from "./validate-domain-DaAswa8n.mjs";
|
|
2
2
|
export { type DomainContractShape, type DomainModelShape, validateContractDomain };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as validateContractDomain } from "./validate-domain-
|
|
1
|
+
import { t as validateContractDomain } from "./validate-domain-BWxgeXy0.mjs";
|
|
2
2
|
export { validateContractDomain };
|
package/dist/psl-parser.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { a as flatPslModels, c as namespacePslExtensionBlocks } from "./psl-ast-
|
|
|
6
6
|
import { n as isPslIdentifier } from "./tokenizer-BMz7z2KR-J0yZ4im3.mjs";
|
|
7
7
|
import { C as TaggedLiteralExprAst, S as StringLiteralExprAst, T as TypesBlockAst, _ as NumberLiteralExprAst, a as CompositeTypeDeclarationAst, b as PathExprAst, d as IdentifierAst, g as NamespaceDeclarationAst, i as BooleanLiteralExprAst, l as FunctionCallAst, m as ModelDeclarationAst, t as ArrayLiteralAst, u as GenericBlockDeclarationAst, y as ObjectLiteralExprAst } from "./declarations-DDT0hm5r-BZoOKiu1.mjs";
|
|
8
8
|
import { a as mapPslDiagnostics, c as readResolvedAttributes, i as keywordPslSpan, l as readResolvedConstructorCall, n as diagnosticFromSpan, o as nodePslSpan, r as diagnosticSource, s as readResolvedAttribute, t as createPslDiagnosticCollector } from "./resolve-C8PUf8zv-QAvnPhCt.mjs";
|
|
9
|
-
//#region ../../../1-framework/2-authoring/psl-parser/dist/symbol-table-
|
|
9
|
+
//#region ../../../1-framework/2-authoring/psl-parser/dist/symbol-table-C1ATzvmU.mjs
|
|
10
10
|
function* modelAttributeDescriptors(namespace) {
|
|
11
11
|
for (const value of Object.values(namespace)) {
|
|
12
12
|
if (isAuthoringModelAttributeDescriptor(value)) {
|
|
@@ -416,6 +416,11 @@ function bind(options) {
|
|
|
416
416
|
for (const declaration of namespace.declarations) {
|
|
417
417
|
declarations.set(declaration.node.syntax, namespace);
|
|
418
418
|
scopes.set(declaration.node.syntax, scope);
|
|
419
|
+
const declaredName = declaration.node.name()?.syntax;
|
|
420
|
+
if (declaredName !== void 0) references.set(declaredName, {
|
|
421
|
+
kind: "namespace",
|
|
422
|
+
symbol: namespace
|
|
423
|
+
});
|
|
419
424
|
}
|
|
420
425
|
for (const symbol of Object.values(namespace.blocks)) {
|
|
421
426
|
declarations.set(symbol.node.syntax, symbol);
|
package/dist/psl-parser.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"psl-parser.mjs","names":["#registry","#records","#namespace","#declarations","#references","#documentScope","#scopes","#base"],"sources":["../../../../1-framework/2-authoring/psl-parser/dist/symbol-table-BgS0X0JI.mjs","../../../../1-framework/2-authoring/psl-parser/dist/index.mjs"],"sourcesContent":["import { C as TaggedLiteralExprAst, D as IdentifierAst, S as StringLiteralExprAst, _ as FunctionCallAst, b as ObjectLiteralExprAst, c as NamespaceDeclarationAst, g as BooleanLiteralExprAst, i as GenericBlockDeclarationAst, l as TypesBlockAst, m as ArrayLiteralAst, o as ModelDeclarationAst, t as CompositeTypeDeclarationAst, v as NumberLiteralExprAst, x as PathExprAst } from \"./declarations-DDT0hm5r.mjs\";\nimport { a as readResolvedConstructorCall, c as diagnosticSource, i as readResolvedAttributes, n as nodePslSpan } from \"./resolve-C8PUf8zv.mjs\";\nimport { isAuthoringModelAttributeDescriptor, isAuthoringPslBlockDescriptor } from \"@internal/framework-components/authoring\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { InternalError } from \"@internal/utils/internal-error\";\n//#region src/attribute-spec/assemble.ts\nfunction* modelAttributeDescriptors(namespace) {\n\tfor (const value of Object.values(namespace)) {\n\t\tif (isAuthoringModelAttributeDescriptor(value)) {\n\t\t\tyield value;\n\t\t\tcontinue;\n\t\t}\n\t\tyield* modelAttributeDescriptors(value);\n\t}\n}\nfunction assembleAttributeSpecs(contributions) {\n\tconst entries = Object.entries(contributions.attributeSpecs.model);\n\tconst claimed = new Set(entries.map(([attribute]) => attribute));\n\tfor (const descriptor of modelAttributeDescriptors(contributions.modelAttributes)) {\n\t\tif (claimed.has(descriptor.attribute)) throw new InternalError(`Duplicate attribute spec registration for \"${descriptor.attribute}\". Each model attribute name may be registered once across family built-ins and model-attribute descriptors.`);\n\t\tclaimed.add(descriptor.attribute);\n\t\tentries.push([descriptor.attribute, descriptor.spec]);\n\t}\n\treturn Object.freeze(blindCast({\n\t\tmodel: Object.freeze(Object.fromEntries(entries)),\n\t\tfield: Object.freeze({ ...contributions.attributeSpecs.field })\n\t}));\n}\nfunction resolveDescribeUnsupportedAttribute(pslDiagnostics) {\n\tif (pslDiagnostics?.describeUnsupportedAttribute === void 0) return;\n\treturn blindCast(pslDiagnostics.describeUnsupportedAttribute);\n}\nfunction resolveDescribeUnresolvedType(pslDiagnostics) {\n\tif (pslDiagnostics?.describeUnresolvedType === void 0) return;\n\treturn blindCast(pslDiagnostics.describeUnresolvedType);\n}\n//#endregion\n//#region src/entity-reference.ts\nfunction writtenEntityReference(node) {\n\tconst name = IdentifierAst.cast(node)?.name();\n\tif (name !== void 0) return {\n\t\tnamespace: void 0,\n\t\tname\n\t};\n\tconst path = PathExprAst.cast(node)?.path();\n\tif (path === void 0 || path.length !== 2) return void 0;\n\tconst [namespace, member] = path;\n\treturn namespace === void 0 || member === void 0 ? void 0 : {\n\t\tnamespace,\n\t\tname: member\n\t};\n}\nfunction describeWrittenEntityReference(reference) {\n\treturn reference.namespace === void 0 ? reference.name : `${reference.namespace}.${reference.name}`;\n}\nconst references = /* @__PURE__ */ new WeakMap();\nfunction entityReference(resolution) {\n\tswitch (resolution.kind) {\n\t\tcase \"model\":\n\t\tcase \"compositeType\":\n\t\tcase \"namedType\":\n\t\tcase \"block\": return interned(resolution.symbol, resolution.namespace);\n\t\tdefault: return;\n\t}\n}\nfunction interned(declaration, namespace) {\n\tconst existing = references.get(declaration);\n\tif (existing !== void 0) return existing;\n\tconst reference = {\n\t\tdeclaration,\n\t\tnamespace\n\t};\n\treferences.set(declaration, reference);\n\treturn reference;\n}\nfunction matchesSelector(reference, expected) {\n\tconst declaration = reference.declaration;\n\tif (declaration.kind !== expected.kind) return false;\n\treturn expected.kind !== \"block\" || declaration.kind === \"block\" && declaration.keyword === expected.keyword;\n}\nfunction describeResolution(resolution) {\n\tswitch (resolution.kind) {\n\t\tcase \"block\": return resolution.symbol.keyword;\n\t\tcase \"contributedType\": return \"scalar type\";\n\t\tcase \"crossSpace\": return \"cross-space reference\";\n\t\tcase \"unresolved\": return \"unresolved name\";\n\t\tdefault: return resolution.kind;\n\t}\n}\n//#endregion\n//#region src/block-spec/descriptor.ts\nfunction blockSpecFactoryOf(descriptor) {\n\treturn blindCast(descriptor.spec);\n}\n//#endregion\n//#region src/contributed-type-scope.ts\nfunction isContributedTypeDescriptor(value) {\n\treturn \"kind\" in value && (value.kind === \"typeConstructor\" || value.kind === \"fieldPreset\");\n}\nfunction mergeContributedTypes(...namespaces) {\n\tconst merged = {};\n\tfor (const namespace of namespaces) for (const [name, value] of Object.entries(namespace)) {\n\t\tconst existing = Object.hasOwn(merged, name) ? merged[name] : void 0;\n\t\tmerged[name] = existing !== void 0 && !isContributedTypeDescriptor(existing) && !isContributedTypeDescriptor(value) ? mergeContributedTypes(existing, value) : value;\n\t}\n\treturn merged;\n}\nfunction contributedTypeScope(contributedTypes) {\n\tconst members = collect(contributedTypes, []);\n\treturn {\n\t\tlookup(name) {\n\t\t\treturn members.get(name);\n\t\t},\n\t\tentries() {\n\t\t\treturn members.entries();\n\t\t}\n\t};\n}\nfunction collect(namespace, prefix) {\n\tconst members = /* @__PURE__ */ new Map();\n\tfor (const [name, value] of Object.entries(namespace)) {\n\t\tconst path = [...prefix, name];\n\t\tmembers.set(name, isContributedTypeDescriptor(value) ? {\n\t\t\tkind: \"contributedType\",\n\t\t\tname,\n\t\t\tpath,\n\t\t\tdescriptor: value\n\t\t} : {\n\t\t\tkind: \"contributedNamespace\",\n\t\t\tname,\n\t\t\tpath,\n\t\t\tmembers: collect(value, path)\n\t\t});\n\t}\n\treturn members;\n}\n//#endregion\n//#region src/extension-block.ts\nfunction findBlockDescriptor(descriptors, keyword) {\n\tif (descriptors === void 0) return void 0;\n\tfor (const value of Object.values(descriptors)) {\n\t\tif (value === void 0) continue;\n\t\tif (isAuthoringPslBlockDescriptor(value)) {\n\t\t\tif (value.keyword === keyword) return value;\n\t\t\tcontinue;\n\t\t}\n\t\tconst nested = findBlockDescriptor(value, keyword);\n\t\tif (nested !== void 0) return nested;\n\t}\n}\n//#endregion\n//#region src/scope.ts\nfunction* recordNames(...records) {\n\tfor (const record of records) yield* Object.keys(record);\n}\nvar Scope = class {\n\tparent;\n\tconstructor(parent) {\n\t\tthis.parent = parent;\n\t}\n\t*entries() {\n\t\tconst seen = /* @__PURE__ */ new Set();\n\t\tfor (const name of this.ownNames()) {\n\t\t\tif (seen.has(name)) continue;\n\t\t\tseen.add(name);\n\t\t\tconst resolution = this.lookup(name);\n\t\t\tif (resolution !== void 0) yield [name, resolution];\n\t\t}\n\t\tfor (const entry of this.parent?.entries() ?? []) if (!seen.has(entry[0])) yield entry;\n\t}\n};\nfunction contributedResolution(member) {\n\treturn member.kind === \"contributedType\" ? {\n\t\tkind: \"contributedType\",\n\t\tsymbol: member\n\t} : {\n\t\tkind: \"contributedNamespace\",\n\t\tsymbol: member\n\t};\n}\nfunction namespaceMember(namespace, name) {\n\tconst model = namespace.models[name];\n\tif (model !== void 0) return {\n\t\tkind: \"model\",\n\t\tsymbol: model,\n\t\tnamespace\n\t};\n\tconst compositeType = namespace.compositeTypes[name];\n\tif (compositeType !== void 0) return {\n\t\tkind: \"compositeType\",\n\t\tsymbol: compositeType,\n\t\tnamespace\n\t};\n\tconst block = namespace.blocks[name];\n\tif (block !== void 0) return {\n\t\tkind: \"block\",\n\t\tsymbol: block,\n\t\tnamespace\n\t};\n}\nvar ContributedScope = class extends Scope {\n\t#registry;\n\tconstructor(registry) {\n\t\tsuper(void 0);\n\t\tthis.#registry = registry;\n\t}\n\tlookup(name) {\n\t\tconst member = this.#registry.lookup(name);\n\t\treturn member === void 0 ? void 0 : contributedResolution(member);\n\t}\n\t*ownNames() {\n\t\tfor (const [name] of this.#registry.entries()) yield name;\n\t}\n};\nvar DocumentScope = class extends Scope {\n\t#records;\n\tconstructor(records, parent) {\n\t\tsuper(parent);\n\t\tthis.#records = records;\n\t}\n\tlookup(name) {\n\t\tconst records = this.#records;\n\t\tconst model = records.models[name];\n\t\tif (model !== void 0) return {\n\t\t\tkind: \"model\",\n\t\t\tsymbol: model\n\t\t};\n\t\tconst compositeType = records.compositeTypes[name];\n\t\tif (compositeType !== void 0) return {\n\t\t\tkind: \"compositeType\",\n\t\t\tsymbol: compositeType\n\t\t};\n\t\tconst namedType = records.namedTypes[name];\n\t\tif (namedType !== void 0) return {\n\t\t\tkind: \"namedType\",\n\t\t\tsymbol: namedType\n\t\t};\n\t\tconst block = records.blocks[name];\n\t\tif (block !== void 0) return {\n\t\t\tkind: \"block\",\n\t\t\tsymbol: block\n\t\t};\n\t\tconst namespace = records.namespaces[name];\n\t\tif (namespace !== void 0) return {\n\t\t\tkind: \"namespace\",\n\t\t\tsymbol: namespace\n\t\t};\n\t\treturn this.parent?.lookup(name);\n\t}\n\townNames() {\n\t\tconst records = this.#records;\n\t\treturn recordNames(records.models, records.compositeTypes, records.namedTypes, records.blocks, records.namespaces);\n\t}\n};\nvar NamespaceScope = class extends Scope {\n\t#namespace;\n\tconstructor(namespace, parent) {\n\t\tsuper(parent);\n\t\tthis.#namespace = namespace;\n\t}\n\tlookup(name) {\n\t\treturn namespaceMember(this.#namespace, name) ?? this.parent?.lookup(name);\n\t}\n\townNames() {\n\t\tconst namespace = this.#namespace;\n\t\treturn recordNames(namespace.models, namespace.compositeTypes, namespace.blocks);\n\t}\n};\nfunction contributedScope(registry) {\n\treturn new ContributedScope(registry);\n}\nfunction documentScope(records, parent) {\n\treturn new DocumentScope(records, parent);\n}\nfunction namedTypeBaseScope(records, parent) {\n\treturn new DocumentScope({\n\t\t...records,\n\t\tnamedTypes: {}\n\t}, parent);\n}\nfunction namespaceScope(namespace, parent) {\n\treturn new NamespaceScope(namespace, parent);\n}\nfunction isNamespaceLike(resolution) {\n\treturn resolution.kind === \"namespace\" || resolution.kind === \"contributedNamespace\";\n}\nfunction* memberEntries(qualifier) {\n\tif (qualifier.kind === \"contributedNamespace\") {\n\t\tfor (const [name, member] of qualifier.symbol.members) yield [name, contributedResolution(member)];\n\t\treturn;\n\t}\n\tyield* new NamespaceScope(qualifier.symbol, void 0).entries();\n}\nfunction lookupMember(qualifier, name) {\n\tif (qualifier.kind === \"contributedNamespace\") {\n\t\tconst member = qualifier.symbol.members.get(name);\n\t\treturn member === void 0 ? void 0 : contributedResolution(member);\n\t}\n\treturn namespaceMember(qualifier.symbol, name);\n}\n//#endregion\n//#region src/binder.ts\nconst PSL_UNRESOLVED_REFERENCE = \"PSL_UNRESOLVED_REFERENCE\";\nfunction typeReferenceNode(symbol) {\n\treturn symbol.node.typeAnnotation()?.name()?.syntax;\n}\nfunction contributedTypeOf(resolution, binder) {\n\tconst base = resolution?.kind === \"namedType\" ? typeReferenceNode(resolution.symbol) : void 0;\n\tconst target = base === void 0 ? resolution : binder.symbolForNode(base);\n\treturn target?.kind === \"contributedType\" ? target.symbol : void 0;\n}\nvar PslBinder = class {\n\t#declarations;\n\t#references;\n\t#documentScope;\n\t#scopes;\n\tconstructor(declarations, references, documentScope, scopes) {\n\t\tthis.#declarations = declarations;\n\t\tthis.#references = references;\n\t\tthis.#documentScope = documentScope;\n\t\tthis.#scopes = scopes;\n\t}\n\tdeclaredSymbol(node) {\n\t\treturn this.#declarations.get(node);\n\t}\n\tsymbolForNode(node) {\n\t\treturn this.#references.get(node);\n\t}\n\tscopeAt(node) {\n\t\treturn node.findAncestor((ancestor) => this.#scopes.get(ancestor)) ?? this.#documentScope;\n\t}\n};\nvar ScopeStack = class {\n\t#base;\n\t#scopes;\n\tconstructor(base) {\n\t\tthis.#base = base;\n\t\tthis.#scopes = [base];\n\t}\n\tcurrent() {\n\t\treturn this.#scopes[this.#scopes.length - 1] ?? this.#base;\n\t}\n\tpush(scope) {\n\t\tthis.#scopes.push(scope);\n\t}\n\tpop() {\n\t\tthis.#scopes.pop();\n\t}\n};\nfunction walkEntities(symbolTable, stack, binder, visit) {\n\tconst { topLevel } = symbolTable;\n\tfor (const entity of Object.values(topLevel.models)) visit(entity);\n\tfor (const entity of Object.values(topLevel.compositeTypes)) visit(entity);\n\tfor (const namespace of Object.values(topLevel.namespaces)) {\n\t\tstack.push(binder.scopeAt(namespace.declarations[0].node.syntax));\n\t\tfor (const entity of Object.values(namespace.models)) visit(entity, namespace);\n\t\tfor (const entity of Object.values(namespace.compositeTypes)) visit(entity, namespace);\n\t\tstack.pop();\n\t}\n}\nfunction declarationResolution(entity, namespace) {\n\treturn entity.kind === \"model\" ? {\n\t\tkind: \"model\",\n\t\tsymbol: entity,\n\t\t...namespace === void 0 ? {} : { namespace }\n\t} : {\n\t\tkind: \"compositeType\",\n\t\tsymbol: entity,\n\t\t...namespace === void 0 ? {} : { namespace }\n\t};\n}\nfunction createBinder(input) {\n\tconst { symbolTable, sources, context } = input;\n\tconst contributions = context.authoringContributions;\n\tconst describeUnsupportedAttributeFactory = resolveDescribeUnsupportedAttribute(context.pslDiagnostics);\n\tconst describeUnresolvedTypeFactory = resolveDescribeUnresolvedType(context.pslDiagnostics);\n\treturn bind({\n\t\tsources,\n\t\tsymbolTable,\n\t\tcontributedTypes: mergeContributedTypes(contributions.field, contributions.type),\n\t\tattributeSpecs: assembleAttributeSpecs(contributions),\n\t\tpslBlockDescriptors: contributions.pslBlockDescriptors,\n\t\tcontrolMutationDefaults: {\n\t\t\tdefaultFunctionRegistry: context.controlMutationDefaults.defaultFunctionRegistry,\n\t\t\tdataTypeEntries: contributions.dataTypes\n\t\t},\n\t\t...describeUnsupportedAttributeFactory !== void 0 ? { describeUnsupportedAttribute: describeUnsupportedAttributeFactory(sources) } : {},\n\t\t...describeUnresolvedTypeFactory !== void 0 ? { describeUnresolvedType: describeUnresolvedTypeFactory(contributions) } : {}\n\t});\n}\nfunction bind(options) {\n\tconst { sources, symbolTable, contributedTypes, attributeSpecs, controlMutationDefaults, describeUnsupportedAttribute, describeUnresolvedType } = options;\n\tconst pslBlockDescriptors = options.pslBlockDescriptors ?? {};\n\tconst contributed = contributedScope(contributedTypeScope(contributedTypes));\n\tconst document = documentScope(symbolTable.topLevel, contributed);\n\tconst stack = new ScopeStack(document);\n\tconst scopes = /* @__PURE__ */ new WeakMap();\n\tconst declarations = /* @__PURE__ */ new WeakMap();\n\tconst references = /* @__PURE__ */ new WeakMap();\n\tconst diagnostics = [];\n\tconst binder = new PslBinder(declarations, references, document, scopes);\n\tconst baseScope = namedTypeBaseScope(symbolTable.topLevel, contributed);\n\tfor (const symbol of Object.values(symbolTable.topLevel.namedTypes)) {\n\t\tdeclarations.set(symbol.node.syntax, symbol);\n\t\tconst declaredName = symbol.node.name()?.syntax;\n\t\tif (declaredName !== void 0) references.set(declaredName, {\n\t\t\tkind: \"namedType\",\n\t\t\tsymbol\n\t\t});\n\t\tconst name = symbol.node.typeAnnotation()?.name();\n\t\tconst outcome = resolveTypeReference(name, baseScope, references);\n\t\tif (name === void 0 || outcome === void 0) continue;\n\t\treferences.set(name.syntax, outcome.resolution);\n\t}\n\tfor (const symbol of Object.values(symbolTable.topLevel.blocks)) {\n\t\tdeclarations.set(symbol.node.syntax, symbol);\n\t\tconst declaredName = symbol.node.name()?.syntax;\n\t\tif (declaredName !== void 0) references.set(declaredName, {\n\t\t\tkind: \"block\",\n\t\t\tsymbol\n\t\t});\n\t}\n\tfor (const namespace of Object.values(symbolTable.topLevel.namespaces)) {\n\t\tconst scope = namespaceScope(namespace, document);\n\t\tfor (const declaration of namespace.declarations) {\n\t\t\tdeclarations.set(declaration.node.syntax, namespace);\n\t\t\tscopes.set(declaration.node.syntax, scope);\n\t\t}\n\t\tfor (const symbol of Object.values(namespace.blocks)) {\n\t\t\tdeclarations.set(symbol.node.syntax, symbol);\n\t\t\tconst declaredName = symbol.node.name()?.syntax;\n\t\t\tif (declaredName !== void 0) references.set(declaredName, {\n\t\t\t\tkind: \"block\",\n\t\t\t\tsymbol,\n\t\t\t\tnamespace\n\t\t\t});\n\t\t}\n\t}\n\twalkEntities(symbolTable, stack, binder, (entity, namespace) => {\n\t\tdeclarations.set(entity.node.syntax, entity);\n\t\tconst declaredName = entity.node.name()?.syntax;\n\t\tif (declaredName !== void 0) references.set(declaredName, declarationResolution(entity, namespace));\n\t\tfor (const field of Object.values(entity.fields)) {\n\t\t\tdeclarations.set(field.node.syntax, field);\n\t\t\tconst fieldName = field.node.name()?.syntax;\n\t\t\tif (fieldName !== void 0) references.set(fieldName, {\n\t\t\t\tkind: \"field\",\n\t\t\t\tsymbol: field\n\t\t\t});\n\t\t\tconst node = typeReferenceNode(field);\n\t\t\tif (node === void 0) continue;\n\t\t\tconst name = field.node.typeAnnotation()?.name();\n\t\t\tconst outcome = resolveTypeReference(name, stack.current(), references, (written) => describeUnresolvedType?.({\n\t\t\t\tfield,\n\t\t\t\towner: entity,\n\t\t\t\twritten\n\t\t\t}));\n\t\t\tif (outcome === void 0) continue;\n\t\t\treferences.set(node, outcome.resolution);\n\t\t\tif (outcome.message !== void 0) diagnostics.push({\n\t\t\t\tcode: PSL_UNRESOLVED_REFERENCE,\n\t\t\t\tmessage: outcome.message,\n\t\t\t\tdata: {\n\t\t\t\t\treference: \"type\",\n\t\t\t\t\tname: outcome.name,\n\t\t\t\t\tconstructorCall: field.typeConstructor !== void 0\n\t\t\t\t},\n\t\t\t\t...diagnosticSource(sources, node).at()\n\t\t\t});\n\t\t}\n\t});\n\twalkEntities(symbolTable, stack, binder, (entity) => {\n\t\tconst context = {\n\t\t\towner: entity,\n\t\t\tscope: stack.current(),\n\t\t\treferences,\n\t\t\tdiagnostics,\n\t\t\tsymbolTable,\n\t\t\tsources,\n\t\t\tdescribeUnsupportedAttribute\n\t\t};\n\t\tconst specContext = entity.kind === \"model\" ? {\n\t\t\tsymbols: symbolTable,\n\t\t\tmodel: entity,\n\t\t\tcontrolMutationDefaults\n\t\t} : void 0;\n\t\tbindAttributes(entity, entity.attributes, attributeSpecs.model, (factory) => specContext === void 0 ? void 0 : factory(specContext), {\n\t\t\t...context,\n\t\t\tfield: void 0\n\t\t});\n\t\tfor (const field of Object.values(entity.fields)) bindAttributes(field, field.attributes, attributeSpecs.field, (factory) => {\n\t\t\tif (specContext === void 0) return void 0;\n\t\t\tconst node = typeReferenceNode(field);\n\t\t\tconst typeResolution = node === void 0 ? void 0 : references.get(node);\n\t\t\treturn factory({\n\t\t\t\t...specContext,\n\t\t\t\tfield,\n\t\t\t\ttypeResolution\n\t\t\t});\n\t\t}, {\n\t\t\t...context,\n\t\t\tfield\n\t\t});\n\t});\n\tconst blockContext = {\n\t\tpslBlockDescriptors,\n\t\tsymbolTable,\n\t\tsources,\n\t\treferences,\n\t\tdiagnostics\n\t};\n\tconst bindBlocks = (blocks) => {\n\t\tconst context = {\n\t\t\t...blockContext,\n\t\t\tscope: stack.current()\n\t\t};\n\t\tfor (const block of Object.values(blocks)) bindBlock(block, context);\n\t};\n\tbindBlocks(symbolTable.topLevel.blocks);\n\tfor (const namespace of Object.values(symbolTable.topLevel.namespaces)) {\n\t\tstack.push(binder.scopeAt(namespace.declarations[0].node.syntax));\n\t\tbindBlocks(namespace.blocks);\n\t\tstack.pop();\n\t}\n\treturn {\n\t\tbinder,\n\t\tdiagnostics\n\t};\n}\nfunction bindBlock(block, ctx) {\n\tconst descriptor = findBlockDescriptor(ctx.pslBlockDescriptors, block.keyword);\n\tif (descriptor === void 0) return;\n\tconst spec = blockSpecFactoryOf(descriptor)({ symbols: ctx.symbolTable });\n\tfor (const entry of block.node.entries()) {\n\t\tconst key = entry.key()?.name();\n\t\tif (key === void 0) continue;\n\t\tconst parameter = spec.mode === \"struct\" && Object.hasOwn(spec.parameters, key) ? spec.parameters[key] : void 0;\n\t\tconst rule = spec.mode === \"struct\" ? parameter?.type : spec.value.type;\n\t\tif (parameter !== void 0) {\n\t\t\tconst keyNode = entry.key()?.syntax;\n\t\t\tif (keyNode !== void 0) ctx.references.set(keyNode, {\n\t\t\t\tkind: \"parameter\",\n\t\t\t\tsymbol: {\n\t\t\t\t\tkind: \"parameter\",\n\t\t\t\t\tname: key,\n\t\t\t\t\tparam: parameter\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tconst value = entry.value();\n\t\tif (rule === void 0 || value === void 0) continue;\n\t\tbindExpression(rule, value, ctx);\n\t}\n\tconst attributeSpecs = descriptor.attributes ?? {};\n\tif (Object.keys(attributeSpecs).length === 0) return;\n\tfor (const attribute of readResolvedAttributes(block.node.attributes(), ctx.sources)) {\n\t\tconst factory = attributeSpecs[attribute.name];\n\t\tif (factory === void 0) continue;\n\t\tconst attributeSpec = blindCast(factory)({ symbols: ctx.symbolTable });\n\t\tconst attributeSymbol = {\n\t\t\tkind: \"attribute\",\n\t\t\tname: attribute.name,\n\t\t\tlevel: \"block\",\n\t\t\tspec: attributeSpec\n\t\t};\n\t\tconst nameNode = attribute.node.name()?.syntax;\n\t\tif (nameNode !== void 0) ctx.references.set(nameNode, {\n\t\t\tkind: \"attribute\",\n\t\t\tsymbol: attributeSymbol\n\t\t});\n\t\tbindArguments(attribute, attributeSpec, ctx);\n\t}\n}\nfunction bindExpression(rule, expression, ctx, modelContext) {\n\tconst trial = tryBindExpression(rule, expression, ctx, modelContext);\n\tfor (const [node, resolution] of trial.references) ctx.references.set(node, resolution);\n\tctx.diagnostics.push(...trial.diagnostics.values());\n}\nfunction tryBindExpression(rule, expression, ctx, modelContext) {\n\tconst references = /* @__PURE__ */ new Map();\n\tconst diagnostics = /* @__PURE__ */ new Map();\n\tswitch (rule.kind) {\n\t\tcase \"oneOf\":\n\t\t\tfor (const alternative of rule.alternatives) {\n\t\t\t\tconst trial = tryBindExpression(alternative, expression, ctx, modelContext);\n\t\t\t\tif (trial.matched) return trial;\n\t\t\t\tfor (const [node, diagnostic] of trial.diagnostics) diagnostics.set(node, diagnostic);\n\t\t\t\tfor (const [node, resolution] of trial.references) if (resolution.kind === \"unresolved\") references.set(node, resolution);\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tmatched: false,\n\t\t\t\treferences,\n\t\t\t\tdiagnostics\n\t\t\t};\n\t\tcase \"list\":\n\t\tcase \"record\": {\n\t\t\tconst children = rule.kind === \"list\" ? ArrayLiteralAst.cast(expression.syntax)?.elements() : recordValues(expression);\n\t\t\tif (children === void 0) return {\n\t\t\t\tmatched: false,\n\t\t\t\treferences,\n\t\t\t\tdiagnostics\n\t\t\t};\n\t\t\tlet matched = true;\n\t\t\tfor (const child of children) {\n\t\t\t\tconst trial = tryBindExpression(rule.of, child, ctx, modelContext);\n\t\t\t\tmatched = trial.matched && matched;\n\t\t\t\tfor (const [node, resolution] of trial.references) references.set(node, resolution);\n\t\t\t\tfor (const [node, diagnostic] of trial.diagnostics) diagnostics.set(node, diagnostic);\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tmatched,\n\t\t\t\treferences,\n\t\t\t\tdiagnostics\n\t\t\t};\n\t\t}\n\t\tcase \"funcCall\": {\n\t\t\tconst call = FunctionCallAst.cast(expression.syntax);\n\t\t\tconst name = call?.name();\n\t\t\tif (call === void 0 || name === void 0 || name.dot() !== void 0 || name.colon() !== void 0 || name.identifier()?.name() !== rule.name) return {\n\t\t\t\tmatched: false,\n\t\t\t\treferences,\n\t\t\t\tdiagnostics\n\t\t\t};\n\t\t\tconst functionSymbol = {\n\t\t\t\tkind: \"function\",\n\t\t\t\tname: rule.name,\n\t\t\t\tsignature: rule.signature\n\t\t\t};\n\t\t\treferences.set(name.syntax, {\n\t\t\t\tkind: \"function\",\n\t\t\t\tsymbol: functionSymbol\n\t\t\t});\n\t\t\tlet matched = true;\n\t\t\tlet positional = 0;\n\t\t\tfor (const arg of call.args()) {\n\t\t\t\tconst key = arg.name()?.name();\n\t\t\t\tconst parameter = argumentParameter(rule.signature, key, key === void 0 ? positional++ : positional);\n\t\t\t\tif (parameter === void 0) {\n\t\t\t\t\tmatched = false;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (key !== void 0) {\n\t\t\t\t\tconst keyNode = arg.name()?.syntax;\n\t\t\t\t\tif (keyNode !== void 0) references.set(keyNode, {\n\t\t\t\t\t\tkind: \"parameter\",\n\t\t\t\t\t\tsymbol: {\n\t\t\t\t\t\t\tkind: \"parameter\",\n\t\t\t\t\t\t\tname: key,\n\t\t\t\t\t\t\tparam: parameter\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tconst value = arg.value();\n\t\t\t\tif (value === void 0) {\n\t\t\t\t\tmatched = false;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst trial = tryBindExpression(parameter.type, value, ctx, modelContext);\n\t\t\t\tmatched = trial.matched && matched;\n\t\t\t\tfor (const [node, resolution] of trial.references) references.set(node, resolution);\n\t\t\t\tfor (const [node, diagnostic] of trial.diagnostics) diagnostics.set(node, diagnostic);\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tmatched,\n\t\t\t\treferences,\n\t\t\t\tdiagnostics\n\t\t\t};\n\t\t}\n\t\tcase \"identifier\": {\n\t\t\tif (rule.name === void 0) return {\n\t\t\t\tmatched: true,\n\t\t\t\treferences,\n\t\t\t\tdiagnostics\n\t\t\t};\n\t\t\tconst node = expression.syntax;\n\t\t\tif (IdentifierAst.cast(node)?.name() !== rule.name) return {\n\t\t\t\tmatched: false,\n\t\t\t\treferences,\n\t\t\t\tdiagnostics\n\t\t\t};\n\t\t\treferences.set(node, {\n\t\t\t\tkind: \"constant\",\n\t\t\t\tsymbol: {\n\t\t\t\t\tkind: \"constant\",\n\t\t\t\t\tname: rule.name,\n\t\t\t\t\tdocumentation: rule.documentation\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn {\n\t\t\t\tmatched: true,\n\t\t\t\treferences,\n\t\t\t\tdiagnostics\n\t\t\t};\n\t\t}\n\t\tcase \"entityRef\": {\n\t\t\tconst node = expression.syntax;\n\t\t\tconst written = writtenEntityReference(node);\n\t\t\tif (written === void 0) return {\n\t\t\t\tmatched: false,\n\t\t\t\treferences,\n\t\t\t\tdiagnostics\n\t\t\t};\n\t\t\tconst failures = [];\n\t\t\tconst resolution = resolveEntity(written, node, {\n\t\t\t\t...ctx,\n\t\t\t\tdiagnostics: failures\n\t\t\t});\n\t\t\treferences.set(node, resolution);\n\t\t\tfor (const diagnostic of failures) diagnostics.set(node, diagnostic);\n\t\t\treturn {\n\t\t\t\tmatched: resolution.kind !== \"unresolved\",\n\t\t\t\treferences,\n\t\t\t\tdiagnostics\n\t\t\t};\n\t\t}\n\t\tcase \"fieldRef\": {\n\t\t\tconst node = expression.syntax;\n\t\t\tconst name = IdentifierAst.cast(node)?.name();\n\t\t\tif (name === void 0 || modelContext === void 0) return {\n\t\t\t\tmatched: false,\n\t\t\t\treferences,\n\t\t\t\tdiagnostics\n\t\t\t};\n\t\t\tconst failures = [];\n\t\t\tconst resolution = resolveOwnerField(name, node, {\n\t\t\t\t...modelContext,\n\t\t\t\tdiagnostics: failures\n\t\t\t});\n\t\t\treferences.set(node, resolution);\n\t\t\tfor (const diagnostic of failures) diagnostics.set(node, diagnostic);\n\t\t\treturn {\n\t\t\t\tmatched: resolution.kind !== \"unresolved\",\n\t\t\t\treferences,\n\t\t\t\tdiagnostics\n\t\t\t};\n\t\t}\n\t\tcase \"referencedFieldRef\": {\n\t\t\tconst node = expression.syntax;\n\t\t\tconst name = IdentifierAst.cast(node)?.name();\n\t\t\tif (name === void 0 || modelContext === void 0) return {\n\t\t\t\tmatched: false,\n\t\t\t\treferences,\n\t\t\t\tdiagnostics\n\t\t\t};\n\t\t\tconst failures = [];\n\t\t\tconst resolution = resolveReferencedField(name, node, {\n\t\t\t\t...modelContext,\n\t\t\t\tdiagnostics: failures\n\t\t\t});\n\t\t\treferences.set(node, resolution);\n\t\t\tfor (const diagnostic of failures) diagnostics.set(node, diagnostic);\n\t\t\treturn {\n\t\t\t\tmatched: resolution.kind !== \"unresolved\",\n\t\t\t\treferences,\n\t\t\t\tdiagnostics\n\t\t\t};\n\t\t}\n\t\tcase \"str\":\n\t\tcase \"json\": return {\n\t\t\tmatched: StringLiteralExprAst.cast(expression.syntax) !== void 0,\n\t\t\treferences,\n\t\t\tdiagnostics\n\t\t};\n\t\tcase \"num\":\n\t\tcase \"int\": return {\n\t\t\tmatched: NumberLiteralExprAst.cast(expression.syntax) !== void 0,\n\t\t\treferences,\n\t\t\tdiagnostics\n\t\t};\n\t\tcase \"bool\": return {\n\t\t\tmatched: BooleanLiteralExprAst.cast(expression.syntax) !== void 0,\n\t\t\treferences,\n\t\t\tdiagnostics\n\t\t};\n\t\tcase \"null\": return {\n\t\t\tmatched: IdentifierAst.cast(expression.syntax)?.name() === \"null\",\n\t\t\treferences,\n\t\t\tdiagnostics\n\t\t};\n\t\tcase \"taggedLiteral\": return {\n\t\t\tmatched: TaggedLiteralExprAst.cast(expression.syntax) !== void 0,\n\t\t\treferences,\n\t\t\tdiagnostics\n\t\t};\n\t\tcase \"rejecting\": return {\n\t\t\tmatched: false,\n\t\t\treferences,\n\t\t\tdiagnostics\n\t\t};\n\t}\n}\nfunction recordValues(expression) {\n\tconst record = ObjectLiteralExprAst.cast(expression.syntax);\n\tif (record === void 0) return void 0;\n\treturn (function* () {\n\t\tfor (const field of record.fields()) {\n\t\t\tconst value = field.value();\n\t\t\tif (value !== void 0) yield value;\n\t\t}\n\t})();\n}\nfunction bindAttributes(holder, attributes, specs, instantiate, ctx) {\n\tconst declared = holder.node.attributes();\n\tconst nodes = Array.from(declared);\n\tconst level = holder.kind === \"field\" ? \"field\" : \"model\";\n\tattributes.forEach((attribute, index) => {\n\t\tconst factory = own(specs, attribute.name);\n\t\tif (factory === void 0) {\n\t\t\tconst diagnostic = ctx.describeUnsupportedAttribute?.({\n\t\t\t\tattribute,\n\t\t\t\tlevel,\n\t\t\t\towner: ctx.owner,\n\t\t\t\tfield: level === \"field\" ? ctx.field : void 0\n\t\t\t});\n\t\t\tif (diagnostic !== void 0) ctx.diagnostics.push(diagnostic);\n\t\t\treturn;\n\t\t}\n\t\tconst spec = instantiate(factory);\n\t\tif (spec === void 0) return;\n\t\tconst attributeSymbol = {\n\t\t\tkind: \"attribute\",\n\t\t\tname: attribute.name,\n\t\t\tlevel,\n\t\t\tspec\n\t\t};\n\t\tconst nameNode = nodes[index]?.name()?.syntax;\n\t\tif (nameNode !== void 0) ctx.references.set(nameNode, {\n\t\t\tkind: \"attribute\",\n\t\t\tsymbol: attributeSymbol\n\t\t});\n\t\tbindArguments(attribute, spec, ctx, ctx);\n\t});\n}\nfunction bindArguments(attribute, spec, ctx, modelContext) {\n\tconst rawArgs = Array.from(attribute.node.argList()?.args() ?? []);\n\tlet positional = 0;\n\tattribute.args.forEach((arg, index) => {\n\t\tconst parameter = argumentParameter(spec, arg.name, arg.name === void 0 ? positional++ : positional);\n\t\tif (parameter === void 0) return;\n\t\tif (arg.name !== void 0) {\n\t\t\tconst keyNode = rawArgs[index]?.name()?.syntax;\n\t\t\tif (keyNode !== void 0) ctx.references.set(keyNode, {\n\t\t\t\tkind: \"parameter\",\n\t\t\t\tsymbol: {\n\t\t\t\t\tkind: \"parameter\",\n\t\t\t\t\tname: arg.name,\n\t\t\t\t\tparam: parameter\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tif (arg.expression === void 0) return;\n\t\tbindExpression(parameter.type, arg.expression, ctx, modelContext);\n\t});\n}\nfunction argumentParameter(spec, name, position) {\n\tif (name === void 0) return spec.positional?.[position];\n\treturn spec.named === void 0 ? void 0 : own(spec.named, name);\n}\nfunction resolveOwnerField(name, node, ctx) {\n\tconst field = ctx.owner.fields[name];\n\tif (field !== void 0) return {\n\t\tkind: \"field\",\n\t\tsymbol: field\n\t};\n\treport(`Cannot find field \"${name}\" on \"${ctx.owner.name}\"`, node, ctx, \"field\");\n\treturn {\n\t\tkind: \"unresolved\",\n\t\tname\n\t};\n}\nfunction resolveReferencedField(name, node, ctx) {\n\tconst declaring = ctx.field;\n\tif (declaring === void 0) return {\n\t\tkind: \"unresolved\",\n\t\tname\n\t};\n\tif (declaring.typeContractSpaceId !== void 0) return { kind: \"crossSpace\" };\n\tconst typeNode = typeReferenceNode(declaring);\n\tconst field = targetFields(typeNode === void 0 ? void 0 : ctx.references.get(typeNode))?.[name];\n\tif (field !== void 0) return {\n\t\tkind: \"field\",\n\t\tsymbol: field\n\t};\n\treport(`Cannot find field \"${name}\" on the type of \"${ctx.owner.name}.${declaring.name}\"`, node, ctx, \"field\");\n\treturn {\n\t\tkind: \"unresolved\",\n\t\tname\n\t};\n}\nfunction targetFields(target) {\n\tif (target === void 0) return void 0;\n\tif (target.kind === \"model\" || target.kind === \"compositeType\") return target.symbol.fields;\n}\nfunction resolveEntity(written, node, ctx) {\n\tconst found = written.namespace === void 0 ? ctx.scope.lookup(written.name) : qualifiedMember(written.namespace, written.name, bindQualifier(entityQualifier(node), ctx.scope, ctx.references));\n\tif (found === void 0) {\n\t\tconst name = describeWrittenEntityReference(written);\n\t\tif (written.name !== \"\") report(`Cannot find entity \"${name}\"`, node, ctx, \"entity\");\n\t\treturn {\n\t\t\tkind: \"unresolved\",\n\t\t\tname\n\t\t};\n\t}\n\tif (\"badQualifier\" in found) {\n\t\treport(found.badQualifier, node, ctx, \"entity\");\n\t\treturn {\n\t\t\tkind: \"unresolved\",\n\t\t\tname: found.qualifier\n\t\t};\n\t}\n\treturn found;\n}\nfunction report(message, node, ctx, reference) {\n\tctx.diagnostics.push({\n\t\tcode: PSL_UNRESOLVED_REFERENCE,\n\t\tmessage,\n\t\tdata: { reference },\n\t\t...diagnosticSource(ctx.sources, node).at()\n\t});\n}\nfunction entityQualifier(node) {\n\tconst path = PathExprAst.cast(node);\n\tif (path === void 0) return void 0;\n\tconst [qualifier] = path.segments();\n\treturn qualifier;\n}\nfunction bindQualifier(qualifier, scope, references) {\n\tconst id = qualifier?.name();\n\tif (qualifier === void 0 || id === void 0) return void 0;\n\tconst resolution = scope.lookup(id);\n\tif (resolution !== void 0 && isNamespaceLike(resolution)) references.set(qualifier.syntax, resolution);\n\treturn resolution;\n}\nfunction resolveTypeReference(reference, scope, references, describeUnresolved) {\n\tif (reference === void 0 || reference.isOverQualified()) return void 0;\n\tif (reference.space() !== void 0) return { resolution: { kind: \"crossSpace\" } };\n\tconst name = reference.identifier()?.name();\n\tif (name === void 0 || name === \"\") return void 0;\n\tconst qualifier = reference.namespace();\n\tconst namespaceId = qualifier?.name();\n\tconst found = namespaceId === void 0 ? scope.lookup(name) : qualifiedMember(namespaceId, name, bindQualifier(qualifier, scope, references));\n\tif (found === void 0) {\n\t\tconst written = namespaceId === void 0 ? name : `${namespaceId}.${name}`;\n\t\tconst message = describeUnresolved?.(written) ?? `Cannot find type \"${written}\"`;\n\t\treturn {\n\t\t\tresolution: {\n\t\t\t\tkind: \"unresolved\",\n\t\t\t\tname: written\n\t\t\t},\n\t\t\tmessage,\n\t\t\tname: written\n\t\t};\n\t}\n\tif (\"badQualifier\" in found) return {\n\t\tresolution: {\n\t\t\tkind: \"unresolved\",\n\t\t\tname: found.qualifier\n\t\t},\n\t\tmessage: found.badQualifier,\n\t\tname: found.qualifier\n\t};\n\tif (found.kind === \"namespace\" || found.kind === \"contributedNamespace\") {\n\t\tconst written = namespaceId === void 0 ? name : `${namespaceId}.${name}`;\n\t\treturn {\n\t\t\tresolution: found,\n\t\t\tmessage: `\"${written}\" is a namespace; a type reference must name a model, composite type, enum, or named type`,\n\t\t\tname: written\n\t\t};\n\t}\n\treturn { resolution: found };\n}\nfunction qualifiedMember(namespaceId, name, qualifier) {\n\tif (qualifier === void 0) return void 0;\n\tif (!isNamespaceLike(qualifier)) return {\n\t\tbadQualifier: `\"${namespaceId}\" is ${describeQualifier(qualifier)}, not a namespace`,\n\t\tqualifier: namespaceId\n\t};\n\treturn lookupMember(qualifier, name);\n}\nfunction describeQualifier(resolution) {\n\tswitch (resolution.kind) {\n\t\tcase \"model\": return \"a model\";\n\t\tcase \"compositeType\": return \"a composite type\";\n\t\tcase \"namedType\": return \"a named type\";\n\t\tcase \"block\": return `${resolution.symbol.keyword === \"enum\" ? \"an\" : \"a\"} ${resolution.symbol.keyword}`;\n\t\tdefault: return \"a scalar type\";\n\t}\n}\nfunction own(record, name) {\n\treturn Object.hasOwn(record, name) ? record[name] : void 0;\n}\n//#endregion\n//#region src/symbol-table.ts\n/**\n* Owns duplicate-declaration detection for all PSL scopes; downstream consumers\n* should consume first-wins symbols rather than re-emitting duplicate diagnostics.\n*/\nfunction buildSymbolTable(options) {\n\tconst { documents, sources } = options;\n\tconst diagnostics = [];\n\tconst namespaces = Object.create(null);\n\tconst namedTypes = Object.create(null);\n\tconst blocks = Object.create(null);\n\tconst models = Object.create(null);\n\tconst compositeTypes = Object.create(null);\n\tconst topLevelNames = /* @__PURE__ */ new Set();\n\tfor (const document of documents) {\n\t\tconst sourceFile = sources.sourceFileFor(document.syntax);\n\t\tconst claim = (taken, name) => {\n\t\t\tconst text = name?.name();\n\t\t\tif (text === void 0) return void 0;\n\t\t\tif (taken.has(text)) {\n\t\t\t\tconst range = nameRange(name, sources);\n\t\t\t\tif (range) diagnostics.push({\n\t\t\t\t\tcode: \"PSL_DUPLICATE_DECLARATION\",\n\t\t\t\t\tmessage: `Duplicate declaration of \"${text}\"`,\n\t\t\t\t\tfilename: sourceFile.filename,\n\t\t\t\t\trange\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttaken.add(text);\n\t\t\treturn text;\n\t\t};\n\t\tfor (const declaration of document.declarations()) if (declaration instanceof ModelDeclarationAst) {\n\t\t\tconst name = claim(topLevelNames, declaration.name());\n\t\t\tif (name !== void 0) models[name] = buildModel(name, declaration, sources, diagnostics);\n\t\t} else if (declaration instanceof CompositeTypeDeclarationAst) {\n\t\t\tconst name = claim(topLevelNames, declaration.name());\n\t\t\tif (name !== void 0) compositeTypes[name] = buildCompositeType(name, declaration, sources, diagnostics);\n\t\t} else if (declaration instanceof GenericBlockDeclarationAst) {\n\t\t\tconst name = claim(topLevelNames, declaration.name());\n\t\t\tif (name !== void 0) blocks[name] = buildBlock(name, declaration, sources);\n\t\t} else if (declaration instanceof NamespaceDeclarationAst) {\n\t\t\tconst declaredName = declaration.name()?.name();\n\t\t\tif (declaredName === void 0) continue;\n\t\t\tlet namespace = namespaces[declaredName];\n\t\t\tif (namespace === void 0) {\n\t\t\t\tconst name = claim(topLevelNames, declaration.name());\n\t\t\t\tif (name === void 0) continue;\n\t\t\t\tnamespace = {\n\t\t\t\t\tkind: \"namespace\",\n\t\t\t\t\tname,\n\t\t\t\t\tdeclarations: [{\n\t\t\t\t\t\tnode: declaration,\n\t\t\t\t\t\tspan: nodePslSpan(declaration.syntax, sources)\n\t\t\t\t\t}],\n\t\t\t\t\tmodels: Object.create(null),\n\t\t\t\t\tcompositeTypes: Object.create(null),\n\t\t\t\t\tblocks: Object.create(null)\n\t\t\t\t};\n\t\t\t\tnamespaces[name] = namespace;\n\t\t\t} else namespace.declarations.push({\n\t\t\t\tnode: declaration,\n\t\t\t\tspan: nodePslSpan(declaration.syntax, sources)\n\t\t\t});\n\t\t\textendNamespace(namespace, declaration, diagnostics, sources);\n\t\t} else if (declaration instanceof TypesBlockAst) for (const binding of declaration.declarations()) {\n\t\t\tconst name = claim(topLevelNames, binding.name());\n\t\t\tif (name === void 0) continue;\n\t\t\tconst resolved = resolveNamedTypeBinding(binding, sources);\n\t\t\tnamedTypes[name] = {\n\t\t\t\tkind: \"namedType\",\n\t\t\t\tname,\n\t\t\t\tnode: binding,\n\t\t\t\tspan: nodePslSpan(binding.syntax, sources),\n\t\t\t\t...resolved\n\t\t\t};\n\t\t}\n\t}\n\treturn {\n\t\tsymbolTable: { topLevel: {\n\t\t\tnamespaces,\n\t\t\tnamedTypes,\n\t\t\tblocks,\n\t\t\tmodels,\n\t\t\tcompositeTypes\n\t\t} },\n\t\tdiagnostics\n\t};\n}\nfunction buildModel(name, node, sources, diagnostics) {\n\treturn {\n\t\tkind: \"model\",\n\t\tname,\n\t\tnode,\n\t\tspan: nodePslSpan(node.syntax, sources),\n\t\tfields: buildFields(name, node.fields(), sources, diagnostics),\n\t\tattributes: readResolvedAttributes(node.attributes(), sources)\n\t};\n}\nfunction buildCompositeType(name, node, sources, diagnostics) {\n\treturn {\n\t\tkind: \"compositeType\",\n\t\tname,\n\t\tnode,\n\t\tspan: nodePslSpan(node.syntax, sources),\n\t\tfields: buildFields(name, node.fields(), sources, diagnostics),\n\t\tattributes: readResolvedAttributes(node.attributes(), sources)\n\t};\n}\nfunction buildBlock(name, node, sources) {\n\treturn {\n\t\tkind: \"block\",\n\t\tname,\n\t\tkeyword: node.keyword()?.text ?? \"\",\n\t\tnode,\n\t\tspan: nodePslSpan(node.syntax, sources)\n\t};\n}\nfunction extendNamespace(namespace, node, diagnostics, sources) {\n\tconst { models, compositeTypes, blocks } = namespace;\n\tfor (const member of node.declarations()) {\n\t\tconst memberName = member.name()?.name();\n\t\tif (memberName === void 0) continue;\n\t\tif (Object.hasOwn(models, memberName) || Object.hasOwn(compositeTypes, memberName) || Object.hasOwn(blocks, memberName)) {\n\t\t\tconst range = nameRange(member.name(), sources);\n\t\t\tif (range) diagnostics.push({\n\t\t\t\tcode: \"PSL_DUPLICATE_DECLARATION\",\n\t\t\t\tmessage: `Duplicate declaration of \"${memberName}\"`,\n\t\t\t\tfilename: sources.sourceFileFor(member.syntax).filename,\n\t\t\t\trange\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (member instanceof ModelDeclarationAst) models[memberName] = buildModel(memberName, member, sources, diagnostics);\n\t\telse if (member instanceof CompositeTypeDeclarationAst) compositeTypes[memberName] = buildCompositeType(memberName, member, sources, diagnostics);\n\t\telse if (member instanceof GenericBlockDeclarationAst) blocks[memberName] = buildBlock(memberName, member, sources);\n\t}\n}\nfunction buildFields(ownerName, fields, sources, diagnostics) {\n\tconst result = Object.create(null);\n\tfor (const field of fields) {\n\t\tconst nameNode = field.name();\n\t\tconst name = nameNode?.name();\n\t\tif (name === void 0) continue;\n\t\tif (Object.hasOwn(result, name)) {\n\t\t\tconst range = nameRange(nameNode, sources);\n\t\t\tif (range) diagnostics.push({\n\t\t\t\tcode: \"PSL_DUPLICATE_DECLARATION\",\n\t\t\t\tmessage: `Duplicate declaration of \"${name}\"`,\n\t\t\t\tfilename: sources.sourceFileFor(field.syntax).filename,\n\t\t\t\trange\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tresult[name] = buildField(ownerName, name, field, sources, diagnostics);\n\t}\n\treturn result;\n}\nfunction buildField(ownerName, name, node, sources, diagnostics) {\n\tconst attributes = readResolvedAttributes(node.attributes(), sources);\n\tconst span = nodePslSpan(node.syntax, sources);\n\tconst annotation = node.typeAnnotation();\n\tconst typeName = annotation?.name();\n\tif (typeName?.isOverQualified()) {\n\t\tconst path = typeName.path();\n\t\tdiagnostics.push({\n\t\t\tcode: \"PSL_INVALID_QUALIFIED_TYPE\",\n\t\t\tmessage: `Field \"${ownerName}.${name}\" has an invalid qualified type \"${path.join(\".\")}\"; use at most one namespace qualifier (e.g. \"ns.TypeName\")`,\n\t\t\tfilename: sources.sourceFileFor(typeName.syntax).filename,\n\t\t\trange: nodeRange(typeName.syntax, sources)\n\t\t});\n\t\treturn {\n\t\t\tkind: \"field\",\n\t\t\tname,\n\t\t\tnode,\n\t\t\tspan,\n\t\t\ttypeName: path[path.length - 1] ?? \"\",\n\t\t\toptional: false,\n\t\t\tlist: false,\n\t\t\telementOptional: false,\n\t\t\tmalformedType: true,\n\t\t\tattributes\n\t\t};\n\t}\n\tconst typeConstructor = annotation?.isConstructor() ? readResolvedConstructorCall(annotation, sources) : void 0;\n\tconst typeNamespaceId = typeName?.namespace()?.name();\n\tconst typeContractSpaceId = typeName?.space()?.name();\n\treturn {\n\t\tkind: \"field\",\n\t\tname,\n\t\tnode,\n\t\tspan,\n\t\ttypeName: typeName?.identifier()?.name() ?? \"\",\n\t\t...typeNamespaceId !== void 0 ? { typeNamespaceId } : {},\n\t\t...typeContractSpaceId !== void 0 ? { typeContractSpaceId } : {},\n\t\toptional: annotation?.isOptional() ?? false,\n\t\tlist: annotation?.isList() ?? false,\n\t\telementOptional: annotation?.isElementOptional() ?? false,\n\t\t...typeConstructor !== void 0 ? { typeConstructor } : {},\n\t\tattributes\n\t};\n}\nfunction resolveNamedTypeBinding(node, sources) {\n\tconst annotation = node.typeAnnotation();\n\tconst isConstructor = annotation?.isConstructor() ?? false;\n\tconst baseType = annotation?.name()?.identifier()?.name();\n\tconst typeConstructor = readResolvedConstructorCall(annotation, sources);\n\treturn {\n\t\tisConstructor,\n\t\t...!isConstructor && baseType !== void 0 ? { baseType } : {},\n\t\t...typeConstructor !== void 0 ? { typeConstructor } : {},\n\t\tattributes: readResolvedAttributes(node.attributes(), sources)\n\t};\n}\nfunction nameRange(name, sources) {\n\tif (name === void 0) return void 0;\n\tconst sourceFile = sources.sourceFileFor(name.syntax);\n\tfor (const token of name.syntax.tokens()) if (token.kind === \"Ident\") return {\n\t\tstart: sourceFile.positionAt(token.offset),\n\t\tend: sourceFile.positionAt(token.offset + token.text.length)\n\t};\n}\nfunction nodeRange(node, sources) {\n\tconst sourceFile = sources.sourceFileFor(node);\n\tconst start = node.offset;\n\tconst end = start + node.green.textLength;\n\treturn {\n\t\tstart: sourceFile.positionAt(start),\n\t\tend: sourceFile.positionAt(end)\n\t};\n}\n//#endregion\nexport { typeReferenceNode as a, findBlockDescriptor as c, describeWrittenEntityReference as d, entityReference as f, assembleAttributeSpecs as h, createBinder as i, blockSpecFactoryOf as l, writtenEntityReference as m, PSL_UNRESOLVED_REFERENCE as n, isNamespaceLike as o, matchesSelector as p, contributedTypeOf as r, memberEntries as s, buildSymbolTable as t, describeResolution as u };\n\n//# sourceMappingURL=symbol-table-BgS0X0JI.mjs.map","import { a as typeReferenceNode, c as findBlockDescriptor, d as describeWrittenEntityReference, f as entityReference, h as assembleAttributeSpecs, i as createBinder, l as blockSpecFactoryOf, m as writtenEntityReference, n as PSL_UNRESOLVED_REFERENCE, o as isNamespaceLike, p as matchesSelector, r as contributedTypeOf, s as memberEntries, t as buildSymbolTable, u as describeResolution } from \"./symbol-table-BgS0X0JI.mjs\";\nimport { n as isPslIdentifier } from \"./tokenizer-BMz7z2KR.mjs\";\nimport { C as TaggedLiteralExprAst, D as IdentifierAst, S as StringLiteralExprAst, _ as FunctionCallAst, b as ObjectLiteralExprAst, g as BooleanLiteralExprAst, m as ArrayLiteralAst, v as NumberLiteralExprAst } from \"./declarations-DDT0hm5r.mjs\";\nimport { a as readResolvedConstructorCall, c as diagnosticSource, i as readResolvedAttributes, l as mapPslDiagnostics, n as nodePslSpan, o as createPslDiagnosticCollector, r as readResolvedAttribute, s as diagnosticFromSpan, t as keywordPslSpan } from \"./resolve-C8PUf8zv.mjs\";\nimport { flatPslModels, namespacePslExtensionBlocks } from \"@internal/framework-components/psl-ast\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { and, notOk, ok, okVoid, or } from \"@internal/utils/result\";\n//#region src/attribute-helpers.ts\nfunction getPositionalArgument(attribute, index = 0) {\n\treturn attribute.args.filter((arg) => arg.kind === \"positional\")[index]?.value;\n}\nfunction parseQuotedStringLiteral(value) {\n\tconst match = value.trim().match(/^(['\"])(.*)\\1$/);\n\tif (!match) return void 0;\n\treturn match[2] ?? \"\";\n}\n//#endregion\n//#region src/attribute-spec/block-attribute.ts\nfunction blockAttribute(name, config) {\n\treturn {\n\t\tlevel: \"block\",\n\t\tname,\n\t\tdocumentation: config.documentation,\n\t\tpositional: config.positional ?? [],\n\t\tnamed: config.named ?? {},\n\t\t...config.refine !== void 0 ? { refine: config.refine } : {}\n\t};\n}\n//#endregion\n//#region src/attribute-spec/combinators/diagnostic.ts\nconst ATTRIBUTE_DIAGNOSTIC_CODE = \"PSL_INVALID_ATTRIBUTE_SYNTAX\";\nfunction leafDiagnostic(ctx, node, message, code = ATTRIBUTE_DIAGNOSTIC_CODE) {\n\treturn {\n\t\tcode,\n\t\tmessage,\n\t\t...diagnosticSource(ctx.sources, node.syntax).at(nodePslSpan(node.syntax, ctx.sources))\n\t};\n}\n//#endregion\n//#region src/attribute-spec/combinators/bool.ts\nfunction bool() {\n\treturn {\n\t\tkind: \"bool\",\n\t\tlabel: \"boolean\",\n\t\tparse: (arg, ctx) => {\n\t\t\tconst literal = BooleanLiteralExprAst.cast(arg.syntax);\n\t\t\tif (literal !== void 0) {\n\t\t\t\tconst value = literal.value();\n\t\t\t\tif (value !== void 0) return ok(value);\n\t\t\t}\n\t\t\treturn notOk([leafDiagnostic(ctx, arg, \"Expected a boolean literal\")]);\n\t\t}\n\t};\n}\n//#endregion\n//#region src/attribute-spec/combinators/entity-ref.ts\nfunction entityRef(expected) {\n\tconst label = `${expected.kind === \"block\" ? expected.keyword : expected.kind} reference`;\n\treturn {\n\t\tkind: \"entityRef\",\n\t\tlabel,\n\t\texpected,\n\t\tparse: (arg, ctx) => {\n\t\t\tconst written = writtenEntityReference(arg.syntax);\n\t\t\tif (written === void 0) return notOk([leafDiagnostic(ctx, arg, `Expected ${label}`)]);\n\t\t\tconst name = describeWrittenEntityReference(written);\n\t\t\tconst resolution = ctx.binder.symbolForNode(arg.syntax);\n\t\t\tif (resolution === void 0 || resolution.kind === \"unresolved\") return notOk([]);\n\t\t\tconst reference = entityReference(resolution);\n\t\t\tif (reference === void 0 || !matchesSelector(reference, expected)) return notOk([leafDiagnostic(ctx, arg, `Expected ${label} \"${name}\", found ${describeResolution(resolution)}`)]);\n\t\t\treturn ok(reference);\n\t\t}\n\t};\n}\n//#endregion\n//#region src/attribute-spec/combinators/field-ref.ts\nfunction parseFieldName(arg, ctx) {\n\tconst identifier = IdentifierAst.cast(arg.syntax);\n\tif (identifier === void 0) return notOk([leafDiagnostic(ctx, arg, \"Expected a field name\")]);\n\tconst name = identifier.name();\n\tif (name === void 0) return notOk([leafDiagnostic(ctx, arg, \"Expected a field name\")]);\n\tconst resolution = ctx.binder.symbolForNode(arg.syntax);\n\tif (resolution === void 0) return notOk([]);\n\tif (resolution.kind === \"field\") return ok(resolution.symbol.name);\n\tif (resolution.kind === \"crossSpace\") return ok(name);\n\treturn notOk([]);\n}\nfunction fieldRef() {\n\treturn {\n\t\tkind: \"fieldRef\",\n\t\tlabel: \"field name\",\n\t\tparse: parseFieldName\n\t};\n}\nfunction referencedFieldRef() {\n\treturn {\n\t\tkind: \"referencedFieldRef\",\n\t\tlabel: \"field name\",\n\t\tparse: parseFieldName\n\t};\n}\n//#endregion\n//#region src/attribute-spec/interpret.ts\nfunction interpretArgs(args, spec, ctx, span, sourceNode) {\n\tlet outcome = okVoid();\n\tconst output = {};\n\tconst seen = /* @__PURE__ */ new Set();\n\tlet positionalSlot = 0;\n\tlet reportedExcess = false;\n\tfor (const arg of args) {\n\t\tconst name = arg.name()?.name();\n\t\tlet key;\n\t\tlet param;\n\t\tif (name === void 0) {\n\t\t\tconst posParam = spec.positional[positionalSlot];\n\t\t\tif (posParam === void 0) {\n\t\t\t\tif (!reportedExcess) {\n\t\t\t\t\toutcome = and(outcome, notOk([diagnostic(`Attribute \"${spec.name}\" received too many positional arguments`, ctx, span, sourceNode)]));\n\t\t\t\t\treportedExcess = true;\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tpositionalSlot += 1;\n\t\t\tkey = posParam.key;\n\t\t\tparam = posParam.type;\n\t\t} else {\n\t\t\tconst namedParam = Object.hasOwn(spec.named, name) ? spec.named[name] : void 0;\n\t\t\tif (namedParam === void 0) {\n\t\t\t\toutcome = and(outcome, notOk([diagnostic(`Attribute \"${spec.name}\" received unknown argument \"${name}\"`, ctx, nodePslSpan(arg.syntax, ctx.sources), arg.syntax)]));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tkey = name;\n\t\t\tparam = namedParam.type;\n\t\t}\n\t\tif (seen.has(key)) {\n\t\t\toutcome = and(outcome, notOk([diagnostic(`Attribute \"${spec.name}\" received duplicate argument \"${key}\"`, ctx, nodePslSpan(arg.syntax, ctx.sources), arg.syntax)]));\n\t\t\tcontinue;\n\t\t}\n\t\tseen.add(key);\n\t\tconst result = parseArgValue(arg, param, ctx);\n\t\tif (result.ok) output[key] = result.value;\n\t\toutcome = and(outcome, result);\n\t}\n\tconst finalized = /* @__PURE__ */ new Set();\n\tconst finalizeAbsentKey = (key, positionalParam, namedParam) => {\n\t\tif (finalized.has(key) || seen.has(key)) return;\n\t\tfinalized.add(key);\n\t\tconst effective = namedParam ?? positionalParam;\n\t\tif (effective === void 0) return;\n\t\tif (isOptionalArgType(effective)) {\n\t\t\tif (effective.hasDefault) output[key] = effective.defaultValue;\n\t\t\treturn;\n\t\t}\n\t\toutcome = and(outcome, notOk([diagnostic(`Attribute \"${spec.name}\" is missing required argument \"${key}\"`, ctx, span, sourceNode)]));\n\t};\n\tfor (const param of spec.positional) {\n\t\tconst namedParam = Object.hasOwn(spec.named, param.key) ? spec.named[param.key] : void 0;\n\t\tfinalizeAbsentKey(param.key, param.type, namedParam?.type);\n\t}\n\tfor (const key of Object.keys(spec.named)) finalizeAbsentKey(key, void 0, spec.named[key]?.type);\n\tif (!outcome.ok) return notOk(outcome.failure);\n\treturn ok(output);\n}\nfunction interpretAttribute(attrNode, spec, ctx) {\n\tconst attributeSpan = nodePslSpan(attrNode.syntax, ctx.sources);\n\tconst bound = interpretArgs(attrNode.argList()?.args() ?? [], spec, ctx, attributeSpan, attrNode.syntax);\n\tif (!bound.ok) return notOk(bound.failure);\n\tconst value = blindCast(bound.value);\n\tif (spec.refine !== void 0) {\n\t\tconst refineDiagnostics = spec.refine(value, ctx, attrNode);\n\t\tif (refineDiagnostics.length > 0) return notOk(refineDiagnostics);\n\t}\n\treturn ok(value);\n}\nfunction parseArgValue(arg, argType, ctx) {\n\tconst value = arg.value();\n\tif (value === void 0) return notOk([diagnostic(\"Attribute argument is missing a value\", ctx, nodePslSpan(arg.syntax, ctx.sources), arg.syntax)]);\n\treturn argType.parse(value, ctx);\n}\nfunction isOptionalArgType(param) {\n\treturn \"optional\" in param && param.optional === true;\n}\nfunction diagnostic(message, ctx, span, sourceNode) {\n\treturn {\n\t\tcode: ATTRIBUTE_DIAGNOSTIC_CODE,\n\t\tmessage,\n\t\t...diagnosticSource(ctx.sources, sourceNode).at(span)\n\t};\n}\n//#endregion\n//#region src/attribute-spec/combinators/func-call.ts\nfunction funcCall(name, sig) {\n\treturn {\n\t\tkind: \"funcCall\",\n\t\tlabel: `${name}()`,\n\t\tname,\n\t\tsignature: sig,\n\t\tparse: (arg, ctx) => {\n\t\t\tconst guard = matchCallee(arg, name, ctx);\n\t\t\tif (!guard.ok) return guard;\n\t\t\tconst span = nodePslSpan(guard.value.syntax, ctx.sources);\n\t\t\tconst bound = interpretArgs(guard.value.args(), {\n\t\t\t\tname,\n\t\t\t\tpositional: sig.positional ?? [],\n\t\t\t\tnamed: sig.named ?? {}\n\t\t\t}, ctx, span, guard.value.syntax);\n\t\t\tif (!bound.ok) return notOk(bound.failure);\n\t\t\treturn ok({\n\t\t\t\tfn: name,\n\t\t\t\tspan,\n\t\t\t\targs: bound.value\n\t\t\t});\n\t\t}\n\t};\n}\nfunction matchCallee(arg, name, ctx) {\n\tconst call = FunctionCallAst.cast(arg.syntax);\n\tif (call === void 0) return notOk([leafDiagnostic(ctx, arg, \"Expected a function call\")]);\n\tconst qname = call.name();\n\tif (qname === void 0 || qname.dot() !== void 0 || qname.colon() !== void 0) return notOk([leafDiagnostic(ctx, arg, \"Expected a function call\")]);\n\tconst calleeName = qname.identifier()?.token()?.text;\n\tif (calleeName === void 0) return notOk([leafDiagnostic(ctx, arg, \"Expected a function call\")]);\n\tif (calleeName !== name) return notOk([leafDiagnostic(ctx, arg, `Expected ${name}()`)]);\n\treturn ok(call);\n}\n//#endregion\n//#region src/attribute-spec/combinators/identifier.ts\nfunction identifier(name, options) {\n\tconst label = name ?? \"identifier\";\n\treturn {\n\t\tkind: \"identifier\",\n\t\tlabel,\n\t\tname,\n\t\tdocumentation: options?.documentation ?? \"\",\n\t\tparse: (arg, ctx) => {\n\t\t\tconst value = IdentifierAst.cast(arg.syntax)?.name();\n\t\t\tif (value !== void 0 && (name === void 0 || value === name)) return ok(value);\n\t\t\treturn notOk([leafDiagnostic(ctx, arg, `Expected ${label}`)]);\n\t\t}\n\t};\n}\n//#endregion\n//#region src/attribute-spec/combinators/int.ts\nfunction int(opts) {\n\tconst min = opts?.min;\n\tconst max = opts?.max;\n\treturn {\n\t\tkind: \"int\",\n\t\tlabel: \"integer\",\n\t\t...min === void 0 ? {} : { min },\n\t\t...max === void 0 ? {} : { max },\n\t\tparse: (arg, ctx) => {\n\t\t\tconst literal = NumberLiteralExprAst.cast(arg.syntax);\n\t\t\tif (literal !== void 0) {\n\t\t\t\tconst value = literal.value();\n\t\t\t\tif (value !== void 0 && Number.isInteger(value)) {\n\t\t\t\t\tif ((min === void 0 || value >= min) && (max === void 0 || value <= max)) return ok(value);\n\t\t\t\t\treturn notOk([leafDiagnostic(ctx, arg, rangeMessage(min, max))]);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn notOk([leafDiagnostic(ctx, arg, \"Expected an integer literal\")]);\n\t\t}\n\t};\n}\nfunction rangeMessage(min, max) {\n\tif (min !== void 0 && max !== void 0) return `Expected an integer between ${min} and ${max}`;\n\tif (min !== void 0) return `Expected an integer greater than or equal to ${min}`;\n\treturn `Expected an integer less than or equal to ${max}`;\n}\n//#endregion\n//#region src/attribute-spec/combinators/json.ts\n/**\n* Reads an opaque JSON object from a quoted JSON string — the ADR's one text-encoded surface\n* exception (e.g. an index `filter` / `weights` argument). The string is decoded by the parser,\n* then JSON-parsed; a non-object (array/scalar) or invalid JSON is a diagnostic.\n*/\nfunction json() {\n\treturn {\n\t\tkind: \"json\",\n\t\tlabel: \"JSON object\",\n\t\tparse: (arg, ctx) => {\n\t\t\tconst literal = StringLiteralExprAst.cast(arg.syntax);\n\t\t\tif (literal === void 0) return notOk([leafDiagnostic(ctx, arg, \"Expected a JSON object string\")]);\n\t\t\tconst raw = literal.value();\n\t\t\tif (raw !== void 0) try {\n\t\t\t\tconst parsed = JSON.parse(raw);\n\t\t\t\tif (typeof parsed === \"object\" && parsed !== null && !Array.isArray(parsed)) return ok(blindCast(parsed));\n\t\t\t} catch {}\n\t\t\treturn notOk([leafDiagnostic(ctx, arg, \"Expected a valid JSON object\")]);\n\t\t}\n\t};\n}\n//#endregion\n//#region src/attribute-spec/combinators/list.ts\nfunction list(of, opts) {\n\tconst allowEmpty = opts?.allowEmpty ?? true;\n\tconst unique = opts?.unique ?? false;\n\treturn {\n\t\tkind: \"list\",\n\t\tlabel: opts?.label ?? (of.label.includes(\" | \") ? `(${of.label})[]` : `${of.label}[]`),\n\t\tof,\n\t\tallowEmpty,\n\t\tunique,\n\t\tparse: (arg, ctx) => {\n\t\t\tconst literal = ArrayLiteralAst.cast(arg.syntax);\n\t\t\tif (literal === void 0) return notOk([leafDiagnostic(ctx, arg, `Expected a list of ${of.label}`)]);\n\t\t\tconst parsed = [];\n\t\t\tlet outcome = okVoid();\n\t\t\tlet count = 0;\n\t\t\tfor (const element of literal.elements()) {\n\t\t\t\tcount += 1;\n\t\t\t\tconst result = of.parse(element, ctx);\n\t\t\t\tif (result.ok) parsed.push({\n\t\t\t\t\tnode: element,\n\t\t\t\t\tvalue: result.value\n\t\t\t\t});\n\t\t\t\toutcome = and(outcome, result);\n\t\t\t}\n\t\t\tif (!allowEmpty && count === 0) outcome = and(outcome, notOk([leafDiagnostic(ctx, arg, \"Expected a non-empty list\")]));\n\t\t\tif (unique) {\n\t\t\t\tconst seen = /* @__PURE__ */ new Set();\n\t\t\t\tfor (const { node, value } of parsed) if (seen.has(value)) outcome = and(outcome, notOk([leafDiagnostic(ctx, node, \"Duplicate list entry\")]));\n\t\t\t\telse seen.add(value);\n\t\t\t}\n\t\t\tif (!outcome.ok) return notOk(outcome.failure);\n\t\t\treturn ok(parsed.map((entry) => entry.value));\n\t\t}\n\t};\n}\n//#endregion\n//#region src/attribute-spec/combinators/one-of.ts\nfunction oneOf(...alts) {\n\tconst label = alts.map((alt) => alt.label).join(\" | \");\n\treturn {\n\t\tkind: \"oneOf\",\n\t\tlabel,\n\t\talternatives: alts,\n\t\tparse: (arg, ctx) => {\n\t\t\tconst [head, ...tail] = blindCast(alts);\n\t\t\tlet rejection = head.parse(arg, ctx);\n\t\t\tif (rejection.ok) return rejection;\n\t\t\tfor (const alt of tail) {\n\t\t\t\tconst result = alt.parse(arg, ctx);\n\t\t\t\tif (result.ok) return result;\n\t\t\t\trejection = or(rejection, result);\n\t\t\t}\n\t\t\tif (!rejection.ok && rejection.failure.length === 0) return notOk([]);\n\t\t\treturn notOk([leafDiagnostic(ctx, arg, `Expected one of: ${label}`)]);\n\t\t}\n\t};\n}\n//#endregion\n//#region src/attribute-spec/combinators/record.ts\nfunction record(of) {\n\treturn {\n\t\tkind: \"record\",\n\t\tlabel: `{ [key]: ${of.label} }`,\n\t\tof,\n\t\tparse: (arg, ctx) => {\n\t\t\tconst literal = ObjectLiteralExprAst.cast(arg.syntax);\n\t\t\tif (literal === void 0) return notOk([leafDiagnostic(ctx, arg, \"Expected an object literal\")]);\n\t\t\tconst entries = [];\n\t\t\tconst keys = /* @__PURE__ */ new Set();\n\t\t\tlet outcome = okVoid();\n\t\t\tfor (const field of Array.from(literal.fields())) {\n\t\t\t\tconst key = field.keyName();\n\t\t\t\tif (key === void 0) {\n\t\t\t\t\toutcome = and(outcome, notOk([leafDiagnostic(ctx, field, \"Expected a key\")]));\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst value = field.value();\n\t\t\t\tif (value === void 0) {\n\t\t\t\t\toutcome = and(outcome, notOk([leafDiagnostic(ctx, field, `Expected a value for key \"${key}\"`)]));\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst parsed = of.parse(value, ctx);\n\t\t\t\tif (!parsed.ok) {\n\t\t\t\t\toutcome = and(outcome, parsed);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (keys.has(key)) {\n\t\t\t\t\toutcome = and(outcome, notOk([leafDiagnostic(ctx, field, `Duplicate key \"${key}\"`)]));\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tkeys.add(key);\n\t\t\t\tentries.push([key, parsed.value]);\n\t\t\t}\n\t\t\tif (!outcome.ok) return notOk(outcome.failure);\n\t\t\treturn ok(Object.fromEntries(entries));\n\t\t}\n\t};\n}\n//#endregion\n//#region src/attribute-spec/combinators/str.ts\nfunction str(value) {\n\tif (value === void 0) return {\n\t\tkind: \"str\",\n\t\tlabel: \"string\",\n\t\tvalue: void 0,\n\t\tparse: (arg, ctx) => {\n\t\t\tconst literal = StringLiteralExprAst.cast(arg.syntax);\n\t\t\tif (literal !== void 0) {\n\t\t\t\tconst parsed = literal.value();\n\t\t\t\tif (parsed !== void 0) return ok(parsed);\n\t\t\t}\n\t\t\treturn notOk([leafDiagnostic(ctx, arg, \"Expected a string literal\")]);\n\t\t}\n\t};\n\treturn {\n\t\tkind: \"str\",\n\t\tlabel: JSON.stringify(value),\n\t\tvalue,\n\t\tparse: (arg, ctx) => {\n\t\t\tconst literal = StringLiteralExprAst.cast(arg.syntax);\n\t\t\tif (literal !== void 0) {\n\t\t\t\tif (literal.value() === value) return ok(value);\n\t\t\t}\n\t\t\treturn notOk([leafDiagnostic(ctx, arg, `Expected ${JSON.stringify(value)}`)]);\n\t\t}\n\t};\n}\n//#endregion\n//#region src/attribute-spec/combinators/json-value.ts\nfunction jsonValue() {\n\tconst self = {\n\t\tkind: \"oneOf\",\n\t\tlabel: \"JSON value\",\n\t\tget alternatives() {\n\t\t\treturn composed.alternatives;\n\t\t},\n\t\tparse: (arg, ctx) => composed.parse(arg, ctx)\n\t};\n\tconst composed = oneOf(str(), finiteNumber(), bool(), jsonNull(), list(self), record(self));\n\treturn self;\n}\nfunction finiteNumber() {\n\treturn {\n\t\tkind: \"num\",\n\t\tvalue: void 0,\n\t\tlabel: \"number\",\n\t\tparse: (arg, ctx) => {\n\t\t\tconst value = NumberLiteralExprAst.cast(arg.syntax)?.value();\n\t\t\tif (value === void 0 || Number.isNaN(value) || !Number.isFinite(value)) return notOk([leafDiagnostic(ctx, arg, \"Expected a finite number literal\")]);\n\t\t\treturn ok(value);\n\t\t}\n\t};\n}\nfunction jsonNull() {\n\treturn {\n\t\tkind: \"null\",\n\t\tlabel: \"null\",\n\t\tparse: (arg, ctx) => {\n\t\t\tif (IdentifierAst.cast(arg.syntax)?.name() === \"null\") return ok(null);\n\t\t\treturn notOk([leafDiagnostic(ctx, arg, \"Expected null\")]);\n\t\t}\n\t};\n}\n//#endregion\n//#region src/attribute-spec/combinators/num.ts\nfunction num(value) {\n\tif (value === void 0) return {\n\t\tkind: \"num\",\n\t\tlabel: \"number\",\n\t\tvalue: void 0,\n\t\tparse: (arg, ctx) => {\n\t\t\tconst literal = NumberLiteralExprAst.cast(arg.syntax);\n\t\t\tif (literal !== void 0) {\n\t\t\t\tconst parsed = literal.value();\n\t\t\t\tif (parsed !== void 0) return ok(parsed);\n\t\t\t}\n\t\t\treturn notOk([leafDiagnostic(ctx, arg, \"Expected a number literal\")]);\n\t\t}\n\t};\n\treturn {\n\t\tkind: \"num\",\n\t\tlabel: String(value),\n\t\tvalue,\n\t\tparse: (arg, ctx) => {\n\t\t\tconst literal = NumberLiteralExprAst.cast(arg.syntax);\n\t\t\tif (literal !== void 0) {\n\t\t\t\tif (literal.value() === value) return ok(value);\n\t\t\t}\n\t\t\treturn notOk([leafDiagnostic(ctx, arg, `Expected ${value}`)]);\n\t\t}\n\t};\n}\n//#endregion\n//#region src/attribute-spec/combinators/num-literal.ts\n/** A number literal kept as its source text, for consumers that must not round it through a JS number. */\nfunction numLiteral() {\n\treturn {\n\t\tkind: \"num\",\n\t\tlabel: \"number\",\n\t\tvalue: void 0,\n\t\tparse: (arg, ctx) => {\n\t\t\tconst text = NumberLiteralExprAst.cast(arg.syntax)?.token()?.text;\n\t\t\tif (text !== void 0) return ok({ text });\n\t\t\treturn notOk([leafDiagnostic(ctx, arg, \"Expected a number literal\")]);\n\t\t}\n\t};\n}\n//#endregion\n//#region src/attribute-spec/combinators/tagged-literal.ts\n/**\n* A `` tag`...` ``, `tag\"...\"`, or `tag'...'` argument. `tags` and `documentation` describe the\n* registered tags for tooling; parsing accepts any tag.\n*/\nfunction taggedLiteral(tags, options) {\n\treturn {\n\t\tkind: \"taggedLiteral\",\n\t\tlabel: `${tags[0] ?? \"tag\"}\\`...\\``,\n\t\ttags,\n\t\tdocumentation: options.documentation,\n\t\tparse: (arg, ctx) => {\n\t\t\tconst literal = TaggedLiteralExprAst.cast(arg.syntax);\n\t\t\tif (literal === void 0) return notOk([leafDiagnostic(ctx, arg, \"Expected a tagged literal\")]);\n\t\t\treturn ok({\n\t\t\t\ttag: literal.tagName(),\n\t\t\t\tcanonicalization: literal.canonicalization(),\n\t\t\t\tspan: nodePslSpan(literal.syntax, ctx.sources)\n\t\t\t});\n\t\t}\n\t};\n}\n//#endregion\n//#region src/attribute-spec/field-attribute.ts\nfunction fieldAttribute(name, config) {\n\treturn {\n\t\tlevel: \"field\",\n\t\tname,\n\t\tdocumentation: config.documentation,\n\t\tpositional: config.positional ?? [],\n\t\tnamed: Object.assign(Object.create(null), config.named),\n\t\t...config.refine !== void 0 ? { refine: config.refine } : {}\n\t};\n}\n//#endregion\n//#region src/attribute-spec/model-attribute.ts\nfunction modelAttribute(name, config) {\n\treturn {\n\t\tlevel: \"model\",\n\t\tname,\n\t\tdocumentation: config.documentation,\n\t\tpositional: config.positional ?? [],\n\t\tnamed: Object.assign(Object.create(null), config.named),\n\t\t...config.refine !== void 0 ? { refine: config.refine } : {}\n\t};\n}\n//#endregion\n//#region src/attribute-spec/optional.ts\nfunction optional(type, ...rest) {\n\tif (rest.length === 0) return {\n\t\t...type,\n\t\toptional: true,\n\t\thasDefault: false\n\t};\n\treturn {\n\t\t...type,\n\t\toptional: true,\n\t\thasDefault: true,\n\t\tdefaultValue: rest[0]\n\t};\n}\n//#endregion\n//#region src/block-spec/constructors.ts\nfunction structBlock(config) {\n\treturn {\n\t\tmode: \"struct\",\n\t\tparameters: config.parameters\n\t};\n}\nfunction mapBlock(config) {\n\treturn {\n\t\tmode: \"map\",\n\t\tvalue: config.value,\n\t\tallowBare: config.allowBare ?? false\n\t};\n}\n//#endregion\n//#region src/block-spec/interpret.ts\nfunction interpretExtensionBlock(input) {\n\tconst { block, descriptor, spec, symbols, sources, binder } = input;\n\tconst ctx = {\n\t\tsources,\n\t\tsymbols,\n\t\tbinder,\n\t\tselfBlock: block\n\t};\n\tconst entries = spec.mode === \"struct\" ? interpretStructBlock(block, spec, ctx) : interpretMapBlock(block, spec, ctx);\n\tconst diagnostics = [...entries.diagnostics];\n\tconst interpretedAttributes = interpretExtensionBlockAttributes({\n\t\tblock,\n\t\tdescriptor,\n\t\tsymbols,\n\t\tsources,\n\t\tbinder\n\t});\n\tdiagnostics.push(...interpretedAttributes.diagnostics);\n\tif (entries.failed || diagnostics.length > 0) return notOk(diagnostics);\n\treturn ok({\n\t\tkind: descriptor.discriminator,\n\t\tkeyword: block.keyword,\n\t\tname: block.name,\n\t\tvalues: blindCast(entries.values),\n\t\tparameterSpans: entries.parameterSpans,\n\t\tnumberTexts: entries.numberTexts,\n\t\tattributes: interpretedAttributes.attributes,\n\t\tspan: block.span\n\t});\n}\nfunction interpretStructBlock(block, spec, ctx) {\n\tconst diagnostics = [];\n\tlet failed = false;\n\tconst values = Object.create(null);\n\tconst parameterSpans = Object.create(null);\n\tconst numberTexts = Object.create(null);\n\tconst seen = /* @__PURE__ */ new Set();\n\tfor (const entry of block.node.entries()) {\n\t\tconst key = entry.key()?.name();\n\t\tif (key === void 0) continue;\n\t\tconst span = nodePslSpan(entry.syntax, ctx.sources);\n\t\tif (seen.has(key)) {\n\t\t\tdiagnostics.push(duplicateParameterDiagnostic(block, key, ctx, entry, span));\n\t\t\tcontinue;\n\t\t}\n\t\tseen.add(key);\n\t\tconst rule = Object.hasOwn(spec.parameters, key) ? spec.parameters[key]?.type : void 0;\n\t\tif (rule === void 0) {\n\t\t\tdiagnostics.push(entryDiagnostic(\"PSL_EXTENSION_UNKNOWN_PARAMETER\", `Unknown parameter \"${key}\" in \"${block.keyword}\" block \"${block.name}\". The block does not declare this parameter.`, ctx, entry, span));\n\t\t\tcontinue;\n\t\t}\n\t\tparameterSpans[key] = span;\n\t\tconst value = entry.value();\n\t\tif (value === void 0) {\n\t\t\tdiagnostics.push(bareEntryDiagnostic(block, key, ctx, entry, span));\n\t\t\tcontinue;\n\t\t}\n\t\tconst parsed = rule.parse(value, ctx);\n\t\tif (parsed.ok) {\n\t\t\tvalues[key] = parsed.value;\n\t\t\trecordNumberText(numberTexts, key, value);\n\t\t} else {\n\t\t\tfailed = true;\n\t\t\tdiagnostics.push(...parsed.failure);\n\t\t}\n\t}\n\tfor (const [key, param] of Object.entries(spec.parameters)) {\n\t\tif (seen.has(key)) continue;\n\t\tif (isOptionalArgType(param.type)) {\n\t\t\tif (param.type.hasDefault) values[key] = param.type.defaultValue;\n\t\t\tcontinue;\n\t\t}\n\t\tdiagnostics.push(entryDiagnostic(\"PSL_EXTENSION_MISSING_REQUIRED_PARAMETER\", `Required parameter \"${key}\" is missing from \"${block.keyword}\" block \"${block.name}\".`, ctx, block.node, block.span));\n\t}\n\treturn {\n\t\tvalues,\n\t\tparameterSpans,\n\t\tnumberTexts,\n\t\tdiagnostics,\n\t\tfailed\n\t};\n}\nfunction interpretMapBlock(block, spec, ctx) {\n\tconst diagnostics = [];\n\tlet failed = false;\n\tconst values = Object.create(null);\n\tconst parameterSpans = Object.create(null);\n\tconst numberTexts = Object.create(null);\n\tconst seen = /* @__PURE__ */ new Set();\n\tfor (const entry of block.node.entries()) {\n\t\tconst key = entry.key()?.name();\n\t\tif (key === void 0) continue;\n\t\tconst span = nodePslSpan(entry.syntax, ctx.sources);\n\t\tif (seen.has(key)) {\n\t\t\tdiagnostics.push(duplicateParameterDiagnostic(block, key, ctx, entry, span));\n\t\t\tcontinue;\n\t\t}\n\t\tseen.add(key);\n\t\tparameterSpans[key] = span;\n\t\tconst value = entry.value();\n\t\tif (value === void 0) {\n\t\t\tif (spec.allowBare) {\n\t\t\t\tvalues[key] = void 0;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tdiagnostics.push(bareEntryDiagnostic(block, key, ctx, entry, span));\n\t\t\tcontinue;\n\t\t}\n\t\tconst parsed = spec.value.type.parse(value, ctx);\n\t\tif (parsed.ok) {\n\t\t\tvalues[key] = parsed.value;\n\t\t\trecordNumberText(numberTexts, key, value);\n\t\t} else {\n\t\t\tfailed = true;\n\t\t\tdiagnostics.push(...parsed.failure);\n\t\t}\n\t}\n\treturn {\n\t\tvalues,\n\t\tparameterSpans,\n\t\tnumberTexts,\n\t\tdiagnostics,\n\t\tfailed\n\t};\n}\nfunction recordNumberText(numberTexts, key, value) {\n\tconst text = NumberLiteralExprAst.cast(value.syntax)?.token()?.text;\n\tif (text !== void 0) numberTexts[key] = text;\n}\nfunction duplicateParameterDiagnostic(block, key, ctx, node, span) {\n\treturn entryDiagnostic(\"PSL_EXTENSION_DUPLICATE_PARAMETER\", `Duplicate parameter \"${key}\" in \"${block.keyword}\" block \"${block.name}\"; first occurrence wins`, ctx, node, span);\n}\nfunction bareEntryDiagnostic(block, key, ctx, node, span) {\n\treturn entryDiagnostic(\"PSL_INVALID_EXTENSION_BLOCK_MEMBER\", `Parameter \"${key}\" in \"${block.keyword}\" block \"${block.name}\" must be written as \"${key} = <value>\".`, ctx, node, span);\n}\nfunction interpretExtensionBlockAttributes(input) {\n\tconst { block, descriptor, symbols, sources, binder } = input;\n\tconst declared = descriptor.attributes ?? {};\n\tconst attributes = Object.create(null);\n\tconst diagnostics = [];\n\tconst seenNames = /* @__PURE__ */ new Set();\n\tfor (const attribute of block.node.attributes()) {\n\t\tconst name = attribute.name()?.path().join(\".\") ?? \"\";\n\t\tconst span = nodePslSpan(attribute.syntax, sources);\n\t\tif (!Object.hasOwn(declared, name)) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_EXTENSION_UNKNOWN_BLOCK_ATTRIBUTE\",\n\t\t\t\tmessage: `Unknown attribute \"@@${name}\" in \"${block.keyword}\" block \"${block.name}\"`,\n\t\t\t\t...diagnosticSource(sources, attribute.syntax).at(span)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (seenNames.has(name)) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_INVALID_EXTENSION_BLOCK_ATTRIBUTE\",\n\t\t\t\tmessage: `Duplicate attribute \"@@${name}\" in \"${block.keyword}\" block \"${block.name}\"; first occurrence wins`,\n\t\t\t\t...diagnosticSource(sources, attribute.syntax).at(span)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tseenNames.add(name);\n\t\tconst spec = blindCast(declared[name])({ symbols });\n\t\tconst result = interpretAttribute(attribute, spec, {\n\t\t\tsources,\n\t\t\tsymbols,\n\t\t\tbinder,\n\t\t\tselfBlock: block\n\t\t});\n\t\tif (result.ok) {\n\t\t\tconst argSpans = Object.create(null);\n\t\t\tlet positionalSlot = 0;\n\t\t\tfor (const arg of readResolvedAttribute(attribute, sources).args) {\n\t\t\t\tconst key = arg.name ?? spec.positional[positionalSlot++]?.key;\n\t\t\t\tif (key !== void 0) argSpans[key] = arg.span;\n\t\t\t}\n\t\t\tattributes[name] = {\n\t\t\t\targs: result.value,\n\t\t\t\targSpans,\n\t\t\t\tspan\n\t\t\t};\n\t\t} else diagnostics.push(...result.failure);\n\t}\n\treturn {\n\t\tattributes,\n\t\tdiagnostics\n\t};\n}\nfunction entryDiagnostic(code, message, ctx, node, span) {\n\treturn {\n\t\tcode,\n\t\tmessage,\n\t\t...diagnosticSource(ctx.sources, node.syntax).at(span)\n\t};\n}\nfunction interpretExtensionBlocks(input) {\n\tconst { symbolTable, sources, pslBlockDescriptors, binder } = input;\n\tconst parsedBlocks = /* @__PURE__ */ new Map();\n\tconst diagnostics = [];\n\tconst scopes = [symbolTable.topLevel, ...Object.values(symbolTable.topLevel.namespaces)];\n\tfor (const scope of scopes) for (const block of Object.values(scope.blocks)) {\n\t\tconst descriptor = findBlockDescriptor(pslBlockDescriptors, block.keyword);\n\t\tif (descriptor === void 0) continue;\n\t\tconst parsed = interpretExtensionBlock({\n\t\t\tblock,\n\t\t\tdescriptor,\n\t\t\tspec: blockSpecFactoryOf(descriptor)({ symbols: symbolTable }),\n\t\t\tsymbols: symbolTable,\n\t\t\tsources,\n\t\t\tbinder\n\t\t});\n\t\tif (parsed.ok) parsedBlocks.set(block, parsed.value);\n\t\telse diagnostics.push(...parsed.failure);\n\t}\n\treturn {\n\t\tparsedBlocks,\n\t\tdiagnostics\n\t};\n}\n//#endregion\n//#region src/name-the-psl-source-loses.ts\n/**\n* A name that is lost when a PSL file is read. The parser keeps block members, and the PSL contract sources keep other names, as keys of plain objects, where assigning this key sets the object's prototype instead of adding a key. Code that writes PSL must not write this name anywhere a PSL source reads a name, including inside `@map` and `@@map`.\n*/\nconst NAME_THE_PSL_SOURCE_LOSES = \"__proto__\";\n//#endregion\n//#region src/schema-directive.ts\nconst DIRECTIVE = /^(\\s*\\/\\/ *use +)(prisma-8|prisma-next)( *)(?!\\S)/;\nconst LEGACY_NAME = \"prisma-next\";\nfunction isPrismaNextSchema(text) {\n\treturn DIRECTIVE.test(text);\n}\n/** The document with the directive earlier releases wrote replaced by the current one. */\nfunction renameLegacyDirective(text) {\n\treturn text.replace(DIRECTIVE, (whole, lead, name, trail) => name === LEGACY_NAME ? `${lead}prisma-8${trail}` : whole);\n}\n//#endregion\nexport { NAME_THE_PSL_SOURCE_LOSES, PSL_UNRESOLVED_REFERENCE, assembleAttributeSpecs, blockAttribute, blockSpecFactoryOf, bool, buildSymbolTable, contributedTypeOf, createBinder, createPslDiagnosticCollector, diagnosticFromSpan, diagnosticSource, entityRef, entityReference, fieldAttribute, fieldRef, findBlockDescriptor, flatPslModels, funcCall, getPositionalArgument, identifier, int, interpretArgs, interpretAttribute, interpretExtensionBlock, interpretExtensionBlockAttributes, interpretExtensionBlocks, isNamespaceLike, isPrismaNextSchema, isPslIdentifier, json, jsonValue, keywordPslSpan, leafDiagnostic, list, mapBlock, mapPslDiagnostics, matchesSelector, memberEntries, modelAttribute, namespacePslExtensionBlocks, nodePslSpan, num, numLiteral, oneOf, optional, parseQuotedStringLiteral, readResolvedAttribute, readResolvedAttributes, readResolvedConstructorCall, record, referencedFieldRef, renameLegacyDirective, str, structBlock, taggedLiteral, typeReferenceNode };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;AAMA,UAAU,0BAA0B,WAAW;CAC9C,KAAK,MAAM,SAAS,OAAO,OAAO,SAAS,GAAG;EAC7C,IAAI,oCAAoC,KAAK,GAAG;GAC/C,MAAM;GACN;EACD;EACA,OAAO,0BAA0B,KAAK;CACvC;AACD;AACA,SAAS,uBAAuB,eAAe;CAC9C,MAAM,UAAU,OAAO,QAAQ,cAAc,eAAe,KAAK;CACjE,MAAM,UAAU,IAAI,IAAI,QAAQ,KAAK,CAAC,eAAe,SAAS,CAAC;CAC/D,KAAK,MAAM,cAAc,0BAA0B,cAAc,eAAe,GAAG;EAClF,IAAI,QAAQ,IAAI,WAAW,SAAS,GAAG,MAAM,IAAI,cAAc,8CAA8C,WAAW,UAAU,6GAA6G;EAC/O,QAAQ,IAAI,WAAW,SAAS;EAChC,QAAQ,KAAK,CAAC,WAAW,WAAW,WAAW,IAAI,CAAC;CACrD;CACA,OAAO,OAAO,OAAO,UAAU;EAC9B,OAAO,OAAO,OAAO,OAAO,YAAY,OAAO,CAAC;EAChD,OAAO,OAAO,OAAO,EAAE,GAAG,cAAc,eAAe,MAAM,CAAC;CAC/D,CAAC,CAAC;AACH;AACA,SAAS,oCAAoC,gBAAgB;CAC5D,IAAI,gBAAgB,iCAAiC,KAAK,GAAG;CAC7D,OAAO,UAAU,eAAe,4BAA4B;AAC7D;AACA,SAAS,8BAA8B,gBAAgB;CACtD,IAAI,gBAAgB,2BAA2B,K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;CACA,OAAO;EACN;EACA;CACD;AACD;AACA,SAAS,gBAAgB,MAAM,SAAS,KAAK,MAAM,MAAM;CACxD,OAAO;EACN;EACA;EACA,GAAG,iBAAiB,IAAI,SAAS,KAAK,MAAM,CAAC,CAAC,GAAG,IAAI;CACtD;AACD;AACA,SAAS,yBAAyB,OAAO;CACxC,MAAM,EAAE,aAAa,SAAS,qBAAqB,WAAW;CAC9D,MAAM,+BAA+B,IAAI,IAAI;CAC7C,MAAM,cAAc,CAAC;CACrB,MAAM,SAAS,CAAC,YAAY,UAAU,GAAG,OAAO,OAAO,YAAY,SAAS,UAAU,CAAC;CACvF,KAAK,MAAM,SAAS,QAAQ,KAAK,MAAM,SAAS,OAAO,OAAO,MAAM,MAAM,GAAG;EAC5E,MAAM,aAAa,oBAAoB,qBAAqB,MAAM,OAAO;EACzE,IAAI,eAAe,KAAK,GAAG;EAC3B,MAAM,SAAS,wBAAwB;GACtC;GACA;GACA,MAAM,mBAAmB,UAAU,CAAC,CAAC,EAAE,SAAS,YAAY,CAAC;GAC7D,SAAS;GACT;GACA;EACD,CAAC;EACD,IAAI,OAAO,IAAI,aAAa,IAAI,OAAO,OAAO,KAAK;OAC9C,YAAY,KAAK,GAAG,OAAO,OAAO;CACxC;CACA,OAAO;EACN;EACA;CACD;AACD;;;;AAMA,MAAM,4BAA4B;AAGlC,MAAM,YAAY;AAClB,MAAM,cAAc;AACpB,SAAS,mBAAmB,MAAM;CACjC,OAAO,UAAU,KAAK,IAAI;AAC3B;;AAEA,SAAS,sBAAsB,MAAM;CACpC,OAAO,KAAK,QAAQ,YAAY,OAAO,MAAM,MAAM,UAAU,SAAS,cAAc,GAAG,KAAK,UAAU,UAAU,KAAK;AACtH"}
|
|
1
|
+
{"version":3,"file":"psl-parser.mjs","names":["#registry","#records","#namespace","#declarations","#references","#documentScope","#scopes","#base"],"sources":["../../../../1-framework/2-authoring/psl-parser/dist/symbol-table-C1ATzvmU.mjs","../../../../1-framework/2-authoring/psl-parser/dist/index.mjs"],"sourcesContent":["import { C as TaggedLiteralExprAst, D as IdentifierAst, S as StringLiteralExprAst, _ as FunctionCallAst, b as ObjectLiteralExprAst, c as NamespaceDeclarationAst, g as BooleanLiteralExprAst, i as GenericBlockDeclarationAst, l as TypesBlockAst, m as ArrayLiteralAst, o as ModelDeclarationAst, t as CompositeTypeDeclarationAst, v as NumberLiteralExprAst, x as PathExprAst } from \"./declarations-DDT0hm5r.mjs\";\nimport { a as readResolvedConstructorCall, c as diagnosticSource, i as readResolvedAttributes, n as nodePslSpan } from \"./resolve-C8PUf8zv.mjs\";\nimport { isAuthoringModelAttributeDescriptor, isAuthoringPslBlockDescriptor } from \"@internal/framework-components/authoring\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { InternalError } from \"@internal/utils/internal-error\";\n//#region src/attribute-spec/assemble.ts\nfunction* modelAttributeDescriptors(namespace) {\n\tfor (const value of Object.values(namespace)) {\n\t\tif (isAuthoringModelAttributeDescriptor(value)) {\n\t\t\tyield value;\n\t\t\tcontinue;\n\t\t}\n\t\tyield* modelAttributeDescriptors(value);\n\t}\n}\nfunction assembleAttributeSpecs(contributions) {\n\tconst entries = Object.entries(contributions.attributeSpecs.model);\n\tconst claimed = new Set(entries.map(([attribute]) => attribute));\n\tfor (const descriptor of modelAttributeDescriptors(contributions.modelAttributes)) {\n\t\tif (claimed.has(descriptor.attribute)) throw new InternalError(`Duplicate attribute spec registration for \"${descriptor.attribute}\". Each model attribute name may be registered once across family built-ins and model-attribute descriptors.`);\n\t\tclaimed.add(descriptor.attribute);\n\t\tentries.push([descriptor.attribute, descriptor.spec]);\n\t}\n\treturn Object.freeze(blindCast({\n\t\tmodel: Object.freeze(Object.fromEntries(entries)),\n\t\tfield: Object.freeze({ ...contributions.attributeSpecs.field })\n\t}));\n}\nfunction resolveDescribeUnsupportedAttribute(pslDiagnostics) {\n\tif (pslDiagnostics?.describeUnsupportedAttribute === void 0) return;\n\treturn blindCast(pslDiagnostics.describeUnsupportedAttribute);\n}\nfunction resolveDescribeUnresolvedType(pslDiagnostics) {\n\tif (pslDiagnostics?.describeUnresolvedType === void 0) return;\n\treturn blindCast(pslDiagnostics.describeUnresolvedType);\n}\n//#endregion\n//#region src/entity-reference.ts\nfunction writtenEntityReference(node) {\n\tconst name = IdentifierAst.cast(node)?.name();\n\tif (name !== void 0) return {\n\t\tnamespace: void 0,\n\t\tname\n\t};\n\tconst path = PathExprAst.cast(node)?.path();\n\tif (path === void 0 || path.length !== 2) return void 0;\n\tconst [namespace, member] = path;\n\treturn namespace === void 0 || member === void 0 ? void 0 : {\n\t\tnamespace,\n\t\tname: member\n\t};\n}\nfunction describeWrittenEntityReference(reference) {\n\treturn reference.namespace === void 0 ? reference.name : `${reference.namespace}.${reference.name}`;\n}\nconst references = /* @__PURE__ */ new WeakMap();\nfunction entityReference(resolution) {\n\tswitch (resolution.kind) {\n\t\tcase \"model\":\n\t\tcase \"compositeType\":\n\t\tcase \"namedType\":\n\t\tcase \"block\": return interned(resolution.symbol, resolution.namespace);\n\t\tdefault: return;\n\t}\n}\nfunction interned(declaration, namespace) {\n\tconst existing = references.get(declaration);\n\tif (existing !== void 0) return existing;\n\tconst reference = {\n\t\tdeclaration,\n\t\tnamespace\n\t};\n\treferences.set(declaration, reference);\n\treturn reference;\n}\nfunction matchesSelector(reference, expected) {\n\tconst declaration = reference.declaration;\n\tif (declaration.kind !== expected.kind) return false;\n\treturn expected.kind !== \"block\" || declaration.kind === \"block\" && declaration.keyword === expected.keyword;\n}\nfunction describeResolution(resolution) {\n\tswitch (resolution.kind) {\n\t\tcase \"block\": return resolution.symbol.keyword;\n\t\tcase \"contributedType\": return \"scalar type\";\n\t\tcase \"crossSpace\": return \"cross-space reference\";\n\t\tcase \"unresolved\": return \"unresolved name\";\n\t\tdefault: return resolution.kind;\n\t}\n}\n//#endregion\n//#region src/block-spec/descriptor.ts\nfunction blockSpecFactoryOf(descriptor) {\n\treturn blindCast(descriptor.spec);\n}\n//#endregion\n//#region src/contributed-type-scope.ts\nfunction isContributedTypeDescriptor(value) {\n\treturn \"kind\" in value && (value.kind === \"typeConstructor\" || value.kind === \"fieldPreset\");\n}\nfunction mergeContributedTypes(...namespaces) {\n\tconst merged = {};\n\tfor (const namespace of namespaces) for (const [name, value] of Object.entries(namespace)) {\n\t\tconst existing = Object.hasOwn(merged, name) ? merged[name] : void 0;\n\t\tmerged[name] = existing !== void 0 && !isContributedTypeDescriptor(existing) && !isContributedTypeDescriptor(value) ? mergeContributedTypes(existing, value) : value;\n\t}\n\treturn merged;\n}\nfunction contributedTypeScope(contributedTypes) {\n\tconst members = collect(contributedTypes, []);\n\treturn {\n\t\tlookup(name) {\n\t\t\treturn members.get(name);\n\t\t},\n\t\tentries() {\n\t\t\treturn members.entries();\n\t\t}\n\t};\n}\nfunction collect(namespace, prefix) {\n\tconst members = /* @__PURE__ */ new Map();\n\tfor (const [name, value] of Object.entries(namespace)) {\n\t\tconst path = [...prefix, name];\n\t\tmembers.set(name, isContributedTypeDescriptor(value) ? {\n\t\t\tkind: \"contributedType\",\n\t\t\tname,\n\t\t\tpath,\n\t\t\tdescriptor: value\n\t\t} : {\n\t\t\tkind: \"contributedNamespace\",\n\t\t\tname,\n\t\t\tpath,\n\t\t\tmembers: collect(value, path)\n\t\t});\n\t}\n\treturn members;\n}\n//#endregion\n//#region src/extension-block.ts\nfunction findBlockDescriptor(descriptors, keyword) {\n\tif (descriptors === void 0) return void 0;\n\tfor (const value of Object.values(descriptors)) {\n\t\tif (value === void 0) continue;\n\t\tif (isAuthoringPslBlockDescriptor(value)) {\n\t\t\tif (value.keyword === keyword) return value;\n\t\t\tcontinue;\n\t\t}\n\t\tconst nested = findBlockDescriptor(value, keyword);\n\t\tif (nested !== void 0) return nested;\n\t}\n}\n//#endregion\n//#region src/scope.ts\nfunction* recordNames(...records) {\n\tfor (const record of records) yield* Object.keys(record);\n}\nvar Scope = class {\n\tparent;\n\tconstructor(parent) {\n\t\tthis.parent = parent;\n\t}\n\t*entries() {\n\t\tconst seen = /* @__PURE__ */ new Set();\n\t\tfor (const name of this.ownNames()) {\n\t\t\tif (seen.has(name)) continue;\n\t\t\tseen.add(name);\n\t\t\tconst resolution = this.lookup(name);\n\t\t\tif (resolution !== void 0) yield [name, resolution];\n\t\t}\n\t\tfor (const entry of this.parent?.entries() ?? []) if (!seen.has(entry[0])) yield entry;\n\t}\n};\nfunction contributedResolution(member) {\n\treturn member.kind === \"contributedType\" ? {\n\t\tkind: \"contributedType\",\n\t\tsymbol: member\n\t} : {\n\t\tkind: \"contributedNamespace\",\n\t\tsymbol: member\n\t};\n}\nfunction namespaceMember(namespace, name) {\n\tconst model = namespace.models[name];\n\tif (model !== void 0) return {\n\t\tkind: \"model\",\n\t\tsymbol: model,\n\t\tnamespace\n\t};\n\tconst compositeType = namespace.compositeTypes[name];\n\tif (compositeType !== void 0) return {\n\t\tkind: \"compositeType\",\n\t\tsymbol: compositeType,\n\t\tnamespace\n\t};\n\tconst block = namespace.blocks[name];\n\tif (block !== void 0) return {\n\t\tkind: \"block\",\n\t\tsymbol: block,\n\t\tnamespace\n\t};\n}\nvar ContributedScope = class extends Scope {\n\t#registry;\n\tconstructor(registry) {\n\t\tsuper(void 0);\n\t\tthis.#registry = registry;\n\t}\n\tlookup(name) {\n\t\tconst member = this.#registry.lookup(name);\n\t\treturn member === void 0 ? void 0 : contributedResolution(member);\n\t}\n\t*ownNames() {\n\t\tfor (const [name] of this.#registry.entries()) yield name;\n\t}\n};\nvar DocumentScope = class extends Scope {\n\t#records;\n\tconstructor(records, parent) {\n\t\tsuper(parent);\n\t\tthis.#records = records;\n\t}\n\tlookup(name) {\n\t\tconst records = this.#records;\n\t\tconst model = records.models[name];\n\t\tif (model !== void 0) return {\n\t\t\tkind: \"model\",\n\t\t\tsymbol: model\n\t\t};\n\t\tconst compositeType = records.compositeTypes[name];\n\t\tif (compositeType !== void 0) return {\n\t\t\tkind: \"compositeType\",\n\t\t\tsymbol: compositeType\n\t\t};\n\t\tconst namedType = records.namedTypes[name];\n\t\tif (namedType !== void 0) return {\n\t\t\tkind: \"namedType\",\n\t\t\tsymbol: namedType\n\t\t};\n\t\tconst block = records.blocks[name];\n\t\tif (block !== void 0) return {\n\t\t\tkind: \"block\",\n\t\t\tsymbol: block\n\t\t};\n\t\tconst namespace = records.namespaces[name];\n\t\tif (namespace !== void 0) return {\n\t\t\tkind: \"namespace\",\n\t\t\tsymbol: namespace\n\t\t};\n\t\treturn this.parent?.lookup(name);\n\t}\n\townNames() {\n\t\tconst records = this.#records;\n\t\treturn recordNames(records.models, records.compositeTypes, records.namedTypes, records.blocks, records.namespaces);\n\t}\n};\nvar NamespaceScope = class extends Scope {\n\t#namespace;\n\tconstructor(namespace, parent) {\n\t\tsuper(parent);\n\t\tthis.#namespace = namespace;\n\t}\n\tlookup(name) {\n\t\treturn namespaceMember(this.#namespace, name) ?? this.parent?.lookup(name);\n\t}\n\townNames() {\n\t\tconst namespace = this.#namespace;\n\t\treturn recordNames(namespace.models, namespace.compositeTypes, namespace.blocks);\n\t}\n};\nfunction contributedScope(registry) {\n\treturn new ContributedScope(registry);\n}\nfunction documentScope(records, parent) {\n\treturn new DocumentScope(records, parent);\n}\nfunction namedTypeBaseScope(records, parent) {\n\treturn new DocumentScope({\n\t\t...records,\n\t\tnamedTypes: {}\n\t}, parent);\n}\nfunction namespaceScope(namespace, parent) {\n\treturn new NamespaceScope(namespace, parent);\n}\nfunction isNamespaceLike(resolution) {\n\treturn resolution.kind === \"namespace\" || resolution.kind === \"contributedNamespace\";\n}\nfunction* memberEntries(qualifier) {\n\tif (qualifier.kind === \"contributedNamespace\") {\n\t\tfor (const [name, member] of qualifier.symbol.members) yield [name, contributedResolution(member)];\n\t\treturn;\n\t}\n\tyield* new NamespaceScope(qualifier.symbol, void 0).entries();\n}\nfunction lookupMember(qualifier, name) {\n\tif (qualifier.kind === \"contributedNamespace\") {\n\t\tconst member = qualifier.symbol.members.get(name);\n\t\treturn member === void 0 ? void 0 : contributedResolution(member);\n\t}\n\treturn namespaceMember(qualifier.symbol, name);\n}\n//#endregion\n//#region src/binder.ts\nconst PSL_UNRESOLVED_REFERENCE = \"PSL_UNRESOLVED_REFERENCE\";\nfunction typeReferenceNode(symbol) {\n\treturn symbol.node.typeAnnotation()?.name()?.syntax;\n}\nfunction contributedTypeOf(resolution, binder) {\n\tconst base = resolution?.kind === \"namedType\" ? typeReferenceNode(resolution.symbol) : void 0;\n\tconst target = base === void 0 ? resolution : binder.symbolForNode(base);\n\treturn target?.kind === \"contributedType\" ? target.symbol : void 0;\n}\nvar PslBinder = class {\n\t#declarations;\n\t#references;\n\t#documentScope;\n\t#scopes;\n\tconstructor(declarations, references, documentScope, scopes) {\n\t\tthis.#declarations = declarations;\n\t\tthis.#references = references;\n\t\tthis.#documentScope = documentScope;\n\t\tthis.#scopes = scopes;\n\t}\n\tdeclaredSymbol(node) {\n\t\treturn this.#declarations.get(node);\n\t}\n\tsymbolForNode(node) {\n\t\treturn this.#references.get(node);\n\t}\n\tscopeAt(node) {\n\t\treturn node.findAncestor((ancestor) => this.#scopes.get(ancestor)) ?? this.#documentScope;\n\t}\n};\nvar ScopeStack = class {\n\t#base;\n\t#scopes;\n\tconstructor(base) {\n\t\tthis.#base = base;\n\t\tthis.#scopes = [base];\n\t}\n\tcurrent() {\n\t\treturn this.#scopes[this.#scopes.length - 1] ?? this.#base;\n\t}\n\tpush(scope) {\n\t\tthis.#scopes.push(scope);\n\t}\n\tpop() {\n\t\tthis.#scopes.pop();\n\t}\n};\nfunction walkEntities(symbolTable, stack, binder, visit) {\n\tconst { topLevel } = symbolTable;\n\tfor (const entity of Object.values(topLevel.models)) visit(entity);\n\tfor (const entity of Object.values(topLevel.compositeTypes)) visit(entity);\n\tfor (const namespace of Object.values(topLevel.namespaces)) {\n\t\tstack.push(binder.scopeAt(namespace.declarations[0].node.syntax));\n\t\tfor (const entity of Object.values(namespace.models)) visit(entity, namespace);\n\t\tfor (const entity of Object.values(namespace.compositeTypes)) visit(entity, namespace);\n\t\tstack.pop();\n\t}\n}\nfunction declarationResolution(entity, namespace) {\n\treturn entity.kind === \"model\" ? {\n\t\tkind: \"model\",\n\t\tsymbol: entity,\n\t\t...namespace === void 0 ? {} : { namespace }\n\t} : {\n\t\tkind: \"compositeType\",\n\t\tsymbol: entity,\n\t\t...namespace === void 0 ? {} : { namespace }\n\t};\n}\nfunction createBinder(input) {\n\tconst { symbolTable, sources, context } = input;\n\tconst contributions = context.authoringContributions;\n\tconst describeUnsupportedAttributeFactory = resolveDescribeUnsupportedAttribute(context.pslDiagnostics);\n\tconst describeUnresolvedTypeFactory = resolveDescribeUnresolvedType(context.pslDiagnostics);\n\treturn bind({\n\t\tsources,\n\t\tsymbolTable,\n\t\tcontributedTypes: mergeContributedTypes(contributions.field, contributions.type),\n\t\tattributeSpecs: assembleAttributeSpecs(contributions),\n\t\tpslBlockDescriptors: contributions.pslBlockDescriptors,\n\t\tcontrolMutationDefaults: {\n\t\t\tdefaultFunctionRegistry: context.controlMutationDefaults.defaultFunctionRegistry,\n\t\t\tdataTypeEntries: contributions.dataTypes\n\t\t},\n\t\t...describeUnsupportedAttributeFactory !== void 0 ? { describeUnsupportedAttribute: describeUnsupportedAttributeFactory(sources) } : {},\n\t\t...describeUnresolvedTypeFactory !== void 0 ? { describeUnresolvedType: describeUnresolvedTypeFactory(contributions) } : {}\n\t});\n}\nfunction bind(options) {\n\tconst { sources, symbolTable, contributedTypes, attributeSpecs, controlMutationDefaults, describeUnsupportedAttribute, describeUnresolvedType } = options;\n\tconst pslBlockDescriptors = options.pslBlockDescriptors ?? {};\n\tconst contributed = contributedScope(contributedTypeScope(contributedTypes));\n\tconst document = documentScope(symbolTable.topLevel, contributed);\n\tconst stack = new ScopeStack(document);\n\tconst scopes = /* @__PURE__ */ new WeakMap();\n\tconst declarations = /* @__PURE__ */ new WeakMap();\n\tconst references = /* @__PURE__ */ new WeakMap();\n\tconst diagnostics = [];\n\tconst binder = new PslBinder(declarations, references, document, scopes);\n\tconst baseScope = namedTypeBaseScope(symbolTable.topLevel, contributed);\n\tfor (const symbol of Object.values(symbolTable.topLevel.namedTypes)) {\n\t\tdeclarations.set(symbol.node.syntax, symbol);\n\t\tconst declaredName = symbol.node.name()?.syntax;\n\t\tif (declaredName !== void 0) references.set(declaredName, {\n\t\t\tkind: \"namedType\",\n\t\t\tsymbol\n\t\t});\n\t\tconst name = symbol.node.typeAnnotation()?.name();\n\t\tconst outcome = resolveTypeReference(name, baseScope, references);\n\t\tif (name === void 0 || outcome === void 0) continue;\n\t\treferences.set(name.syntax, outcome.resolution);\n\t}\n\tfor (const symbol of Object.values(symbolTable.topLevel.blocks)) {\n\t\tdeclarations.set(symbol.node.syntax, symbol);\n\t\tconst declaredName = symbol.node.name()?.syntax;\n\t\tif (declaredName !== void 0) references.set(declaredName, {\n\t\t\tkind: \"block\",\n\t\t\tsymbol\n\t\t});\n\t}\n\tfor (const namespace of Object.values(symbolTable.topLevel.namespaces)) {\n\t\tconst scope = namespaceScope(namespace, document);\n\t\tfor (const declaration of namespace.declarations) {\n\t\t\tdeclarations.set(declaration.node.syntax, namespace);\n\t\t\tscopes.set(declaration.node.syntax, scope);\n\t\t\tconst declaredName = declaration.node.name()?.syntax;\n\t\t\tif (declaredName !== void 0) references.set(declaredName, {\n\t\t\t\tkind: \"namespace\",\n\t\t\t\tsymbol: namespace\n\t\t\t});\n\t\t}\n\t\tfor (const symbol of Object.values(namespace.blocks)) {\n\t\t\tdeclarations.set(symbol.node.syntax, symbol);\n\t\t\tconst declaredName = symbol.node.name()?.syntax;\n\t\t\tif (declaredName !== void 0) references.set(declaredName, {\n\t\t\t\tkind: \"block\",\n\t\t\t\tsymbol,\n\t\t\t\tnamespace\n\t\t\t});\n\t\t}\n\t}\n\twalkEntities(symbolTable, stack, binder, (entity, namespace) => {\n\t\tdeclarations.set(entity.node.syntax, entity);\n\t\tconst declaredName = entity.node.name()?.syntax;\n\t\tif (declaredName !== void 0) references.set(declaredName, declarationResolution(entity, namespace));\n\t\tfor (const field of Object.values(entity.fields)) {\n\t\t\tdeclarations.set(field.node.syntax, field);\n\t\t\tconst fieldName = field.node.name()?.syntax;\n\t\t\tif (fieldName !== void 0) references.set(fieldName, {\n\t\t\t\tkind: \"field\",\n\t\t\t\tsymbol: field\n\t\t\t});\n\t\t\tconst node = typeReferenceNode(field);\n\t\t\tif (node === void 0) continue;\n\t\t\tconst name = field.node.typeAnnotation()?.name();\n\t\t\tconst outcome = resolveTypeReference(name, stack.current(), references, (written) => describeUnresolvedType?.({\n\t\t\t\tfield,\n\t\t\t\towner: entity,\n\t\t\t\twritten\n\t\t\t}));\n\t\t\tif (outcome === void 0) continue;\n\t\t\treferences.set(node, outcome.resolution);\n\t\t\tif (outcome.message !== void 0) diagnostics.push({\n\t\t\t\tcode: PSL_UNRESOLVED_REFERENCE,\n\t\t\t\tmessage: outcome.message,\n\t\t\t\tdata: {\n\t\t\t\t\treference: \"type\",\n\t\t\t\t\tname: outcome.name,\n\t\t\t\t\tconstructorCall: field.typeConstructor !== void 0\n\t\t\t\t},\n\t\t\t\t...diagnosticSource(sources, node).at()\n\t\t\t});\n\t\t}\n\t});\n\twalkEntities(symbolTable, stack, binder, (entity) => {\n\t\tconst context = {\n\t\t\towner: entity,\n\t\t\tscope: stack.current(),\n\t\t\treferences,\n\t\t\tdiagnostics,\n\t\t\tsymbolTable,\n\t\t\tsources,\n\t\t\tdescribeUnsupportedAttribute\n\t\t};\n\t\tconst specContext = entity.kind === \"model\" ? {\n\t\t\tsymbols: symbolTable,\n\t\t\tmodel: entity,\n\t\t\tcontrolMutationDefaults\n\t\t} : void 0;\n\t\tbindAttributes(entity, entity.attributes, attributeSpecs.model, (factory) => specContext === void 0 ? void 0 : factory(specContext), {\n\t\t\t...context,\n\t\t\tfield: void 0\n\t\t});\n\t\tfor (const field of Object.values(entity.fields)) bindAttributes(field, field.attributes, attributeSpecs.field, (factory) => {\n\t\t\tif (specContext === void 0) return void 0;\n\t\t\tconst node = typeReferenceNode(field);\n\t\t\tconst typeResolution = node === void 0 ? void 0 : references.get(node);\n\t\t\treturn factory({\n\t\t\t\t...specContext,\n\t\t\t\tfield,\n\t\t\t\ttypeResolution\n\t\t\t});\n\t\t}, {\n\t\t\t...context,\n\t\t\tfield\n\t\t});\n\t});\n\tconst blockContext = {\n\t\tpslBlockDescriptors,\n\t\tsymbolTable,\n\t\tsources,\n\t\treferences,\n\t\tdiagnostics\n\t};\n\tconst bindBlocks = (blocks) => {\n\t\tconst context = {\n\t\t\t...blockContext,\n\t\t\tscope: stack.current()\n\t\t};\n\t\tfor (const block of Object.values(blocks)) bindBlock(block, context);\n\t};\n\tbindBlocks(symbolTable.topLevel.blocks);\n\tfor (const namespace of Object.values(symbolTable.topLevel.namespaces)) {\n\t\tstack.push(binder.scopeAt(namespace.declarations[0].node.syntax));\n\t\tbindBlocks(namespace.blocks);\n\t\tstack.pop();\n\t}\n\treturn {\n\t\tbinder,\n\t\tdiagnostics\n\t};\n}\nfunction bindBlock(block, ctx) {\n\tconst descriptor = findBlockDescriptor(ctx.pslBlockDescriptors, block.keyword);\n\tif (descriptor === void 0) return;\n\tconst spec = blockSpecFactoryOf(descriptor)({ symbols: ctx.symbolTable });\n\tfor (const entry of block.node.entries()) {\n\t\tconst key = entry.key()?.name();\n\t\tif (key === void 0) continue;\n\t\tconst parameter = spec.mode === \"struct\" && Object.hasOwn(spec.parameters, key) ? spec.parameters[key] : void 0;\n\t\tconst rule = spec.mode === \"struct\" ? parameter?.type : spec.value.type;\n\t\tif (parameter !== void 0) {\n\t\t\tconst keyNode = entry.key()?.syntax;\n\t\t\tif (keyNode !== void 0) ctx.references.set(keyNode, {\n\t\t\t\tkind: \"parameter\",\n\t\t\t\tsymbol: {\n\t\t\t\t\tkind: \"parameter\",\n\t\t\t\t\tname: key,\n\t\t\t\t\tparam: parameter\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tconst value = entry.value();\n\t\tif (rule === void 0 || value === void 0) continue;\n\t\tbindExpression(rule, value, ctx);\n\t}\n\tconst attributeSpecs = descriptor.attributes ?? {};\n\tif (Object.keys(attributeSpecs).length === 0) return;\n\tfor (const attribute of readResolvedAttributes(block.node.attributes(), ctx.sources)) {\n\t\tconst factory = attributeSpecs[attribute.name];\n\t\tif (factory === void 0) continue;\n\t\tconst attributeSpec = blindCast(factory)({ symbols: ctx.symbolTable });\n\t\tconst attributeSymbol = {\n\t\t\tkind: \"attribute\",\n\t\t\tname: attribute.name,\n\t\t\tlevel: \"block\",\n\t\t\tspec: attributeSpec\n\t\t};\n\t\tconst nameNode = attribute.node.name()?.syntax;\n\t\tif (nameNode !== void 0) ctx.references.set(nameNode, {\n\t\t\tkind: \"attribute\",\n\t\t\tsymbol: attributeSymbol\n\t\t});\n\t\tbindArguments(attribute, attributeSpec, ctx);\n\t}\n}\nfunction bindExpression(rule, expression, ctx, modelContext) {\n\tconst trial = tryBindExpression(rule, expression, ctx, modelContext);\n\tfor (const [node, resolution] of trial.references) ctx.references.set(node, resolution);\n\tctx.diagnostics.push(...trial.diagnostics.values());\n}\nfunction tryBindExpression(rule, expression, ctx, modelContext) {\n\tconst references = /* @__PURE__ */ new Map();\n\tconst diagnostics = /* @__PURE__ */ new Map();\n\tswitch (rule.kind) {\n\t\tcase \"oneOf\":\n\t\t\tfor (const alternative of rule.alternatives) {\n\t\t\t\tconst trial = tryBindExpression(alternative, expression, ctx, modelContext);\n\t\t\t\tif (trial.matched) return trial;\n\t\t\t\tfor (const [node, diagnostic] of trial.diagnostics) diagnostics.set(node, diagnostic);\n\t\t\t\tfor (const [node, resolution] of trial.references) if (resolution.kind === \"unresolved\") references.set(node, resolution);\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tmatched: false,\n\t\t\t\treferences,\n\t\t\t\tdiagnostics\n\t\t\t};\n\t\tcase \"list\":\n\t\tcase \"record\": {\n\t\t\tconst children = rule.kind === \"list\" ? ArrayLiteralAst.cast(expression.syntax)?.elements() : recordValues(expression);\n\t\t\tif (children === void 0) return {\n\t\t\t\tmatched: false,\n\t\t\t\treferences,\n\t\t\t\tdiagnostics\n\t\t\t};\n\t\t\tlet matched = true;\n\t\t\tfor (const child of children) {\n\t\t\t\tconst trial = tryBindExpression(rule.of, child, ctx, modelContext);\n\t\t\t\tmatched = trial.matched && matched;\n\t\t\t\tfor (const [node, resolution] of trial.references) references.set(node, resolution);\n\t\t\t\tfor (const [node, diagnostic] of trial.diagnostics) diagnostics.set(node, diagnostic);\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tmatched,\n\t\t\t\treferences,\n\t\t\t\tdiagnostics\n\t\t\t};\n\t\t}\n\t\tcase \"funcCall\": {\n\t\t\tconst call = FunctionCallAst.cast(expression.syntax);\n\t\t\tconst name = call?.name();\n\t\t\tif (call === void 0 || name === void 0 || name.dot() !== void 0 || name.colon() !== void 0 || name.identifier()?.name() !== rule.name) return {\n\t\t\t\tmatched: false,\n\t\t\t\treferences,\n\t\t\t\tdiagnostics\n\t\t\t};\n\t\t\tconst functionSymbol = {\n\t\t\t\tkind: \"function\",\n\t\t\t\tname: rule.name,\n\t\t\t\tsignature: rule.signature\n\t\t\t};\n\t\t\treferences.set(name.syntax, {\n\t\t\t\tkind: \"function\",\n\t\t\t\tsymbol: functionSymbol\n\t\t\t});\n\t\t\tlet matched = true;\n\t\t\tlet positional = 0;\n\t\t\tfor (const arg of call.args()) {\n\t\t\t\tconst key = arg.name()?.name();\n\t\t\t\tconst parameter = argumentParameter(rule.signature, key, key === void 0 ? positional++ : positional);\n\t\t\t\tif (parameter === void 0) {\n\t\t\t\t\tmatched = false;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (key !== void 0) {\n\t\t\t\t\tconst keyNode = arg.name()?.syntax;\n\t\t\t\t\tif (keyNode !== void 0) references.set(keyNode, {\n\t\t\t\t\t\tkind: \"parameter\",\n\t\t\t\t\t\tsymbol: {\n\t\t\t\t\t\t\tkind: \"parameter\",\n\t\t\t\t\t\t\tname: key,\n\t\t\t\t\t\t\tparam: parameter\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tconst value = arg.value();\n\t\t\t\tif (value === void 0) {\n\t\t\t\t\tmatched = false;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst trial = tryBindExpression(parameter.type, value, ctx, modelContext);\n\t\t\t\tmatched = trial.matched && matched;\n\t\t\t\tfor (const [node, resolution] of trial.references) references.set(node, resolution);\n\t\t\t\tfor (const [node, diagnostic] of trial.diagnostics) diagnostics.set(node, diagnostic);\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tmatched,\n\t\t\t\treferences,\n\t\t\t\tdiagnostics\n\t\t\t};\n\t\t}\n\t\tcase \"identifier\": {\n\t\t\tif (rule.name === void 0) return {\n\t\t\t\tmatched: true,\n\t\t\t\treferences,\n\t\t\t\tdiagnostics\n\t\t\t};\n\t\t\tconst node = expression.syntax;\n\t\t\tif (IdentifierAst.cast(node)?.name() !== rule.name) return {\n\t\t\t\tmatched: false,\n\t\t\t\treferences,\n\t\t\t\tdiagnostics\n\t\t\t};\n\t\t\treferences.set(node, {\n\t\t\t\tkind: \"constant\",\n\t\t\t\tsymbol: {\n\t\t\t\t\tkind: \"constant\",\n\t\t\t\t\tname: rule.name,\n\t\t\t\t\tdocumentation: rule.documentation\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn {\n\t\t\t\tmatched: true,\n\t\t\t\treferences,\n\t\t\t\tdiagnostics\n\t\t\t};\n\t\t}\n\t\tcase \"entityRef\": {\n\t\t\tconst node = expression.syntax;\n\t\t\tconst written = writtenEntityReference(node);\n\t\t\tif (written === void 0) return {\n\t\t\t\tmatched: false,\n\t\t\t\treferences,\n\t\t\t\tdiagnostics\n\t\t\t};\n\t\t\tconst failures = [];\n\t\t\tconst resolution = resolveEntity(written, node, {\n\t\t\t\t...ctx,\n\t\t\t\tdiagnostics: failures\n\t\t\t});\n\t\t\treferences.set(node, resolution);\n\t\t\tfor (const diagnostic of failures) diagnostics.set(node, diagnostic);\n\t\t\treturn {\n\t\t\t\tmatched: resolution.kind !== \"unresolved\",\n\t\t\t\treferences,\n\t\t\t\tdiagnostics\n\t\t\t};\n\t\t}\n\t\tcase \"fieldRef\": {\n\t\t\tconst node = expression.syntax;\n\t\t\tconst name = IdentifierAst.cast(node)?.name();\n\t\t\tif (name === void 0 || modelContext === void 0) return {\n\t\t\t\tmatched: false,\n\t\t\t\treferences,\n\t\t\t\tdiagnostics\n\t\t\t};\n\t\t\tconst failures = [];\n\t\t\tconst resolution = resolveOwnerField(name, node, {\n\t\t\t\t...modelContext,\n\t\t\t\tdiagnostics: failures\n\t\t\t});\n\t\t\treferences.set(node, resolution);\n\t\t\tfor (const diagnostic of failures) diagnostics.set(node, diagnostic);\n\t\t\treturn {\n\t\t\t\tmatched: resolution.kind !== \"unresolved\",\n\t\t\t\treferences,\n\t\t\t\tdiagnostics\n\t\t\t};\n\t\t}\n\t\tcase \"referencedFieldRef\": {\n\t\t\tconst node = expression.syntax;\n\t\t\tconst name = IdentifierAst.cast(node)?.name();\n\t\t\tif (name === void 0 || modelContext === void 0) return {\n\t\t\t\tmatched: false,\n\t\t\t\treferences,\n\t\t\t\tdiagnostics\n\t\t\t};\n\t\t\tconst failures = [];\n\t\t\tconst resolution = resolveReferencedField(name, node, {\n\t\t\t\t...modelContext,\n\t\t\t\tdiagnostics: failures\n\t\t\t});\n\t\t\treferences.set(node, resolution);\n\t\t\tfor (const diagnostic of failures) diagnostics.set(node, diagnostic);\n\t\t\treturn {\n\t\t\t\tmatched: resolution.kind !== \"unresolved\",\n\t\t\t\treferences,\n\t\t\t\tdiagnostics\n\t\t\t};\n\t\t}\n\t\tcase \"str\":\n\t\tcase \"json\": return {\n\t\t\tmatched: StringLiteralExprAst.cast(expression.syntax) !== void 0,\n\t\t\treferences,\n\t\t\tdiagnostics\n\t\t};\n\t\tcase \"num\":\n\t\tcase \"int\": return {\n\t\t\tmatched: NumberLiteralExprAst.cast(expression.syntax) !== void 0,\n\t\t\treferences,\n\t\t\tdiagnostics\n\t\t};\n\t\tcase \"bool\": return {\n\t\t\tmatched: BooleanLiteralExprAst.cast(expression.syntax) !== void 0,\n\t\t\treferences,\n\t\t\tdiagnostics\n\t\t};\n\t\tcase \"null\": return {\n\t\t\tmatched: IdentifierAst.cast(expression.syntax)?.name() === \"null\",\n\t\t\treferences,\n\t\t\tdiagnostics\n\t\t};\n\t\tcase \"taggedLiteral\": return {\n\t\t\tmatched: TaggedLiteralExprAst.cast(expression.syntax) !== void 0,\n\t\t\treferences,\n\t\t\tdiagnostics\n\t\t};\n\t\tcase \"rejecting\": return {\n\t\t\tmatched: false,\n\t\t\treferences,\n\t\t\tdiagnostics\n\t\t};\n\t}\n}\nfunction recordValues(expression) {\n\tconst record = ObjectLiteralExprAst.cast(expression.syntax);\n\tif (record === void 0) return void 0;\n\treturn (function* () {\n\t\tfor (const field of record.fields()) {\n\t\t\tconst value = field.value();\n\t\t\tif (value !== void 0) yield value;\n\t\t}\n\t})();\n}\nfunction bindAttributes(holder, attributes, specs, instantiate, ctx) {\n\tconst declared = holder.node.attributes();\n\tconst nodes = Array.from(declared);\n\tconst level = holder.kind === \"field\" ? \"field\" : \"model\";\n\tattributes.forEach((attribute, index) => {\n\t\tconst factory = own(specs, attribute.name);\n\t\tif (factory === void 0) {\n\t\t\tconst diagnostic = ctx.describeUnsupportedAttribute?.({\n\t\t\t\tattribute,\n\t\t\t\tlevel,\n\t\t\t\towner: ctx.owner,\n\t\t\t\tfield: level === \"field\" ? ctx.field : void 0\n\t\t\t});\n\t\t\tif (diagnostic !== void 0) ctx.diagnostics.push(diagnostic);\n\t\t\treturn;\n\t\t}\n\t\tconst spec = instantiate(factory);\n\t\tif (spec === void 0) return;\n\t\tconst attributeSymbol = {\n\t\t\tkind: \"attribute\",\n\t\t\tname: attribute.name,\n\t\t\tlevel,\n\t\t\tspec\n\t\t};\n\t\tconst nameNode = nodes[index]?.name()?.syntax;\n\t\tif (nameNode !== void 0) ctx.references.set(nameNode, {\n\t\t\tkind: \"attribute\",\n\t\t\tsymbol: attributeSymbol\n\t\t});\n\t\tbindArguments(attribute, spec, ctx, ctx);\n\t});\n}\nfunction bindArguments(attribute, spec, ctx, modelContext) {\n\tconst rawArgs = Array.from(attribute.node.argList()?.args() ?? []);\n\tlet positional = 0;\n\tattribute.args.forEach((arg, index) => {\n\t\tconst parameter = argumentParameter(spec, arg.name, arg.name === void 0 ? positional++ : positional);\n\t\tif (parameter === void 0) return;\n\t\tif (arg.name !== void 0) {\n\t\t\tconst keyNode = rawArgs[index]?.name()?.syntax;\n\t\t\tif (keyNode !== void 0) ctx.references.set(keyNode, {\n\t\t\t\tkind: \"parameter\",\n\t\t\t\tsymbol: {\n\t\t\t\t\tkind: \"parameter\",\n\t\t\t\t\tname: arg.name,\n\t\t\t\t\tparam: parameter\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tif (arg.expression === void 0) return;\n\t\tbindExpression(parameter.type, arg.expression, ctx, modelContext);\n\t});\n}\nfunction argumentParameter(spec, name, position) {\n\tif (name === void 0) return spec.positional?.[position];\n\treturn spec.named === void 0 ? void 0 : own(spec.named, name);\n}\nfunction resolveOwnerField(name, node, ctx) {\n\tconst field = ctx.owner.fields[name];\n\tif (field !== void 0) return {\n\t\tkind: \"field\",\n\t\tsymbol: field\n\t};\n\treport(`Cannot find field \"${name}\" on \"${ctx.owner.name}\"`, node, ctx, \"field\");\n\treturn {\n\t\tkind: \"unresolved\",\n\t\tname\n\t};\n}\nfunction resolveReferencedField(name, node, ctx) {\n\tconst declaring = ctx.field;\n\tif (declaring === void 0) return {\n\t\tkind: \"unresolved\",\n\t\tname\n\t};\n\tif (declaring.typeContractSpaceId !== void 0) return { kind: \"crossSpace\" };\n\tconst typeNode = typeReferenceNode(declaring);\n\tconst field = targetFields(typeNode === void 0 ? void 0 : ctx.references.get(typeNode))?.[name];\n\tif (field !== void 0) return {\n\t\tkind: \"field\",\n\t\tsymbol: field\n\t};\n\treport(`Cannot find field \"${name}\" on the type of \"${ctx.owner.name}.${declaring.name}\"`, node, ctx, \"field\");\n\treturn {\n\t\tkind: \"unresolved\",\n\t\tname\n\t};\n}\nfunction targetFields(target) {\n\tif (target === void 0) return void 0;\n\tif (target.kind === \"model\" || target.kind === \"compositeType\") return target.symbol.fields;\n}\nfunction resolveEntity(written, node, ctx) {\n\tconst found = written.namespace === void 0 ? ctx.scope.lookup(written.name) : qualifiedMember(written.namespace, written.name, bindQualifier(entityQualifier(node), ctx.scope, ctx.references));\n\tif (found === void 0) {\n\t\tconst name = describeWrittenEntityReference(written);\n\t\tif (written.name !== \"\") report(`Cannot find entity \"${name}\"`, node, ctx, \"entity\");\n\t\treturn {\n\t\t\tkind: \"unresolved\",\n\t\t\tname\n\t\t};\n\t}\n\tif (\"badQualifier\" in found) {\n\t\treport(found.badQualifier, node, ctx, \"entity\");\n\t\treturn {\n\t\t\tkind: \"unresolved\",\n\t\t\tname: found.qualifier\n\t\t};\n\t}\n\treturn found;\n}\nfunction report(message, node, ctx, reference) {\n\tctx.diagnostics.push({\n\t\tcode: PSL_UNRESOLVED_REFERENCE,\n\t\tmessage,\n\t\tdata: { reference },\n\t\t...diagnosticSource(ctx.sources, node).at()\n\t});\n}\nfunction entityQualifier(node) {\n\tconst path = PathExprAst.cast(node);\n\tif (path === void 0) return void 0;\n\tconst [qualifier] = path.segments();\n\treturn qualifier;\n}\nfunction bindQualifier(qualifier, scope, references) {\n\tconst id = qualifier?.name();\n\tif (qualifier === void 0 || id === void 0) return void 0;\n\tconst resolution = scope.lookup(id);\n\tif (resolution !== void 0 && isNamespaceLike(resolution)) references.set(qualifier.syntax, resolution);\n\treturn resolution;\n}\nfunction resolveTypeReference(reference, scope, references, describeUnresolved) {\n\tif (reference === void 0 || reference.isOverQualified()) return void 0;\n\tif (reference.space() !== void 0) return { resolution: { kind: \"crossSpace\" } };\n\tconst name = reference.identifier()?.name();\n\tif (name === void 0 || name === \"\") return void 0;\n\tconst qualifier = reference.namespace();\n\tconst namespaceId = qualifier?.name();\n\tconst found = namespaceId === void 0 ? scope.lookup(name) : qualifiedMember(namespaceId, name, bindQualifier(qualifier, scope, references));\n\tif (found === void 0) {\n\t\tconst written = namespaceId === void 0 ? name : `${namespaceId}.${name}`;\n\t\tconst message = describeUnresolved?.(written) ?? `Cannot find type \"${written}\"`;\n\t\treturn {\n\t\t\tresolution: {\n\t\t\t\tkind: \"unresolved\",\n\t\t\t\tname: written\n\t\t\t},\n\t\t\tmessage,\n\t\t\tname: written\n\t\t};\n\t}\n\tif (\"badQualifier\" in found) return {\n\t\tresolution: {\n\t\t\tkind: \"unresolved\",\n\t\t\tname: found.qualifier\n\t\t},\n\t\tmessage: found.badQualifier,\n\t\tname: found.qualifier\n\t};\n\tif (found.kind === \"namespace\" || found.kind === \"contributedNamespace\") {\n\t\tconst written = namespaceId === void 0 ? name : `${namespaceId}.${name}`;\n\t\treturn {\n\t\t\tresolution: found,\n\t\t\tmessage: `\"${written}\" is a namespace; a type reference must name a model, composite type, enum, or named type`,\n\t\t\tname: written\n\t\t};\n\t}\n\treturn { resolution: found };\n}\nfunction qualifiedMember(namespaceId, name, qualifier) {\n\tif (qualifier === void 0) return void 0;\n\tif (!isNamespaceLike(qualifier)) return {\n\t\tbadQualifier: `\"${namespaceId}\" is ${describeQualifier(qualifier)}, not a namespace`,\n\t\tqualifier: namespaceId\n\t};\n\treturn lookupMember(qualifier, name);\n}\nfunction describeQualifier(resolution) {\n\tswitch (resolution.kind) {\n\t\tcase \"model\": return \"a model\";\n\t\tcase \"compositeType\": return \"a composite type\";\n\t\tcase \"namedType\": return \"a named type\";\n\t\tcase \"block\": return `${resolution.symbol.keyword === \"enum\" ? \"an\" : \"a\"} ${resolution.symbol.keyword}`;\n\t\tdefault: return \"a scalar type\";\n\t}\n}\nfunction own(record, name) {\n\treturn Object.hasOwn(record, name) ? record[name] : void 0;\n}\n//#endregion\n//#region src/symbol-table.ts\n/**\n* Owns duplicate-declaration detection for all PSL scopes; downstream consumers\n* should consume first-wins symbols rather than re-emitting duplicate diagnostics.\n*/\nfunction buildSymbolTable(options) {\n\tconst { documents, sources } = options;\n\tconst diagnostics = [];\n\tconst namespaces = Object.create(null);\n\tconst namedTypes = Object.create(null);\n\tconst blocks = Object.create(null);\n\tconst models = Object.create(null);\n\tconst compositeTypes = Object.create(null);\n\tconst topLevelNames = /* @__PURE__ */ new Set();\n\tfor (const document of documents) {\n\t\tconst sourceFile = sources.sourceFileFor(document.syntax);\n\t\tconst claim = (taken, name) => {\n\t\t\tconst text = name?.name();\n\t\t\tif (text === void 0) return void 0;\n\t\t\tif (taken.has(text)) {\n\t\t\t\tconst range = nameRange(name, sources);\n\t\t\t\tif (range) diagnostics.push({\n\t\t\t\t\tcode: \"PSL_DUPLICATE_DECLARATION\",\n\t\t\t\t\tmessage: `Duplicate declaration of \"${text}\"`,\n\t\t\t\t\tfilename: sourceFile.filename,\n\t\t\t\t\trange\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttaken.add(text);\n\t\t\treturn text;\n\t\t};\n\t\tfor (const declaration of document.declarations()) if (declaration instanceof ModelDeclarationAst) {\n\t\t\tconst name = claim(topLevelNames, declaration.name());\n\t\t\tif (name !== void 0) models[name] = buildModel(name, declaration, sources, diagnostics);\n\t\t} else if (declaration instanceof CompositeTypeDeclarationAst) {\n\t\t\tconst name = claim(topLevelNames, declaration.name());\n\t\t\tif (name !== void 0) compositeTypes[name] = buildCompositeType(name, declaration, sources, diagnostics);\n\t\t} else if (declaration instanceof GenericBlockDeclarationAst) {\n\t\t\tconst name = claim(topLevelNames, declaration.name());\n\t\t\tif (name !== void 0) blocks[name] = buildBlock(name, declaration, sources);\n\t\t} else if (declaration instanceof NamespaceDeclarationAst) {\n\t\t\tconst declaredName = declaration.name()?.name();\n\t\t\tif (declaredName === void 0) continue;\n\t\t\tlet namespace = namespaces[declaredName];\n\t\t\tif (namespace === void 0) {\n\t\t\t\tconst name = claim(topLevelNames, declaration.name());\n\t\t\t\tif (name === void 0) continue;\n\t\t\t\tnamespace = {\n\t\t\t\t\tkind: \"namespace\",\n\t\t\t\t\tname,\n\t\t\t\t\tdeclarations: [{\n\t\t\t\t\t\tnode: declaration,\n\t\t\t\t\t\tspan: nodePslSpan(declaration.syntax, sources)\n\t\t\t\t\t}],\n\t\t\t\t\tmodels: Object.create(null),\n\t\t\t\t\tcompositeTypes: Object.create(null),\n\t\t\t\t\tblocks: Object.create(null)\n\t\t\t\t};\n\t\t\t\tnamespaces[name] = namespace;\n\t\t\t} else namespace.declarations.push({\n\t\t\t\tnode: declaration,\n\t\t\t\tspan: nodePslSpan(declaration.syntax, sources)\n\t\t\t});\n\t\t\textendNamespace(namespace, declaration, diagnostics, sources);\n\t\t} else if (declaration instanceof TypesBlockAst) for (const binding of declaration.declarations()) {\n\t\t\tconst name = claim(topLevelNames, binding.name());\n\t\t\tif (name === void 0) continue;\n\t\t\tconst resolved = resolveNamedTypeBinding(binding, sources);\n\t\t\tnamedTypes[name] = {\n\t\t\t\tkind: \"namedType\",\n\t\t\t\tname,\n\t\t\t\tnode: binding,\n\t\t\t\tspan: nodePslSpan(binding.syntax, sources),\n\t\t\t\t...resolved\n\t\t\t};\n\t\t}\n\t}\n\treturn {\n\t\tsymbolTable: { topLevel: {\n\t\t\tnamespaces,\n\t\t\tnamedTypes,\n\t\t\tblocks,\n\t\t\tmodels,\n\t\t\tcompositeTypes\n\t\t} },\n\t\tdiagnostics\n\t};\n}\nfunction buildModel(name, node, sources, diagnostics) {\n\treturn {\n\t\tkind: \"model\",\n\t\tname,\n\t\tnode,\n\t\tspan: nodePslSpan(node.syntax, sources),\n\t\tfields: buildFields(name, node.fields(), sources, diagnostics),\n\t\tattributes: readResolvedAttributes(node.attributes(), sources)\n\t};\n}\nfunction buildCompositeType(name, node, sources, diagnostics) {\n\treturn {\n\t\tkind: \"compositeType\",\n\t\tname,\n\t\tnode,\n\t\tspan: nodePslSpan(node.syntax, sources),\n\t\tfields: buildFields(name, node.fields(), sources, diagnostics),\n\t\tattributes: readResolvedAttributes(node.attributes(), sources)\n\t};\n}\nfunction buildBlock(name, node, sources) {\n\treturn {\n\t\tkind: \"block\",\n\t\tname,\n\t\tkeyword: node.keyword()?.text ?? \"\",\n\t\tnode,\n\t\tspan: nodePslSpan(node.syntax, sources)\n\t};\n}\nfunction extendNamespace(namespace, node, diagnostics, sources) {\n\tconst { models, compositeTypes, blocks } = namespace;\n\tfor (const member of node.declarations()) {\n\t\tconst memberName = member.name()?.name();\n\t\tif (memberName === void 0) continue;\n\t\tif (Object.hasOwn(models, memberName) || Object.hasOwn(compositeTypes, memberName) || Object.hasOwn(blocks, memberName)) {\n\t\t\tconst range = nameRange(member.name(), sources);\n\t\t\tif (range) diagnostics.push({\n\t\t\t\tcode: \"PSL_DUPLICATE_DECLARATION\",\n\t\t\t\tmessage: `Duplicate declaration of \"${memberName}\"`,\n\t\t\t\tfilename: sources.sourceFileFor(member.syntax).filename,\n\t\t\t\trange\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (member instanceof ModelDeclarationAst) models[memberName] = buildModel(memberName, member, sources, diagnostics);\n\t\telse if (member instanceof CompositeTypeDeclarationAst) compositeTypes[memberName] = buildCompositeType(memberName, member, sources, diagnostics);\n\t\telse if (member instanceof GenericBlockDeclarationAst) blocks[memberName] = buildBlock(memberName, member, sources);\n\t}\n}\nfunction buildFields(ownerName, fields, sources, diagnostics) {\n\tconst result = Object.create(null);\n\tfor (const field of fields) {\n\t\tconst nameNode = field.name();\n\t\tconst name = nameNode?.name();\n\t\tif (name === void 0) continue;\n\t\tif (Object.hasOwn(result, name)) {\n\t\t\tconst range = nameRange(nameNode, sources);\n\t\t\tif (range) diagnostics.push({\n\t\t\t\tcode: \"PSL_DUPLICATE_DECLARATION\",\n\t\t\t\tmessage: `Duplicate declaration of \"${name}\"`,\n\t\t\t\tfilename: sources.sourceFileFor(field.syntax).filename,\n\t\t\t\trange\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tresult[name] = buildField(ownerName, name, field, sources, diagnostics);\n\t}\n\treturn result;\n}\nfunction buildField(ownerName, name, node, sources, diagnostics) {\n\tconst attributes = readResolvedAttributes(node.attributes(), sources);\n\tconst span = nodePslSpan(node.syntax, sources);\n\tconst annotation = node.typeAnnotation();\n\tconst typeName = annotation?.name();\n\tif (typeName?.isOverQualified()) {\n\t\tconst path = typeName.path();\n\t\tdiagnostics.push({\n\t\t\tcode: \"PSL_INVALID_QUALIFIED_TYPE\",\n\t\t\tmessage: `Field \"${ownerName}.${name}\" has an invalid qualified type \"${path.join(\".\")}\"; use at most one namespace qualifier (e.g. \"ns.TypeName\")`,\n\t\t\tfilename: sources.sourceFileFor(typeName.syntax).filename,\n\t\t\trange: nodeRange(typeName.syntax, sources)\n\t\t});\n\t\treturn {\n\t\t\tkind: \"field\",\n\t\t\tname,\n\t\t\tnode,\n\t\t\tspan,\n\t\t\ttypeName: path[path.length - 1] ?? \"\",\n\t\t\toptional: false,\n\t\t\tlist: false,\n\t\t\telementOptional: false,\n\t\t\tmalformedType: true,\n\t\t\tattributes\n\t\t};\n\t}\n\tconst typeConstructor = annotation?.isConstructor() ? readResolvedConstructorCall(annotation, sources) : void 0;\n\tconst typeNamespaceId = typeName?.namespace()?.name();\n\tconst typeContractSpaceId = typeName?.space()?.name();\n\treturn {\n\t\tkind: \"field\",\n\t\tname,\n\t\tnode,\n\t\tspan,\n\t\ttypeName: typeName?.identifier()?.name() ?? \"\",\n\t\t...typeNamespaceId !== void 0 ? { typeNamespaceId } : {},\n\t\t...typeContractSpaceId !== void 0 ? { typeContractSpaceId } : {},\n\t\toptional: annotation?.isOptional() ?? false,\n\t\tlist: annotation?.isList() ?? false,\n\t\telementOptional: annotation?.isElementOptional() ?? false,\n\t\t...typeConstructor !== void 0 ? { typeConstructor } : {},\n\t\tattributes\n\t};\n}\nfunction resolveNamedTypeBinding(node, sources) {\n\tconst annotation = node.typeAnnotation();\n\tconst isConstructor = annotation?.isConstructor() ?? false;\n\tconst baseType = annotation?.name()?.identifier()?.name();\n\tconst typeConstructor = readResolvedConstructorCall(annotation, sources);\n\treturn {\n\t\tisConstructor,\n\t\t...!isConstructor && baseType !== void 0 ? { baseType } : {},\n\t\t...typeConstructor !== void 0 ? { typeConstructor } : {},\n\t\tattributes: readResolvedAttributes(node.attributes(), sources)\n\t};\n}\nfunction nameRange(name, sources) {\n\tif (name === void 0) return void 0;\n\tconst sourceFile = sources.sourceFileFor(name.syntax);\n\tfor (const token of name.syntax.tokens()) if (token.kind === \"Ident\") return {\n\t\tstart: sourceFile.positionAt(token.offset),\n\t\tend: sourceFile.positionAt(token.offset + token.text.length)\n\t};\n}\nfunction nodeRange(node, sources) {\n\tconst sourceFile = sources.sourceFileFor(node);\n\tconst start = node.offset;\n\tconst end = start + node.green.textLength;\n\treturn {\n\t\tstart: sourceFile.positionAt(start),\n\t\tend: sourceFile.positionAt(end)\n\t};\n}\n//#endregion\nexport { typeReferenceNode as a, findBlockDescriptor as c, describeWrittenEntityReference as d, entityReference as f, assembleAttributeSpecs as h, createBinder as i, blockSpecFactoryOf as l, writtenEntityReference as m, PSL_UNRESOLVED_REFERENCE as n, isNamespaceLike as o, matchesSelector as p, contributedTypeOf as r, memberEntries as s, buildSymbolTable as t, describeResolution as u };\n\n//# sourceMappingURL=symbol-table-C1ATzvmU.mjs.map","import { a as typeReferenceNode, c as findBlockDescriptor, d as describeWrittenEntityReference, f as entityReference, h as assembleAttributeSpecs, i as createBinder, l as blockSpecFactoryOf, m as writtenEntityReference, n as PSL_UNRESOLVED_REFERENCE, o as isNamespaceLike, p as matchesSelector, r as contributedTypeOf, s as memberEntries, t as buildSymbolTable, u as describeResolution } from \"./symbol-table-C1ATzvmU.mjs\";\nimport { n as isPslIdentifier } from \"./tokenizer-BMz7z2KR.mjs\";\nimport { C as TaggedLiteralExprAst, D as IdentifierAst, S as StringLiteralExprAst, _ as FunctionCallAst, b as ObjectLiteralExprAst, g as BooleanLiteralExprAst, m as ArrayLiteralAst, v as NumberLiteralExprAst } from \"./declarations-DDT0hm5r.mjs\";\nimport { a as readResolvedConstructorCall, c as diagnosticSource, i as readResolvedAttributes, l as mapPslDiagnostics, n as nodePslSpan, o as createPslDiagnosticCollector, r as readResolvedAttribute, s as diagnosticFromSpan, t as keywordPslSpan } from \"./resolve-C8PUf8zv.mjs\";\nimport { flatPslModels, namespacePslExtensionBlocks } from \"@internal/framework-components/psl-ast\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { and, notOk, ok, okVoid, or } from \"@internal/utils/result\";\n//#region src/attribute-helpers.ts\nfunction getPositionalArgument(attribute, index = 0) {\n\treturn attribute.args.filter((arg) => arg.kind === \"positional\")[index]?.value;\n}\nfunction parseQuotedStringLiteral(value) {\n\tconst match = value.trim().match(/^(['\"])(.*)\\1$/);\n\tif (!match) return void 0;\n\treturn match[2] ?? \"\";\n}\n//#endregion\n//#region src/attribute-spec/block-attribute.ts\nfunction blockAttribute(name, config) {\n\treturn {\n\t\tlevel: \"block\",\n\t\tname,\n\t\tdocumentation: config.documentation,\n\t\tpositional: config.positional ?? [],\n\t\tnamed: config.named ?? {},\n\t\t...config.refine !== void 0 ? { refine: config.refine } : {}\n\t};\n}\n//#endregion\n//#region src/attribute-spec/combinators/diagnostic.ts\nconst ATTRIBUTE_DIAGNOSTIC_CODE = \"PSL_INVALID_ATTRIBUTE_SYNTAX\";\nfunction leafDiagnostic(ctx, node, message, code = ATTRIBUTE_DIAGNOSTIC_CODE) {\n\treturn {\n\t\tcode,\n\t\tmessage,\n\t\t...diagnosticSource(ctx.sources, node.syntax).at(nodePslSpan(node.syntax, ctx.sources))\n\t};\n}\n//#endregion\n//#region src/attribute-spec/combinators/bool.ts\nfunction bool() {\n\treturn {\n\t\tkind: \"bool\",\n\t\tlabel: \"boolean\",\n\t\tparse: (arg, ctx) => {\n\t\t\tconst literal = BooleanLiteralExprAst.cast(arg.syntax);\n\t\t\tif (literal !== void 0) {\n\t\t\t\tconst value = literal.value();\n\t\t\t\tif (value !== void 0) return ok(value);\n\t\t\t}\n\t\t\treturn notOk([leafDiagnostic(ctx, arg, \"Expected a boolean literal\")]);\n\t\t}\n\t};\n}\n//#endregion\n//#region src/attribute-spec/combinators/entity-ref.ts\nfunction entityRef(expected) {\n\tconst label = `${expected.kind === \"block\" ? expected.keyword : expected.kind} reference`;\n\treturn {\n\t\tkind: \"entityRef\",\n\t\tlabel,\n\t\texpected,\n\t\tparse: (arg, ctx) => {\n\t\t\tconst written = writtenEntityReference(arg.syntax);\n\t\t\tif (written === void 0) return notOk([leafDiagnostic(ctx, arg, `Expected ${label}`)]);\n\t\t\tconst name = describeWrittenEntityReference(written);\n\t\t\tconst resolution = ctx.binder.symbolForNode(arg.syntax);\n\t\t\tif (resolution === void 0 || resolution.kind === \"unresolved\") return notOk([]);\n\t\t\tconst reference = entityReference(resolution);\n\t\t\tif (reference === void 0 || !matchesSelector(reference, expected)) return notOk([leafDiagnostic(ctx, arg, `Expected ${label} \"${name}\", found ${describeResolution(resolution)}`)]);\n\t\t\treturn ok(reference);\n\t\t}\n\t};\n}\n//#endregion\n//#region src/attribute-spec/combinators/field-ref.ts\nfunction parseFieldName(arg, ctx) {\n\tconst identifier = IdentifierAst.cast(arg.syntax);\n\tif (identifier === void 0) return notOk([leafDiagnostic(ctx, arg, \"Expected a field name\")]);\n\tconst name = identifier.name();\n\tif (name === void 0) return notOk([leafDiagnostic(ctx, arg, \"Expected a field name\")]);\n\tconst resolution = ctx.binder.symbolForNode(arg.syntax);\n\tif (resolution === void 0) return notOk([]);\n\tif (resolution.kind === \"field\") return ok(resolution.symbol.name);\n\tif (resolution.kind === \"crossSpace\") return ok(name);\n\treturn notOk([]);\n}\nfunction fieldRef() {\n\treturn {\n\t\tkind: \"fieldRef\",\n\t\tlabel: \"field name\",\n\t\tparse: parseFieldName\n\t};\n}\nfunction referencedFieldRef() {\n\treturn {\n\t\tkind: \"referencedFieldRef\",\n\t\tlabel: \"field name\",\n\t\tparse: parseFieldName\n\t};\n}\n//#endregion\n//#region src/attribute-spec/interpret.ts\nfunction interpretArgs(args, spec, ctx, span, sourceNode) {\n\tlet outcome = okVoid();\n\tconst output = {};\n\tconst seen = /* @__PURE__ */ new Set();\n\tlet positionalSlot = 0;\n\tlet reportedExcess = false;\n\tfor (const arg of args) {\n\t\tconst name = arg.name()?.name();\n\t\tlet key;\n\t\tlet param;\n\t\tif (name === void 0) {\n\t\t\tconst posParam = spec.positional[positionalSlot];\n\t\t\tif (posParam === void 0) {\n\t\t\t\tif (!reportedExcess) {\n\t\t\t\t\toutcome = and(outcome, notOk([diagnostic(`Attribute \"${spec.name}\" received too many positional arguments`, ctx, span, sourceNode)]));\n\t\t\t\t\treportedExcess = true;\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tpositionalSlot += 1;\n\t\t\tkey = posParam.key;\n\t\t\tparam = posParam.type;\n\t\t} else {\n\t\t\tconst namedParam = Object.hasOwn(spec.named, name) ? spec.named[name] : void 0;\n\t\t\tif (namedParam === void 0) {\n\t\t\t\toutcome = and(outcome, notOk([diagnostic(`Attribute \"${spec.name}\" received unknown argument \"${name}\"`, ctx, nodePslSpan(arg.syntax, ctx.sources), arg.syntax)]));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tkey = name;\n\t\t\tparam = namedParam.type;\n\t\t}\n\t\tif (seen.has(key)) {\n\t\t\toutcome = and(outcome, notOk([diagnostic(`Attribute \"${spec.name}\" received duplicate argument \"${key}\"`, ctx, nodePslSpan(arg.syntax, ctx.sources), arg.syntax)]));\n\t\t\tcontinue;\n\t\t}\n\t\tseen.add(key);\n\t\tconst result = parseArgValue(arg, param, ctx);\n\t\tif (result.ok) output[key] = result.value;\n\t\toutcome = and(outcome, result);\n\t}\n\tconst finalized = /* @__PURE__ */ new Set();\n\tconst finalizeAbsentKey = (key, positionalParam, namedParam) => {\n\t\tif (finalized.has(key) || seen.has(key)) return;\n\t\tfinalized.add(key);\n\t\tconst effective = namedParam ?? positionalParam;\n\t\tif (effective === void 0) return;\n\t\tif (isOptionalArgType(effective)) {\n\t\t\tif (effective.hasDefault) output[key] = effective.defaultValue;\n\t\t\treturn;\n\t\t}\n\t\toutcome = and(outcome, notOk([diagnostic(`Attribute \"${spec.name}\" is missing required argument \"${key}\"`, ctx, span, sourceNode)]));\n\t};\n\tfor (const param of spec.positional) {\n\t\tconst namedParam = Object.hasOwn(spec.named, param.key) ? spec.named[param.key] : void 0;\n\t\tfinalizeAbsentKey(param.key, param.type, namedParam?.type);\n\t}\n\tfor (const key of Object.keys(spec.named)) finalizeAbsentKey(key, void 0, spec.named[key]?.type);\n\tif (!outcome.ok) return notOk(outcome.failure);\n\treturn ok(output);\n}\nfunction interpretAttribute(attrNode, spec, ctx) {\n\tconst attributeSpan = nodePslSpan(attrNode.syntax, ctx.sources);\n\tconst bound = interpretArgs(attrNode.argList()?.args() ?? [], spec, ctx, attributeSpan, attrNode.syntax);\n\tif (!bound.ok) return notOk(bound.failure);\n\tconst value = blindCast(bound.value);\n\tif (spec.refine !== void 0) {\n\t\tconst refineDiagnostics = spec.refine(value, ctx, attrNode);\n\t\tif (refineDiagnostics.length > 0) return notOk(refineDiagnostics);\n\t}\n\treturn ok(value);\n}\nfunction parseArgValue(arg, argType, ctx) {\n\tconst value = arg.value();\n\tif (value === void 0) return notOk([diagnostic(\"Attribute argument is missing a value\", ctx, nodePslSpan(arg.syntax, ctx.sources), arg.syntax)]);\n\treturn argType.parse(value, ctx);\n}\nfunction isOptionalArgType(param) {\n\treturn \"optional\" in param && param.optional === true;\n}\nfunction diagnostic(message, ctx, span, sourceNode) {\n\treturn {\n\t\tcode: ATTRIBUTE_DIAGNOSTIC_CODE,\n\t\tmessage,\n\t\t...diagnosticSource(ctx.sources, sourceNode).at(span)\n\t};\n}\n//#endregion\n//#region src/attribute-spec/combinators/func-call.ts\nfunction funcCall(name, sig) {\n\treturn {\n\t\tkind: \"funcCall\",\n\t\tlabel: `${name}()`,\n\t\tname,\n\t\tsignature: sig,\n\t\tparse: (arg, ctx) => {\n\t\t\tconst guard = matchCallee(arg, name, ctx);\n\t\t\tif (!guard.ok) return guard;\n\t\t\tconst span = nodePslSpan(guard.value.syntax, ctx.sources);\n\t\t\tconst bound = interpretArgs(guard.value.args(), {\n\t\t\t\tname,\n\t\t\t\tpositional: sig.positional ?? [],\n\t\t\t\tnamed: sig.named ?? {}\n\t\t\t}, ctx, span, guard.value.syntax);\n\t\t\tif (!bound.ok) return notOk(bound.failure);\n\t\t\treturn ok({\n\t\t\t\tfn: name,\n\t\t\t\tspan,\n\t\t\t\targs: bound.value\n\t\t\t});\n\t\t}\n\t};\n}\nfunction matchCallee(arg, name, ctx) {\n\tconst call = FunctionCallAst.cast(arg.syntax);\n\tif (call === void 0) return notOk([leafDiagnostic(ctx, arg, \"Expected a function call\")]);\n\tconst qname = call.name();\n\tif (qname === void 0 || qname.dot() !== void 0 || qname.colon() !== void 0) return notOk([leafDiagnostic(ctx, arg, \"Expected a function call\")]);\n\tconst calleeName = qname.identifier()?.token()?.text;\n\tif (calleeName === void 0) return notOk([leafDiagnostic(ctx, arg, \"Expected a function call\")]);\n\tif (calleeName !== name) return notOk([leafDiagnostic(ctx, arg, `Expected ${name}()`)]);\n\treturn ok(call);\n}\n//#endregion\n//#region src/attribute-spec/combinators/identifier.ts\nfunction identifier(name, options) {\n\tconst label = name ?? \"identifier\";\n\treturn {\n\t\tkind: \"identifier\",\n\t\tlabel,\n\t\tname,\n\t\tdocumentation: options?.documentation ?? \"\",\n\t\tparse: (arg, ctx) => {\n\t\t\tconst value = IdentifierAst.cast(arg.syntax)?.name();\n\t\t\tif (value !== void 0 && (name === void 0 || value === name)) return ok(value);\n\t\t\treturn notOk([leafDiagnostic(ctx, arg, `Expected ${label}`)]);\n\t\t}\n\t};\n}\n//#endregion\n//#region src/attribute-spec/combinators/int.ts\nfunction int(opts) {\n\tconst min = opts?.min;\n\tconst max = opts?.max;\n\treturn {\n\t\tkind: \"int\",\n\t\tlabel: \"integer\",\n\t\t...min === void 0 ? {} : { min },\n\t\t...max === void 0 ? {} : { max },\n\t\tparse: (arg, ctx) => {\n\t\t\tconst literal = NumberLiteralExprAst.cast(arg.syntax);\n\t\t\tif (literal !== void 0) {\n\t\t\t\tconst value = literal.value();\n\t\t\t\tif (value !== void 0 && Number.isInteger(value)) {\n\t\t\t\t\tif ((min === void 0 || value >= min) && (max === void 0 || value <= max)) return ok(value);\n\t\t\t\t\treturn notOk([leafDiagnostic(ctx, arg, rangeMessage(min, max))]);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn notOk([leafDiagnostic(ctx, arg, \"Expected an integer literal\")]);\n\t\t}\n\t};\n}\nfunction rangeMessage(min, max) {\n\tif (min !== void 0 && max !== void 0) return `Expected an integer between ${min} and ${max}`;\n\tif (min !== void 0) return `Expected an integer greater than or equal to ${min}`;\n\treturn `Expected an integer less than or equal to ${max}`;\n}\n//#endregion\n//#region src/attribute-spec/combinators/json.ts\n/**\n* Reads an opaque JSON object from a quoted JSON string — the ADR's one text-encoded surface\n* exception (e.g. an index `filter` / `weights` argument). The string is decoded by the parser,\n* then JSON-parsed; a non-object (array/scalar) or invalid JSON is a diagnostic.\n*/\nfunction json() {\n\treturn {\n\t\tkind: \"json\",\n\t\tlabel: \"JSON object\",\n\t\tparse: (arg, ctx) => {\n\t\t\tconst literal = StringLiteralExprAst.cast(arg.syntax);\n\t\t\tif (literal === void 0) return notOk([leafDiagnostic(ctx, arg, \"Expected a JSON object string\")]);\n\t\t\tconst raw = literal.value();\n\t\t\tif (raw !== void 0) try {\n\t\t\t\tconst parsed = JSON.parse(raw);\n\t\t\t\tif (typeof parsed === \"object\" && parsed !== null && !Array.isArray(parsed)) return ok(blindCast(parsed));\n\t\t\t} catch {}\n\t\t\treturn notOk([leafDiagnostic(ctx, arg, \"Expected a valid JSON object\")]);\n\t\t}\n\t};\n}\n//#endregion\n//#region src/attribute-spec/combinators/list.ts\nfunction list(of, opts) {\n\tconst allowEmpty = opts?.allowEmpty ?? true;\n\tconst unique = opts?.unique ?? false;\n\treturn {\n\t\tkind: \"list\",\n\t\tlabel: opts?.label ?? (of.label.includes(\" | \") ? `(${of.label})[]` : `${of.label}[]`),\n\t\tof,\n\t\tallowEmpty,\n\t\tunique,\n\t\tparse: (arg, ctx) => {\n\t\t\tconst literal = ArrayLiteralAst.cast(arg.syntax);\n\t\t\tif (literal === void 0) return notOk([leafDiagnostic(ctx, arg, `Expected a list of ${of.label}`)]);\n\t\t\tconst parsed = [];\n\t\t\tlet outcome = okVoid();\n\t\t\tlet count = 0;\n\t\t\tfor (const element of literal.elements()) {\n\t\t\t\tcount += 1;\n\t\t\t\tconst result = of.parse(element, ctx);\n\t\t\t\tif (result.ok) parsed.push({\n\t\t\t\t\tnode: element,\n\t\t\t\t\tvalue: result.value\n\t\t\t\t});\n\t\t\t\toutcome = and(outcome, result);\n\t\t\t}\n\t\t\tif (!allowEmpty && count === 0) outcome = and(outcome, notOk([leafDiagnostic(ctx, arg, \"Expected a non-empty list\")]));\n\t\t\tif (unique) {\n\t\t\t\tconst seen = /* @__PURE__ */ new Set();\n\t\t\t\tfor (const { node, value } of parsed) if (seen.has(value)) outcome = and(outcome, notOk([leafDiagnostic(ctx, node, \"Duplicate list entry\")]));\n\t\t\t\telse seen.add(value);\n\t\t\t}\n\t\t\tif (!outcome.ok) return notOk(outcome.failure);\n\t\t\treturn ok(parsed.map((entry) => entry.value));\n\t\t}\n\t};\n}\n//#endregion\n//#region src/attribute-spec/combinators/one-of.ts\nfunction oneOf(...alts) {\n\tconst label = alts.map((alt) => alt.label).join(\" | \");\n\treturn {\n\t\tkind: \"oneOf\",\n\t\tlabel,\n\t\talternatives: alts,\n\t\tparse: (arg, ctx) => {\n\t\t\tconst [head, ...tail] = blindCast(alts);\n\t\t\tlet rejection = head.parse(arg, ctx);\n\t\t\tif (rejection.ok) return rejection;\n\t\t\tfor (const alt of tail) {\n\t\t\t\tconst result = alt.parse(arg, ctx);\n\t\t\t\tif (result.ok) return result;\n\t\t\t\trejection = or(rejection, result);\n\t\t\t}\n\t\t\tif (!rejection.ok && rejection.failure.length === 0) return notOk([]);\n\t\t\treturn notOk([leafDiagnostic(ctx, arg, `Expected one of: ${label}`)]);\n\t\t}\n\t};\n}\n//#endregion\n//#region src/attribute-spec/combinators/record.ts\nfunction record(of) {\n\treturn {\n\t\tkind: \"record\",\n\t\tlabel: `{ [key]: ${of.label} }`,\n\t\tof,\n\t\tparse: (arg, ctx) => {\n\t\t\tconst literal = ObjectLiteralExprAst.cast(arg.syntax);\n\t\t\tif (literal === void 0) return notOk([leafDiagnostic(ctx, arg, \"Expected an object literal\")]);\n\t\t\tconst entries = [];\n\t\t\tconst keys = /* @__PURE__ */ new Set();\n\t\t\tlet outcome = okVoid();\n\t\t\tfor (const field of Array.from(literal.fields())) {\n\t\t\t\tconst key = field.keyName();\n\t\t\t\tif (key === void 0) {\n\t\t\t\t\toutcome = and(outcome, notOk([leafDiagnostic(ctx, field, \"Expected a key\")]));\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst value = field.value();\n\t\t\t\tif (value === void 0) {\n\t\t\t\t\toutcome = and(outcome, notOk([leafDiagnostic(ctx, field, `Expected a value for key \"${key}\"`)]));\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst parsed = of.parse(value, ctx);\n\t\t\t\tif (!parsed.ok) {\n\t\t\t\t\toutcome = and(outcome, parsed);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (keys.has(key)) {\n\t\t\t\t\toutcome = and(outcome, notOk([leafDiagnostic(ctx, field, `Duplicate key \"${key}\"`)]));\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tkeys.add(key);\n\t\t\t\tentries.push([key, parsed.value]);\n\t\t\t}\n\t\t\tif (!outcome.ok) return notOk(outcome.failure);\n\t\t\treturn ok(Object.fromEntries(entries));\n\t\t}\n\t};\n}\n//#endregion\n//#region src/attribute-spec/combinators/str.ts\nfunction str(value) {\n\tif (value === void 0) return {\n\t\tkind: \"str\",\n\t\tlabel: \"string\",\n\t\tvalue: void 0,\n\t\tparse: (arg, ctx) => {\n\t\t\tconst literal = StringLiteralExprAst.cast(arg.syntax);\n\t\t\tif (literal !== void 0) {\n\t\t\t\tconst parsed = literal.value();\n\t\t\t\tif (parsed !== void 0) return ok(parsed);\n\t\t\t}\n\t\t\treturn notOk([leafDiagnostic(ctx, arg, \"Expected a string literal\")]);\n\t\t}\n\t};\n\treturn {\n\t\tkind: \"str\",\n\t\tlabel: JSON.stringify(value),\n\t\tvalue,\n\t\tparse: (arg, ctx) => {\n\t\t\tconst literal = StringLiteralExprAst.cast(arg.syntax);\n\t\t\tif (literal !== void 0) {\n\t\t\t\tif (literal.value() === value) return ok(value);\n\t\t\t}\n\t\t\treturn notOk([leafDiagnostic(ctx, arg, `Expected ${JSON.stringify(value)}`)]);\n\t\t}\n\t};\n}\n//#endregion\n//#region src/attribute-spec/combinators/json-value.ts\nfunction jsonValue() {\n\tconst self = {\n\t\tkind: \"oneOf\",\n\t\tlabel: \"JSON value\",\n\t\tget alternatives() {\n\t\t\treturn composed.alternatives;\n\t\t},\n\t\tparse: (arg, ctx) => composed.parse(arg, ctx)\n\t};\n\tconst composed = oneOf(str(), finiteNumber(), bool(), jsonNull(), list(self), record(self));\n\treturn self;\n}\nfunction finiteNumber() {\n\treturn {\n\t\tkind: \"num\",\n\t\tvalue: void 0,\n\t\tlabel: \"number\",\n\t\tparse: (arg, ctx) => {\n\t\t\tconst value = NumberLiteralExprAst.cast(arg.syntax)?.value();\n\t\t\tif (value === void 0 || Number.isNaN(value) || !Number.isFinite(value)) return notOk([leafDiagnostic(ctx, arg, \"Expected a finite number literal\")]);\n\t\t\treturn ok(value);\n\t\t}\n\t};\n}\nfunction jsonNull() {\n\treturn {\n\t\tkind: \"null\",\n\t\tlabel: \"null\",\n\t\tparse: (arg, ctx) => {\n\t\t\tif (IdentifierAst.cast(arg.syntax)?.name() === \"null\") return ok(null);\n\t\t\treturn notOk([leafDiagnostic(ctx, arg, \"Expected null\")]);\n\t\t}\n\t};\n}\n//#endregion\n//#region src/attribute-spec/combinators/num.ts\nfunction num(value) {\n\tif (value === void 0) return {\n\t\tkind: \"num\",\n\t\tlabel: \"number\",\n\t\tvalue: void 0,\n\t\tparse: (arg, ctx) => {\n\t\t\tconst literal = NumberLiteralExprAst.cast(arg.syntax);\n\t\t\tif (literal !== void 0) {\n\t\t\t\tconst parsed = literal.value();\n\t\t\t\tif (parsed !== void 0) return ok(parsed);\n\t\t\t}\n\t\t\treturn notOk([leafDiagnostic(ctx, arg, \"Expected a number literal\")]);\n\t\t}\n\t};\n\treturn {\n\t\tkind: \"num\",\n\t\tlabel: String(value),\n\t\tvalue,\n\t\tparse: (arg, ctx) => {\n\t\t\tconst literal = NumberLiteralExprAst.cast(arg.syntax);\n\t\t\tif (literal !== void 0) {\n\t\t\t\tif (literal.value() === value) return ok(value);\n\t\t\t}\n\t\t\treturn notOk([leafDiagnostic(ctx, arg, `Expected ${value}`)]);\n\t\t}\n\t};\n}\n//#endregion\n//#region src/attribute-spec/combinators/num-literal.ts\n/** A number literal kept as its source text, for consumers that must not round it through a JS number. */\nfunction numLiteral() {\n\treturn {\n\t\tkind: \"num\",\n\t\tlabel: \"number\",\n\t\tvalue: void 0,\n\t\tparse: (arg, ctx) => {\n\t\t\tconst text = NumberLiteralExprAst.cast(arg.syntax)?.token()?.text;\n\t\t\tif (text !== void 0) return ok({ text });\n\t\t\treturn notOk([leafDiagnostic(ctx, arg, \"Expected a number literal\")]);\n\t\t}\n\t};\n}\n//#endregion\n//#region src/attribute-spec/combinators/tagged-literal.ts\n/**\n* A `` tag`...` ``, `tag\"...\"`, or `tag'...'` argument. `tags` and `documentation` describe the\n* registered tags for tooling; parsing accepts any tag.\n*/\nfunction taggedLiteral(tags, options) {\n\treturn {\n\t\tkind: \"taggedLiteral\",\n\t\tlabel: `${tags[0] ?? \"tag\"}\\`...\\``,\n\t\ttags,\n\t\tdocumentation: options.documentation,\n\t\tparse: (arg, ctx) => {\n\t\t\tconst literal = TaggedLiteralExprAst.cast(arg.syntax);\n\t\t\tif (literal === void 0) return notOk([leafDiagnostic(ctx, arg, \"Expected a tagged literal\")]);\n\t\t\treturn ok({\n\t\t\t\ttag: literal.tagName(),\n\t\t\t\tcanonicalization: literal.canonicalization(),\n\t\t\t\tspan: nodePslSpan(literal.syntax, ctx.sources)\n\t\t\t});\n\t\t}\n\t};\n}\n//#endregion\n//#region src/attribute-spec/field-attribute.ts\nfunction fieldAttribute(name, config) {\n\treturn {\n\t\tlevel: \"field\",\n\t\tname,\n\t\tdocumentation: config.documentation,\n\t\tpositional: config.positional ?? [],\n\t\tnamed: Object.assign(Object.create(null), config.named),\n\t\t...config.refine !== void 0 ? { refine: config.refine } : {}\n\t};\n}\n//#endregion\n//#region src/attribute-spec/model-attribute.ts\nfunction modelAttribute(name, config) {\n\treturn {\n\t\tlevel: \"model\",\n\t\tname,\n\t\tdocumentation: config.documentation,\n\t\tpositional: config.positional ?? [],\n\t\tnamed: Object.assign(Object.create(null), config.named),\n\t\t...config.refine !== void 0 ? { refine: config.refine } : {}\n\t};\n}\n//#endregion\n//#region src/attribute-spec/optional.ts\nfunction optional(type, ...rest) {\n\tif (rest.length === 0) return {\n\t\t...type,\n\t\toptional: true,\n\t\thasDefault: false\n\t};\n\treturn {\n\t\t...type,\n\t\toptional: true,\n\t\thasDefault: true,\n\t\tdefaultValue: rest[0]\n\t};\n}\n//#endregion\n//#region src/block-spec/constructors.ts\nfunction structBlock(config) {\n\treturn {\n\t\tmode: \"struct\",\n\t\tparameters: config.parameters\n\t};\n}\nfunction mapBlock(config) {\n\treturn {\n\t\tmode: \"map\",\n\t\tvalue: config.value,\n\t\tallowBare: config.allowBare ?? false\n\t};\n}\n//#endregion\n//#region src/block-spec/interpret.ts\nfunction interpretExtensionBlock(input) {\n\tconst { block, descriptor, spec, symbols, sources, binder } = input;\n\tconst ctx = {\n\t\tsources,\n\t\tsymbols,\n\t\tbinder,\n\t\tselfBlock: block\n\t};\n\tconst entries = spec.mode === \"struct\" ? interpretStructBlock(block, spec, ctx) : interpretMapBlock(block, spec, ctx);\n\tconst diagnostics = [...entries.diagnostics];\n\tconst interpretedAttributes = interpretExtensionBlockAttributes({\n\t\tblock,\n\t\tdescriptor,\n\t\tsymbols,\n\t\tsources,\n\t\tbinder\n\t});\n\tdiagnostics.push(...interpretedAttributes.diagnostics);\n\tif (entries.failed || diagnostics.length > 0) return notOk(diagnostics);\n\treturn ok({\n\t\tkind: descriptor.discriminator,\n\t\tkeyword: block.keyword,\n\t\tname: block.name,\n\t\tvalues: blindCast(entries.values),\n\t\tparameterSpans: entries.parameterSpans,\n\t\tnumberTexts: entries.numberTexts,\n\t\tattributes: interpretedAttributes.attributes,\n\t\tspan: block.span\n\t});\n}\nfunction interpretStructBlock(block, spec, ctx) {\n\tconst diagnostics = [];\n\tlet failed = false;\n\tconst values = Object.create(null);\n\tconst parameterSpans = Object.create(null);\n\tconst numberTexts = Object.create(null);\n\tconst seen = /* @__PURE__ */ new Set();\n\tfor (const entry of block.node.entries()) {\n\t\tconst key = entry.key()?.name();\n\t\tif (key === void 0) continue;\n\t\tconst span = nodePslSpan(entry.syntax, ctx.sources);\n\t\tif (seen.has(key)) {\n\t\t\tdiagnostics.push(duplicateParameterDiagnostic(block, key, ctx, entry, span));\n\t\t\tcontinue;\n\t\t}\n\t\tseen.add(key);\n\t\tconst rule = Object.hasOwn(spec.parameters, key) ? spec.parameters[key]?.type : void 0;\n\t\tif (rule === void 0) {\n\t\t\tdiagnostics.push(entryDiagnostic(\"PSL_EXTENSION_UNKNOWN_PARAMETER\", `Unknown parameter \"${key}\" in \"${block.keyword}\" block \"${block.name}\". The block does not declare this parameter.`, ctx, entry, span));\n\t\t\tcontinue;\n\t\t}\n\t\tparameterSpans[key] = span;\n\t\tconst value = entry.value();\n\t\tif (value === void 0) {\n\t\t\tdiagnostics.push(bareEntryDiagnostic(block, key, ctx, entry, span));\n\t\t\tcontinue;\n\t\t}\n\t\tconst parsed = rule.parse(value, ctx);\n\t\tif (parsed.ok) {\n\t\t\tvalues[key] = parsed.value;\n\t\t\trecordNumberText(numberTexts, key, value);\n\t\t} else {\n\t\t\tfailed = true;\n\t\t\tdiagnostics.push(...parsed.failure);\n\t\t}\n\t}\n\tfor (const [key, param] of Object.entries(spec.parameters)) {\n\t\tif (seen.has(key)) continue;\n\t\tif (isOptionalArgType(param.type)) {\n\t\t\tif (param.type.hasDefault) values[key] = param.type.defaultValue;\n\t\t\tcontinue;\n\t\t}\n\t\tdiagnostics.push(entryDiagnostic(\"PSL_EXTENSION_MISSING_REQUIRED_PARAMETER\", `Required parameter \"${key}\" is missing from \"${block.keyword}\" block \"${block.name}\".`, ctx, block.node, block.span));\n\t}\n\treturn {\n\t\tvalues,\n\t\tparameterSpans,\n\t\tnumberTexts,\n\t\tdiagnostics,\n\t\tfailed\n\t};\n}\nfunction interpretMapBlock(block, spec, ctx) {\n\tconst diagnostics = [];\n\tlet failed = false;\n\tconst values = Object.create(null);\n\tconst parameterSpans = Object.create(null);\n\tconst numberTexts = Object.create(null);\n\tconst seen = /* @__PURE__ */ new Set();\n\tfor (const entry of block.node.entries()) {\n\t\tconst key = entry.key()?.name();\n\t\tif (key === void 0) continue;\n\t\tconst span = nodePslSpan(entry.syntax, ctx.sources);\n\t\tif (seen.has(key)) {\n\t\t\tdiagnostics.push(duplicateParameterDiagnostic(block, key, ctx, entry, span));\n\t\t\tcontinue;\n\t\t}\n\t\tseen.add(key);\n\t\tparameterSpans[key] = span;\n\t\tconst value = entry.value();\n\t\tif (value === void 0) {\n\t\t\tif (spec.allowBare) {\n\t\t\t\tvalues[key] = void 0;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tdiagnostics.push(bareEntryDiagnostic(block, key, ctx, entry, span));\n\t\t\tcontinue;\n\t\t}\n\t\tconst parsed = spec.value.type.parse(value, ctx);\n\t\tif (parsed.ok) {\n\t\t\tvalues[key] = parsed.value;\n\t\t\trecordNumberText(numberTexts, key, value);\n\t\t} else {\n\t\t\tfailed = true;\n\t\t\tdiagnostics.push(...parsed.failure);\n\t\t}\n\t}\n\treturn {\n\t\tvalues,\n\t\tparameterSpans,\n\t\tnumberTexts,\n\t\tdiagnostics,\n\t\tfailed\n\t};\n}\nfunction recordNumberText(numberTexts, key, value) {\n\tconst text = NumberLiteralExprAst.cast(value.syntax)?.token()?.text;\n\tif (text !== void 0) numberTexts[key] = text;\n}\nfunction duplicateParameterDiagnostic(block, key, ctx, node, span) {\n\treturn entryDiagnostic(\"PSL_EXTENSION_DUPLICATE_PARAMETER\", `Duplicate parameter \"${key}\" in \"${block.keyword}\" block \"${block.name}\"; first occurrence wins`, ctx, node, span);\n}\nfunction bareEntryDiagnostic(block, key, ctx, node, span) {\n\treturn entryDiagnostic(\"PSL_INVALID_EXTENSION_BLOCK_MEMBER\", `Parameter \"${key}\" in \"${block.keyword}\" block \"${block.name}\" must be written as \"${key} = <value>\".`, ctx, node, span);\n}\nfunction interpretExtensionBlockAttributes(input) {\n\tconst { block, descriptor, symbols, sources, binder } = input;\n\tconst declared = descriptor.attributes ?? {};\n\tconst attributes = Object.create(null);\n\tconst diagnostics = [];\n\tconst seenNames = /* @__PURE__ */ new Set();\n\tfor (const attribute of block.node.attributes()) {\n\t\tconst name = attribute.name()?.path().join(\".\") ?? \"\";\n\t\tconst span = nodePslSpan(attribute.syntax, sources);\n\t\tif (!Object.hasOwn(declared, name)) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_EXTENSION_UNKNOWN_BLOCK_ATTRIBUTE\",\n\t\t\t\tmessage: `Unknown attribute \"@@${name}\" in \"${block.keyword}\" block \"${block.name}\"`,\n\t\t\t\t...diagnosticSource(sources, attribute.syntax).at(span)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (seenNames.has(name)) {\n\t\t\tdiagnostics.push({\n\t\t\t\tcode: \"PSL_INVALID_EXTENSION_BLOCK_ATTRIBUTE\",\n\t\t\t\tmessage: `Duplicate attribute \"@@${name}\" in \"${block.keyword}\" block \"${block.name}\"; first occurrence wins`,\n\t\t\t\t...diagnosticSource(sources, attribute.syntax).at(span)\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tseenNames.add(name);\n\t\tconst spec = blindCast(declared[name])({ symbols });\n\t\tconst result = interpretAttribute(attribute, spec, {\n\t\t\tsources,\n\t\t\tsymbols,\n\t\t\tbinder,\n\t\t\tselfBlock: block\n\t\t});\n\t\tif (result.ok) {\n\t\t\tconst argSpans = Object.create(null);\n\t\t\tlet positionalSlot = 0;\n\t\t\tfor (const arg of readResolvedAttribute(attribute, sources).args) {\n\t\t\t\tconst key = arg.name ?? spec.positional[positionalSlot++]?.key;\n\t\t\t\tif (key !== void 0) argSpans[key] = arg.span;\n\t\t\t}\n\t\t\tattributes[name] = {\n\t\t\t\targs: result.value,\n\t\t\t\targSpans,\n\t\t\t\tspan\n\t\t\t};\n\t\t} else diagnostics.push(...result.failure);\n\t}\n\treturn {\n\t\tattributes,\n\t\tdiagnostics\n\t};\n}\nfunction entryDiagnostic(code, message, ctx, node, span) {\n\treturn {\n\t\tcode,\n\t\tmessage,\n\t\t...diagnosticSource(ctx.sources, node.syntax).at(span)\n\t};\n}\nfunction interpretExtensionBlocks(input) {\n\tconst { symbolTable, sources, pslBlockDescriptors, binder } = input;\n\tconst parsedBlocks = /* @__PURE__ */ new Map();\n\tconst diagnostics = [];\n\tconst scopes = [symbolTable.topLevel, ...Object.values(symbolTable.topLevel.namespaces)];\n\tfor (const scope of scopes) for (const block of Object.values(scope.blocks)) {\n\t\tconst descriptor = findBlockDescriptor(pslBlockDescriptors, block.keyword);\n\t\tif (descriptor === void 0) continue;\n\t\tconst parsed = interpretExtensionBlock({\n\t\t\tblock,\n\t\t\tdescriptor,\n\t\t\tspec: blockSpecFactoryOf(descriptor)({ symbols: symbolTable }),\n\t\t\tsymbols: symbolTable,\n\t\t\tsources,\n\t\t\tbinder\n\t\t});\n\t\tif (parsed.ok) parsedBlocks.set(block, parsed.value);\n\t\telse diagnostics.push(...parsed.failure);\n\t}\n\treturn {\n\t\tparsedBlocks,\n\t\tdiagnostics\n\t};\n}\n//#endregion\n//#region src/name-the-psl-source-loses.ts\n/**\n* A name that is lost when a PSL file is read. The parser keeps block members, and the PSL contract sources keep other names, as keys of plain objects, where assigning this key sets the object's prototype instead of adding a key. Code that writes PSL must not write this name anywhere a PSL source reads a name, including inside `@map` and `@@map`.\n*/\nconst NAME_THE_PSL_SOURCE_LOSES = \"__proto__\";\n//#endregion\n//#region src/schema-directive.ts\nconst DIRECTIVE = /^(\\s*\\/\\/ *use +)(prisma-8|prisma-next)( *)(?!\\S)/;\nconst LEGACY_NAME = \"prisma-next\";\nfunction isPrismaNextSchema(text) {\n\treturn DIRECTIVE.test(text);\n}\n/** The document with the directive earlier releases wrote replaced by the current one. */\nfunction renameLegacyDirective(text) {\n\treturn text.replace(DIRECTIVE, (whole, lead, name, trail) => name === LEGACY_NAME ? `${lead}prisma-8${trail}` : whole);\n}\n//#endregion\nexport { NAME_THE_PSL_SOURCE_LOSES, PSL_UNRESOLVED_REFERENCE, assembleAttributeSpecs, blockAttribute, blockSpecFactoryOf, bool, buildSymbolTable, contributedTypeOf, createBinder, createPslDiagnosticCollector, diagnosticFromSpan, diagnosticSource, entityRef, entityReference, fieldAttribute, fieldRef, findBlockDescriptor, flatPslModels, funcCall, getPositionalArgument, identifier, int, interpretArgs, interpretAttribute, interpretExtensionBlock, interpretExtensionBlockAttributes, interpretExtensionBlocks, isNamespaceLike, isPrismaNextSchema, isPslIdentifier, json, jsonValue, keywordPslSpan, leafDiagnostic, list, mapBlock, mapPslDiagnostics, matchesSelector, memberEntries, modelAttribute, namespacePslExtensionBlocks, nodePslSpan, num, numLiteral, oneOf, optional, parseQuotedStringLiteral, readResolvedAttribute, readResolvedAttributes, readResolvedConstructorCall, record, referencedFieldRef, renameLegacyDirective, str, structBlock, taggedLiteral, typeReferenceNode };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;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E,aAAa,SAAS,qBAAqB,WAAW;CAC9D,MAAM,+BAA+B,IAAI,IAAI;CAC7C,MAAM,cAAc,CAAC;CACrB,MAAM,SAAS,CAAC,YAAY,UAAU,GAAG,OAAO,OAAO,YAAY,SAAS,UAAU,CAAC;CACvF,KAAK,MAAM,SAAS,QAAQ,KAAK,MAAM,SAAS,OAAO,OAAO,MAAM,MAAM,GAAG;EAC5E,MAAM,aAAa,oBAAoB,qBAAqB,MAAM,OAAO;EACzE,IAAI,eAAe,KAAK,GAAG;EAC3B,MAAM,SAAS,wBAAwB;GACtC;GACA;GACA,MAAM,mBAAmB,UAAU,CAAC,CAAC,EAAE,SAAS,YAAY,CAAC;GAC7D,SAAS;GACT;GACA;EACD,CAAC;EACD,IAAI,OAAO,IAAI,aAAa,IAAI,OAAO,OAAO,KAAK;OAC9C,YAAY,KAAK,GAAG,OAAO,OAAO;CACxC;CACA,OAAO;EACN;EACA;CACD;AACD;;;;AAMA,MAAM,4BAA4B;AAGlC,MAAM,YAAY;AAClB,MAAM,cAAc;AACpB,SAAS,mBAAmB,MAAM;CACjC,OAAO,UAAU,KAAK,IAAI;AAC3B;;AAEA,SAAS,sBAAsB,MAAM;CACpC,OAAO,KAAK,QAAQ,YAAY,OAAO,MAAM,MAAM,UAAU,SAAS,cAAc,GAAG,KAAK,UAAU,UAAU,KAAK;AACtH"}
|
|
@@ -100,6 +100,17 @@ function validateDiscriminators(modelIndex, errors) {
|
|
|
100
100
|
if (!model.variants || Object.keys(model.variants).length === 0) errors.push(`Model "${namespaceId}:${modelName}" has discriminator but no variants`);
|
|
101
101
|
if (!Object.hasOwn(model.fields, model.discriminator.field)) errors.push(`Discriminator field "${model.discriminator.field}" is not a field on model "${namespaceId}:${modelName}"`);
|
|
102
102
|
}
|
|
103
|
+
if (model.variants) {
|
|
104
|
+
const variantsByValue = /* @__PURE__ */ new Map();
|
|
105
|
+
for (const [variantName, { value }] of Object.entries(model.variants)) {
|
|
106
|
+
const existingVariant = variantsByValue.get(value);
|
|
107
|
+
if (existingVariant !== void 0) {
|
|
108
|
+
errors.push(`Discriminator value "${value}" is used by both "${namespaceId}:${existingVariant}" and "${namespaceId}:${variantName}" on base model "${namespaceId}:${modelName}"`);
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
variantsByValue.set(value, variantName);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
103
114
|
if (model.variants && Object.keys(model.variants).length > 0 && !model.discriminator) errors.push(`Model "${namespaceId}:${modelName}" has variants but no discriminator`);
|
|
104
115
|
if (model.base) {
|
|
105
116
|
if (model.discriminator) errors.push(`Model "${namespaceId}:${modelName}" has base and must not have discriminator`);
|
|
@@ -157,4 +168,4 @@ function validateFieldModifiers(modelIndex, contract, errors) {
|
|
|
157
168
|
//#endregion
|
|
158
169
|
export { validateContractDomain as t };
|
|
159
170
|
|
|
160
|
-
//# sourceMappingURL=validate-domain-
|
|
171
|
+
//# sourceMappingURL=validate-domain-BWxgeXy0.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-domain-BWxgeXy0.mjs","names":[],"sources":["../../../../1-framework/0-foundation/contract/dist/validate-domain.mjs"],"sourcesContent":["import { t as asNamespaceId } from \"./namespace-id-asbWpwMw.mjs\";\nimport { t as ContractValidationError } from \"./contract-validation-error-DEiWp_EI.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\n//#region src/validate-domain.ts\nfunction indexDomainModels(contract) {\n\tconst index = /* @__PURE__ */ new Map();\n\tfor (const [namespaceKey, namespace] of Object.entries(contract.domain.namespaces)) {\n\t\tconst namespaceId = asNamespaceId(namespaceKey);\n\t\tlet modelsInNamespace = index.get(namespaceId);\n\t\tif (modelsInNamespace === void 0) {\n\t\t\tmodelsInNamespace = /* @__PURE__ */ new Map();\n\t\t\tindex.set(namespaceId, modelsInNamespace);\n\t\t}\n\t\tfor (const [name, model] of Object.entries(namespace.models)) modelsInNamespace.set(name, {\n\t\t\tnamespaceId,\n\t\t\tname,\n\t\t\tmodel\n\t\t});\n\t}\n\treturn index;\n}\nfunction lookupModel(index, ref) {\n\treturn index.get(ref.namespace)?.get(ref.model);\n}\nfunction* iterateIndexedModels(index) {\n\tfor (const modelsInNamespace of index.values()) for (const entry of modelsInNamespace.values()) yield entry;\n}\nfunction validateContractDomain(contract) {\n\tconst errors = [];\n\tconst modelIndex = indexDomainModels(contract);\n\tvalidateRoots(contract, modelIndex, errors);\n\tvalidateVariantsAndBases(modelIndex, errors);\n\tvalidateRelationTargets(modelIndex, errors);\n\tvalidateRelationNullability(modelIndex, errors);\n\tvalidateDiscriminators(modelIndex, errors);\n\tvalidateOwnership(contract, modelIndex, errors);\n\tvalidateValueObjectReferences(contract, errors);\n\tvalidateFieldModifiers(modelIndex, contract, errors);\n\tif (errors.length > 0) throw new ContractValidationError(`Contract domain validation failed:\\n- ${errors.join(\"\\n- \")}`, \"domain\");\n}\nfunction validateRoots(contract, modelIndex, errors) {\n\tconst seenRootTargets = /* @__PURE__ */ new Map();\n\tfor (const [rootKey, crossRef] of Object.entries(contract.roots)) {\n\t\tlet modelsInNamespace = seenRootTargets.get(crossRef.namespace);\n\t\tif (modelsInNamespace === void 0) {\n\t\t\tmodelsInNamespace = /* @__PURE__ */ new Set();\n\t\t\tseenRootTargets.set(crossRef.namespace, modelsInNamespace);\n\t\t}\n\t\tif (modelsInNamespace.has(crossRef.model)) errors.push(`Duplicate root value: \"${crossRef.namespace}:${crossRef.model}\" is mapped by multiple root keys`);\n\t\tmodelsInNamespace.add(crossRef.model);\n\t\tif (!lookupModel(modelIndex, crossRef)) errors.push(`Root \"${rootKey}\" references model \"${crossRef.namespace}:${crossRef.model}\" which does not exist in domain.namespaces`);\n\t}\n}\nfunction validateVariantsAndBases(modelIndex, errors) {\n\tfor (const { namespaceId, name: modelName, model } of iterateIndexedModels(modelIndex)) {\n\t\tif (model.variants) for (const variantName of Object.keys(model.variants)) {\n\t\t\tconst variantEntry = lookupModel(modelIndex, {\n\t\t\t\tnamespace: namespaceId,\n\t\t\t\tmodel: variantName\n\t\t\t});\n\t\t\tif (!variantEntry) {\n\t\t\t\terrors.push(`Model \"${namespaceId}:${modelName}\" lists variant \"${variantName}\" which does not exist at that namespace coordinate`);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst variantBase = variantEntry.model.base;\n\t\t\tif (variantBase?.namespace !== namespaceId || variantBase?.model !== modelName) errors.push(`Variant \"${namespaceId}:${variantName}\" has base \"${variantBase?.namespace ?? \"?\"}:${variantBase?.model ?? \"(none)\"}\" but expected \"${namespaceId}:${modelName}\"`);\n\t\t}\n\t\tif (model.base) {\n\t\t\tconst baseEntry = lookupModel(modelIndex, model.base);\n\t\t\tif (!baseEntry) {\n\t\t\t\terrors.push(`Model \"${namespaceId}:${modelName}\" has base \"${model.base.namespace}:${model.base.model}\" which does not exist in domain.namespaces`);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!baseEntry.model.variants || !Object.hasOwn(baseEntry.model.variants, modelName)) errors.push(`Model \"${namespaceId}:${modelName}\" has base \"${model.base.namespace}:${model.base.model}\" which does not list it as a variant`);\n\t\t}\n\t}\n}\nfunction validateRelationTargets(modelIndex, errors) {\n\tfor (const { namespaceId, name: modelName, model } of iterateIndexedModels(modelIndex)) for (const [relName, relation] of Object.entries(model.relations ?? {})) {\n\t\tif (relation.to.space !== void 0) continue;\n\t\tif (!lookupModel(modelIndex, relation.to)) errors.push(`Relation \"${relName}\" on model \"${namespaceId}:${modelName}\" targets \"${relation.to.namespace}:${relation.to.model}\" which does not exist in domain.namespaces`);\n\t}\n}\nfunction relationKindLabel(relation) {\n\treturn relation.on === void 0 ? \"embed relation\" : `${relation.cardinality} relation`;\n}\nfunction validateRelationNullability(modelIndex, errors) {\n\tfor (const { namespaceId, name: modelName, model } of iterateIndexedModels(modelIndex)) for (const [relName, relation] of Object.entries(model.relations ?? {})) {\n\t\tconst location = `Relation \"${relName}\" on model \"${namespaceId}:${modelName}\"`;\n\t\tif (relation.on !== void 0 && (relation.cardinality === \"1:1\" || relation.cardinality === \"N:1\")) {\n\t\t\tif (relation.nullable !== void 0 && typeof relation.nullable !== \"boolean\") errors.push(`${location} is a ${relation.cardinality} relation and its \"nullable\" must be a boolean`);\n\t\t\tcontinue;\n\t\t}\n\t\tif (relation.nullable !== void 0) errors.push(`${location} is a ${relationKindLabel(relation)} and must not carry \"nullable\"`);\n\t}\n}\nfunction validateDiscriminators(modelIndex, errors) {\n\tfor (const { namespaceId, name: modelName, model } of iterateIndexedModels(modelIndex)) {\n\t\tif (model.discriminator) {\n\t\t\tif (!model.variants || Object.keys(model.variants).length === 0) errors.push(`Model \"${namespaceId}:${modelName}\" has discriminator but no variants`);\n\t\t\tif (!Object.hasOwn(model.fields, model.discriminator.field)) errors.push(`Discriminator field \"${model.discriminator.field}\" is not a field on model \"${namespaceId}:${modelName}\"`);\n\t\t}\n\t\tif (model.variants) {\n\t\t\tconst variantsByValue = /* @__PURE__ */ new Map();\n\t\t\tfor (const [variantName, { value }] of Object.entries(model.variants)) {\n\t\t\t\tconst existingVariant = variantsByValue.get(value);\n\t\t\t\tif (existingVariant !== void 0) {\n\t\t\t\t\terrors.push(`Discriminator value \"${value}\" is used by both \"${namespaceId}:${existingVariant}\" and \"${namespaceId}:${variantName}\" on base model \"${namespaceId}:${modelName}\"`);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tvariantsByValue.set(value, variantName);\n\t\t\t}\n\t\t}\n\t\tif (model.variants && Object.keys(model.variants).length > 0 && !model.discriminator) errors.push(`Model \"${namespaceId}:${modelName}\" has variants but no discriminator`);\n\t\tif (model.base) {\n\t\t\tif (model.discriminator) errors.push(`Model \"${namespaceId}:${modelName}\" has base and must not have discriminator`);\n\t\t\tif (model.variants && Object.keys(model.variants).length > 0) errors.push(`Model \"${namespaceId}:${modelName}\" has base and must not have variants`);\n\t\t}\n\t}\n}\nfunction validateOwnership(contract, modelIndex, errors) {\n\tfor (const { namespaceId, name: modelName, model } of iterateIndexedModels(modelIndex)) {\n\t\tif (!model.owner) continue;\n\t\tif (model.owner === modelName) errors.push(`Model \"${namespaceId}:${modelName}\" cannot own itself`);\n\t\tif (!lookupModel(modelIndex, {\n\t\t\tnamespace: namespaceId,\n\t\t\tmodel: model.owner\n\t\t})) errors.push(`Model \"${namespaceId}:${modelName}\" has owner \"${namespaceId}:${model.owner}\" which does not exist in domain.namespaces`);\n\t\tfor (const [rootKey, rootRef] of Object.entries(contract.roots)) if (rootRef.namespace === namespaceId && rootRef.model === modelName) errors.push(`Owned model \"${namespaceId}:${modelName}\" must not appear in roots (found as root \"${rootKey}\")`);\n\t}\n}\nfunction validateValueObjectReferences(contract, errors) {\n\tconst voNamesByNamespace = /* @__PURE__ */ new Map();\n\tfor (const [namespaceKey, namespace] of Object.entries(contract.domain.namespaces)) {\n\t\tconst namespaceId = asNamespaceId(namespaceKey);\n\t\tvoNamesByNamespace.set(namespaceId, new Set(Object.keys(namespace.valueObjects ?? {})));\n\t}\n\tfunction checkType(type, location, namespaceId) {\n\t\tif (!type) return;\n\t\tconst voNames = voNamesByNamespace.get(namespaceId) ?? /* @__PURE__ */ new Set();\n\t\tif (type.kind === \"valueObject\" && type.name && !voNames.has(type.name)) {\n\t\t\terrors.push(`${location} references value object \"${namespaceId}:${type.name}\" which does not exist in that namespace's valueObjects`);\n\t\t\treturn;\n\t\t}\n\t\tif (type.kind === \"union\") for (const member of type.members ?? []) checkType(member, location, namespaceId);\n\t}\n\tfor (const [namespaceKey, namespace] of Object.entries(contract.domain.namespaces)) {\n\t\tconst namespaceId = asNamespaceId(namespaceKey);\n\t\tfor (const [modelName, model] of Object.entries(namespace.models)) for (const [fieldName, field] of Object.entries(model.fields)) checkType(blindCast(field)?.type, `Model \"${namespaceId}:${modelName}\" field \"${fieldName}\"`, namespaceId);\n\t\tfor (const [voName, vo] of Object.entries(namespace.valueObjects ?? {})) for (const [fieldName, field] of Object.entries(vo.fields)) checkType(blindCast(field)?.type, `Value object \"${namespaceId}:${voName}\" field \"${fieldName}\"`, namespaceId);\n\t}\n}\nfunction validateFieldModifiers(modelIndex, contract, errors) {\n\tfunction validateField(location, field) {\n\t\tconst candidate = blindCast(field);\n\t\tconst many = candidate?.many;\n\t\tconst isList = typeof many === \"object\" && many !== null && !Array.isArray(many) && Object.keys(many).length === 1 && \"elementNullable\" in many && typeof many.elementNullable === \"boolean\";\n\t\tif (many !== void 0 && many !== false && !isList) errors.push(`${location} has invalid \"many\"; expected false or an elementNullable descriptor`);\n\t\tif (candidate?.elementNullable !== void 0) errors.push(`${location} cannot have sibling \"elementNullable\"; put it inside \"many\"`);\n\t\tif (isList && candidate?.dict) errors.push(`${location} cannot have both \"many\" and \"dict\" modifiers`);\n\t}\n\tfor (const { namespaceId, name: modelName, model } of iterateIndexedModels(modelIndex)) for (const [fieldName, field] of Object.entries(model.fields)) validateField(`Model \"${namespaceId}:${modelName}\" field \"${fieldName}\"`, field);\n\tfor (const [namespaceKey, namespace] of Object.entries(contract.domain.namespaces)) {\n\t\tconst namespaceId = asNamespaceId(namespaceKey);\n\t\tfor (const [voName, vo] of Object.entries(namespace.valueObjects ?? {})) for (const [fieldName, field] of Object.entries(vo.fields)) validateField(`Value object \"${namespaceId}:${voName}\" field \"${fieldName}\"`, field);\n\t}\n}\n//#endregion\nexport { validateContractDomain };\n\n//# sourceMappingURL=validate-domain.mjs.map"],"mappings":";;;;AAIA,SAAS,kBAAkB,UAAU;CACpC,MAAM,wBAAwB,IAAI,IAAI;CACtC,KAAK,MAAM,CAAC,cAAc,cAAc,OAAO,QAAQ,SAAS,OAAO,UAAU,GAAG;EACnF,MAAM,cAAc,cAAc,YAAY;EAC9C,IAAI,oBAAoB,MAAM,IAAI,WAAW;EAC7C,IAAI,sBAAsB,KAAK,GAAG;GACjC,oCAAoC,IAAI,IAAI;GAC5C,MAAM,IAAI,aAAa,iBAAiB;EACzC;EACA,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,UAAU,MAAM,GAAG,kBAAkB,IAA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AAM,YAAY,UAAU,KAAK;EACjC,MAAM,OAAO,WAAW;EACxB,MAAM,SAAS,OAAO,SAAS,YAAY,SAAS,QAAQ,CAAC,MAAM,QAAQ,IAAI,KAAK,OAAO,KAAK,IAAI,CAAC,CAAC,WAAW,KAAK,qBAAqB,QAAQ,OAAO,KAAK,oBAAoB;EACnL,IAAI,SAAS,KAAK,KAAK,SAAS,SAAS,CAAC,QAAQ,OAAO,KAAK,GAAG,SAAS,qEAAqE;EAC/I,IAAI,WAAW,oBAAoB,KAAK,GAAG,OAAO,KAAK,GAAG,SAAS,6DAA6D;EAChI,IAAI,UAAU,WAAW,MAAM,OAAO,KAAK,GAAG,SAAS,8CAA8C;CACtG;CACA,KAAK,MAAM,EAAE,aAAa,MAAM,WAAW,WAAW,qBAAqB,UAAU,GAAG,KAAK,MAAM,CAAC,WAAW,UAAU,OAAO,QAAQ,MAAM,MAAM,GAAG,cAAc,UAAU,YAAY,GAAG,UAAU,WAAW,UAAU,IAAI,KAAK;CACtO,KAAK,MAAM,CAAC,cAAc,cAAc,OAAO,QAAQ,SAAS,OAAO,UAAU,GAAG;EACnF,MAAM,cAAc,cAAc,YAAY;EAC9C,KAAK,MAAM,CAAC,QAAQ,OAAO,OAAO,QAAQ,UAAU,gBAAgB,CAAC,CAAC,GAAG,KAAK,MAAM,CAAC,WAAW,UAAU,OAAO,QAAQ,GAAG,MAAM,GAAG,cAAc,iBAAiB,YAAY,GAAG,OAAO,WAAW,UAAU,IAAI,KAAK;CACzN;AACD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as CrossReference, E as ContractWithDomain } from "./domain-envelope-C2vVIWGK-C5x7cBpU.mjs";
|
|
1
|
+
import { D as CrossReference, E as ContractWithDomain, T as ContractVariantEntry } from "./domain-envelope-C2vVIWGK-C5x7cBpU.mjs";
|
|
2
2
|
//#region ../../../1-framework/0-foundation/contract/dist/validate-domain.d.mts
|
|
3
3
|
//#region src/validate-domain.d.ts
|
|
4
4
|
interface DomainRelationShape {
|
|
@@ -13,7 +13,7 @@ interface DomainModelShape {
|
|
|
13
13
|
readonly discriminator?: {
|
|
14
14
|
readonly field: string;
|
|
15
15
|
};
|
|
16
|
-
readonly variants?: Record<string,
|
|
16
|
+
readonly variants?: Record<string, ContractVariantEntry>;
|
|
17
17
|
readonly base?: CrossReference;
|
|
18
18
|
readonly owner?: string;
|
|
19
19
|
}
|
|
@@ -23,4 +23,4 @@ interface DomainContractShape extends ContractWithDomain {
|
|
|
23
23
|
declare function validateContractDomain(contract: DomainContractShape): void;
|
|
24
24
|
//#endregion
|
|
25
25
|
export { DomainModelShape as n, validateContractDomain as r, DomainContractShape as t };
|
|
26
|
-
//# sourceMappingURL=validate-domain-
|
|
26
|
+
//# sourceMappingURL=validate-domain-DaAswa8n.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-domain-DaAswa8n.d.mts","names":[],"sources":["../../../../1-framework/0-foundation/contract/dist/validate-domain.d.mts"],"mappings":";;;UAEU;WACC,IAAI;WACJ;WACA;WACA;;UAED;WACC,QAAQ;WACR,YAAY,eAAe;WAC3B;aACE;;WAEF,WAAW,eAAe;WAC1B,OAAO;WACP;;UAED,4BAA4B;WAC3B,OAAO,eAAe;;iBAEhB,uBAAuB,UAAU"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/orm-framework",
|
|
3
|
-
"version": "8.0.0-rc.14-dev.
|
|
3
|
+
"version": "8.0.0-rc.14-dev.43",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -16,20 +16,20 @@
|
|
|
16
16
|
"uniku": "^0.5.0"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@internal/config": "8.0.0-rc.14-dev.
|
|
20
|
-
"@internal/contract": "8.0.0-rc.14-dev.
|
|
21
|
-
"@internal/contract-authoring": "8.0.0-rc.14-dev.
|
|
22
|
-
"@internal/errors": "8.0.0-rc.14-dev.
|
|
23
|
-
"@internal/framework-components": "8.0.0-rc.14-dev.
|
|
24
|
-
"@internal/ids": "8.0.0-rc.14-dev.
|
|
25
|
-
"@internal/operations": "8.0.0-rc.14-dev.
|
|
26
|
-
"@internal/psl-parser": "8.0.0-rc.14-dev.
|
|
27
|
-
"@internal/psl-printer": "8.0.0-rc.14-dev.
|
|
28
|
-
"@internal/ts-render": "8.0.0-rc.14-dev.
|
|
29
|
-
"@repo/tsconfig": "8.0.0-rc.14-dev.
|
|
30
|
-
"@internal/publish-surface": "8.0.0-rc.14-dev.
|
|
31
|
-
"@repo/tsdown": "8.0.0-rc.14-dev.
|
|
32
|
-
"@internal/utils": "8.0.0-rc.14-dev.
|
|
19
|
+
"@internal/config": "8.0.0-rc.14-dev.43",
|
|
20
|
+
"@internal/contract": "8.0.0-rc.14-dev.43",
|
|
21
|
+
"@internal/contract-authoring": "8.0.0-rc.14-dev.43",
|
|
22
|
+
"@internal/errors": "8.0.0-rc.14-dev.43",
|
|
23
|
+
"@internal/framework-components": "8.0.0-rc.14-dev.43",
|
|
24
|
+
"@internal/ids": "8.0.0-rc.14-dev.43",
|
|
25
|
+
"@internal/operations": "8.0.0-rc.14-dev.43",
|
|
26
|
+
"@internal/psl-parser": "8.0.0-rc.14-dev.43",
|
|
27
|
+
"@internal/psl-printer": "8.0.0-rc.14-dev.43",
|
|
28
|
+
"@internal/ts-render": "8.0.0-rc.14-dev.43",
|
|
29
|
+
"@repo/tsconfig": "8.0.0-rc.14-dev.43",
|
|
30
|
+
"@internal/publish-surface": "8.0.0-rc.14-dev.43",
|
|
31
|
+
"@repo/tsdown": "8.0.0-rc.14-dev.43",
|
|
32
|
+
"@internal/utils": "8.0.0-rc.14-dev.43",
|
|
33
33
|
"tsdown": "0.22.14",
|
|
34
34
|
"typescript": "5.9.3",
|
|
35
35
|
"vitest": "5.0.0-rc.2"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validate-domain-DgY72oWI.mjs","names":[],"sources":["../../../../1-framework/0-foundation/contract/dist/validate-domain.mjs"],"sourcesContent":["import { t as asNamespaceId } from \"./namespace-id-asbWpwMw.mjs\";\nimport { t as ContractValidationError } from \"./contract-validation-error-DEiWp_EI.mjs\";\nimport { blindCast } from \"@internal/utils/casts\";\n//#region src/validate-domain.ts\nfunction indexDomainModels(contract) {\n\tconst index = /* @__PURE__ */ new Map();\n\tfor (const [namespaceKey, namespace] of Object.entries(contract.domain.namespaces)) {\n\t\tconst namespaceId = asNamespaceId(namespaceKey);\n\t\tlet modelsInNamespace = index.get(namespaceId);\n\t\tif (modelsInNamespace === void 0) {\n\t\t\tmodelsInNamespace = /* @__PURE__ */ new Map();\n\t\t\tindex.set(namespaceId, modelsInNamespace);\n\t\t}\n\t\tfor (const [name, model] of Object.entries(namespace.models)) modelsInNamespace.set(name, {\n\t\t\tnamespaceId,\n\t\t\tname,\n\t\t\tmodel\n\t\t});\n\t}\n\treturn index;\n}\nfunction lookupModel(index, ref) {\n\treturn index.get(ref.namespace)?.get(ref.model);\n}\nfunction* iterateIndexedModels(index) {\n\tfor (const modelsInNamespace of index.values()) for (const entry of modelsInNamespace.values()) yield entry;\n}\nfunction validateContractDomain(contract) {\n\tconst errors = [];\n\tconst modelIndex = indexDomainModels(contract);\n\tvalidateRoots(contract, modelIndex, errors);\n\tvalidateVariantsAndBases(modelIndex, errors);\n\tvalidateRelationTargets(modelIndex, errors);\n\tvalidateRelationNullability(modelIndex, errors);\n\tvalidateDiscriminators(modelIndex, errors);\n\tvalidateOwnership(contract, modelIndex, errors);\n\tvalidateValueObjectReferences(contract, errors);\n\tvalidateFieldModifiers(modelIndex, contract, errors);\n\tif (errors.length > 0) throw new ContractValidationError(`Contract domain validation failed:\\n- ${errors.join(\"\\n- \")}`, \"domain\");\n}\nfunction validateRoots(contract, modelIndex, errors) {\n\tconst seenRootTargets = /* @__PURE__ */ new Map();\n\tfor (const [rootKey, crossRef] of Object.entries(contract.roots)) {\n\t\tlet modelsInNamespace = seenRootTargets.get(crossRef.namespace);\n\t\tif (modelsInNamespace === void 0) {\n\t\t\tmodelsInNamespace = /* @__PURE__ */ new Set();\n\t\t\tseenRootTargets.set(crossRef.namespace, modelsInNamespace);\n\t\t}\n\t\tif (modelsInNamespace.has(crossRef.model)) errors.push(`Duplicate root value: \"${crossRef.namespace}:${crossRef.model}\" is mapped by multiple root keys`);\n\t\tmodelsInNamespace.add(crossRef.model);\n\t\tif (!lookupModel(modelIndex, crossRef)) errors.push(`Root \"${rootKey}\" references model \"${crossRef.namespace}:${crossRef.model}\" which does not exist in domain.namespaces`);\n\t}\n}\nfunction validateVariantsAndBases(modelIndex, errors) {\n\tfor (const { namespaceId, name: modelName, model } of iterateIndexedModels(modelIndex)) {\n\t\tif (model.variants) for (const variantName of Object.keys(model.variants)) {\n\t\t\tconst variantEntry = lookupModel(modelIndex, {\n\t\t\t\tnamespace: namespaceId,\n\t\t\t\tmodel: variantName\n\t\t\t});\n\t\t\tif (!variantEntry) {\n\t\t\t\terrors.push(`Model \"${namespaceId}:${modelName}\" lists variant \"${variantName}\" which does not exist at that namespace coordinate`);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst variantBase = variantEntry.model.base;\n\t\t\tif (variantBase?.namespace !== namespaceId || variantBase?.model !== modelName) errors.push(`Variant \"${namespaceId}:${variantName}\" has base \"${variantBase?.namespace ?? \"?\"}:${variantBase?.model ?? \"(none)\"}\" but expected \"${namespaceId}:${modelName}\"`);\n\t\t}\n\t\tif (model.base) {\n\t\t\tconst baseEntry = lookupModel(modelIndex, model.base);\n\t\t\tif (!baseEntry) {\n\t\t\t\terrors.push(`Model \"${namespaceId}:${modelName}\" has base \"${model.base.namespace}:${model.base.model}\" which does not exist in domain.namespaces`);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!baseEntry.model.variants || !Object.hasOwn(baseEntry.model.variants, modelName)) errors.push(`Model \"${namespaceId}:${modelName}\" has base \"${model.base.namespace}:${model.base.model}\" which does not list it as a variant`);\n\t\t}\n\t}\n}\nfunction validateRelationTargets(modelIndex, errors) {\n\tfor (const { namespaceId, name: modelName, model } of iterateIndexedModels(modelIndex)) for (const [relName, relation] of Object.entries(model.relations ?? {})) {\n\t\tif (relation.to.space !== void 0) continue;\n\t\tif (!lookupModel(modelIndex, relation.to)) errors.push(`Relation \"${relName}\" on model \"${namespaceId}:${modelName}\" targets \"${relation.to.namespace}:${relation.to.model}\" which does not exist in domain.namespaces`);\n\t}\n}\nfunction relationKindLabel(relation) {\n\treturn relation.on === void 0 ? \"embed relation\" : `${relation.cardinality} relation`;\n}\nfunction validateRelationNullability(modelIndex, errors) {\n\tfor (const { namespaceId, name: modelName, model } of iterateIndexedModels(modelIndex)) for (const [relName, relation] of Object.entries(model.relations ?? {})) {\n\t\tconst location = `Relation \"${relName}\" on model \"${namespaceId}:${modelName}\"`;\n\t\tif (relation.on !== void 0 && (relation.cardinality === \"1:1\" || relation.cardinality === \"N:1\")) {\n\t\t\tif (relation.nullable !== void 0 && typeof relation.nullable !== \"boolean\") errors.push(`${location} is a ${relation.cardinality} relation and its \"nullable\" must be a boolean`);\n\t\t\tcontinue;\n\t\t}\n\t\tif (relation.nullable !== void 0) errors.push(`${location} is a ${relationKindLabel(relation)} and must not carry \"nullable\"`);\n\t}\n}\nfunction validateDiscriminators(modelIndex, errors) {\n\tfor (const { namespaceId, name: modelName, model } of iterateIndexedModels(modelIndex)) {\n\t\tif (model.discriminator) {\n\t\t\tif (!model.variants || Object.keys(model.variants).length === 0) errors.push(`Model \"${namespaceId}:${modelName}\" has discriminator but no variants`);\n\t\t\tif (!Object.hasOwn(model.fields, model.discriminator.field)) errors.push(`Discriminator field \"${model.discriminator.field}\" is not a field on model \"${namespaceId}:${modelName}\"`);\n\t\t}\n\t\tif (model.variants && Object.keys(model.variants).length > 0 && !model.discriminator) errors.push(`Model \"${namespaceId}:${modelName}\" has variants but no discriminator`);\n\t\tif (model.base) {\n\t\t\tif (model.discriminator) errors.push(`Model \"${namespaceId}:${modelName}\" has base and must not have discriminator`);\n\t\t\tif (model.variants && Object.keys(model.variants).length > 0) errors.push(`Model \"${namespaceId}:${modelName}\" has base and must not have variants`);\n\t\t}\n\t}\n}\nfunction validateOwnership(contract, modelIndex, errors) {\n\tfor (const { namespaceId, name: modelName, model } of iterateIndexedModels(modelIndex)) {\n\t\tif (!model.owner) continue;\n\t\tif (model.owner === modelName) errors.push(`Model \"${namespaceId}:${modelName}\" cannot own itself`);\n\t\tif (!lookupModel(modelIndex, {\n\t\t\tnamespace: namespaceId,\n\t\t\tmodel: model.owner\n\t\t})) errors.push(`Model \"${namespaceId}:${modelName}\" has owner \"${namespaceId}:${model.owner}\" which does not exist in domain.namespaces`);\n\t\tfor (const [rootKey, rootRef] of Object.entries(contract.roots)) if (rootRef.namespace === namespaceId && rootRef.model === modelName) errors.push(`Owned model \"${namespaceId}:${modelName}\" must not appear in roots (found as root \"${rootKey}\")`);\n\t}\n}\nfunction validateValueObjectReferences(contract, errors) {\n\tconst voNamesByNamespace = /* @__PURE__ */ new Map();\n\tfor (const [namespaceKey, namespace] of Object.entries(contract.domain.namespaces)) {\n\t\tconst namespaceId = asNamespaceId(namespaceKey);\n\t\tvoNamesByNamespace.set(namespaceId, new Set(Object.keys(namespace.valueObjects ?? {})));\n\t}\n\tfunction checkType(type, location, namespaceId) {\n\t\tif (!type) return;\n\t\tconst voNames = voNamesByNamespace.get(namespaceId) ?? /* @__PURE__ */ new Set();\n\t\tif (type.kind === \"valueObject\" && type.name && !voNames.has(type.name)) {\n\t\t\terrors.push(`${location} references value object \"${namespaceId}:${type.name}\" which does not exist in that namespace's valueObjects`);\n\t\t\treturn;\n\t\t}\n\t\tif (type.kind === \"union\") for (const member of type.members ?? []) checkType(member, location, namespaceId);\n\t}\n\tfor (const [namespaceKey, namespace] of Object.entries(contract.domain.namespaces)) {\n\t\tconst namespaceId = asNamespaceId(namespaceKey);\n\t\tfor (const [modelName, model] of Object.entries(namespace.models)) for (const [fieldName, field] of Object.entries(model.fields)) checkType(blindCast(field)?.type, `Model \"${namespaceId}:${modelName}\" field \"${fieldName}\"`, namespaceId);\n\t\tfor (const [voName, vo] of Object.entries(namespace.valueObjects ?? {})) for (const [fieldName, field] of Object.entries(vo.fields)) checkType(blindCast(field)?.type, `Value object \"${namespaceId}:${voName}\" field \"${fieldName}\"`, namespaceId);\n\t}\n}\nfunction validateFieldModifiers(modelIndex, contract, errors) {\n\tfunction validateField(location, field) {\n\t\tconst candidate = blindCast(field);\n\t\tconst many = candidate?.many;\n\t\tconst isList = typeof many === \"object\" && many !== null && !Array.isArray(many) && Object.keys(many).length === 1 && \"elementNullable\" in many && typeof many.elementNullable === \"boolean\";\n\t\tif (many !== void 0 && many !== false && !isList) errors.push(`${location} has invalid \"many\"; expected false or an elementNullable descriptor`);\n\t\tif (candidate?.elementNullable !== void 0) errors.push(`${location} cannot have sibling \"elementNullable\"; put it inside \"many\"`);\n\t\tif (isList && candidate?.dict) errors.push(`${location} cannot have both \"many\" and \"dict\" modifiers`);\n\t}\n\tfor (const { namespaceId, name: modelName, model } of iterateIndexedModels(modelIndex)) for (const [fieldName, field] of Object.entries(model.fields)) validateField(`Model \"${namespaceId}:${modelName}\" field \"${fieldName}\"`, field);\n\tfor (const [namespaceKey, namespace] of Object.entries(contract.domain.namespaces)) {\n\t\tconst namespaceId = asNamespaceId(namespaceKey);\n\t\tfor (const [voName, vo] of Object.entries(namespace.valueObjects ?? {})) for (const [fieldName, field] of Object.entries(vo.fields)) validateField(`Value object \"${namespaceId}:${voName}\" field \"${fieldName}\"`, field);\n\t}\n}\n//#endregion\nexport { validateContractDomain };\n\n//# sourceMappingURL=validate-domain.mjs.map"],"mappings":";;;;AAIA,SAAS,kBAAkB,UAAU;CACpC,MAAM,wBAAwB,IAAI,IAAI;CACtC,KAAK,MAAM,CAAC,cAAc,cAAc,OAAO,QAAQ,SAAS,OAAO,UAAU,GAAG;E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