@prisma/orm-framework 8.0.0-rc.22-dev.14 → 8.0.0-rc.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/dist/{authoring-CcfXu8Dz.mjs → authoring-DnYn5EZT.mjs} +4 -4
  2. package/dist/{authoring-CcfXu8Dz.mjs.map → authoring-DnYn5EZT.mjs.map} +1 -1
  3. package/dist/{codec-descriptor-BNc32mKN-mmex2e4w.mjs → codec-descriptor-CPSGZunM-DxrbRHX1.mjs} +3 -5
  4. package/dist/codec-descriptor-CPSGZunM-DxrbRHX1.mjs.map +1 -0
  5. package/dist/{codec-CL-KdP7y.mjs → codec-yFwW7XRh.mjs} +3 -3
  6. package/dist/{codec-CL-KdP7y.mjs.map → codec-yFwW7XRh.mjs.map} +1 -1
  7. package/dist/{components-BTHe5Y0g.mjs → components-BaV9iCkq.mjs} +2 -2
  8. package/dist/{components-BTHe5Y0g.mjs.map → components-BaV9iCkq.mjs.map} +1 -1
  9. package/dist/components.mjs +8 -8
  10. package/dist/components__authoring.mjs +2 -2
  11. package/dist/components__codec.mjs +3 -3
  12. package/dist/components__components.mjs +1 -1
  13. package/dist/components__control.mjs +2 -2
  14. package/dist/components__execution.mjs +1 -1
  15. package/dist/contract-authoring.mjs +3 -3
  16. package/dist/{control-CwUsQQ-8.mjs → control-DzRwUDn-.mjs} +3 -5
  17. package/dist/control-DzRwUDn-.mjs.map +1 -0
  18. package/dist/{control-MllEQmML-BtyADFtB.mjs → control-MllEQmML-7F84gYuT.mjs} +2 -2
  19. package/dist/{control-MllEQmML-BtyADFtB.mjs.map → control-MllEQmML-7F84gYuT.mjs.map} +1 -1
  20. package/dist/{data-type-DPsP4_9m-BRPJX_-z.mjs → data-type-V6mcDhcG-DVQAPOQT.mjs} +3 -8
  21. package/dist/data-type-V6mcDhcG-DVQAPOQT.mjs.map +1 -0
  22. package/dist/{declarations-BgUAq1RG-DvmyJ8LS.mjs → declarations-BgUAq1RG-1LikMIfo.mjs} +2 -2
  23. package/dist/{declarations-BgUAq1RG-DvmyJ8LS.mjs.map → declarations-BgUAq1RG-1LikMIfo.mjs.map} +1 -1
  24. package/dist/errors.mjs +3 -3
  25. package/dist/errors__control.mjs +1 -1
  26. package/dist/errors__execution.mjs +1 -1
  27. package/dist/errors__migration.mjs +1 -1
  28. package/dist/{execution-DcIdFSAR.mjs → execution-DJDqCoRU.mjs} +1 -3
  29. package/dist/execution-DJDqCoRU.mjs.map +1 -0
  30. package/dist/{execution-DuM7OvTJ.mjs → execution-Dv2tEKdY.mjs} +2 -2
  31. package/dist/{execution-DuM7OvTJ.mjs.map → execution-Dv2tEKdY.mjs.map} +1 -1
  32. package/dist/{expressions-CMQzbnHk-B7zBWJ0c.mjs → expressions-CMQzbnHk-DUoL8DKO.mjs} +2 -2
  33. package/dist/{expressions-CMQzbnHk-B7zBWJ0c.mjs.map → expressions-CMQzbnHk-DUoL8DKO.mjs.map} +1 -1
  34. package/dist/{migration-e3jmn5gt.mjs → migration-DyafDAAZ.mjs} +2 -2
  35. package/dist/{migration-e3jmn5gt.mjs.map → migration-DyafDAAZ.mjs.map} +1 -1
  36. package/dist/{parse-bZgfjovA-Vk8LMIu5.mjs → parse-bZgfjovA-Duxv-s-s.mjs} +3 -3
  37. package/dist/{parse-bZgfjovA-Vk8LMIu5.mjs.map → parse-bZgfjovA-Duxv-s-s.mjs.map} +1 -1
  38. package/dist/psl-parser.mjs +5 -5
  39. package/dist/psl-parser__format.mjs +3 -3
  40. package/dist/psl-parser__interpret.mjs +2 -2
  41. package/dist/psl-parser__syntax.mjs +3 -3
  42. package/dist/psl-printer.mjs +1 -1
  43. package/dist/{temporal-type-aliases-BI3SL5iB-DIP8j4Gv.mjs → temporal-type-aliases-CFh3BW2a-DOlmiuQn.mjs} +3 -3
  44. package/dist/{temporal-type-aliases-BI3SL5iB-DIP8j4Gv.mjs.map → temporal-type-aliases-CFh3BW2a-DOlmiuQn.mjs.map} +1 -1
  45. package/dist/{type-constructor-calls-Bfg5ojed-DYHnzC9z.mjs → type-constructor-calls-Bfg5ojed-DwjW6zNQ.mjs} +5 -5
  46. package/dist/{type-constructor-calls-Bfg5ojed-DYHnzC9z.mjs.map → type-constructor-calls-Bfg5ojed-DwjW6zNQ.mjs.map} +1 -1
  47. package/package.json +16 -16
  48. package/dist/codec-descriptor-BNc32mKN-mmex2e4w.mjs.map +0 -1
  49. package/dist/control-CwUsQQ-8.mjs.map +0 -1
  50. package/dist/data-type-DPsP4_9m-BRPJX_-z.mjs.map +0 -1
  51. package/dist/execution-DcIdFSAR.mjs.map +0 -1
  52. package/dist/framework-copies-DeDyytAc-CK9tduQ6.mjs +0 -121
  53. package/dist/framework-copies-DeDyytAc-CK9tduQ6.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"type-constructor-calls-Bfg5ojed-DYHnzC9z.mjs","names":[],"sources":["../../../../1-framework/2-authoring/psl-parser/dist/contributed-type-scope-Ds4uDG91.mjs","../../../../1-framework/2-authoring/psl-parser/dist/type-constructor-calls-Bfg5ojed.mjs"],"sourcesContent":["import { a as NumberLiteralExprAst, i as FunctionCallAst, l as StringLiteralExprAst, m as IdentifierAst, r as BooleanLiteralExprAst, s as ObjectLiteralExprAst, t as ArrayLiteralAst, u as TaggedLiteralExprAst, y as printSyntax } from \"./expressions-CMQzbnHk.mjs\";\nimport { admittedForms, describeExpected, readWrittenValueAs, resolveAuthoringTypeChoice, typeConstructorLookup } from \"@internal/framework-components/authoring\";\nimport { InternalError, isInternalError } from \"@internal/utils/internal-error\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { describeTaggedLiteralFailure } from \"@internal/framework-components/control\";\nimport { createDataTypeLookup, dataTypeId } from \"@internal/framework-components/codec\";\n//#region src/diagnostic.ts\nfunction diagnosticSource(sources, node) {\n\treturn {\n\t\tsources,\n\t\tnode,\n\t\tat(span) {\n\t\t\tconst sourceFile = sources.sourceFileFor(node);\n\t\t\tconst range = span === void 0 ? {\n\t\t\t\tstart: sourceFile.positionAt(node.offset),\n\t\t\t\tend: sourceFile.positionAt(node.endOffset)\n\t\t\t} : sourceFile.pslSpanToRange(span);\n\t\t\treturn {\n\t\t\t\tfilename: sourceFile.filename,\n\t\t\t\trange\n\t\t\t};\n\t\t}\n\t};\n}\nfunction diagnosticFromSpan(diagnostic, source) {\n\tif (diagnostic.span === void 0) throw new InternalError(\"Owned PSL diagnostic has no span\");\n\treturn {\n\t\tcode: diagnostic.code,\n\t\tmessage: diagnostic.message,\n\t\t...source.at(diagnostic.span),\n\t\t...diagnostic.data === void 0 ? {} : { data: diagnostic.data }\n\t};\n}\nfunction mapPslDiagnostics(diagnostics, sources) {\n\treturn diagnostics.map(({ filename, code, message, range, data }) => ({\n\t\tcode,\n\t\tmessage,\n\t\tsourceId: filename,\n\t\tspan: sources.sourceFileNamed(filename).rangeToPslSpan(range),\n\t\t...data === void 0 ? {} : { data }\n\t}));\n}\nfunction createPslDiagnosticCollector(sources) {\n\tconst entries = [];\n\treturn {\n\t\tget length() {\n\t\t\treturn entries.length;\n\t\t},\n\t\tpush(...diagnostics) {\n\t\t\tfor (const diagnostic of diagnostics) entries.push({\n\t\t\t\tkind: \"psl\",\n\t\t\t\tdiagnostic\n\t\t\t});\n\t\t},\n\t\tpushUnlocated(...diagnostics) {\n\t\t\tfor (const diagnostic of diagnostics) entries.push({\n\t\t\t\tkind: \"psl\",\n\t\t\t\tdiagnostic,\n\t\t\t\tomitSpan: true\n\t\t\t});\n\t\t},\n\t\tpushExternal(...diagnostics) {\n\t\t\tfor (const diagnostic of diagnostics) entries.push({\n\t\t\t\tkind: \"external\",\n\t\t\t\tdiagnostic\n\t\t\t});\n\t\t},\n\t\ttoExternal() {\n\t\t\treturn entries.flatMap((entry) => {\n\t\t\t\tif (entry.kind === \"external\") return [entry.diagnostic];\n\t\t\t\tif (entry.omitSpan) {\n\t\t\t\t\tconst { code, message, filename, data } = entry.diagnostic;\n\t\t\t\t\treturn [{\n\t\t\t\t\t\tcode,\n\t\t\t\t\t\tmessage,\n\t\t\t\t\t\tsourceId: filename,\n\t\t\t\t\t\t...data === void 0 ? {} : { data }\n\t\t\t\t\t}];\n\t\t\t\t}\n\t\t\t\treturn mapPslDiagnostics([entry.diagnostic], sources);\n\t\t\t});\n\t\t}\n\t};\n}\n//#endregion\n//#region src/resolve.ts\nfunction readResolvedAttribute(attribute, sources) {\n\treturn {\n\t\tname: attributeName(attribute.name()),\n\t\targs: readResolvedArgList(attribute.argList(), sources),\n\t\tspan: nodePslSpan(attribute.syntax, sources),\n\t\tnode: attribute\n\t};\n}\nfunction readResolvedAttributes(attributes, sources) {\n\treturn Array.from(attributes, (attribute) => readResolvedAttribute(attribute, sources));\n}\nfunction readResolvedConstructorCall(annotation, sources) {\n\tconst argList = annotation?.argList();\n\tif (annotation === void 0 || argList === void 0) return void 0;\n\treturn {\n\t\tpath: annotation.name()?.path() ?? [],\n\t\targs: readResolvedArgList(argList, sources),\n\t\tspan: nodePslSpan(annotation.syntax, sources)\n\t};\n}\nfunction readResolvedArgList(argList, sources) {\n\tif (argList === void 0) return [];\n\tconst args = [];\n\tfor (const arg of argList.args()) {\n\t\tconst name = arg.name()?.name();\n\t\tconst expression = arg.value();\n\t\targs.push({\n\t\t\tkind: name !== void 0 ? \"named\" : \"positional\",\n\t\t\t...name !== void 0 ? { name } : {},\n\t\t\tvalue: renderExpression(expression),\n\t\t\t...expression !== void 0 ? { expression } : {},\n\t\t\tspan: nodePslSpan(arg.syntax, sources),\n\t\t\tnode: arg\n\t\t});\n\t}\n\treturn args;\n}\nfunction attributeName(name) {\n\treturn name?.path().join(\".\") ?? \"\";\n}\nfunction renderExpression(expression) {\n\tif (expression === void 0) return \"\";\n\treturn printSyntax(expression.syntax).trim();\n}\nfunction nodePslSpan(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.offsetToPslPosition(start),\n\t\tend: sourceFile.offsetToPslPosition(end)\n\t};\n}\n/** Unsupported-top-level-block diagnostics are anchored to the keyword token. */\nfunction keywordPslSpan(node, keyword, sources) {\n\tconst sourceFile = sources.sourceFileFor(node);\n\tconst start = node.offset;\n\tconst end = start + keyword.length;\n\treturn {\n\t\tstart: sourceFile.offsetToPslPosition(start),\n\t\tend: sourceFile.offsetToPslPosition(end)\n\t};\n}\n//#endregion\n//#region src/written-scalar.ts\nconst AN_EXPRESSION = {\n\tok: false,\n\treason: \"not-a-literal\",\n\tfound: \"an expression\"\n};\nfunction written(value) {\n\treturn {\n\t\tok: true,\n\t\twritten: value\n\t};\n}\n/** Reads a PSL literal expression as a `WrittenScalar`, for a position that takes a value of a data type. ADR 254. */\nfunction readWrittenScalar(expression) {\n\tconst syntax = expression.syntax;\n\tconst string = StringLiteralExprAst.cast(syntax)?.value();\n\tif (string !== void 0) return written({\n\t\tkind: \"string\",\n\t\ttext: string\n\t});\n\tconst number = NumberLiteralExprAst.cast(syntax);\n\tif (number !== void 0) {\n\t\tconst text = number.token()?.text;\n\t\treturn text === void 0 ? AN_EXPRESSION : written({\n\t\t\tkind: \"number\",\n\t\t\ttext\n\t\t});\n\t}\n\tconst boolean = BooleanLiteralExprAst.cast(syntax)?.value();\n\tif (boolean !== void 0) return written({\n\t\tkind: \"boolean\",\n\t\tvalue: boolean\n\t});\n\tconst tagged = TaggedLiteralExprAst.cast(syntax);\n\tif (tagged !== void 0) {\n\t\tconst canonicalization = tagged.canonicalization();\n\t\treturn canonicalization.ok ? written({\n\t\t\tkind: \"tag\",\n\t\t\ttag: tagged.tagName(),\n\t\t\ttext: canonicalization.text\n\t\t}) : {\n\t\t\tok: false,\n\t\t\treason: canonicalization.reason\n\t\t};\n\t}\n\tif (IdentifierAst.cast(syntax) !== void 0) return {\n\t\tok: false,\n\t\treason: \"not-a-literal\",\n\t\tfound: \"an identifier\"\n\t};\n\tif (FunctionCallAst.cast(syntax) !== void 0) return {\n\t\tok: false,\n\t\treason: \"not-a-literal\",\n\t\tfound: \"a function call\"\n\t};\n\tif (ArrayLiteralAst.cast(syntax) !== void 0) return {\n\t\tok: false,\n\t\treason: \"not-a-literal\",\n\t\tfound: \"a list\"\n\t};\n\tif (ObjectLiteralExprAst.cast(syntax) !== void 0) return {\n\t\tok: false,\n\t\treason: \"not-a-literal\",\n\t\tfound: \"an object\"\n\t};\n\treturn AN_EXPRESSION;\n}\n//#endregion\n//#region src/read-expression-as.ts\nconst TAGGED_LITERAL_FAILURE_CODES = {\n\tnul: \"PSL_TAGGED_LITERAL_NUL\",\n\t\"too-large\": \"PSL_TAGGED_LITERAL_TOO_LARGE\"\n};\n/**\n* Reads `expression` as a value of `dataType`: the literal is read through the authoring entry for its syntax, then taken into `dataType` directly or through a cast it declares. The read every argument typed by a data type takes, in an attribute or a type constructor. ADR 254.\n*/\nfunction readExpressionAs(support, dataType, expression) {\n\tif (!support.lookup.has(dataType)) throw new InternalError(`An argument receives data type \"${dataType}\", which this stack does not register.`);\n\tconst forms = admittedForms(support, [dataType]);\n\tif (forms.length === 0) throw new InternalError(`An argument receives data type \"${dataType}\", which nothing in this stack writes.`);\n\tconst literal = readWrittenScalar(expression);\n\tif (!literal.ok) return literal.reason === \"not-a-literal\" ? notOk({\n\t\tcode: \"PSL_INVALID_ATTRIBUTE_SYNTAX\",\n\t\tmessage: `${describeExpected(forms)}; got ${literal.found}`\n\t}) : notOk({\n\t\tcode: TAGGED_LITERAL_FAILURE_CODES[literal.reason],\n\t\tmessage: describeTaggedLiteralFailure(literal.reason)\n\t});\n\treturn readWrittenValueAs(support, dataType, literal.written);\n}\n//#endregion\n//#region src/attribute-spec/spec-context.ts\n/** The data types of a stack that registers none. */\nconst EMPTY_DATA_TYPES = {\n\tentries: {},\n\tlookup: createDataTypeLookup([]),\n\tdataTypeOfCodec: () => void 0\n};\n/** How a diagnostic names a subject, as in `Field \"Post.slug\"` or `Type alias \"Slug\"`. */\nfunction typeAttributeSubjectLabel(subject) {\n\treturn `${subject.kind === \"field\" ? \"Field\" : \"Type alias\"} \"${subject.name}\"`;\n}\nfunction typeAttributeSpecContextOfField(ctx) {\n\treturn {\n\t\tsymbols: ctx.symbols,\n\t\tdefaultFunctionRegistry: ctx.defaultFunctionRegistry,\n\t\tgeneratorFunctions: ctx.generatorFunctions,\n\t\tdataTypes: ctx.dataTypes,\n\t\tsubject: {\n\t\t\tkind: \"field\",\n\t\t\tname: `${ctx.model.name}.${ctx.field.name}`\n\t\t},\n\t\tlist: ctx.field.list,\n\t\ttypeName: ctx.field.typeName,\n\t\ttypeResolution: ctx.typeResolution,\n\t\tcontributedType: ctx.contributedType\n\t};\n}\n//#endregion\n//#region src/call-arguments.ts\n/** The call as the schema writes it, with its arguments separated by `, `. */\nfunction printTypeConstructorCall(call) {\n\tconst args = call.args.map((arg) => arg.kind === \"named\" ? `${arg.name}: ${arg.value}` : arg.value);\n\treturn `${call.path.join(\".\")}(${args.join(\", \")})`;\n}\n/**\n* Binds a call's arguments to its parameters, as PSL reads every call: the positional arguments fill the parameters in order, wherever named ones sit among them, and a named argument fills the parameter it names, which no other argument may fill. The bound arguments come positional ones first, then named ones, each in the order written.\n*/\nfunction bindCallArguments(args, parameters) {\n\tconst positional = args.filter((arg) => arg.kind === \"positional\");\n\tif (positional.length > parameters.length) return notOk({\n\t\tkind: \"tooManyPositional\",\n\t\treceived: positional.length,\n\t\tbound: []\n\t});\n\tconst bound = positional.map((argument, index) => ({\n\t\targument,\n\t\tindex\n\t}));\n\tconst filled = new Set(bound.map(({ index }) => index));\n\tfor (const argument of args.filter((arg) => arg.kind === \"named\")) {\n\t\tconst index = argument.name === void 0 ? -1 : parameters.indexOf(argument.name);\n\t\tif (index < 0) return notOk({\n\t\t\tkind: \"unknownName\",\n\t\t\targument,\n\t\t\tbound\n\t\t});\n\t\tif (filled.has(index)) return notOk({\n\t\t\tkind: \"filledTwice\",\n\t\t\targument,\n\t\t\tbound\n\t\t});\n\t\tfilled.add(index);\n\t\tbound.push({\n\t\t\targument,\n\t\t\tindex\n\t\t});\n\t}\n\treturn ok(bound);\n}\n/** Each argument's value, keyed by the parameter it fills, as {@link bindCallArguments} binds them; `undefined` when they do not bind. */\nfunction argumentsByParameter(args, parameters) {\n\tconst bound = bindCallArguments(args, parameters);\n\tif (!bound.ok) return void 0;\n\tconst values = /* @__PURE__ */ new Map();\n\tfor (const { argument, index } of bound.value) {\n\t\tconst parameter = parameters[index];\n\t\tif (parameter === void 0) return void 0;\n\t\tvalues.set(parameter, argument.value);\n\t}\n\treturn values;\n}\n//#endregion\n//#region src/authoring-arguments.ts\nconst INVALID_AUTHORING_ARGUMENT = Symbol(\"invalidAuthoringArgument\");\n/** Why a written value is not one of the names an option takes, and, for a number that only one value argument takes, that argument. */\nfunction misplacedOptionMessage(descriptors, dataTypes, option, written, argumentLabel) {\n\tconst refused = `${argumentLabel} is ${written}, but argument \"${option.name}\" takes one of these names, written without quotes: ${option.values.join(\", \")}.`;\n\tif (!/^[+-]?\\d/.test(written)) return refused;\n\tconst takers = descriptors.flatMap((descriptor) => descriptor.kind === \"value\" && descriptor.name !== void 0 && readWrittenValueAs(dataTypes, dataTypeId(descriptor.dataType), {\n\t\tkind: \"number\",\n\t\ttext: written\n\t}).ok ? [descriptor.name] : []);\n\tconst [taker] = takers;\n\treturn takers.length === 1 && taker !== void 0 ? `${refused} Write ${taker} by name, as in ${taker}: ${written}.` : refused;\n}\nconst SILENT_REFUSALS = {\n\tcall: () => {},\n\targument: () => {},\n\tvalue: () => {}\n};\n/**\n* The value of one argument as `descriptor` reads it: a `value` argument as a value of its data type, read from its expression as attribute arguments are, and a type choice's option as a bare name. A refusal is reported at the argument.\n*/\nfunction readPslHelperArgument(input, refusals, descriptor, argument, argumentLabel) {\n\tconst refuse = (message) => {\n\t\trefusals.argument(argument.span, message);\n\t\treturn INVALID_AUTHORING_ARGUMENT;\n\t};\n\tif (descriptor.kind === \"option\") {\n\t\tconst written = argument.value.trim();\n\t\tif (/^[A-Za-z_][A-Za-z0-9_]*$/.test(written)) return written;\n\t\treturn refuse(misplacedOptionMessage(input.descriptors, input.dataTypes, descriptor, written, argumentLabel));\n\t}\n\tconst { expression } = argument;\n\tif (expression === void 0 && argument.node !== void 0) return refuse(`${argumentLabel} has no value.`);\n\tif (expression === void 0) throw new InternalError(`A call received ${argumentLabel} with no expression. A value argument is read from the expression a schema writes; a reader that builds a call must pass the arguments it parsed, or instantiate the constructor with values.`);\n\tconst read = readExpressionAs(input.dataTypes, dataTypeId(descriptor.dataType), expression);\n\tif (read.ok) return read.value.value;\n\trefusals.value(expression.syntax, read.failure);\n\treturn INVALID_AUTHORING_ARGUMENT;\n}\nfunction readPslHelperArgsReporting(input, refusals) {\n\tconst bound = bindCallArguments(input.args, input.descriptors.map((descriptor) => descriptor?.name));\n\tconst mappedArgs = input.descriptors.map(() => void 0);\n\tfor (const { argument, index } of bound.ok ? bound.value : bound.failure.bound) {\n\t\tconst descriptor = input.descriptors[index];\n\t\tif (!descriptor) {\n\t\t\trefusals.argument(argument.span, `does not define positional argument #${index + 1}.`);\n\t\t\treturn;\n\t\t}\n\t\tconst value = readPslHelperArgument(input, refusals, descriptor, argument, argument.kind === \"named\" ? `named argument \"${argument.name}\"` : `argument #${index + 1}`);\n\t\tif (value === INVALID_AUTHORING_ARGUMENT) return void 0;\n\t\tmappedArgs[index] = value;\n\t}\n\tif (bound.ok) return mappedArgs;\n\tconst failure = bound.failure;\n\tswitch (failure.kind) {\n\t\tcase \"tooManyPositional\":\n\t\t\trefusals.call(`accepts at most ${input.descriptors.length} argument(s), received ${failure.received}.`);\n\t\t\treturn;\n\t\tcase \"unknownName\":\n\t\t\trefusals.argument(failure.argument.span, `received unknown named argument \"${failure.argument.name}\".`);\n\t\t\treturn;\n\t\tcase \"filledTwice\":\n\t\t\trefusals.argument(failure.argument.span, `received duplicate value for argument \"${failure.argument.name}\".`);\n\t\t\treturn;\n\t}\n}\n/**\n* The arguments of a type constructor or type choice call, positional and named, each read as its descriptor says. `undefined`, with a diagnostic pushed, when one cannot be read or does not match a descriptor.\n*/\nfunction mapPslHelperArgs(input) {\n\tconst refused = (span, message) => input.diagnostics.push({\n\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\tmessage: `${input.entityLabel} ${input.helperLabel} ${message}`,\n\t\t...input.source.at(span)\n\t});\n\treturn readPslHelperArgsReporting(input, {\n\t\tcall: (message) => refused(input.span, message),\n\t\targument: refused,\n\t\tvalue: (node, failure) => input.diagnostics.push({\n\t\t\tcode: failure.code,\n\t\t\tmessage: failure.message,\n\t\t\t...input.source.at(nodePslSpan(node, input.source.sources))\n\t\t})\n\t});\n}\n/**\n* The arguments of a call read as {@link mapPslHelperArgs} reads them, without reporting what it refuses: `undefined` when the call does not read, which the reader that resolves the column reports.\n*/\nfunction readPslHelperArgs(input) {\n\treturn readPslHelperArgsReporting(input, SILENT_REFUSALS);\n}\n//#endregion\n//#region src/contributed-type-scope.ts\nfunction isContributedTypeChoice(symbol) {\n\treturn symbol.descriptor.kind === \"typeChoice\";\n}\nfunction isContributedTypeDescriptor(value) {\n\treturn \"kind\" in value && (value.kind === \"typeConstructor\" || value.kind === \"typeAlias\" || value.kind === \"typeChoice\");\n}\n/** The explicit type a call of the type choice `symbol` chooses and the arguments it is built with, reading the call as the column does, or why it chooses none. */\nfunction chosenTypeConstructor(symbol, call, dataTypes) {\n\tconst helperPath = symbol.path.join(\".\");\n\tconst args = readPslHelperArgs({\n\t\targs: call?.args ?? [],\n\t\tdescriptors: symbol.descriptor.args,\n\t\tdataTypes\n\t});\n\tif (args === void 0) return notOk(`The arguments of ${helperPath} do not read.`);\n\ttry {\n\t\treturn ok(resolveAuthoringTypeChoice({\n\t\t\thelperPath,\n\t\t\tdescriptor: symbol.descriptor,\n\t\t\targs,\n\t\t\tconstructorNamed: (name) => symbol.choiceTypes.get(name)\n\t\t}));\n\t} catch (error) {\n\t\tif (isInternalError(error) || !(error instanceof Error)) throw error;\n\t\treturn notOk(error.message);\n\t}\n}\n/** The codec a column typed by `use` is stored with; `undefined` for a type choice whose call chooses no type, which the column's resolution reports. */\nfunction contributedTypeCodecId(use, dataTypes) {\n\tconst { symbol } = use;\n\tif (isContributedTypeChoice(symbol)) {\n\t\tconst chosen = chosenTypeConstructor(symbol, use.call, dataTypes);\n\t\treturn chosen.ok ? chosen.value.descriptor.output.codecId : void 0;\n\t}\n\tconst { descriptor } = symbol;\n\treturn descriptor.kind === \"typeAlias\" ? descriptor.output.type.codecId : descriptor.output.codecId;\n}\n/** The descriptor at `path` in `namespace`, or `undefined` when none is contributed there. */\nfunction contributedTypeAt(namespace, path) {\n\tconst [name, ...rest] = path;\n\tif (name === void 0 || !Object.hasOwn(namespace, name)) return void 0;\n\tconst value = namespace[name];\n\tif (value === void 0) return void 0;\n\tif (isContributedTypeDescriptor(value)) return rest.length === 0 ? value : void 0;\n\treturn contributedTypeAt(value, rest);\n}\n/** The codec a column typed by `call` is stored with, reading the call's arguments as the column does, or `undefined` when no type is contributed at its path or it is a type choice whose arguments choose no type. */\nfunction writtenContributedTypeCodecId(namespace, call) {\n\treturn codecIdAtPath(namespace, call.path, [], call);\n}\nfunction codecIdAtPath(namespace, path, prefix, call) {\n\tconst [name, ...rest] = path;\n\tif (name === void 0 || !Object.hasOwn(namespace, name)) return void 0;\n\tconst value = namespace[name];\n\tif (value === void 0) return void 0;\n\tconst at = [...prefix, name];\n\tif (!isContributedTypeDescriptor(value)) return codecIdAtPath(value, rest, at, call);\n\tif (rest.length > 0) return void 0;\n\treturn contributedTypeCodecId({\n\t\tsymbol: contributedTypeSymbol(name, at, value, namespace),\n\t\tcall\n\t}, EMPTY_DATA_TYPES);\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) ? contributedTypeSymbol(name, path, value, namespace) : {\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}\nfunction contributedTypeSymbol(name, path, descriptor, namespace) {\n\tif (descriptor.kind !== \"typeChoice\") return {\n\t\tkind: \"contributedType\",\n\t\tname,\n\t\tpath,\n\t\tdescriptor\n\t};\n\tconst constructorNamed = typeConstructorLookup(namespace);\n\tconst choiceTypes = /* @__PURE__ */ new Map();\n\tfor (const { type } of descriptor.choices) {\n\t\tconst chosen = constructorNamed(type);\n\t\tif (chosen !== void 0) choiceTypes.set(type, chosen);\n\t}\n\treturn {\n\t\tkind: \"contributedType\",\n\t\tname,\n\t\tpath,\n\t\tdescriptor,\n\t\tchoiceTypes\n\t};\n}\n//#endregion\nexport { mapPslDiagnostics as C, diagnosticSource as S, readResolvedAttribute as _, isContributedTypeChoice as a, createPslDiagnosticCollector as b, argumentsByParameter as c, typeAttributeSpecContextOfField as d, typeAttributeSubjectLabel as f, nodePslSpan as g, keywordPslSpan as h, contributedTypeScope as i, printTypeConstructorCall as l, readWrittenScalar as m, contributedTypeAt as n, writtenContributedTypeCodecId as o, readExpressionAs as p, contributedTypeCodecId as r, mapPslHelperArgs as s, chosenTypeConstructor as t, EMPTY_DATA_TYPES as u, readResolvedAttributes as v, diagnosticFromSpan as x, readResolvedConstructorCall as y };\n\n//# sourceMappingURL=contributed-type-scope-Ds4uDG91.mjs.map","//#region src/type-constructor-calls.ts\nfunction isBareTypeConstructor(descriptor) {\n\treturn descriptor.entityRefArg === void 0 && (descriptor.args ?? []).every((arg) => arg.optional === true);\n}\nfunction argumentSpelling(descriptor) {\n\tconst args = descriptor.args ?? [];\n\tconst reference = descriptor.entityRefArg;\n\tconst count = Math.max(args.length, (reference?.index ?? -1) + 1);\n\tconst names = [];\n\tfor (let index = 0; index < count; index++) {\n\t\tconst arg = args[index];\n\t\tif (index === reference?.index) names.push(reference.entityKind);\n\t\telse if (arg !== void 0 && arg.optional !== true) names.push(arg.name ?? `argument${index + 1}`);\n\t}\n\treturn names.join(\", \");\n}\nfunction reportTypeConstructorNotCalled(input) {\n\tinput.diagnostics.push({\n\t\tcode: \"PSL_TYPE_CONSTRUCTOR_NOT_CALLED\",\n\t\tmessage: `${input.entityLabel} uses type constructor \"${input.path}\" without arguments. Write ${input.path}(${argumentSpelling(input.descriptor)}).`,\n\t\t...input.source.at(input.span)\n\t});\n}\n//#endregion\nexport { reportTypeConstructorNotCalled as n, isBareTypeConstructor as t };\n\n//# sourceMappingURL=type-constructor-calls-Bfg5ojed.mjs.map"],"mappings":";;;;;;;AAOA,SAAS,iBAAiB,SAAS,MAAM;CACxC,OAAO;EACN;EACA;EACA,GAAG,MAAM;GACR,MAAM,aAAa,QAAQ,cAAc,IAAI;GAC7C,MAAM,QAAQ,SAAS,KAAK,IAAI;IAC/B,OAAO,WAAW,WAAW,KAAK,MAAM;IACxC,KAAK,WAAW,WAAW,KAAK,SAAS;GAC1C,IAAI,WAAW,eAAe,IAAI;GAClC,OAAO;IACN,UAAU,WAAW;IACrB;GACD;EACD;CACD;AACD;AACA,SAAS,mBAAmB,YAAY,QAAQ;CAC/C,IAAI,WAAW,SAAS,KAAK,GAAG,MAAM,IAAI,cAAc,kCAAkC;CAC1F,OAAO;EACN,MAAM,WAAW;EACjB,SAAS,WAAW;EACpB,GAAG,OAAO,GAAG,WAAW,IAAI;EAC5B,GAAG,WAAW,SAAS,KAAK,IAAI,CAAC,IAAI,EAAE,MAAM,WAAW,KAAK;CAC9D;AACD;AACA,SAAS,kBAAkB,aAAa,SAAS;CAChD,OAAO,YAAY,KAAK,EAAE,UAAU,MAAM,SAAS,OAAO,YAAY;EACrE;EACA;EACA,UAAU;EACV,MAAM,QAAQ,gBAAgB,QAAQ,CAAC,CAAC,eAAe,KAAK;EAC5D,GAAG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SAAS,+BAA+B,OAAO;CAC9C,MAAM,YAAY,KAAK;EACtB,MAAM;EACN,SAAS,GAAG,MAAM,YAAY,0BAA0B,MAAM,KAAK,6BAA6B,MAAM,KAAK,GAAG,iBAAiB,MAAM,UAAU,EAAE;EACjJ,GAAG,MAAM,OAAO,GAAG,MAAM,IAAI;CAC9B,CAAC;AACF"}
1
+ {"version":3,"file":"type-constructor-calls-Bfg5ojed-DwjW6zNQ.mjs","names":[],"sources":["../../../../1-framework/2-authoring/psl-parser/dist/contributed-type-scope-Ds4uDG91.mjs","../../../../1-framework/2-authoring/psl-parser/dist/type-constructor-calls-Bfg5ojed.mjs"],"sourcesContent":["import { a as NumberLiteralExprAst, i as FunctionCallAst, l as StringLiteralExprAst, m as IdentifierAst, r as BooleanLiteralExprAst, s as ObjectLiteralExprAst, t as ArrayLiteralAst, u as TaggedLiteralExprAst, y as printSyntax } from \"./expressions-CMQzbnHk.mjs\";\nimport { admittedForms, describeExpected, readWrittenValueAs, resolveAuthoringTypeChoice, typeConstructorLookup } from \"@internal/framework-components/authoring\";\nimport { InternalError, isInternalError } from \"@internal/utils/internal-error\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { describeTaggedLiteralFailure } from \"@internal/framework-components/control\";\nimport { createDataTypeLookup, dataTypeId } from \"@internal/framework-components/codec\";\n//#region src/diagnostic.ts\nfunction diagnosticSource(sources, node) {\n\treturn {\n\t\tsources,\n\t\tnode,\n\t\tat(span) {\n\t\t\tconst sourceFile = sources.sourceFileFor(node);\n\t\t\tconst range = span === void 0 ? {\n\t\t\t\tstart: sourceFile.positionAt(node.offset),\n\t\t\t\tend: sourceFile.positionAt(node.endOffset)\n\t\t\t} : sourceFile.pslSpanToRange(span);\n\t\t\treturn {\n\t\t\t\tfilename: sourceFile.filename,\n\t\t\t\trange\n\t\t\t};\n\t\t}\n\t};\n}\nfunction diagnosticFromSpan(diagnostic, source) {\n\tif (diagnostic.span === void 0) throw new InternalError(\"Owned PSL diagnostic has no span\");\n\treturn {\n\t\tcode: diagnostic.code,\n\t\tmessage: diagnostic.message,\n\t\t...source.at(diagnostic.span),\n\t\t...diagnostic.data === void 0 ? {} : { data: diagnostic.data }\n\t};\n}\nfunction mapPslDiagnostics(diagnostics, sources) {\n\treturn diagnostics.map(({ filename, code, message, range, data }) => ({\n\t\tcode,\n\t\tmessage,\n\t\tsourceId: filename,\n\t\tspan: sources.sourceFileNamed(filename).rangeToPslSpan(range),\n\t\t...data === void 0 ? {} : { data }\n\t}));\n}\nfunction createPslDiagnosticCollector(sources) {\n\tconst entries = [];\n\treturn {\n\t\tget length() {\n\t\t\treturn entries.length;\n\t\t},\n\t\tpush(...diagnostics) {\n\t\t\tfor (const diagnostic of diagnostics) entries.push({\n\t\t\t\tkind: \"psl\",\n\t\t\t\tdiagnostic\n\t\t\t});\n\t\t},\n\t\tpushUnlocated(...diagnostics) {\n\t\t\tfor (const diagnostic of diagnostics) entries.push({\n\t\t\t\tkind: \"psl\",\n\t\t\t\tdiagnostic,\n\t\t\t\tomitSpan: true\n\t\t\t});\n\t\t},\n\t\tpushExternal(...diagnostics) {\n\t\t\tfor (const diagnostic of diagnostics) entries.push({\n\t\t\t\tkind: \"external\",\n\t\t\t\tdiagnostic\n\t\t\t});\n\t\t},\n\t\ttoExternal() {\n\t\t\treturn entries.flatMap((entry) => {\n\t\t\t\tif (entry.kind === \"external\") return [entry.diagnostic];\n\t\t\t\tif (entry.omitSpan) {\n\t\t\t\t\tconst { code, message, filename, data } = entry.diagnostic;\n\t\t\t\t\treturn [{\n\t\t\t\t\t\tcode,\n\t\t\t\t\t\tmessage,\n\t\t\t\t\t\tsourceId: filename,\n\t\t\t\t\t\t...data === void 0 ? {} : { data }\n\t\t\t\t\t}];\n\t\t\t\t}\n\t\t\t\treturn mapPslDiagnostics([entry.diagnostic], sources);\n\t\t\t});\n\t\t}\n\t};\n}\n//#endregion\n//#region src/resolve.ts\nfunction readResolvedAttribute(attribute, sources) {\n\treturn {\n\t\tname: attributeName(attribute.name()),\n\t\targs: readResolvedArgList(attribute.argList(), sources),\n\t\tspan: nodePslSpan(attribute.syntax, sources),\n\t\tnode: attribute\n\t};\n}\nfunction readResolvedAttributes(attributes, sources) {\n\treturn Array.from(attributes, (attribute) => readResolvedAttribute(attribute, sources));\n}\nfunction readResolvedConstructorCall(annotation, sources) {\n\tconst argList = annotation?.argList();\n\tif (annotation === void 0 || argList === void 0) return void 0;\n\treturn {\n\t\tpath: annotation.name()?.path() ?? [],\n\t\targs: readResolvedArgList(argList, sources),\n\t\tspan: nodePslSpan(annotation.syntax, sources)\n\t};\n}\nfunction readResolvedArgList(argList, sources) {\n\tif (argList === void 0) return [];\n\tconst args = [];\n\tfor (const arg of argList.args()) {\n\t\tconst name = arg.name()?.name();\n\t\tconst expression = arg.value();\n\t\targs.push({\n\t\t\tkind: name !== void 0 ? \"named\" : \"positional\",\n\t\t\t...name !== void 0 ? { name } : {},\n\t\t\tvalue: renderExpression(expression),\n\t\t\t...expression !== void 0 ? { expression } : {},\n\t\t\tspan: nodePslSpan(arg.syntax, sources),\n\t\t\tnode: arg\n\t\t});\n\t}\n\treturn args;\n}\nfunction attributeName(name) {\n\treturn name?.path().join(\".\") ?? \"\";\n}\nfunction renderExpression(expression) {\n\tif (expression === void 0) return \"\";\n\treturn printSyntax(expression.syntax).trim();\n}\nfunction nodePslSpan(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.offsetToPslPosition(start),\n\t\tend: sourceFile.offsetToPslPosition(end)\n\t};\n}\n/** Unsupported-top-level-block diagnostics are anchored to the keyword token. */\nfunction keywordPslSpan(node, keyword, sources) {\n\tconst sourceFile = sources.sourceFileFor(node);\n\tconst start = node.offset;\n\tconst end = start + keyword.length;\n\treturn {\n\t\tstart: sourceFile.offsetToPslPosition(start),\n\t\tend: sourceFile.offsetToPslPosition(end)\n\t};\n}\n//#endregion\n//#region src/written-scalar.ts\nconst AN_EXPRESSION = {\n\tok: false,\n\treason: \"not-a-literal\",\n\tfound: \"an expression\"\n};\nfunction written(value) {\n\treturn {\n\t\tok: true,\n\t\twritten: value\n\t};\n}\n/** Reads a PSL literal expression as a `WrittenScalar`, for a position that takes a value of a data type. ADR 254. */\nfunction readWrittenScalar(expression) {\n\tconst syntax = expression.syntax;\n\tconst string = StringLiteralExprAst.cast(syntax)?.value();\n\tif (string !== void 0) return written({\n\t\tkind: \"string\",\n\t\ttext: string\n\t});\n\tconst number = NumberLiteralExprAst.cast(syntax);\n\tif (number !== void 0) {\n\t\tconst text = number.token()?.text;\n\t\treturn text === void 0 ? AN_EXPRESSION : written({\n\t\t\tkind: \"number\",\n\t\t\ttext\n\t\t});\n\t}\n\tconst boolean = BooleanLiteralExprAst.cast(syntax)?.value();\n\tif (boolean !== void 0) return written({\n\t\tkind: \"boolean\",\n\t\tvalue: boolean\n\t});\n\tconst tagged = TaggedLiteralExprAst.cast(syntax);\n\tif (tagged !== void 0) {\n\t\tconst canonicalization = tagged.canonicalization();\n\t\treturn canonicalization.ok ? written({\n\t\t\tkind: \"tag\",\n\t\t\ttag: tagged.tagName(),\n\t\t\ttext: canonicalization.text\n\t\t}) : {\n\t\t\tok: false,\n\t\t\treason: canonicalization.reason\n\t\t};\n\t}\n\tif (IdentifierAst.cast(syntax) !== void 0) return {\n\t\tok: false,\n\t\treason: \"not-a-literal\",\n\t\tfound: \"an identifier\"\n\t};\n\tif (FunctionCallAst.cast(syntax) !== void 0) return {\n\t\tok: false,\n\t\treason: \"not-a-literal\",\n\t\tfound: \"a function call\"\n\t};\n\tif (ArrayLiteralAst.cast(syntax) !== void 0) return {\n\t\tok: false,\n\t\treason: \"not-a-literal\",\n\t\tfound: \"a list\"\n\t};\n\tif (ObjectLiteralExprAst.cast(syntax) !== void 0) return {\n\t\tok: false,\n\t\treason: \"not-a-literal\",\n\t\tfound: \"an object\"\n\t};\n\treturn AN_EXPRESSION;\n}\n//#endregion\n//#region src/read-expression-as.ts\nconst TAGGED_LITERAL_FAILURE_CODES = {\n\tnul: \"PSL_TAGGED_LITERAL_NUL\",\n\t\"too-large\": \"PSL_TAGGED_LITERAL_TOO_LARGE\"\n};\n/**\n* Reads `expression` as a value of `dataType`: the literal is read through the authoring entry for its syntax, then taken into `dataType` directly or through a cast it declares. The read every argument typed by a data type takes, in an attribute or a type constructor. ADR 254.\n*/\nfunction readExpressionAs(support, dataType, expression) {\n\tif (!support.lookup.has(dataType)) throw new InternalError(`An argument receives data type \"${dataType}\", which this stack does not register.`);\n\tconst forms = admittedForms(support, [dataType]);\n\tif (forms.length === 0) throw new InternalError(`An argument receives data type \"${dataType}\", which nothing in this stack writes.`);\n\tconst literal = readWrittenScalar(expression);\n\tif (!literal.ok) return literal.reason === \"not-a-literal\" ? notOk({\n\t\tcode: \"PSL_INVALID_ATTRIBUTE_SYNTAX\",\n\t\tmessage: `${describeExpected(forms)}; got ${literal.found}`\n\t}) : notOk({\n\t\tcode: TAGGED_LITERAL_FAILURE_CODES[literal.reason],\n\t\tmessage: describeTaggedLiteralFailure(literal.reason)\n\t});\n\treturn readWrittenValueAs(support, dataType, literal.written);\n}\n//#endregion\n//#region src/attribute-spec/spec-context.ts\n/** The data types of a stack that registers none. */\nconst EMPTY_DATA_TYPES = {\n\tentries: {},\n\tlookup: createDataTypeLookup([]),\n\tdataTypeOfCodec: () => void 0\n};\n/** How a diagnostic names a subject, as in `Field \"Post.slug\"` or `Type alias \"Slug\"`. */\nfunction typeAttributeSubjectLabel(subject) {\n\treturn `${subject.kind === \"field\" ? \"Field\" : \"Type alias\"} \"${subject.name}\"`;\n}\nfunction typeAttributeSpecContextOfField(ctx) {\n\treturn {\n\t\tsymbols: ctx.symbols,\n\t\tdefaultFunctionRegistry: ctx.defaultFunctionRegistry,\n\t\tgeneratorFunctions: ctx.generatorFunctions,\n\t\tdataTypes: ctx.dataTypes,\n\t\tsubject: {\n\t\t\tkind: \"field\",\n\t\t\tname: `${ctx.model.name}.${ctx.field.name}`\n\t\t},\n\t\tlist: ctx.field.list,\n\t\ttypeName: ctx.field.typeName,\n\t\ttypeResolution: ctx.typeResolution,\n\t\tcontributedType: ctx.contributedType\n\t};\n}\n//#endregion\n//#region src/call-arguments.ts\n/** The call as the schema writes it, with its arguments separated by `, `. */\nfunction printTypeConstructorCall(call) {\n\tconst args = call.args.map((arg) => arg.kind === \"named\" ? `${arg.name}: ${arg.value}` : arg.value);\n\treturn `${call.path.join(\".\")}(${args.join(\", \")})`;\n}\n/**\n* Binds a call's arguments to its parameters, as PSL reads every call: the positional arguments fill the parameters in order, wherever named ones sit among them, and a named argument fills the parameter it names, which no other argument may fill. The bound arguments come positional ones first, then named ones, each in the order written.\n*/\nfunction bindCallArguments(args, parameters) {\n\tconst positional = args.filter((arg) => arg.kind === \"positional\");\n\tif (positional.length > parameters.length) return notOk({\n\t\tkind: \"tooManyPositional\",\n\t\treceived: positional.length,\n\t\tbound: []\n\t});\n\tconst bound = positional.map((argument, index) => ({\n\t\targument,\n\t\tindex\n\t}));\n\tconst filled = new Set(bound.map(({ index }) => index));\n\tfor (const argument of args.filter((arg) => arg.kind === \"named\")) {\n\t\tconst index = argument.name === void 0 ? -1 : parameters.indexOf(argument.name);\n\t\tif (index < 0) return notOk({\n\t\t\tkind: \"unknownName\",\n\t\t\targument,\n\t\t\tbound\n\t\t});\n\t\tif (filled.has(index)) return notOk({\n\t\t\tkind: \"filledTwice\",\n\t\t\targument,\n\t\t\tbound\n\t\t});\n\t\tfilled.add(index);\n\t\tbound.push({\n\t\t\targument,\n\t\t\tindex\n\t\t});\n\t}\n\treturn ok(bound);\n}\n/** Each argument's value, keyed by the parameter it fills, as {@link bindCallArguments} binds them; `undefined` when they do not bind. */\nfunction argumentsByParameter(args, parameters) {\n\tconst bound = bindCallArguments(args, parameters);\n\tif (!bound.ok) return void 0;\n\tconst values = /* @__PURE__ */ new Map();\n\tfor (const { argument, index } of bound.value) {\n\t\tconst parameter = parameters[index];\n\t\tif (parameter === void 0) return void 0;\n\t\tvalues.set(parameter, argument.value);\n\t}\n\treturn values;\n}\n//#endregion\n//#region src/authoring-arguments.ts\nconst INVALID_AUTHORING_ARGUMENT = Symbol(\"invalidAuthoringArgument\");\n/** Why a written value is not one of the names an option takes, and, for a number that only one value argument takes, that argument. */\nfunction misplacedOptionMessage(descriptors, dataTypes, option, written, argumentLabel) {\n\tconst refused = `${argumentLabel} is ${written}, but argument \"${option.name}\" takes one of these names, written without quotes: ${option.values.join(\", \")}.`;\n\tif (!/^[+-]?\\d/.test(written)) return refused;\n\tconst takers = descriptors.flatMap((descriptor) => descriptor.kind === \"value\" && descriptor.name !== void 0 && readWrittenValueAs(dataTypes, dataTypeId(descriptor.dataType), {\n\t\tkind: \"number\",\n\t\ttext: written\n\t}).ok ? [descriptor.name] : []);\n\tconst [taker] = takers;\n\treturn takers.length === 1 && taker !== void 0 ? `${refused} Write ${taker} by name, as in ${taker}: ${written}.` : refused;\n}\nconst SILENT_REFUSALS = {\n\tcall: () => {},\n\targument: () => {},\n\tvalue: () => {}\n};\n/**\n* The value of one argument as `descriptor` reads it: a `value` argument as a value of its data type, read from its expression as attribute arguments are, and a type choice's option as a bare name. A refusal is reported at the argument.\n*/\nfunction readPslHelperArgument(input, refusals, descriptor, argument, argumentLabel) {\n\tconst refuse = (message) => {\n\t\trefusals.argument(argument.span, message);\n\t\treturn INVALID_AUTHORING_ARGUMENT;\n\t};\n\tif (descriptor.kind === \"option\") {\n\t\tconst written = argument.value.trim();\n\t\tif (/^[A-Za-z_][A-Za-z0-9_]*$/.test(written)) return written;\n\t\treturn refuse(misplacedOptionMessage(input.descriptors, input.dataTypes, descriptor, written, argumentLabel));\n\t}\n\tconst { expression } = argument;\n\tif (expression === void 0 && argument.node !== void 0) return refuse(`${argumentLabel} has no value.`);\n\tif (expression === void 0) throw new InternalError(`A call received ${argumentLabel} with no expression. A value argument is read from the expression a schema writes; a reader that builds a call must pass the arguments it parsed, or instantiate the constructor with values.`);\n\tconst read = readExpressionAs(input.dataTypes, dataTypeId(descriptor.dataType), expression);\n\tif (read.ok) return read.value.value;\n\trefusals.value(expression.syntax, read.failure);\n\treturn INVALID_AUTHORING_ARGUMENT;\n}\nfunction readPslHelperArgsReporting(input, refusals) {\n\tconst bound = bindCallArguments(input.args, input.descriptors.map((descriptor) => descriptor?.name));\n\tconst mappedArgs = input.descriptors.map(() => void 0);\n\tfor (const { argument, index } of bound.ok ? bound.value : bound.failure.bound) {\n\t\tconst descriptor = input.descriptors[index];\n\t\tif (!descriptor) {\n\t\t\trefusals.argument(argument.span, `does not define positional argument #${index + 1}.`);\n\t\t\treturn;\n\t\t}\n\t\tconst value = readPslHelperArgument(input, refusals, descriptor, argument, argument.kind === \"named\" ? `named argument \"${argument.name}\"` : `argument #${index + 1}`);\n\t\tif (value === INVALID_AUTHORING_ARGUMENT) return void 0;\n\t\tmappedArgs[index] = value;\n\t}\n\tif (bound.ok) return mappedArgs;\n\tconst failure = bound.failure;\n\tswitch (failure.kind) {\n\t\tcase \"tooManyPositional\":\n\t\t\trefusals.call(`accepts at most ${input.descriptors.length} argument(s), received ${failure.received}.`);\n\t\t\treturn;\n\t\tcase \"unknownName\":\n\t\t\trefusals.argument(failure.argument.span, `received unknown named argument \"${failure.argument.name}\".`);\n\t\t\treturn;\n\t\tcase \"filledTwice\":\n\t\t\trefusals.argument(failure.argument.span, `received duplicate value for argument \"${failure.argument.name}\".`);\n\t\t\treturn;\n\t}\n}\n/**\n* The arguments of a type constructor or type choice call, positional and named, each read as its descriptor says. `undefined`, with a diagnostic pushed, when one cannot be read or does not match a descriptor.\n*/\nfunction mapPslHelperArgs(input) {\n\tconst refused = (span, message) => input.diagnostics.push({\n\t\tcode: \"PSL_INVALID_ATTRIBUTE_ARGUMENT\",\n\t\tmessage: `${input.entityLabel} ${input.helperLabel} ${message}`,\n\t\t...input.source.at(span)\n\t});\n\treturn readPslHelperArgsReporting(input, {\n\t\tcall: (message) => refused(input.span, message),\n\t\targument: refused,\n\t\tvalue: (node, failure) => input.diagnostics.push({\n\t\t\tcode: failure.code,\n\t\t\tmessage: failure.message,\n\t\t\t...input.source.at(nodePslSpan(node, input.source.sources))\n\t\t})\n\t});\n}\n/**\n* The arguments of a call read as {@link mapPslHelperArgs} reads them, without reporting what it refuses: `undefined` when the call does not read, which the reader that resolves the column reports.\n*/\nfunction readPslHelperArgs(input) {\n\treturn readPslHelperArgsReporting(input, SILENT_REFUSALS);\n}\n//#endregion\n//#region src/contributed-type-scope.ts\nfunction isContributedTypeChoice(symbol) {\n\treturn symbol.descriptor.kind === \"typeChoice\";\n}\nfunction isContributedTypeDescriptor(value) {\n\treturn \"kind\" in value && (value.kind === \"typeConstructor\" || value.kind === \"typeAlias\" || value.kind === \"typeChoice\");\n}\n/** The explicit type a call of the type choice `symbol` chooses and the arguments it is built with, reading the call as the column does, or why it chooses none. */\nfunction chosenTypeConstructor(symbol, call, dataTypes) {\n\tconst helperPath = symbol.path.join(\".\");\n\tconst args = readPslHelperArgs({\n\t\targs: call?.args ?? [],\n\t\tdescriptors: symbol.descriptor.args,\n\t\tdataTypes\n\t});\n\tif (args === void 0) return notOk(`The arguments of ${helperPath} do not read.`);\n\ttry {\n\t\treturn ok(resolveAuthoringTypeChoice({\n\t\t\thelperPath,\n\t\t\tdescriptor: symbol.descriptor,\n\t\t\targs,\n\t\t\tconstructorNamed: (name) => symbol.choiceTypes.get(name)\n\t\t}));\n\t} catch (error) {\n\t\tif (isInternalError(error) || !(error instanceof Error)) throw error;\n\t\treturn notOk(error.message);\n\t}\n}\n/** The codec a column typed by `use` is stored with; `undefined` for a type choice whose call chooses no type, which the column's resolution reports. */\nfunction contributedTypeCodecId(use, dataTypes) {\n\tconst { symbol } = use;\n\tif (isContributedTypeChoice(symbol)) {\n\t\tconst chosen = chosenTypeConstructor(symbol, use.call, dataTypes);\n\t\treturn chosen.ok ? chosen.value.descriptor.output.codecId : void 0;\n\t}\n\tconst { descriptor } = symbol;\n\treturn descriptor.kind === \"typeAlias\" ? descriptor.output.type.codecId : descriptor.output.codecId;\n}\n/** The descriptor at `path` in `namespace`, or `undefined` when none is contributed there. */\nfunction contributedTypeAt(namespace, path) {\n\tconst [name, ...rest] = path;\n\tif (name === void 0 || !Object.hasOwn(namespace, name)) return void 0;\n\tconst value = namespace[name];\n\tif (value === void 0) return void 0;\n\tif (isContributedTypeDescriptor(value)) return rest.length === 0 ? value : void 0;\n\treturn contributedTypeAt(value, rest);\n}\n/** The codec a column typed by `call` is stored with, reading the call's arguments as the column does, or `undefined` when no type is contributed at its path or it is a type choice whose arguments choose no type. */\nfunction writtenContributedTypeCodecId(namespace, call) {\n\treturn codecIdAtPath(namespace, call.path, [], call);\n}\nfunction codecIdAtPath(namespace, path, prefix, call) {\n\tconst [name, ...rest] = path;\n\tif (name === void 0 || !Object.hasOwn(namespace, name)) return void 0;\n\tconst value = namespace[name];\n\tif (value === void 0) return void 0;\n\tconst at = [...prefix, name];\n\tif (!isContributedTypeDescriptor(value)) return codecIdAtPath(value, rest, at, call);\n\tif (rest.length > 0) return void 0;\n\treturn contributedTypeCodecId({\n\t\tsymbol: contributedTypeSymbol(name, at, value, namespace),\n\t\tcall\n\t}, EMPTY_DATA_TYPES);\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) ? contributedTypeSymbol(name, path, value, namespace) : {\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}\nfunction contributedTypeSymbol(name, path, descriptor, namespace) {\n\tif (descriptor.kind !== \"typeChoice\") return {\n\t\tkind: \"contributedType\",\n\t\tname,\n\t\tpath,\n\t\tdescriptor\n\t};\n\tconst constructorNamed = typeConstructorLookup(namespace);\n\tconst choiceTypes = /* @__PURE__ */ new Map();\n\tfor (const { type } of descriptor.choices) {\n\t\tconst chosen = constructorNamed(type);\n\t\tif (chosen !== void 0) choiceTypes.set(type, chosen);\n\t}\n\treturn {\n\t\tkind: \"contributedType\",\n\t\tname,\n\t\tpath,\n\t\tdescriptor,\n\t\tchoiceTypes\n\t};\n}\n//#endregion\nexport { mapPslDiagnostics as C, diagnosticSource as S, readResolvedAttribute as _, isContributedTypeChoice as a, createPslDiagnosticCollector as b, argumentsByParameter as c, typeAttributeSpecContextOfField as d, typeAttributeSubjectLabel as f, nodePslSpan as g, keywordPslSpan as h, contributedTypeScope as i, printTypeConstructorCall as l, readWrittenScalar as m, contributedTypeAt as n, writtenContributedTypeCodecId as o, readExpressionAs as p, contributedTypeCodecId as r, mapPslHelperArgs as s, chosenTypeConstructor as t, EMPTY_DATA_TYPES as u, readResolvedAttributes as v, diagnosticFromSpan as x, readResolvedConstructorCall as y };\n\n//# sourceMappingURL=contributed-type-scope-Ds4uDG91.mjs.map","//#region src/type-constructor-calls.ts\nfunction isBareTypeConstructor(descriptor) {\n\treturn descriptor.entityRefArg === void 0 && (descriptor.args ?? []).every((arg) => arg.optional === true);\n}\nfunction argumentSpelling(descriptor) {\n\tconst args = descriptor.args ?? [];\n\tconst reference = descriptor.entityRefArg;\n\tconst count = Math.max(args.length, (reference?.index ?? -1) + 1);\n\tconst names = [];\n\tfor (let index = 0; index < count; index++) {\n\t\tconst arg = args[index];\n\t\tif (index === reference?.index) names.push(reference.entityKind);\n\t\telse if (arg !== void 0 && arg.optional !== true) names.push(arg.name ?? `argument${index + 1}`);\n\t}\n\treturn names.join(\", \");\n}\nfunction reportTypeConstructorNotCalled(input) {\n\tinput.diagnostics.push({\n\t\tcode: \"PSL_TYPE_CONSTRUCTOR_NOT_CALLED\",\n\t\tmessage: `${input.entityLabel} uses type constructor \"${input.path}\" without arguments. Write ${input.path}(${argumentSpelling(input.descriptor)}).`,\n\t\t...input.source.at(input.span)\n\t});\n}\n//#endregion\nexport { reportTypeConstructorNotCalled as n, isBareTypeConstructor as t };\n\n//# sourceMappingURL=type-constructor-calls-Bfg5ojed.mjs.map"],"mappings":";;;;;;;AAOA,SAAS,iBAAiB,SAAS,MAAM;CACxC,OAAO;EACN;EACA;EACA,GAAG,MAAM;GACR,MAAM,aAAa,QAAQ,cAAc,IAAI;GAC7C,MAAM,QAAQ,SAAS,KAAK,IAAI;IAC/B,OAAO,WAAW,WAAW,KAAK,MAAM;IACxC,KAAK,WAAW,WAAW,KAAK,SAAS;GAC1C,IAAI,WAAW,eAAe,IAAI;GAClC,OAAO;IACN,UAAU,WAAW;IACrB;GACD;EACD;CACD;AACD;AACA,SAAS,mBAAmB,YAAY,QAAQ;CAC/C,IAAI,WAAW,SAAS,KAAK,GAAG,MAAM,IAAI,cAAc,kCAAkC;CAC1F,OAAO;EACN,MAAM,WAAW;EACjB,SAAS,WAAW;EACpB,GAAG,OAAO,GAAG,WAAW,IAAI;EAC5B,GAAG,WAAW,SAAS,KAAK,IAAI,CAAC,IAAI,EAAE,MAAM,WAAW,KAAK;CAC9D;AACD;AACA,SAAS,kBAAkB,aAAa,SAAS;CAChD,OAAO,YAAY,KAAK,EAAE,UAAU,MAAM,SAAS,OAAO,YAAY;EACrE;EACA;EACA,UAAU;EACV,MAAM,QAAQ,gBAAgB,QAAQ,CAAC,CAAC,eAAe,KAAK;EAC5D,GAAG,SAAS,KAAK,IAAI,CAAC,IAAI,EAAE,KAAK;CAClC,EAAE;AACH;AACA,SAAS,6BAA6B,SAAS;CAC9C,MAAM,UAAU,CAAC;CACjB,OAAO;EACN,IAAI,SAAS;GACZ,OAAO,QAAQ;EAChB;EACA,KAAK,GAAG,aAAa;GACpB,KAAK,MAAM,cAAc,aAAa,QAAQ,KAAK;IAClD,MAAM;IACN;GACD,CAAC;EACF;EACA,cAAc,GAA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isma/orm-framework",
3
- "version": "8.0.0-rc.22-dev.14",
3
+ "version": "8.0.0-rc.23",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -17,21 +17,21 @@
17
17
  "uniku": "^0.5.0"
18
18
  },
19
19
  "devDependencies": {
20
- "@internal/config": "8.0.0-rc.22-dev.14",
21
- "@internal/contract": "8.0.0-rc.22-dev.14",
22
- "@internal/contract-authoring": "8.0.0-rc.22-dev.14",
23
- "@internal/errors": "8.0.0-rc.22-dev.14",
24
- "@internal/framework-components": "8.0.0-rc.22-dev.14",
25
- "@internal/ids": "8.0.0-rc.22-dev.14",
26
- "@internal/operations": "8.0.0-rc.22-dev.14",
27
- "@internal/psl-parser": "8.0.0-rc.22-dev.14",
28
- "@internal/psl-printer": "8.0.0-rc.22-dev.14",
29
- "@internal/ts-render": "8.0.0-rc.22-dev.14",
30
- "@internal/type-implementations": "8.0.0-rc.22-dev.14",
31
- "@repo/tsconfig": "8.0.0-rc.22-dev.14",
32
- "@internal/publish-surface": "8.0.0-rc.22-dev.14",
33
- "@repo/tsdown": "8.0.0-rc.22-dev.14",
34
- "@internal/utils": "8.0.0-rc.22-dev.14",
20
+ "@internal/config": "8.0.0-rc.23",
21
+ "@internal/contract": "8.0.0-rc.23",
22
+ "@internal/contract-authoring": "8.0.0-rc.23",
23
+ "@internal/errors": "8.0.0-rc.23",
24
+ "@internal/framework-components": "8.0.0-rc.23",
25
+ "@internal/ids": "8.0.0-rc.23",
26
+ "@internal/operations": "8.0.0-rc.23",
27
+ "@internal/psl-parser": "8.0.0-rc.23",
28
+ "@internal/psl-printer": "8.0.0-rc.23",
29
+ "@internal/ts-render": "8.0.0-rc.23",
30
+ "@internal/type-implementations": "8.0.0-rc.23",
31
+ "@repo/tsconfig": "8.0.0-rc.23",
32
+ "@internal/publish-surface": "8.0.0-rc.23",
33
+ "@repo/tsdown": "8.0.0-rc.23",
34
+ "@internal/utils": "8.0.0-rc.23",
35
35
  "tsdown": "0.22.14",
36
36
  "typescript": "5.9.3",
37
37
  "vitest": "5.0.0-rc.2"
@@ -1 +0,0 @@
1
- {"version":3,"file":"codec-descriptor-BNc32mKN-mmex2e4w.mjs","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/codec-descriptor-BNc32mKN.mjs"],"sourcesContent":["import { o as dataTypeParams, u as requireValueOf } from \"./data-type-DPsP4_9m.mjs\";\nimport { n as registerFrameworkCopy } from \"./framework-copies-DeDyytAc.mjs\";\nimport { InternalError } from \"@internal/utils/internal-error\";\n//#region src/shared/numeral-text.ts\n/**\n* A number as a contract source writes it: no exponent, because no schema language has that syntax,\n* so the decimal point moves to where the exponent puts it. A non-finite number is its own word.\n*/\nfunction numeralText(value) {\n\tconst [coefficient = \"\", exponent] = String(value).split(\"e\");\n\tif (exponent === void 0) return coefficient;\n\tconst sign = coefficient.startsWith(\"-\") ? \"-\" : \"\";\n\tconst [whole = \"\", fraction = \"\"] = coefficient.slice(sign.length).split(\".\");\n\tconst digits = `${whole}${fraction}`;\n\tconst point = whole.length + Number(exponent);\n\tif (point <= 0) return `${sign}0.${\"0\".repeat(-point)}${digits}`;\n\tif (point >= digits.length) return `${sign}${digits}${\"0\".repeat(point - digits.length)}`;\n\treturn `${sign}${digits.slice(0, point)}.${digits.slice(point)}`;\n}\n//#endregion\n//#region src/shared/codec.ts\nregisterFrameworkCopy();\n/**\n* The application value `codec` gives for `json`, a value a contract stores for a column with the column's `typeParams`: the codec's data type reads it with the parameters it declares, and the codec converts the value.\n*/\nfunction readContractValue(codec, json, typeParams) {\n\treturn codec.fromDataTypeValue(codec.dataType.fromContract(json, dataTypeParams(codec.dataType, typeParams)));\n}\nfunction namedDataType(descriptor) {\n\treturn Reflect.get(descriptor, \"dataType\");\n}\n/**\n* Abstract base class for concrete codec implementations.\n*\n* A codec is built with its descriptor, the data type it converts values of and the column's parameters of that type. The constructor makes `fromDataTypeValue` refuse a value of another data type before the subclass's conversion runs. `fromDataTypeValue` and `toDataTypeValue` convert between a value of the type and the application value, and `toDataTypeValue` finishes with {@link CodecImpl.dataTypeValueOf}, which constructs the value through the type and writes any spelling the type reads in its stored spelling, or, for a codec whose application value is the stored form itself, with {@link CodecImpl.storedDataTypeValueOf}, which takes only the stored spelling. `fromWire` and `toWire` read and write what the driver exchanges, asynchronously.\n*/\nvar CodecImpl = class {\n\tdescriptor;\n\tdataType;\n\tdataTypeParams;\n\t/**\n\t* The descriptor is variance-erased: concrete codec subclasses receive the typed descriptor in their own constructors and forward it via `super(descriptor, dataType, params)`; the variance erasure lives at this base because the abstract surface can't carry the concrete `TParams`.\n\t*/\n\tconstructor(descriptor, dataType, dataTypeParams = {}) {\n\t\tthis.descriptor = descriptor;\n\t\tthis.dataType = dataType;\n\t\tthis.dataTypeParams = dataTypeParams;\n\t\tconst named = namedDataType(descriptor);\n\t\tif (named !== void 0 && named !== dataType.id) throw new InternalError(`Codec ${descriptor.codecId} is built with the data type ${dataType.id}, but its descriptor names ${String(named)}.`);\n\t\tconst convert = Reflect.get(this, \"fromDataTypeValue\");\n\t\tObject.defineProperty(this, \"fromDataTypeValue\", {\n\t\t\tvalue: (value) => convert.call(this, requireValueOf(this.dataType.id, value, `Codec ${this.id}`)),\n\t\t\twritable: true,\n\t\t\tconfigurable: true\n\t\t});\n\t}\n\tget id() {\n\t\treturn this.descriptor.codecId;\n\t}\n\t/** The value of the codec's data type that `json` stores, under the codec's parameters. */\n\tdataTypeValueOf(json) {\n\t\treturn this.dataType.valueFrom(json, this.dataTypeParams);\n\t}\n\t/** The value of the codec's data type that `json` stores, refusing JSON in any spelling but the stored one: for a codec whose application value is the stored form, so a value it is given reads back as given. */\n\tstoredDataTypeValueOf(json) {\n\t\treturn this.dataType.fromContract(json, this.dataTypeParams);\n\t}\n};\n//#endregion\n//#region src/shared/codec-descriptor.ts\n/**\n* Why an enum cannot use the codec `descriptor` describes, or `undefined` when one can: the codec's own {@link CodecDescriptorTemplate.enumRefusal}, else the missing `equality` trait. Every enum authoring surface refuses a codec through this.\n*/\nfunction enumRefusalOf(descriptor) {\n\tif (descriptor.enumRefusal !== void 0) return descriptor.enumRefusal;\n\tif (descriptor.traits.includes(\"equality\")) return void 0;\n\treturn \"The codec does not declare the equality trait, so no value can be compared with a member. Use a codec that declares it.\";\n}\n/**\n* Abstract base class for concrete codec descriptors.\n*\n* Codec authors extend this class with their typed `TParams` and declare `codecId`, `traits`, `paramsSchema`, and the curried `factory(params)`.\n*\n* Implements the {@link CodecDescriptor} interface so a concrete subclass instance is directly usable wherever the framework expects a `CodecDescriptor<P>`.\n*/\nvar CodecDescriptorTemplateImpl = class {\n\tget isParameterized() {\n\t\treturn this.paramsSchema !== void 0;\n\t}\n};\n/**\n* Abstract base for a concrete codec descriptor: a {@link CodecDescriptorTemplateImpl} that also\n* names the data type its codec represents.\n*\n* A codec whose data type depends on the target that adopts it extends\n* {@link CodecDescriptorTemplateImpl} instead, and the target names the type when it adapts the\n* template.\n*/\nvar CodecDescriptorImpl = class extends CodecDescriptorTemplateImpl {};\n//#endregion\nexport { readContractValue as a, CodecImpl as i, CodecDescriptorTemplateImpl as n, numeralText as o, enumRefusalOf as r, CodecDescriptorImpl as t };\n\n//# sourceMappingURL=codec-descriptor-BNc32mKN.mjs.map"],"mappings":";;;;;;;;AAQA,SAAS,YAAY,OAAO;CAC3B,MAAM,CAAC,cAAc,IAAI,YAAY,OAAO,KAAK,CAAC,CAAC,MAAM,GAAG;CAC5D,IAAI,aAAa,KAAK,GAAG,OAAO;CAChC,MAAM,OAAO,YAAY,WAAW,GAAG,IAAI,MAAM;CACjD,MAAM,CAAC,QAAQ,IAAI,WAAW,MAAM,YAAY,MAAM,KAAK,MAAM,CAAC,CAAC,MAAM,GAAG;CAC5E,MAAM,SAAS,GAAG,QAAQ;CAC1B,MAAM,QAAQ,MAAM,SAAS,OAAO,QAAQ;CAC5C,IAAI,SAAS,GAAG,OAAO,GAAG,KAAK,IAAI,IAAI,OAAO,CAAC,KAAK,IAAI;CACxD,IAAI,SAAS,OA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AAK;CACxD,OAAO;AACR;;;;;;;;AAQA,IAAI,8BAA8B,MAAM;CACvC,IAAI,kBAAkB;EACrB,OAAO,KAAK,iBAAiB,KAAK;CACnC;AACD;;;;;;;;;AASA,IAAI,sBAAsB,cAAc,4BAA4B,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"control-CwUsQQ-8.mjs","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/control.mjs"],"sourcesContent":["import { l as objectSchemaKeys } from \"./data-type-DPsP4_9m.mjs\";\nimport { n as runtimeError } from \"./runtime-error-BA9d7XjZ.mjs\";\nimport { t as assertOneFrameworkCopy } from \"./framework-copies-DeDyytAc.mjs\";\nimport { n as codecDescriptorMissing, r as codecForRef } from \"./resolve-codec-qqMjZrmn.mjs\";\nimport { a as mergeCapabilityMatrices, n as assembleGeneratorFunctions, o as aggregateDescriptorKey, r as assembleGeneratorRegistrations, s as isAggregateDescriptor } from \"./generator-functions-CXbQfvYu.mjs\";\nimport { A as assertTypeAliasesValid, D as assertNoAuthoringFieldNamespace, E as AUTHORING_TYPE_DESCRIPTOR_KINDS, J as mergeAuthoringNamespaces, M as collectContributedDescriptorPaths, O as assertNoCrossRegistryCollisions, _ as collectScalarTypeConstructors, a as assembleDataTypeSupport, f as resolvePslBacktickEscapes, h as assertTypeChoicesValid, i as assembleAuthoringDataTypes, k as assertResolvableTypeConstructorTemplates, l as describeTaggedLiteralFailure, o as contributedHelpers, p as resolveTemplateTagEscapes, q as mergeAuthoringAttributeSpecs, r as timestampNowControlDescriptor, s as TAGGED_LITERAL_MAX_BYTES, z as isAuthoringArgRef } from \"./temporal-type-aliases-BI3SL5iB.mjs\";\nimport \"./namespace-VUH2dgnS.mjs\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { InternalError, isInternalError } from \"@internal/utils/internal-error\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { asNamespaceId } from \"@internal/contract/types\";\n//#region src/control/check-expectation.ts\nfunction expectAbsent(object) {\n\treturn {\n\t\texpects: \"absent\",\n\t\tobject\n\t};\n}\nfunction expectPresent(object) {\n\treturn {\n\t\texpects: \"present\",\n\t\tobject\n\t};\n}\n//#endregion\n//#region src/control/contract-snapshot-layout.ts\nconst CONTRACT_SNAPSHOTS_DIRNAME = \"snapshots\";\nconst STORAGE_HASH_PATTERN = /^[0-9a-f]{64}$/;\n/** Whether the snapshot store can address `storageHash`. */\nfunction isStorageHashHex(storageHash) {\n\treturn STORAGE_HASH_PATTERN.test(storageHash);\n}\n/** Validate a storage hash for use as a directory name. */\nfunction storageHashHex(storageHash) {\n\tif (!isStorageHashHex(storageHash)) throw new InternalError(`Invalid storage hash \"${storageHash}\": expected 64 lowercase hex characters`);\n\treturn storageHash;\n}\n/** Module specifier for the store's `contract.json`, POSIX separators. */\nfunction contractSnapshotJsonSpecifier(snapshotsImportPath, storageHash) {\n\treturn `${snapshotsImportPath}/${storageHashHex(storageHash)}/contract.json`;\n}\n/** Type-only module specifier for the store's `contract.d.ts` (no extension). */\nfunction contractSnapshotTypesSpecifier(snapshotsImportPath, storageHash) {\n\treturn `${snapshotsImportPath}/${storageHashHex(storageHash)}/contract`;\n}\n//#endregion\n//#region src/control/control-capabilities.ts\nfunction hasMigrations(target) {\n\treturn \"migrations\" in target && !!target[\"migrations\"];\n}\nfunction hasSchemaView(instance) {\n\treturn \"toSchemaView\" in instance && typeof instance[\"toSchemaView\"] === \"function\";\n}\nfunction hasPslContractInfer(instance) {\n\treturn \"inferPslContract\" in instance && typeof instance[\"inferPslContract\"] === \"function\";\n}\nfunction hasPslContractBuild(instance) {\n\treturn \"buildPslContract\" in instance && typeof Reflect.get(instance, \"buildPslContract\") === \"function\";\n}\nfunction hasOperationPreview(instance) {\n\treturn \"toOperationPreview\" in instance && typeof instance[\"toOperationPreview\"] === \"function\";\n}\nfunction hasSchemaSubjectClassifier(instance) {\n\treturn \"classifySubjectGranularity\" in instance && typeof instance[\"classifySubjectGranularity\"] === \"function\" && \"classifyEntityKind\" in instance && typeof instance[\"classifyEntityKind\"] === \"function\";\n}\n//#endregion\n//#region src/control/control-migration-types.ts\n/** The origin a plan from `contract` asserts, or `null` when it starts from no contract. */\nfunction planOriginOf(contract) {\n\treturn contract === null ? null : { storageHash: contract.storage.storageHash };\n}\nfunction migrationRunnerFailure(code, message, options) {\n\tconst meta = options?.meta ?? {};\n\tconst error = structuredError(code, message, {\n\t\t...ifDefined(\"why\", options?.why),\n\t\tmeta,\n\t\t...ifDefined(\"cause\", options?.cause)\n\t});\n\treturn Object.assign(error, {\n\t\tcode,\n\t\tmeta\n\t});\n}\n/** The same failure, attributed to the space whose plan failed. */\nfunction withFailingSpace(failure, failingSpace) {\n\tconst attributed = migrationRunnerFailure(failure.code, failure.message, {\n\t\twhy: failure.why,\n\t\tmeta: {\n\t\t\t...failure.meta,\n\t\t\tfailingSpace\n\t\t},\n\t\t...ifDefined(\"cause\", failure.cause)\n\t});\n\tif (failure.stack !== void 0) attributed.stack = failure.stack;\n\treturn attributed;\n}\nfunction asSentence(text) {\n\tconst trimmed = text.trimEnd();\n\treturn /[.!?]$/.test(trimmed) ? trimmed : `${trimmed}.`;\n}\n/**\n* The same failure, saying whether the database is as it was before the failed apply, in its meta\n* and at the end of its why.\n*/\nfunction withDatabaseUnchanged(failure, databaseUnchanged) {\n\tconst outcome = databaseUnchanged ? \"The failed apply changed nothing.\" : \"The operations that ran before the failure stay applied.\";\n\tconst attributed = migrationRunnerFailure(failure.code, failure.message, {\n\t\twhy: failure.why === void 0 ? outcome : `${asSentence(failure.why)} ${outcome}`,\n\t\tmeta: {\n\t\t\t...failure.meta,\n\t\t\tdatabaseUnchanged\n\t\t},\n\t\t...ifDefined(\"cause\", failure.cause)\n\t});\n\tif (failure.stack !== void 0) attributed.stack = failure.stack;\n\treturn attributed;\n}\n//#endregion\n//#region src/control/control-operation-results.ts\nconst VERIFY_CODE_MARKER_MISSING = \"CONTRACT.MARKER_MISSING\";\nconst VERIFY_CODE_HASH_MISMATCH = \"CONTRACT.MARKER_MISMATCH\";\nconst VERIFY_CODE_TARGET_MISMATCH = \"CONTRACT.TARGET_MISMATCH\";\nconst VERIFY_CODE_SCHEMA_FAILURE = \"CONTRACT.SCHEMA_VERIFICATION_FAILED\";\n/** Whether two markers hold the same hashes, `null` standing for no marker. */\nfunction sameMarkerHashes(a, b) {\n\tif (a === null || b === null) return a === b;\n\treturn a.storageHash === b.storageHash && a.profileHash === b.profileHash;\n}\n//#endregion\n//#region src/control/control-schema-view.ts\nvar SchemaTreeNode = class {\n\tkind;\n\tid;\n\tlabel;\n\tlabelParts;\n\tmeta;\n\tchildren;\n\tconstructor(options) {\n\t\tthis.kind = options.kind;\n\t\tthis.id = options.id;\n\t\tthis.label = options.labelParts.map((part) => part.text).join(\"\");\n\t\tthis.labelParts = options.labelParts;\n\t\tif (options.meta !== void 0) this.meta = options.meta;\n\t\tif (options.children !== void 0) this.children = options.children;\n\t\tObject.freeze(this);\n\t}\n\taccept(visitor) {\n\t\treturn visitor.visit(this);\n\t}\n};\n//#endregion\n//#region src/control/control-spaces.ts\n/**\n* Canonical control-plane identifiers for contract spaces.\n*\n* A contract space is the disjoint `(contract.json, migration-graph)` unit\n* the per-space planner / runner / verifier (project: extension contract\n* spaces, TML-2397) operates on. The application owns one well-known\n* space — the value below — and each loaded extension that contributes\n* schema owns a uniquely-named space.\n*\n* Lives in `framework-components/control` so every layer that has to\n* reason about space identity (the migration tooling, the SQL runtime's\n* marker reader, target-side statement builders, target-side adapters)\n* can import a single value rather than duplicating the literal. Raw\n* `'app'` string literals in framework / target / runtime / adapter\n* source code are forbidden and policed by\n* `scripts/lint-app-space-id.mjs` (wired into `pnpm lint:deps`).\n*\n* @see specs/framework-mechanism.spec.md § 3 — Layout convention (γ).\n*/\nconst APP_SPACE_ID = \"app\";\n//#endregion\n//#region src/control/control-stack.ts\nfunction addUniqueId(ids, seen, id) {\n\tif (!seen.has(id)) {\n\t\tids.push(id);\n\t\tseen.add(id);\n\t}\n}\nfunction assertUniqueCodecOwner(options) {\n\tconst existingOwner = options.owners.get(options.codecId);\n\tif (existingOwner !== void 0) throw new InternalError(`Duplicate ${options.entityLabel} for codecId \"${options.codecId}\". Descriptor \"${options.descriptorId}\" conflicts with \"${existingOwner}\". Each codecId can only have one ${options.entityOwnershipLabel}.`);\n}\nfunction extractCodecTypeImports(descriptors) {\n\tconst imports = [];\n\tfor (const descriptor of descriptors) {\n\t\tconst codecTypes = descriptor.types?.codecTypes;\n\t\tif (codecTypes?.import) imports.push(codecTypes.import);\n\t\tif (codecTypes?.typeImports) imports.push(...codecTypes.typeImports);\n\t}\n\treturn imports;\n}\nfunction extractParameterizedOutputTypeImports(descriptors) {\n\treturn descriptors.flatMap((descriptor) => {\n\t\tconst typeFunction = descriptor.types?.codecTypes?.parameterizedOutputTypes;\n\t\treturn typeFunction === void 0 ? [] : [typeFunction];\n\t});\n}\nfunction extractQueryOperationTypeImports(descriptors) {\n\tconst imports = [];\n\tfor (const descriptor of descriptors) {\n\t\tconst queryOperationTypes = descriptor.types?.queryOperationTypes;\n\t\tif (queryOperationTypes?.import) imports.push(queryOperationTypes.import);\n\t}\n\treturn imports;\n}\nfunction extractComponentIds(family, target, adapter, extensions) {\n\tconst ids = [];\n\tconst seen = /* @__PURE__ */ new Set();\n\taddUniqueId(ids, seen, family.id);\n\taddUniqueId(ids, seen, target.id);\n\tif (adapter) addUniqueId(ids, seen, adapter.id);\n\tfor (const ext of extensions) addUniqueId(ids, seen, ext.id);\n\treturn ids;\n}\nfunction assembleAuthoringContributions(descriptors, dataTypes = assembleAuthoringDataTypes(descriptors)) {\n\tconst type = {};\n\tconst entityTypes = {};\n\tconst pslBlockDescriptors = {};\n\tconst modelAttributes = {};\n\tconst attributeSpecs = {\n\t\tmodel: {},\n\t\tfield: {}\n\t};\n\tconst attributeSpecOwners = /* @__PURE__ */ new Map();\n\tconst pathOwners = /* @__PURE__ */ new Map();\n\tconst claimContributedPaths = (namespace, descriptorKind, label, descriptorId) => {\n\t\tfor (const path of collectContributedDescriptorPaths(namespace, descriptorKind)) {\n\t\t\tconst key = `${label}:${path}`;\n\t\t\tconst existingOwner = pathOwners.get(key);\n\t\t\tif (existingOwner !== void 0) throw new InternalError(`Duplicate authoring ${label} helper \"${path}\". Descriptor \"${descriptorId}\" conflicts with \"${existingOwner}\".`);\n\t\t\tpathOwners.set(key, descriptorId);\n\t\t}\n\t};\n\tlet valueObjectStorageDeclaration;\n\tfor (const descriptor of descriptors) {\n\t\tconst descriptorId = descriptor.id ?? \"<unknown>\";\n\t\tassertNoAuthoringFieldNamespace(descriptorId, descriptor.authoring);\n\t\tconst declaredValueObjectStorageType = descriptor.authoring?.valueObjectStorageType;\n\t\tif (declaredValueObjectStorageType !== void 0) {\n\t\t\tif (valueObjectStorageDeclaration !== void 0) throw new InternalError(`Duplicate authoring valueObjectStorageType declaration. Descriptor \"${descriptorId}\" conflicts with \"${valueObjectStorageDeclaration.ownerId}\". Exactly one composed component may declare the value-object storage type.`);\n\t\t\tvalueObjectStorageDeclaration = {\n\t\t\t\tname: declaredValueObjectStorageType,\n\t\t\t\townerId: descriptorId\n\t\t\t};\n\t\t}\n\t\tif (descriptor.authoring?.type) {\n\t\t\tclaimContributedPaths(descriptor.authoring.type, AUTHORING_TYPE_DESCRIPTOR_KINDS, \"type\", descriptorId);\n\t\t\tassertResolvableTypeConstructorTemplates(descriptor.authoring.type, descriptorId);\n\t\t\tmergeAuthoringNamespaces(type, descriptor.authoring.type, [], AUTHORING_TYPE_DESCRIPTOR_KINDS, \"type\");\n\t\t}\n\t\tif (descriptor.authoring?.entityTypes) {\n\t\t\tclaimContributedPaths(descriptor.authoring.entityTypes, \"entity\", \"entity\", descriptorId);\n\t\t\tmergeAuthoringNamespaces(entityTypes, descriptor.authoring.entityTypes, [], \"entity\", \"entity\");\n\t\t}\n\t\tif (descriptor.authoring?.pslBlockDescriptors) {\n\t\t\tclaimContributedPaths(descriptor.authoring.pslBlockDescriptors, \"pslBlock\", \"pslBlock\", descriptorId);\n\t\t\tmergeAuthoringNamespaces(pslBlockDescriptors, descriptor.authoring.pslBlockDescriptors, [], \"pslBlock\", \"pslBlock\");\n\t\t}\n\t\tif (descriptor.authoring?.modelAttributes) mergeAuthoringNamespaces(modelAttributes, descriptor.authoring.modelAttributes, [], \"modelAttribute\", \"modelAttribute\");\n\t\tif (descriptor.authoring?.attributeSpecs) mergeAuthoringAttributeSpecs(attributeSpecs, descriptor.authoring.attributeSpecs, descriptorId, attributeSpecOwners);\n\t}\n\tconst typeNamespace = type;\n\tconst entityTypeNamespace = entityTypes;\n\tconst pslBlockDescriptorNamespace = blindCast(pslBlockDescriptors);\n\tconst modelAttributeNamespace = blindCast(modelAttributes);\n\tassertNoCrossRegistryCollisions(typeNamespace, entityTypeNamespace, pslBlockDescriptorNamespace, modelAttributeNamespace);\n\tfor (const descriptor of descriptors) {\n\t\tif (descriptor.authoring?.type === void 0) continue;\n\t\tassertTypeChoicesValid(descriptor.authoring.type, descriptor.id ?? \"<unknown>\");\n\t}\n\tif (valueObjectStorageDeclaration !== void 0 && !collectScalarTypeConstructors(typeNamespace).has(valueObjectStorageDeclaration.name)) throw new InternalError(`Invalid authoring valueObjectStorageType \"${valueObjectStorageDeclaration.name}\" declared by descriptor \"${valueObjectStorageDeclaration.ownerId}\". The name must be a top-level bare-eligible type constructor in the assembled authoring namespace.`);\n\treturn {\n\t\tdataTypes,\n\t\ttype: typeNamespace,\n\t\tentityTypes: entityTypeNamespace,\n\t\tpslBlockDescriptors: pslBlockDescriptorNamespace,\n\t\tmodelAttributes: modelAttributeNamespace,\n\t\tattributeSpecs,\n\t\t...valueObjectStorageDeclaration !== void 0 ? { valueObjectStorageType: valueObjectStorageDeclaration.name } : {}\n\t};\n}\nfunction argumentMappedKeys(descriptor) {\n\treturn Object.entries(descriptor.output.typeParams ?? {}).flatMap(([key, template]) => isAuthoringArgRef(template) ? [key] : []);\n}\n/**\n* The checks on type constructors that read the stack's codecs, each naming the component and the id at fault:\n*\n* 1. every type constructor names a registered codec;\n* 2. a type constructor maps its arguments only onto parameters its data type or codec declares;\n* 3. at most one type constructor per data type is marked inferred.\n*\n* {@link assembleDataTypeSupport} checks data types, their entries and casts, and the value arguments of type constructors.\n*/\nfunction enforceHelperCodecInvariants(input) {\n\tconst inferredBy = /* @__PURE__ */ new Map();\n\tfor (const contributed of input.helpers) {\n\t\tconst { path, descriptor, contributedBy } = contributed;\n\t\tconst codecId = descriptor.output.codecId;\n\t\tconst codec = input.codecDescriptorFor(codecId);\n\t\tif (codec === void 0) throw new InternalError(`Type constructor \"${path}\" contributed by \"${contributedBy}\" names codec \"${codecId}\", which no component registers.`);\n\t\tconst codecKeys = codec.paramsSchema === void 0 ? [] : objectSchemaKeys(codec.paramsSchema);\n\t\tif (codecKeys !== void 0) {\n\t\t\tconst declared = /* @__PURE__ */ new Set([...codecKeys, ...objectSchemaKeys(input.lookup.get(codec.dataType)?.params) ?? []]);\n\t\t\tfor (const key of argumentMappedKeys(descriptor)) if (!declared.has(key)) throw new InternalError(`Type constructor \"${path}\" contributed by \"${contributedBy}\" maps an argument onto the parameter \"${key}\", which neither data type \"${codec.dataType}\" nor codec \"${codecId}\" declares.`);\n\t\t}\n\t\tif (descriptor.inferred !== true) continue;\n\t\tconst existing = inferredBy.get(codec.dataType);\n\t\tif (existing !== void 0) throw new InternalError(`Type constructors \"${existing.path}\" contributed by \"${existing.contributedBy}\" and \"${path}\" contributed by \"${contributedBy}\" are both marked inferred for data type \"${codec.dataType}\"; a data type has at most one.`);\n\t\tinferredBy.set(codec.dataType, contributed);\n\t}\n}\nfunction assembleControlMutationDefaults(descriptors) {\n\tconst defaultFunctionRegistry = /* @__PURE__ */ new Map();\n\tconst functionOwners = /* @__PURE__ */ new Map();\n\tconst registered = assembleGeneratorRegistrations(descriptors);\n\tfor (const descriptor of descriptors) {\n\t\tconst contributions = descriptor.controlMutationDefaults;\n\t\tif (!contributions) continue;\n\t\tconst descriptorId = descriptor.id ?? \"<unknown>\";\n\t\tfor (const [functionName, handler] of contributions.defaultFunctionRegistry) {\n\t\t\tconst existingOwner = functionOwners.get(functionName);\n\t\t\tif (existingOwner !== void 0) throw new InternalError(`Duplicate mutation default function \"${functionName}\". Descriptor \"${descriptorId}\" conflicts with \"${existingOwner}\".`);\n\t\t\tdefaultFunctionRegistry.set(functionName, handler);\n\t\t\tfunctionOwners.set(functionName, descriptorId);\n\t\t}\n\t}\n\treturn {\n\t\tdefaultFunctionRegistry,\n\t\tgeneratorDescriptors: [...registered.values()].map(({ descriptor }) => descriptor),\n\t\tcomponentIdsByGenerator: new Map([...registered].map(([id, { componentId }]) => [id, componentId]))\n\t};\n}\n/**\n* Collect every contributed {@link AggregateDescriptor} across the composed components, rejecting malformed shapes and second claims on one `(operation, input)` overload.\n*\n* Both planes read the same contribution slot: emission derives result types from these descriptors, and family runtimes build their resolution registry from them. Rejections are user-facing — an extension author's bad contribution surfaces here first, during `contract emit` — so a malformed shape raises `CONTRACT.AGGREGATE_DESCRIPTOR_INVALID` and a second claim raises `CONTRACT.AGGREGATE_DESCRIPTOR_DUPLICATE`, each naming the contributing component.\n*/\nfunction collectAggregateDescriptors(descriptors) {\n\tconst collected = [];\n\tconst owners = /* @__PURE__ */ new Map();\n\tfor (const descriptor of descriptors) {\n\t\tconst descriptorId = descriptor.id ?? \"<unknown>\";\n\t\tfor (const contributed of descriptor.types?.aggregateDescriptors ?? []) {\n\t\t\tif (!isAggregateDescriptor(contributed)) throw runtimeError(\"CONTRACT.AGGREGATE_DESCRIPTOR_INVALID\", `Malformed aggregate descriptor contributed by \"${descriptorId}\". A descriptor declares a non-empty \\`operation\\`, an \\`input\\` match of kind \\`none\\`/\\`any\\`/\\`codec\\`/\\`trait\\`, an \\`output\\` of kind \\`self\\`/\\`codec\\`, and a boolean \\`nullable\\` — plus \\`emptyResultWire\\`, a wire value of the result codec, where \\`nullable\\` is false; a \\`self\\` output needs an input to reuse.`, {\n\t\t\t\tcontributedBy: descriptorId,\n\t\t\t\tdescriptor: contributed\n\t\t\t});\n\t\t\tconst key = aggregateDescriptorKey(contributed);\n\t\t\tconst existingOwner = owners.get(key);\n\t\t\tif (existingOwner !== void 0) throw runtimeError(\"CONTRACT.AGGREGATE_DESCRIPTOR_DUPLICATE\", `Duplicate aggregate descriptor for \"${key}\". Descriptor \"${descriptorId}\" conflicts with \"${existingOwner}\". Each operation/input pair can only have one provider.`, {\n\t\t\t\tkey,\n\t\t\t\tcontributedBy: descriptorId,\n\t\t\t\towner: existingOwner\n\t\t\t});\n\t\t\towners.set(key, descriptorId);\n\t\t\tcollected.push(contributed);\n\t\t}\n\t}\n\treturn collected;\n}\n/**\n* Flatten the codec descriptors the composed components contribute.\n*\n* A component may know a codec and still withhold it — an adapter that cannot name a codec's emitted type contributes the rest without it — so the contributed set is not always the set some component's own registry holds. Consumers whose output must agree with what the runtime resolves read this list rather than any one component's registry.\n*/\nfunction collectCodecDescriptors(descriptors) {\n\treturn descriptors.flatMap((descriptor) => descriptor.types?.codecTypes?.codecDescriptors ?? []);\n}\nfunction extractCodecLookup(descriptors) {\n\tconst byId = /* @__PURE__ */ new Map();\n\tconst descriptorsById = /* @__PURE__ */ new Map();\n\tconst renderersById = /* @__PURE__ */ new Map();\n\tconst inputRenderersById = /* @__PURE__ */ new Map();\n\tconst valueLiteralRenderersById = /* @__PURE__ */ new Map();\n\tconst owners = /* @__PURE__ */ new Map();\n\tfor (const descriptor of descriptors) {\n\t\tconst codecTypes = descriptor.types?.codecTypes;\n\t\tconst descriptorId = descriptor.id;\n\t\tfor (const codecDescriptor of codecTypes?.codecDescriptors ?? []) {\n\t\t\tassertUniqueCodecOwner({\n\t\t\t\tcodecId: codecDescriptor.codecId,\n\t\t\t\towners,\n\t\t\t\tdescriptorId,\n\t\t\t\tentityLabel: \"codec descriptor\",\n\t\t\t\tentityOwnershipLabel: \"codec descriptor provider\"\n\t\t\t});\n\t\t\towners.set(codecDescriptor.codecId, descriptorId);\n\t\t\tdescriptorsById.set(codecDescriptor.codecId, codecDescriptor);\n\t\t\tif (typeof codecDescriptor.renderOutputType === \"function\") renderersById.set(codecDescriptor.codecId, codecDescriptor.renderOutputType);\n\t\t\tif (typeof codecDescriptor.renderInputType === \"function\") inputRenderersById.set(codecDescriptor.codecId, codecDescriptor.renderInputType);\n\t\t\tif (typeof codecDescriptor.renderValueLiteral === \"function\") valueLiteralRenderersById.set(codecDescriptor.codecId, codecDescriptor.renderValueLiteral);\n\t\t\tif (!byId.has(codecDescriptor.codecId)) if (codecDescriptor.isParameterized) try {\n\t\t\t\tconst representative = codecDescriptor.factory({})({ name: `<lookup:${codecDescriptor.codecId}>` });\n\t\t\t\tbyId.set(codecDescriptor.codecId, representative);\n\t\t\t} catch (error) {\n\t\t\t\tif (isInternalError(error)) throw error;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconst representative = codecDescriptor.factory(void 0)({ name: `<lookup:${codecDescriptor.codecId}>` });\n\t\t\t\tbyId.set(codecDescriptor.codecId, representative);\n\t\t\t}\n\t\t}\n\t}\n\tconst registry = {\n\t\tget: (id) => byId.get(id),\n\t\tforCodecRef(ref) {\n\t\t\treturn codecForRef(registry, ref) ?? codecDescriptorMissing(ref, \"CONTRACT.CODEC_DESCRIPTOR_MISSING\");\n\t\t},\n\t\tforColumn: () => void 0,\n\t\trenderOutputTypeFor: (id, params) => renderersById.get(id)?.(params),\n\t\trenderInputTypeFor: (id, params) => inputRenderersById.get(id)?.(params),\n\t\trenderValueLiteralFor: (id, value, side) => valueLiteralRenderersById.get(id)?.(value, side),\n\t\tdescriptorFor: (id) => descriptorsById.get(id)\n\t};\n\treturn registry;\n}\nfunction assembleExtensionContracts(extensions) {\n\tconst result = /* @__PURE__ */ new Map();\n\tfor (const ext of extensions) {\n\t\tif (ext.contractSpace === void 0) continue;\n\t\tresult.set(ext.id, ext.contractSpace.contractJson);\n\t}\n\treturn result;\n}\nfunction readDeclaredDependencyIds(descriptor) {\n\tconst packs = descriptor.contractSpace?.contractJson?.extensions;\n\tif (packs === null || typeof packs !== \"object\") return [];\n\treturn Object.keys(packs);\n}\n/**\n* Builds a dependency-respecting load order for the given extension descriptors\n* using Kahn's topological sort algorithm. Dependencies (packs declared in\n* `contractSpace.contractJson.extensions`) are placed before the extensions\n* that depend on them.\n*\n* Throws if the dependency graph contains a cycle, with an error message that\n* names every extension involved in the cycle.\n*\n* Throws if any extension declares a dependency on a pack ID that is not present\n* in the provided list — add the missing pack to the `extensions` list to\n* resolve the error.\n*/\nfunction buildExtensionLoadOrder(extensions) {\n\tif (extensions.length === 0) return [];\n\tconst idSet = new Set(extensions.map((e) => e.id));\n\tconst inDegree = /* @__PURE__ */ new Map();\n\tconst dependents = /* @__PURE__ */ new Map();\n\tfor (const ext of extensions) {\n\t\tif (!inDegree.has(ext.id)) inDegree.set(ext.id, 0);\n\t\tif (!dependents.has(ext.id)) dependents.set(ext.id, []);\n\t}\n\tfor (const ext of extensions) for (const depId of readDeclaredDependencyIds(ext)) {\n\t\tif (!idSet.has(depId)) throw new InternalError(`Extension \"${ext.id}\" declares a dependency on \"${depId}\", but \"${depId}\" is not in the provided extension set. Add the missing space to extensions.`);\n\t\tinDegree.set(ext.id, (inDegree.get(ext.id) ?? 0) + 1);\n\t\tconst list = dependents.get(depId);\n\t\tif (list !== void 0) list.push(ext.id);\n\t}\n\tconst queue = [];\n\tfor (const [id, deg] of inDegree) if (deg === 0) queue.push(id);\n\tqueue.sort();\n\tconst result = [];\n\twhile (queue.length > 0) {\n\t\tconst id = queue.shift();\n\t\tif (id === void 0) break;\n\t\tresult.push(id);\n\t\tconst children = dependents.get(id) ?? [];\n\t\tchildren.sort();\n\t\tfor (const childId of children) {\n\t\t\tconst newDeg = (inDegree.get(childId) ?? 1) - 1;\n\t\t\tinDegree.set(childId, newDeg);\n\t\t\tif (newDeg === 0) queue.push(childId);\n\t\t}\n\t}\n\tif (result.length < extensions.length) throw new InternalError(`Extension dependency cycle detected. Cycle members: ${extensions.map((e) => e.id).filter((id) => !result.includes(id)).sort().map((id) => `\"${id}\"`).join(\", \")}.`);\n\treturn result;\n}\n/** The driver descriptor, connecting each driver with the session settings the target declares. */\nfunction withSessionSettings(driver, sessionSettings) {\n\tif (driver === void 0 || sessionSettings === void 0) return driver;\n\tconst create = driver.create.bind(driver);\n\treturn {\n\t\t...driver,\n\t\tcreate: (connection, options) => create(connection, {\n\t\t\t...options,\n\t\t\tsessionSettings\n\t\t})\n\t};\n}\nfunction createControlStack(input) {\n\tassertOneFrameworkCopy();\n\tconst { family, target, adapter, driver, extensions = [] } = input;\n\tconst orderedIds = buildExtensionLoadOrder(extensions);\n\tconst extensionById = new Map(extensions.map((ext) => [ext.id, ext]));\n\tconst orderedExtensions = orderedIds.map((id) => extensionById.get(id)).filter((ext) => ext !== void 0);\n\tconst allDescriptors = [\n\t\tfamily,\n\t\ttarget,\n\t\t...adapter ? [adapter] : [],\n\t\t...orderedExtensions\n\t];\n\tconst codecLookup = extractCodecLookup(allDescriptors);\n\tconst dataTypes = assembleDataTypeSupport(allDescriptors, (codecId) => codecLookup.descriptorFor?.(codecId)?.dataType);\n\tconst authoringContributions = assembleAuthoringContributions(allDescriptors, dataTypes.support.entries);\n\tconst codecDescriptors = collectCodecDescriptors(allDescriptors);\n\tenforceHelperCodecInvariants({\n\t\tlookup: dataTypes.support.lookup,\n\t\thelpers: allDescriptors.flatMap(contributedHelpers),\n\t\tcodecDescriptorFor: (codecId) => codecLookup.descriptorFor?.(codecId)\n\t});\n\tconst controlMutationDefaults = assembleControlMutationDefaults(allDescriptors);\n\tconst generatorFunctions = assembleGeneratorFunctions(allDescriptors);\n\tassertTypeAliasesValid(authoringContributions.type, {\n\t\tgeneratorFunctions,\n\t\tparamsSchemaOf: (codecId) => codecLookup.descriptorFor(codecId)?.paramsSchema,\n\t\tfieldLength: (field) => family.fieldLength?.(field, dataTypes.support)\n\t});\n\treturn {\n\t\tfamily,\n\t\ttarget,\n\t\tadapter,\n\t\tdriver: withSessionSettings(driver, target.sessionSettings),\n\t\textensions: orderedExtensions,\n\t\textensionContracts: assembleExtensionContracts(orderedExtensions),\n\t\tcodecTypeImports: extractCodecTypeImports(allDescriptors),\n\t\tqueryOperationTypeImports: extractQueryOperationTypeImports(allDescriptors),\n\t\tparameterizedOutputTypeImports: extractParameterizedOutputTypeImports(allDescriptors),\n\t\textensionIds: extractComponentIds(family, target, adapter, orderedExtensions),\n\t\tcodecLookup,\n\t\tcodecDescriptors,\n\t\tdataTypes: dataTypes.support,\n\t\tdeclaredDataTypes: dataTypes.declared,\n\t\taggregateDescriptors: collectAggregateDescriptors(allDescriptors),\n\t\tauthoringContributions,\n\t\tscalarTypes: [...collectScalarTypeConstructors(authoringContributions.type).keys()],\n\t\tcontrolMutationDefaults,\n\t\tgeneratorFunctions,\n\t\tcapabilities: mergeCapabilityMatrices({}, [\n\t\t\ttarget,\n\t\t\t...adapter ? [adapter] : [],\n\t\t\t...orderedExtensions\n\t\t])\n\t};\n}\n//#endregion\n//#region src/control/migration-statements.ts\nfunction isRenameStatement(statement) {\n\treturn statement.kind === \"rename\";\n}\n/** A key that is equal for two subjects exactly when they name the same thing. */\nfunction migrationSubjectKey(subject) {\n\tswitch (subject.kind) {\n\t\tcase \"model\": return JSON.stringify([\n\t\t\t\"model\",\n\t\t\tsubject.namespaceId,\n\t\t\tsubject.model\n\t\t]);\n\t\tcase \"field\": return JSON.stringify([\n\t\t\t\"field\",\n\t\t\tsubject.namespaceId,\n\t\t\tsubject.model,\n\t\t\tsubject.field\n\t\t]);\n\t\tcase \"enumValue\": return JSON.stringify([\n\t\t\t\"enumValue\",\n\t\t\tsubject.namespaceId,\n\t\t\tsubject.enum,\n\t\t\tsubject.member\n\t\t]);\n\t\tcase \"valueObjectField\": return JSON.stringify([\n\t\t\t\"valueObjectField\",\n\t\t\tsubject.namespaceId,\n\t\t\tsubject.valueObject,\n\t\t\tsubject.field\n\t\t]);\n\t\tcase \"storage\": return JSON.stringify([\"storage\", subject.name]);\n\t}\n}\n/**\n* A model's name in messages: `namespace.Model`, or `Model` alone in the unbound namespace, whose\n* id is internal.\n*/\nfunction modelDisplayName(coordinate) {\n\treturn coordinate.namespaceId === \"__unbound__\" ? coordinate.model : `${coordinate.namespaceId}.${coordinate.model}`;\n}\n/** A model as a statement names it: with its namespace only when the contract has several. */\nfunction modelStatementText(contract, coordinate) {\n\treturn Object.keys(contract.domain.namespaces).length > 1 ? modelDisplayName(coordinate) : coordinate.model;\n}\n/** A field as a statement names it, through its model: `User.age`, or `app.User.age` when the contract has several namespaces. */\nfunction fieldStatementText(contract, field) {\n\treturn `${modelStatementText(contract, field)}.${field.field}`;\n}\n/** An enum member as a statement names it, through its enum: `Status.ARCHIVED`, or `app.Status.ARCHIVED` when the contract has several namespaces. */\nfunction enumValueStatementText(contract, value) {\n\treturn `${modelStatementText(contract, {\n\t\tnamespaceId: value.namespaceId,\n\t\tmodel: value.enum\n\t})}.${value.member}`;\n}\n/** A value object field as a statement names it, through its value object: `GeoPoint.lat`, or `app.GeoPoint.lat` when the contract has several namespaces. */\nfunction valueObjectFieldStatementText(contract, field) {\n\treturn `${modelStatementText(contract, {\n\t\tnamespaceId: field.namespaceId,\n\t\tmodel: field.valueObject\n\t})}.${field.field}`;\n}\n/** An enum value coordinate read from its JSON form, in which the unbound namespace is left out. */\nfunction enumValueCoordinateFromJson(json) {\n\treturn {\n\t\tnamespaceId: json.namespaceId ?? asNamespaceId(\"__unbound__\"),\n\t\tenum: json.enum,\n\t\tmember: json.member\n\t};\n}\n/** An enum value coordinate in its JSON form, which leaves out the unbound namespace. */\nfunction enumValueCoordinateJson(value) {\n\treturn coordinateJson(value);\n}\nfunction coordinateJson(coordinate) {\n\tif (coordinate.namespaceId !== \"__unbound__\") return coordinate;\n\tconst { namespaceId: _unbound, ...rest } = coordinate;\n\treturn rest;\n}\n/** The statement as JSON output writes it. */\nfunction migrationStatementJson(statement) {\n\tswitch (statement.kind) {\n\t\tcase \"convert\": return statement.entity === \"model\" ? {\n\t\t\t...statement,\n\t\t\tmodel: coordinateJson(statement.model)\n\t\t} : {\n\t\t\t...statement,\n\t\t\tfield: coordinateJson(statement.field)\n\t\t};\n\t\tcase \"backfill\": return statement.entity === \"field\" ? {\n\t\t\t...statement,\n\t\t\tfield: coordinateJson(statement.field)\n\t\t} : {\n\t\t\t...statement,\n\t\t\tfield: coordinateJson(statement.field)\n\t\t};\n\t\tcase \"rename\": return renameStatementJson(statement);\n\t}\n}\nfunction renameStatementJson(statement) {\n\tswitch (statement.entity) {\n\t\tcase \"namespace\": return {\n\t\t\t...statement,\n\t\t\tfrom: { namespaceId: statement.from },\n\t\t\tto: { namespaceId: statement.to }\n\t\t};\n\t\tcase \"model\": return {\n\t\t\t...statement,\n\t\t\tfrom: coordinateJson(statement.from),\n\t\t\tto: coordinateJson(statement.to)\n\t\t};\n\t\tcase \"field\": return {\n\t\t\t...statement,\n\t\t\tfrom: coordinateJson(statement.from),\n\t\t\tto: coordinateJson(statement.to)\n\t\t};\n\t\tcase \"enumValue\": return {\n\t\t\t...statement,\n\t\t\tfrom: coordinateJson(statement.from),\n\t\t\tto: coordinateJson(statement.to)\n\t\t};\n\t\tcase \"valueObjectField\": return {\n\t\t\t...statement,\n\t\t\tfrom: coordinateJson(statement.from),\n\t\t\tto: coordinateJson(statement.to)\n\t\t};\n\t}\n}\n/** The subject as JSON output writes it. */\nfunction migrationSubjectJson(subject) {\n\tswitch (subject.kind) {\n\t\tcase \"model\": return {\n\t\t\tkind: \"model\",\n\t\t\t...coordinateJson({\n\t\t\t\tnamespaceId: subject.namespaceId,\n\t\t\t\tmodel: subject.model\n\t\t\t})\n\t\t};\n\t\tcase \"field\": return {\n\t\t\tkind: \"field\",\n\t\t\t...coordinateJson({\n\t\t\t\tnamespaceId: subject.namespaceId,\n\t\t\t\tmodel: subject.model,\n\t\t\t\tfield: subject.field\n\t\t\t})\n\t\t};\n\t\tcase \"enumValue\": return {\n\t\t\tkind: \"enumValue\",\n\t\t\t...coordinateJson({\n\t\t\t\tnamespaceId: subject.namespaceId,\n\t\t\t\tenum: subject.enum,\n\t\t\t\tmember: subject.member\n\t\t\t})\n\t\t};\n\t\tcase \"valueObjectField\": return {\n\t\t\tkind: \"valueObjectField\",\n\t\t\t...coordinateJson({\n\t\t\t\tnamespaceId: subject.namespaceId,\n\t\t\t\tvalueObject: subject.valueObject,\n\t\t\t\tfield: subject.field\n\t\t\t})\n\t\t};\n\t\tcase \"storage\": return subject;\n\t}\n}\nfunction qualifiedModelText(coordinate) {\n\treturn coordinate.namespaceId === \"__unbound__\" ? coordinate.model : `${coordinate.namespaceId}.${coordinate.model}`;\n}\n/**\n* The text that reports a statement, in domain names: a model or field is named with its\n* namespace only when its contract has more than one, and a model moved to another namespace always\n* is. A renamed field is named through its model as\n* the destination contract names it, as the statement itself is written.\n*/\nfunction describeMigrationStatement(statement, fromContract, contract) {\n\tif (statement.kind !== \"rename\") return describeDataStatement(statement, contract);\n\tif (statement.entity === \"namespace\") return `rename namespace \"${statement.from}\" to \"${statement.to}\"`;\n\tif (statement.entity === \"enumValue\") return `rename enum value \"${enumValueStatementText(fromContract, statement.from)}\" to \"${enumValueStatementText(contract, statement.to)}\"`;\n\tif (statement.entity === \"valueObjectField\") return `rename value object field \"${valueObjectFieldStatementText(fromContract, statement.from)}\" to \"${valueObjectFieldStatementText(contract, statement.to)}\"`;\n\tif (statement.entity === \"model\") {\n\t\tconst { from, to } = statement;\n\t\tif (from.namespaceId === to.namespaceId) return `rename model \"${modelStatementText(fromContract, from)}\" to \"${modelStatementText(contract, to)}\"`;\n\t\tif (from.model === to.model) return `move model \"${qualifiedModelText(from)}\" to namespace \"${to.namespaceId}\"`;\n\t\treturn `rename model \"${qualifiedModelText(from)}\" to \"${qualifiedModelText(to)}\"`;\n\t}\n\tconst model = modelStatementText(contract, statement.to);\n\treturn `rename field \"${model}.${statement.from.field}\" to \"${model}.${statement.to.field}\"`;\n}\nfunction describeDataStatement(statement, contract) {\n\tif (statement.entity === \"field\") return `${statement.kind} field \"${fieldStatementText(contract, statement.field)}\"`;\n\tif (statement.entity === \"valueObjectField\") return `${statement.kind} value object field \"${valueObjectFieldStatementText(contract, statement.field)}\"`;\n\tif (statement.kind === \"convert\") return `convert variant \"${modelStatementText(contract, statement.model)}\"`;\n\treturn statement;\n}\n//#endregion\n//#region src/control/order-issues-by-dependencies.ts\nconst PATH_DELIMITER = \" \";\nfunction pathKey(path) {\n\treturn path.join(PATH_DELIMITER);\n}\n/**\n* Whether an issue's op builds its subject up (create or alter) rather than\n* only tearing it down. The differ sets `expected` on every create (`not-found`)\n* and alter (`not-equal`) issue and leaves it absent on a pure drop\n* (`not-expected`). This is the single signal the ordering law reads for edge\n* direction — never `reason`.\n*/\nfunction buildsUp(issue) {\n\treturn issue.expected !== void 0;\n}\n/**\n* The nearest strict-ancestor bucket of `path` — the surviving parent entity a\n* child is contained by. Walks the path's proper prefixes from longest to\n* shortest and returns the first prefix that maps to a bucket; a gap (a prefix\n* with no bucket) is skipped so containment always attaches to the closest real\n* parent.\n*\n* Returns a list because a path prefix can be shared by two siblings of\n* different `nodeKind` (a role and a namespace named alike); linking the child\n* to every candidate over-constrains safely (the extra edge points at a same-\n* direction op and never forms a cycle, since a parent never depends on its\n* child) rather than risk picking the wrong one.\n*/\nfunction nearestAncestors(path, byPath) {\n\tfor (let end = path.length - 1; end >= 1; end -= 1) {\n\t\tconst bucket = byPath.get(pathKey(path.slice(0, end)));\n\t\tif (bucket !== void 0) return bucket;\n\t}\n\treturn [];\n}\n/**\n* Orders schema-diff issues so that every dependency's op precedes its\n* dependent on the way up and follows it on the way down, breaking ties\n* deterministically by path.\n*\n* Edges come from two sources:\n* - **`dependsOn` cross-links** — the resolved issue-to-issue paths the differ\n* mirrors onto each issue (a node's declared structural prerequisites). A\n* path that resolves to no issue in this list is skipped (the dependency is\n* satisfied by reality); a path shared by two same-id/different-kind siblings\n* links to every match, over-constraining safely.\n* - **containment** — every issue depends on its nearest strict-ancestor issue\n* (a child entity on the parent entity that owns it). Subtree coalescing has\n* already removed the descendants of a whole create/drop, so this only links\n* the parent/child pairs that legitimately survive together.\n*\n* The ordering law reads each dependent's presence for direction: an issue that\n* builds up (`expected` present — a create or alter) needs its dependency\n* first; a pure drop needs its dependent removed first, so the edge reverses.\n* The graph is a DAG by construction (dependencies point from dependents to\n* their prerequisites, and prerequisites never point back), so a cycle is a\n* derivation or authoring bug: the topological sort asserts acyclicity and\n* throws, naming the issues it could not place.\n*/\nfunction orderIssuesByDependencies(issues) {\n\tif (issues.length <= 1) return issues;\n\tconst nodes = issues.map((issue) => ({\n\t\tissue,\n\t\tkey: pathKey(issue.path),\n\t\tbuildsUp: buildsUp(issue),\n\t\toutgoing: /* @__PURE__ */ new Set(),\n\t\tinDegree: 0\n\t}));\n\tconst nodesByPath = /* @__PURE__ */ new Map();\n\tfor (const node of nodes) {\n\t\tconst bucket = nodesByPath.get(node.key);\n\t\tif (bucket === void 0) nodesByPath.set(node.key, [node]);\n\t\telse bucket.push(node);\n\t}\n\tconst addEdge = (before, after) => {\n\t\tif (before.outgoing.has(after)) return;\n\t\tbefore.outgoing.add(after);\n\t\tafter.inDegree += 1;\n\t};\n\tconst addDependency = (dependent, dependency) => {\n\t\tif (dependent === dependency) return;\n\t\tif (dependent.buildsUp) addEdge(dependency, dependent);\n\t\telse addEdge(dependent, dependency);\n\t};\n\tfor (const node of nodes) {\n\t\tfor (const targetPath of node.issue.dependsOn ?? []) for (const target of nodesByPath.get(pathKey(targetPath)) ?? []) addDependency(node, target);\n\t\tfor (const ancestor of nearestAncestors(node.issue.path, nodesByPath)) addDependency(node, ancestor);\n\t}\n\tconst ready = nodes.filter((node) => node.inDegree === 0);\n\tconst order = [];\n\twhile (ready.length > 0) {\n\t\tlet best;\n\t\tfor (const candidate of ready) if (best === void 0 || candidate.key < best.key) best = candidate;\n\t\tif (best === void 0) break;\n\t\tready.splice(ready.indexOf(best), 1);\n\t\torder.push(best);\n\t\tfor (const next of best.outgoing) {\n\t\t\tnext.inDegree -= 1;\n\t\t\tif (next.inDegree === 0) ready.push(next);\n\t\t}\n\t}\n\tif (order.length !== nodes.length) {\n\t\tconst placed = new Set(order);\n\t\tthrow new InternalError(`orderIssuesByDependencies: dependency cycle among schema-diff issues (unresolved: ${nodes.filter((node) => !placed.has(node)).map((node) => node.issue.path.join(\"/\")).join(\", \")})`);\n\t}\n\treturn order.map((node) => node.issue);\n}\n//#endregion\n//#region src/control/schema-diff.ts\n/**\n* The outcome an issue represents, discriminated by presence rather than any\n* stored field — the single source of truth every consumer reads. An issue\n* always carries at least one side by construction; neither is a malformed\n* issue and throws.\n*/\nfunction issueOutcome(issue) {\n\tconst hasExpected = issue.expected !== void 0;\n\tconst hasActual = issue.actual !== void 0;\n\tif (hasExpected && hasActual) return \"not-equal\";\n\tif (hasExpected) return \"not-found\";\n\tif (hasActual) return \"not-expected\";\n\tthrow new InternalError(`issueOutcome: issue at \"${issue.path.join(\"/\")}\" carries neither an expected nor an actual node`);\n}\nfunction siblingKey(node) {\n\treturn JSON.stringify([node.nodeKind, node.id]);\n}\nfunction insertNode(map, node) {\n\tconst key = siblingKey(node);\n\tif (map.has(key)) throw new InternalError(`diffSchemas: duplicate id among siblings: ${node.nodeKind}/${node.id}`);\n\tmap.set(key, node);\n}\nfunction emitMissingSubtree(node, parentPath) {\n\tconst path = [...parentPath, node.id];\n\treturn [{\n\t\tpath,\n\t\texpected: node,\n\t\t...ifDefined(\"explanation\", node.explainMismatch?.(void 0))\n\t}, ...node.children().flatMap((c) => emitMissingSubtree(c, path))];\n}\nfunction emitExtraSubtree(node, parentPath) {\n\tconst path = [...parentPath, node.id];\n\treturn [{\n\t\tpath,\n\t\tactual: node\n\t}, ...node.children().flatMap((c) => emitExtraSubtree(c, path))];\n}\n/**\n* Diff two schema trees starting from their roots.\n*\n* The differ is **total**: every node-level difference is reported. An unmatched\n* non-leaf node emits its own issue and descends, emitting an issue for every\n* node in the missing/extra subtree. Coalescing a parent change over its\n* children is the planner's responsibility. Ownership filtering (dropping `extra`\n* issues in namespaces a contract doesn't own) is the caller's responsibility.\n*/\nfunction diffSchemas(expected, actual) {\n\treturn mirrorDependsOnOntoIssues(diffPair(expected, actual, []));\n}\nfunction schemaNodeRefKey(ref) {\n\treturn JSON.stringify(ref.map((step) => step.id));\n}\nfunction issuePathKey(path) {\n\treturn JSON.stringify(path);\n}\nfunction terminalNodeKind(issue) {\n\treturn (issue.expected ?? issue.actual)?.nodeKind;\n}\n/**\n* Copies each issue's node's `dependsOn` refs onto the issue itself, as\n* issue-to-issue path references. A ref is kept only when some emitted issue\n* sits at that exact path AND that issue's node `nodeKind` matches the ref's\n* last step — otherwise the ref is dropped (its target either didn't\n* change, or was never part of either tree; either way the dependency is\n* satisfied by reality, not by an operation this diff will produce).\n*\n* The path index is a multimap: two siblings may share an `id` under\n* different `nodeKind`s (a role and a namespace named alike), so an id-path\n* alone is ambiguous. The ref's terminal `nodeKind` disambiguates — the ref\n* resolves only against a same-path issue whose own node carries that kind.\n*/\nfunction mirrorDependsOnOntoIssues(issues) {\n\tconst issuesByPath = /* @__PURE__ */ new Map();\n\tfor (const issue of issues) {\n\t\tconst key = issuePathKey(issue.path);\n\t\tconst bucket = issuesByPath.get(key);\n\t\tif (bucket === void 0) issuesByPath.set(key, [issue]);\n\t\telse bucket.push(issue);\n\t}\n\treturn issues.map((issue) => {\n\t\tconst refs = (issue.expected ?? issue.actual)?.dependsOn;\n\t\tif (refs === void 0 || refs.length === 0) return issue;\n\t\tconst dependsOn = refs.flatMap((ref) => {\n\t\t\tconst lastStep = ref[ref.length - 1];\n\t\t\tif (lastStep === void 0) return [];\n\t\t\tif (!(issuesByPath.get(schemaNodeRefKey(ref)) ?? []).some((c) => terminalNodeKind(c) === lastStep.nodeKind)) return [];\n\t\t\treturn [ref.map((step) => step.id)];\n\t\t});\n\t\tif (dependsOn.length === 0) return issue;\n\t\treturn {\n\t\t\t...issue,\n\t\t\tdependsOn\n\t\t};\n\t});\n}\nfunction diffPair(expected, actual, parentPath) {\n\tconst path = [...parentPath, expected.id];\n\tconst issues = [];\n\tif (!expected.isEqualTo(actual)) issues.push({\n\t\tpath,\n\t\texpected,\n\t\tactual,\n\t\t...ifDefined(\"explanation\", expected.explainMismatch?.(actual))\n\t});\n\tissues.push(...diffChildren(expected.children(), actual.children(), path));\n\treturn issues;\n}\n/**\n* Align one level of nodes by `(nodeKind, id)`; emit issues in input order\n* and recurse.\n*\n* A missing node emits one issue for itself and one for every node in its\n* subtree (total descent). Same for extra nodes. A matched pair recurses via\n* `diffPair`.\n*/\nfunction diffChildren(expected, actual, parentPath) {\n\tconst expectedMap = /* @__PURE__ */ new Map();\n\tfor (const node of expected) insertNode(expectedMap, node);\n\tconst actualMap = /* @__PURE__ */ new Map();\n\tfor (const node of actual) insertNode(actualMap, node);\n\tconst issues = [];\n\tfor (const [key, expectedNode] of expectedMap) {\n\t\tconst actualNode = actualMap.get(key);\n\t\tif (actualNode === void 0) issues.push(...emitMissingSubtree(expectedNode, parentPath));\n\t\telse issues.push(...diffPair(expectedNode, actualNode, parentPath));\n\t}\n\tfor (const [key, actualNode] of actualMap) if (!expectedMap.has(key)) issues.push(...emitExtraSubtree(actualNode, parentPath));\n\treturn issues;\n}\n/**\n* The result of diffing a contract's expected schema against the introspected\n* actual schema: one node-typed issue list. Carries no verdict, verification\n* tree, or counts — those are the verifier's own presentation, built from the\n* same underlying comparison.\n*\n* `TNode` is the concrete schema-IR node the issues carry; it defaults to\n* `DiffableNode`, so this is purely additive — a caller that wants the\n* concrete node opts in (the Postgres planner uses the concrete node type),\n* everyone else keeps the default unchanged.\n*/\nvar SchemaDiff = class SchemaDiff {\n\tissues;\n\tconstructor(issues) {\n\t\tthis.issues = issues;\n\t}\n\t/** Returns a new `SchemaDiff` narrowed to the issues `keep` returns true for. */\n\tfilter(keep) {\n\t\treturn new SchemaDiff(this.issues.filter(keep));\n\t}\n};\n//#endregion\n//#region src/control/runner-failure-why.ts\nconst OUTCOME_LABEL = {\n\t\"not-found\": \"missing\",\n\t\"not-expected\": \"extra\",\n\t\"not-equal\": \"mismatch\"\n};\n/** What a diff issue says: its outcome, its path, and its explanation when it has one. */\nfunction issueLabel(issue) {\n\tconst label = `${OUTCOME_LABEL[issueOutcome(issue)]}: ${issue.path.join(\"/\")}`;\n\treturn issue.explanation === void 0 ? label : `${label}. ${issue.explanation.text}`;\n}\n/** The issues of a failed schema check, as one sentence after `opening`. */\nfunction schemaIssuesWhy(opening, issues) {\n\treturn `${opening}: ${issues.map((issue) => issueLabel(issue).replace(/\\.$/, \"\")).join(\"; \")}.`;\n}\n/** The why of a failed schema check after apply, listing its issues when it found any. */\nfunction schemaCheckWhy(issues) {\n\treturn issues.length === 0 ? \"The resulting database schema does not satisfy the destination contract.\" : schemaIssuesWhy(\"The schema check after apply found\", issues);\n}\n/** What a failed check before an operation means: the operation, the check description as written, and what the check's expectation says of the database when it has one. */\nfunction failedPrecheckWhy(check) {\n\tconst checked = `Before operation ${check.operationId} runs, it checks: ${check.description}.`;\n\tconst { expectation } = check;\n\tif (expectation === void 0) return `${checked} That check failed on this database.`;\n\treturn expectation.expects === \"absent\" ? `${checked} That check failed: the database already has ${expectation.object}.` : `${checked} That check failed: the database has no ${expectation.object}.`;\n}\n/** What a failed check after an operation means: the operation, the check description as written, and what the check's expectation says of the database when it has one. */\nfunction failedPostcheckWhy(check) {\n\tconst checked = `After operation ${check.operationId} ran, it checks: ${check.description}.`;\n\tconst { expectation } = check;\n\tif (expectation === void 0) return `${checked} That check failed on this database.`;\n\treturn expectation.expects === \"absent\" ? `${checked} That check failed: the database still has ${expectation.object}.` : `${checked} That check failed: the database has no ${expectation.object}.`;\n}\n//#endregion\n//#region src/control/verifier-disposition.ts\n/**\n* Grades a target-neutral issue category against a control policy.\n*\n* - `observed` warns on everything.\n* - `tolerated` suppresses only an extra nested element (everything else fails).\n* - `external` suppresses every extra category and value drift (existence and\n* declared-shape divergences still fail).\n* - `managed` (and any other) fails.\n*/\nfunction dispositionForCategory(controlPolicy, category) {\n\tif (controlPolicy === \"observed\") return \"warn\";\n\tif (controlPolicy === \"tolerated\" && category === \"extraNestedElement\") return \"suppress\";\n\tif (controlPolicy === \"external\") {\n\t\tif (category === \"extraNestedElement\" || category === \"extraAuxiliary\" || category === \"extraTopLevelObject\" || category === \"valueDrift\") return \"suppress\";\n\t}\n\treturn \"fail\";\n}\n//#endregion\nexport { APP_SPACE_ID, CONTRACT_SNAPSHOTS_DIRNAME, SchemaDiff, SchemaTreeNode, TAGGED_LITERAL_MAX_BYTES, VERIFY_CODE_HASH_MISMATCH, VERIFY_CODE_MARKER_MISSING, VERIFY_CODE_SCHEMA_FAILURE, VERIFY_CODE_TARGET_MISMATCH, assembleAuthoringContributions, assembleControlMutationDefaults, assertUniqueCodecOwner, buildExtensionLoadOrder, contractSnapshotJsonSpecifier, contractSnapshotTypesSpecifier, createControlStack, describeMigrationStatement, describeTaggedLiteralFailure, diffSchemas, dispositionForCategory, enforceHelperCodecInvariants, enumValueCoordinateFromJson, enumValueCoordinateJson, enumValueStatementText, expectAbsent, expectPresent, extractCodecLookup, extractCodecTypeImports, extractComponentIds, extractParameterizedOutputTypeImports, extractQueryOperationTypeImports, failedPostcheckWhy, failedPrecheckWhy, fieldStatementText, hasMigrations, hasOperationPreview, hasPslContractBuild, hasPslContractInfer, hasSchemaSubjectClassifier, hasSchemaView, isRenameStatement, isStorageHashHex, issueLabel, issueOutcome, migrationRunnerFailure, migrationStatementJson, migrationSubjectJson, migrationSubjectKey, modelDisplayName, modelStatementText, orderIssuesByDependencies, planOriginOf, resolvePslBacktickEscapes, resolveTemplateTagEscapes, sameMarkerHashes, schemaCheckWhy, schemaIssuesWhy, storageHashHex, timestampNowControlDescriptor, valueObjectFieldStatementText, withDatabaseUnchanged, withFailingSpace };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":";;;;;;;;;;;;AAaA,SAAS,aAAa,QAAQ;CAC7B,OAAO;EACN,SAAS;EACT;CACD;AACD;AACA,SAAS,cAAc,QAAQ;CAC9B,OAAO;EACN,SAAS;EACT;CACD;AACD;AAGA,MAAM,6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AO;AACrM;;AAEA,SAAS,mBAAmB,OAAO;CAClC,MAAM,UAAU,mBAAmB,MAAM,YAAY,mBAAmB,MAAM,YAAY;CAC1F,MAAM,EAAE,gBAAgB;CACxB,IAAI,gBAAgB,KAAK,GAAG,OAAO,GAAG,QAAQ;CAC9C,OAAO,YAAY,YAAY,WAAW,GAAG,QAAQ,6CAA6C,YAAY,OAAO,KAAK,GAAG,QAAQ,0CAA0C,YAAY,OAAO;AACnM;;;;;;;;;;AAYA,SAAS,uBAAuB,eAAe,UAAU;CACxD,IAAI,kBAAkB,YAAY,OAAO;CACzC,IAAI,kBAAkB,eAAe,aAAa,sBAAsB,OAAO;CAC/E,IAAI,kBAAkB,YACjB;MAAA,aAAa,wBAAwB,aAAa,oBAAoB,aAAa,yBAAyB,aAAa,cAAc,OAAO;CAAA;CAEnJ,OAAO;AACR"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"data-type-DPsP4_9m-BRPJX_-z.mjs","names":["#constructedByItsType"],"sources":["../../../../1-framework/1-core/framework-components/dist/data-type-DPsP4_9m.mjs"],"sourcesContent":["import { t as canonicalizeJson } from \"./canonicalize-json-ZPawceQR.mjs\";\nimport { n as runtimeError } from \"./runtime-error-BA9d7XjZ.mjs\";\nimport { n as registerFrameworkCopy, t as assertOneFrameworkCopy } from \"./framework-copies-DeDyytAc.mjs\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { InternalError, isInternalError } from \"@internal/utils/internal-error\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { type } from \"arktype\";\n//#region src/shared/data-type-id-pattern.ts\n/** The whole of what a data type id is: `owner/name` in lower case, with no version. */\nconst DATA_TYPE_ID_PATTERN = /^[a-z0-9]+(?:-[a-z0-9]+)*\\/[a-z0-9]+(?:-[a-z0-9]+)*$/;\n//#endregion\n//#region src/shared/json-readers.ts\n/**\n* Readers for the JSON forms data types share. Each returns the JSON it is given in a form it reads and refuses anything else with {@link refuseJsonValue}. `owner` is the data type whose value is read, or the codec whose own limit refuses it.\n*/\nconst RECEIVED_PREVIEW_LIMIT = 100;\n/** The value a refusal names: its JSON text, or its digits for a number JSON cannot write, cut to 100 characters. */\nfunction receivedPreview(json) {\n\treturn (typeof json === \"number\" ? String(json) : JSON.stringify(json)).slice(0, RECEIVED_PREVIEW_LIMIT);\n}\n/**\n* The refusal of a JSON value: `RUNTIME.DECODE_FAILED`, `<owner> JSON value must be <expected>`, with `meta.received`, the value it was given as JSON text, cut to 100 characters, and `meta.dataType` or `meta.codecId` naming the owner. A data type id carries no version and a codec id does, so the id says which it is.\n*/\nfunction refuseJsonValue(owner, expected, json) {\n\tconst named = DATA_TYPE_ID_PATTERN.test(owner) ? { dataType: owner } : { codecId: owner };\n\tthrow structuredError(\"RUNTIME.DECODE_FAILED\", `${owner} JSON value must be ${expected}`, { meta: {\n\t\t...named,\n\t\treceived: receivedPreview(json)\n\t} });\n}\nfunction readJsonString(owner, json) {\n\tif (typeof json !== \"string\") return refuseJsonValue(owner, \"a string\", json);\n\treturn json;\n}\n/** Reads a JSON string that matches `pattern`; `form` names what the pattern accepts, for the refusal. */\nfunction readJsonMatching(owner, json, pattern, form) {\n\tif (typeof json !== \"string\" || !pattern.test(json)) return refuseJsonValue(owner, form, json);\n\treturn json;\n}\nfunction readJsonBoolean(owner, json) {\n\tif (typeof json !== \"boolean\") return refuseJsonValue(owner, \"a boolean\", json);\n\treturn json;\n}\n/** Whether `value` is an integer within `range`, its ends included. */\nfunction isIntegerIn(value, range) {\n\treturn typeof value === \"number\" && Number.isInteger(value) && value >= range.min && value <= range.max;\n}\n/** The integers a JavaScript `number` holds exactly. */\nconst SAFE_INTEGER_RANGE = {\n\tmin: Number.MIN_SAFE_INTEGER,\n\tmax: Number.MAX_SAFE_INTEGER\n};\n/** The integers a signed 32-bit integer holds. */\nconst INT32_RANGE = {\n\tmin: -(2 ** 31),\n\tmax: 2 ** 31 - 1\n};\nfunction readJsonInteger(owner, json, range) {\n\tif (!isIntegerIn(json, range)) return refuseJsonValue(owner, `an integer from ${range.min} to ${range.max}`, json);\n\treturn json;\n}\n/** The integers a signed 64-bit integer holds. */\nconst INT64_RANGE = {\n\tmin: -(2n ** 63n),\n\tmax: 2n ** 63n - 1n\n};\n/** The integers a JavaScript `number` holds exactly, as a `bigint` range. */\nconst SAFE_INTEGER_BIGINT_RANGE = {\n\tmin: BigInt(Number.MIN_SAFE_INTEGER),\n\tmax: BigInt(Number.MAX_SAFE_INTEGER)\n};\nconst DECIMAL_INTEGER_TEXT = /^-?\\d+$/;\n/**\n* Reads an integer a codec writes as decimal text, because a JSON number cannot hold every value of its type. The text must be the integer's decimal text, with no leading zeros and no minus sign on zero; another spelling is refused with the text to write, as `\"7\"` for `\"007\"`.\n*/\nfunction readJsonIntegerText(owner, json, range) {\n\tconst expected = range === void 0 ? \"a decimal integer string\" : `a decimal integer string from ${range.min} to ${range.max}`;\n\tconst value = BigInt(readJsonMatching(owner, json, DECIMAL_INTEGER_TEXT, expected));\n\tif (range !== void 0 && (value < range.min || value > range.max)) return refuseJsonValue(owner, expected, json);\n\tconst written = value.toString();\n\tif (json !== written) return refuseJsonValue(owner, `\"${written}\", the integer's decimal text without leading zeros or a minus sign on zero`, json);\n\treturn value;\n}\nconst NON_FINITE_TEXT = /* @__PURE__ */ new Set([\n\t\"NaN\",\n\t\"Infinity\",\n\t\"-Infinity\"\n]);\n/** Whether `text` is `NaN`, `Infinity` or `-Infinity`, the text a float's JSON form writes for a value JSON has no number for. */\nfunction isNonFiniteText(text) {\n\treturn NON_FINITE_TEXT.has(text);\n}\n/** JSON has no number for NaN or an infinity, so a float's JSON form writes them as the text `NaN`, `Infinity` and `-Infinity`. */\nfunction floatToJson(value) {\n\treturn Number.isFinite(value) ? value : String(value);\n}\nfunction readJsonFloat(owner, json) {\n\tif (typeof json === \"number\" && Number.isFinite(json)) return json;\n\tif (typeof json === \"string\" && isNonFiniteText(json)) return Number(json);\n\treturn refuseJsonValue(owner, \"a finite number or the text NaN, Infinity or -Infinity\", json);\n}\n//#endregion\n//#region src/shared/data-type.ts\nregisterFrameworkCopy();\nvar DataTypeValueRecord = class {\n\ttype;\n\tparams;\n\tvalue;\n\t#constructedByItsType = true;\n\tconstructor(type, params, value) {\n\t\tthis.type = type;\n\t\tthis.params = params;\n\t\tthis.value = value;\n\t\tObject.freeze(this);\n\t}\n\tstatic isConstructed(value) {\n\t\treturn typeof value === \"object\" && value !== null && #constructedByItsType in value && value.#constructedByItsType;\n\t}\n};\n/** Read `id` as a data type id, refusing anything that is not `owner/name` in lower case. */\nfunction dataTypeId(id) {\n\tif (!DATA_TYPE_ID_PATTERN.test(id)) throw runtimeError(\"CONTRACT.DATA_TYPE_ID_INVALID\", `\"${id}\" is not a data type id. A data type id is \"owner/name\" in lower case and carries no version, as in \"owner/name\"; a versioned id names a codec.`, { id });\n\treturn blindCast(id);\n}\n/** Declare a data type. Every id it names, its own and each cast's source, is validated here. */\nfunction dataType(id, spec) {\n\tconst typeId = dataTypeId(id);\n\tconst casts = {};\n\tfor (const [source, cast] of Object.entries(spec.casts ?? {})) casts[dataTypeId(source)] = cast;\n\tconst listCast = spec.listCast;\n\tconst { read, spell, normalize } = spec;\n\tconst construct = (json, params) => new DataTypeValueRecord(typeId, Object.freeze({ ...normalize === void 0 ? params : normalize(params) }), json);\n\tconst spelledUnder = (json, params) => {\n\t\tconst accepted = read(json, params);\n\t\treturn spell === void 0 ? accepted : spell(accepted, params);\n\t};\n\t/** Whether `json` is already the spelling the type gives it without parameters, so that a difference under `params` is theirs. */\n\tconst spelledWithoutParams = (json) => {\n\t\ttry {\n\t\t\treturn canonicalizeJson(spelledUnder(json, {})) === canonicalizeJson(json);\n\t\t} catch (error) {\n\t\t\tif (isInternalError(error)) throw error;\n\t\t\treturn false;\n\t\t}\n\t};\n\tconst fromContract = (json, params) => {\n\t\tconst spelled = spelledUnder(json, params);\n\t\tif (canonicalizeJson(spelled) !== canonicalizeJson(json)) return refuseJsonValue(typeId, Object.keys(params).length > 0 && spelledWithoutParams(json) ? `${JSON.stringify(spelled)}, the spelling its parameters give this value` : `${JSON.stringify(spelled)}, as ${typeId} stores this value`, json);\n\t\treturn construct(json, params);\n\t};\n\treturn {\n\t\tid: typeId,\n\t\t...ifDefined(\"params\", spec.params),\n\t\tcasts,\n\t\t...listCast === void 0 ? {} : { listCast: {\n\t\t\tof: listCast.of.map(dataTypeId),\n\t\t\tcast: listCast.cast\n\t\t} },\n\t\tfromContract,\n\t\tvalueFrom: (json, params) => blindCast(construct(spelledUnder(json, params), params)),\n\t\ttoContract: (value) => requireValueOf(typeId, value, `Data type ${typeId}`).value,\n\t\t...ifDefined(\"equalityKey\", spec.equalityKey)\n\t};\n}\n/** What is wrong with `params` for `type`, or undefined when `type` accepts them or has no parameter schema. */\nfunction dataTypeParamsProblem(type$1, params) {\n\tconst result = type$1.params?.(params);\n\tif (!(result instanceof type.errors)) return void 0;\n\treturn {\n\t\tdataType: type$1.id,\n\t\tmessage: `${type$1.id}: ${result.summary}`,\n\t\tparameters: [...new Set(result.map((error) => error.path.map(String).join(\".\")))]\n\t};\n}\n/** Refuses `params` that `type` does not accept with `CONTRACT.TYPE_PARAMS_INVALID`, naming the data type and each parameter it refuses, plus the facts in `meta`. */\nfunction assertDataTypeParams(type, params, meta = {}) {\n\tconst problem = dataTypeParamsProblem(type, params);\n\tif (problem === void 0) return;\n\tthrow structuredError(\"CONTRACT.TYPE_PARAMS_INVALID\", problem.message, { meta: {\n\t\tdataType: problem.dataType,\n\t\tparameters: problem.parameters,\n\t\t...meta\n\t} });\n}\n/** `value`, when it is a value of `type` that a data type constructed; anything else is a bug in `holder`'s caller. */\nfunction requireValueOf(type, value, holder) {\n\tif (!DataTypeValueRecord.isConstructed(value)) {\n\t\tassertOneFrameworkCopy();\n\t\tthrow new InternalError(`${holder} takes only values of ${type}, and was handed an object no data type constructed.`);\n\t}\n\tif (value.type !== type) throw new InternalError(`${holder} takes only values of ${type}, and was handed a value of ${value.type}.`);\n\treturn value;\n}\n/** The parameters in `typeParams` that `type` declares; keys a codec keeps for itself are dropped. */\nfunction dataTypeParams(type, typeParams) {\n\tif (typeof typeParams !== \"object\" || typeParams === null) return {};\n\tconst kept = {};\n\tfor (const key of objectSchemaKeys(type.params) ?? []) if (Object.hasOwn(typeParams, key)) kept[key] = Reflect.get(typeParams, key);\n\treturn kept;\n}\n/** Whether two values are one: the same type, equal parameters, and JSON equal as canonical JSON. */\nfunction dataTypeValuesEqual(a, b) {\n\treturn a.type === b.type && canonicalizeJson(a.params) === canonicalizeJson(b.params) && canonicalizeJson(a.value) === canonicalizeJson(b.value);\n}\nfunction isSchemaPropList(value) {\n\treturn Array.isArray(value) && value.every((prop) => prop !== null && (typeof prop === \"object\" || typeof prop === \"function\") && \"key\" in prop);\n}\nfunction describesObjects(schema) {\n\tconst extendsType = Reflect.get(schema, \"extends\");\n\treturn typeof extendsType === \"function\" && extendsType.call(schema, \"object\") === true;\n}\nfunction objectSchemaProps(schema) {\n\tif (schema === null || typeof schema !== \"object\" && typeof schema !== \"function\") return;\n\tif (!describesObjects(schema)) return void 0;\n\tconst props = readProps(schema);\n\treturn isSchemaPropList(props) ? props : void 0;\n}\n/** Arktype throws from `props` for a union or a morph, whose keys it cannot list. */\nfunction readProps(schema) {\n\ttry {\n\t\treturn Reflect.get(schema, \"props\");\n\t} catch {\n\t\treturn;\n\t}\n}\n/** The keys an arktype object schema declares, or undefined when `schema` is not one. */\nfunction objectSchemaKeys(schema) {\n\treturn objectSchemaProps(schema)?.flatMap((prop) => typeof prop.key === \"string\" ? [prop.key] : []);\n}\n/** The required keys an arktype object schema declares, or undefined when `schema` is not one. */\nfunction requiredSchemaKeys(schema) {\n\treturn objectSchemaProps(schema)?.flatMap((prop) => prop.kind === \"required\" && typeof prop.key === \"string\" ? [prop.key] : []);\n}\nfunction propAllows(prop, value) {\n\tconst schema = prop.value;\n\tif (schema === null || typeof schema !== \"object\" && typeof schema !== \"function\") return false;\n\tconst allows = Reflect.get(schema, \"allows\");\n\treturn typeof allows === \"function\" && allows.call(schema, value) === true;\n}\n/** The keys of an arktype object schema whose own schema accepts `value`, or undefined when `schema` is not one. */\nfunction schemaKeysAllowing(schema, value) {\n\treturn objectSchemaProps(schema)?.flatMap((prop) => typeof prop.key === \"string\" && propAllows(prop, value) ? [prop.key] : []);\n}\n/** The parameters a data type requires. */\nfunction requiredParamKeys(type) {\n\treturn requiredSchemaKeys(type.params) ?? [];\n}\nfunction createDataTypeLookup(types) {\n\tconst byId = new Map(types.map((type) => [type.id, type]));\n\treturn {\n\t\tget: (id) => byId.get(id),\n\t\thas: (id) => byId.has(id)\n\t};\n}\n/** Collect every data type the composed components register, refusing two declarations of one id. */\nfunction assembleDataTypes(descriptors) {\n\tconst declared = [];\n\tconst owners = /* @__PURE__ */ new Map();\n\tfor (const descriptor of descriptors) {\n\t\tconst contributedBy = descriptor.id ?? \"<unknown>\";\n\t\tfor (const type of descriptor.dataTypes ?? []) {\n\t\t\tconst existingOwner = owners.get(type.id);\n\t\t\tif (existingOwner !== void 0) throw runtimeError(\"CONTRACT.DATA_TYPE_DUPLICATE\", `Duplicate data type \"${type.id}\". Component \"${contributedBy}\" conflicts with \"${existingOwner}\". Each data type has exactly one owner across the composed stack.`, {\n\t\t\t\tdataType: type.id,\n\t\t\t\tcontributedBy,\n\t\t\t\towner: existingOwner\n\t\t\t});\n\t\t\towners.set(type.id, contributedBy);\n\t\t\tdeclared.push({\n\t\t\t\ttype,\n\t\t\t\tcontributedBy\n\t\t\t});\n\t\t}\n\t}\n\treturn {\n\t\tlookup: createDataTypeLookup(declared.map((entry) => entry.type)),\n\t\tdeclared\n\t};\n}\n//#endregion\nexport { readJsonInteger as C, refuseJsonValue as D, readJsonString as E, DATA_TYPE_ID_PATTERN as O, readJsonFloat as S, readJsonMatching as T, SAFE_INTEGER_RANGE as _, dataTypeId as a, isNonFiniteText as b, dataTypeValuesEqual as c, requiredParamKeys as d, requiredSchemaKeys as f, SAFE_INTEGER_BIGINT_RANGE as g, INT64_RANGE as h, dataType as i, objectSchemaKeys as l, INT32_RANGE as m, assertDataTypeParams as n, dataTypeParams as o, schemaKeysAllowing as p, createDataTypeLookup as r, dataTypeParamsProblem as s, assembleDataTypes as t, requireValueOf as u, floatToJson as v, readJsonIntegerText as w, readJsonBoolean as x, isIntegerIn as y };\n\n//# sourceMappingURL=data-type-DPsP4_9m.mjs.map"],"mappings":";;;;;;;;;;AAUA,MAAM,uBAAuB;;;;AAM7B,MAAM,yBAAyB;;AAE/B,SAAS,gBAAgB,MAAM;CAC9B,QAAQ,OAAO,SAAS,WAAW,OAAO,IAAI,IAAI,KAAK,UAAU,IAAI,EAAA,CAAG,MAAM,GAAG,sBAAsB;AACxG;;;;AAIA,SAAS,gBAAgB,OAAO,UAAU,MAAM;CAC/C,MAAM,QAAQ,qBAAqB,KAAK,KAAK,IAAI,EAAE,UAAU,MAAM,IAAI,EAAE,SAAS,MAAM;CACxF,MAAM,gBAAgB,yBAAyB,GAAG,MAAM,sBAAsB,YAAY,EAAE,MAAM;EACjG,GAAG;EACH,UAAU,gBAAgB,IAAI;CAC/B,EAAE,CAAC;AACJ;AACA,SAAS,eAAe,OAAO,MAAM;CACpC,IAAI,OAAO,SAAS,UAAU,OAAO,gBAAgB,OAAO,YAAY,IAAI;CAC5E,OAAO;AACR;;AAEA,SAAS,iBAAiB,OAAO,MAAM,SAAS,MAAM;CACrD,IAAI,OAAO,SAAS,YAAY,CAAC,QAAQ,KAAK,IAAI,GAAG,OAAO,gBAAgB,OAAO,MAAM,IAAI;CAC7F,OAAO;AACR;AACA,SAAS,gBAAgB,OAAO,MAAM;CACrC,IAAI,OAAO,SAAS,WAAW,OAAO,gBAAgB,OAAO,aAAa,IAAI;CAC9E,OAAO;AACR;;AAEA,SAAS,YAAY,OAAO,OAAO;CAClC,OAAO,OAAO,UAAU,YAAY,OAAO,UAAU,KAAK,KAAK,SAAS,MAAM,OAAO,SAAS,MAAM;AACrG;;AAEA,MAAM,qBAAqB;CAC1B,K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;CACvC,KAAK,MAAM,cAAc,aAAa;EACrC,MAAM,gBAAgB,WAAW,MAAM;EACvC,KAAK,MAAM,QAAQ,WAAW,aAAa,CAAC,GAAG;GAC9C,MAAM,gBAAgB,OAAO,IAAI,KAAK,EAAE;GACxC,IAAI,kBAAkB,KAAK,GAAG,MAAM,aAAa,gCAAgC,wBAAwB,KAAK,GAAG,gBAAgB,cAAc,oBAAoB,cAAc,qEAAqE;IACrP,UAAU,KAAK;IACf;IACA,OAAO;GACR,CAAC;GACD,OAAO,IAAI,KAAK,IAAI,aAAa;GACjC,SAAS,KAAK;IACb;IACA;GACD,CAAC;EACF;CACD;CACA,OAAO;EACN,QAAQ,qBAAqB,SAAS,KAAK,UAAU,MAAM,IAAI,CAAC;EAChE;CACD;AACD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"execution-DcIdFSAR.mjs","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/execution.mjs"],"sourcesContent":["import { n as runtimeError } from \"./runtime-error-BA9d7XjZ.mjs\";\nimport { t as assertOneFrameworkCopy } from \"./framework-copies-DeDyytAc.mjs\";\nimport { t as checkContractComponentRequirements } from \"./framework-components-D6j4Y5K7.mjs\";\n//#region src/execution/execution-requirements.ts\nfunction assertRuntimeContractRequirementsSatisfied({ contract, family, target, adapter, extensions }) {\n\tconst providedComponentIds = /* @__PURE__ */ new Set([\n\t\tfamily.id,\n\t\ttarget.id,\n\t\tadapter.id\n\t]);\n\tfor (const extension of extensions) providedComponentIds.add(extension.id);\n\tconst result = checkContractComponentRequirements({\n\t\tcontract,\n\t\texpectedTargetId: target.targetId,\n\t\tprovidedComponentIds\n\t});\n\tif (result.targetMismatch) throw runtimeError(\"CONTRACT.TARGET_MISMATCH\", `Contract target '${result.targetMismatch.actual}' does not match runtime target descriptor '${result.targetMismatch.expected}'.`);\n\tfor (const packId of result.missingExtensionPackIds) throw runtimeError(\"RUNTIME.MISSING_EXTENSION_PACK\", `Contract requires extension pack '${packId}', but runtime descriptors do not provide a matching component.`);\n}\n//#endregion\n//#region src/execution/execution-stack.ts\nfunction createExecutionStack(input) {\n\tassertOneFrameworkCopy();\n\treturn {\n\t\ttarget: input.target,\n\t\tadapter: input.adapter,\n\t\tdriver: withSessionSettings(input.driver, input.target.sessionSettings),\n\t\textensions: input.extensions ?? []\n\t};\n}\n/** The driver descriptor, creating each driver with the session settings the target declares. */\nfunction withSessionSettings(driver, sessionSettings) {\n\tif (driver === void 0 || sessionSettings === void 0) return driver;\n\tconst create = driver.create.bind(driver);\n\treturn {\n\t\t...driver,\n\t\tcreate: (options) => create(options, sessionSettings)\n\t};\n}\nfunction instantiateExecutionStack(stack) {\n\tconst driver = stack.driver ? stack.driver.create() : void 0;\n\treturn {\n\t\tstack,\n\t\ttarget: stack.target.create(),\n\t\tadapter: stack.adapter.create(stack),\n\t\tdriver,\n\t\textensions: stack.extensions.map((descriptor) => descriptor.create())\n\t};\n}\n//#endregion\nexport { assertRuntimeContractRequirementsSatisfied, createExecutionStack, instantiateExecutionStack };\n\n//# sourceMappingURL=execution.mjs.map"],"mappings":";;;;AAIA,SAAS,2CAA2C,EAAE,UAAU,QAAQ,QAAQ,SAAS,cAAc;CACtG,MAAM,uCAAuC,IAAI,IAAI;EACpD,OAAO;EACP,OAAO;EACP,QAAQ;CACT,CAAC;CACD,KAAK,MAAM,aAAa,YAAY,qBAAqB,IAAI,UAAU,EAAE;CACzE,MAAM,SAAS,mCAAmC;EACjD;EACA,kBAAkB,OAAO;EACzB;CACD,CAAC;CACD,IAAI,OAAO,gBAAgB,MAAM,aAAa,4BAA4B,oBAAoB,OAAO,eAAe,OAAO,8CAA8C,OAAO,eAAe,SAAS,GAAG;CAC3M,KAAK,MAAM,UAAU,OAAO,yBAAyB,MAAM,aAAa,kCAAkC,qCAAqC,OAAO,gEAAgE;AACvN;AAGA,SAAS,qBAAqB,OAAO;CACpC,uBAAuB;CACvB,OAAO;EACN,QAAQ,MAAM;EACd,SAAS,MAAM;EACf,QAAQ,oBAAoB,MAAM,QAAQ,MAAM,OAAO,eAAe;EACtE,YAAY,MAAM,cAAc,CAAC;CAClC;AACD;;AAEA,SAAS,oBAAoB,QAAQ,iBAAiB;CACrD,IAAI,WAAW,KAAK,KAAK,oBAAoB,KAAK,GAAG,OAAO;CAC5D,MAAM,SAAS,OAAO,OAAO,KAAK,MAAM;CACxC,OAAO;EACN,GAAG;EACH,SAAS,YAAY,OAAO,SAAS,eAAe;CACrD;AACD;AACA,SAAS,0BAA0B,OAAO;CACzC,MAAM,SAAS,MAAM,SAAS,MAAM,OAAO,OAAO,IAAI,KAAK;CAC3D,OAAO;EACN;EACA,QAAQ,MAAM,OAAO,OAAO;EAC5B,SAAS,MAAM,QAAQ,OAAO,KAAK;EACnC;EACA,YAAY,MAAM,WAAW,KAAK,eAAe,WAAW,OAAO,CAAC;CACrE;AACD"}
@@ -1,121 +0,0 @@
1
- import { n as runtimeError } from "./runtime-error-BA9d7XjZ-BlT8t6LB.mjs";
2
- //#region ../../../1-framework/1-core/framework-components/dist/framework-copies-DeDyytAc.mjs
3
- /** The names the framework's own package goes by: published, and in this repository's workspace. */
4
- const frameworkPackageNames = /* @__PURE__ */ new Set(["@prisma/orm-framework", "@internal/framework-components"]);
5
- const frameworkCopiesKey = Symbol.for("prisma.orm.frameworkCopies");
6
- function recordedModuleUrls() {
7
- const existing = Reflect.get(globalThis, frameworkCopiesKey);
8
- if (existing instanceof Set) return existing;
9
- const created = /* @__PURE__ */ new Set();
10
- Object.defineProperty(globalThis, frameworkCopiesKey, { value: created });
11
- return created;
12
- }
13
- function parsedUrl(url) {
14
- try {
15
- return new URL(url);
16
- } catch {
17
- return;
18
- }
19
- }
20
- function withoutQueryOrHash(url) {
21
- const location = parsedUrl(url);
22
- if (location === void 0) return url;
23
- location.search = "";
24
- location.hash = "";
25
- return location.href;
26
- }
27
- const thisModuleUrl = import.meta.url;
28
- /**
29
- * Records that this copy of the framework has loaded. A copy is identified by the URL of this
30
- * module, which each copy has exactly one of however its other modules are split into files.
31
- * Modules whose values another copy would not recognise call it, so loading any of them records
32
- * the copy. A host that gives modules no URL records nothing.
33
- */
34
- function registerFrameworkCopy() {
35
- if (typeof thisModuleUrl !== "string") return;
36
- recordedModuleUrls().add(withoutQueryOrHash(thisModuleUrl));
37
- }
38
- registerFrameworkCopy();
39
- function nodeFs() {
40
- return globalThis.process?.getBuiltinModule?.("node:fs");
41
- }
42
- function nodeUrl() {
43
- return globalThis.process?.getBuiltinModule?.("node:url");
44
- }
45
- function displayedPath(location) {
46
- return ((location.protocol === "file:" ? nodeUrl()?.fileURLToPath(location) : void 0) ?? location.href).replace(/[/\\]$/, "");
47
- }
48
- function frameworkVersionAt(fs, folder) {
49
- try {
50
- const manifest = JSON.parse(fs.readFileSync(new URL("package.json", folder), "utf-8"));
51
- if (typeof manifest !== "object" || manifest === null) return void 0;
52
- const name = Reflect.get(manifest, "name");
53
- const version = Reflect.get(manifest, "version");
54
- return typeof name === "string" && frameworkPackageNames.has(name) && typeof version === "string" ? version : void 0;
55
- } catch {
56
- return;
57
- }
58
- }
59
- const describedCopies = /* @__PURE__ */ new Map();
60
- /** The framework package folder `moduleUrl` belongs to, read once per URL. */
61
- function copyOf(moduleUrl) {
62
- const described = describedCopies.get(moduleUrl);
63
- if (described !== void 0) return described;
64
- const copy = describeCopy(moduleUrl);
65
- describedCopies.set(moduleUrl, copy);
66
- return copy;
67
- }
68
- /** The framework package folder `moduleUrl` belongs to; the module itself when no framework `package.json` encloses it. */
69
- function describeCopy(moduleUrl) {
70
- const location = parsedUrl(moduleUrl);
71
- if (location === void 0) return { folder: moduleUrl };
72
- const fs = location.protocol === "file:" ? nodeFs() : void 0;
73
- if (fs !== void 0) for (let folder = new URL(".", location);; folder = new URL("..", folder)) {
74
- const version = frameworkVersionAt(fs, folder);
75
- if (version !== void 0) return {
76
- folder: displayedPath(folder),
77
- version
78
- };
79
- if (new URL("..", folder).href === folder.href) break;
80
- }
81
- return { folder: displayedPath(location) };
82
- }
83
- /** Every framework copy loaded so far, one per package folder. */
84
- function loadedFrameworkCopies() {
85
- const urls = recordedModuleUrls();
86
- if (urls.size <= 1) return [];
87
- const byFolder = /* @__PURE__ */ new Map();
88
- for (const url of urls) {
89
- const copy = copyOf(url);
90
- if (!byFolder.has(copy.folder)) byFolder.set(copy.folder, copy);
91
- }
92
- return [...byFolder.values()];
93
- }
94
- function versionLabel(copy) {
95
- return copy.version ?? "unknown version";
96
- }
97
- function copyLine(copy, versionWidth) {
98
- return ` ${versionLabel(copy).padEnd(versionWidth)} ${copy.folder}`;
99
- }
100
- const findCopies = "`npm ls @prisma/orm-framework`, `pnpm why @prisma/orm-framework` or `bun why @prisma/orm-framework` shows which package brought each copy.";
101
- function fixFor(copies) {
102
- const versions = new Set(copies.map((copy) => copy.version));
103
- const [onlyVersion] = versions;
104
- if (versions.size === 1 && onlyVersion !== void 0) return `Every copy is ${onlyVersion}, so the package manager installed one version more than once. Reinstall so it keeps one copy, for example by deleting node_modules and the lockfile and installing again. With pnpm, copies of one version can also differ by their peer dependencies; \`pnpm why @prisma/orm-framework\` shows the difference, and giving every dependent the same peer leaves one copy. ${findCopies}`;
105
- return `Install the same version of every @prisma/orm-* package, and a prisma CLI that runs that version. ${findCopies}`;
106
- }
107
- /** Throws `RUNTIME.MULTIPLE_ORM_COPIES` when the framework has been loaded from more than one package folder. */
108
- function assertOneFrameworkCopy() {
109
- const copies = loadedFrameworkCopies();
110
- if (copies.length <= 1) return;
111
- const versionWidth = Math.max(...copies.map((copy) => versionLabel(copy).length));
112
- throw Object.assign(runtimeError("RUNTIME.MULTIPLE_ORM_COPIES", `Prisma ORM is loaded from ${copies.length} copies (${copies.map(versionLabel).join(", ")})`, { copies }), {
113
- why: ["Values and registries made by one copy are not recognised by another, so every @prisma/orm-* package and the prisma CLI must use one copy.", ...copies.map((copy) => copyLine(copy, versionWidth))].join("\n"),
114
- fix: fixFor(copies),
115
- meta: { copies }
116
- });
117
- }
118
- //#endregion
119
- export { registerFrameworkCopy as n, assertOneFrameworkCopy as t };
120
-
121
- //# sourceMappingURL=framework-copies-DeDyytAc-CK9tduQ6.mjs.map