@prisma/orm-framework 8.0.0-rc.18-dev.41 → 8.0.0-rc.18-dev.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/dist/{authoring-BKO7sRLw.d.mts → authoring-C8sYYHu7.d.mts} +3 -3
  2. package/dist/{authoring-BKO7sRLw.d.mts.map → authoring-C8sYYHu7.d.mts.map} +1 -1
  3. package/dist/{authoring-so3aBYD8.mjs → authoring-qO6idK5H.mjs} +24 -3
  4. package/dist/authoring-qO6idK5H.mjs.map +1 -0
  5. package/dist/{binder-WS9-1Mu9-MJi8x3Gm.d.mts → binder-63ozT0D8-BixamO0l.d.mts} +12 -10
  6. package/dist/binder-63ozT0D8-BixamO0l.d.mts.map +1 -0
  7. package/dist/{components-D-8GZwNo.d.mts → components-B3SnaxMU.d.mts} +2 -2
  8. package/dist/{components-D-8GZwNo.d.mts.map → components-B3SnaxMU.d.mts.map} +1 -1
  9. package/dist/components.d.mts +10 -10
  10. package/dist/components.mjs +4 -4
  11. package/dist/components__authoring.d.mts +4 -4
  12. package/dist/components__authoring.mjs +3 -3
  13. package/dist/components__components.d.mts +2 -2
  14. package/dist/components__control.d.mts +3 -3
  15. package/dist/components__control.mjs +3 -3
  16. package/dist/components__execution.d.mts +1 -1
  17. package/dist/components__psl-ast.d.mts +3 -3
  18. package/dist/{config-types-CfdMN7t-.d.mts → config-types-0fY7fbd7.d.mts} +6 -6
  19. package/dist/{config-types-CfdMN7t-.d.mts.map → config-types-0fY7fbd7.d.mts.map} +1 -1
  20. package/dist/config.d.mts +1 -1
  21. package/dist/config__config-types.d.mts +1 -1
  22. package/dist/contract-authoring.d.mts +34 -14
  23. package/dist/contract-authoring.d.mts.map +1 -1
  24. package/dist/contract-authoring.mjs +3 -3
  25. package/dist/{control-B5ezUWD2-BgUEggvd.d.mts → control-B5ezUWD2-D6knyncN.d.mts} +2 -2
  26. package/dist/{control-B5ezUWD2-BgUEggvd.d.mts.map → control-B5ezUWD2-D6knyncN.d.mts.map} +1 -1
  27. package/dist/control-D2ZpYj6i.d.mts +1 -0
  28. package/dist/{control-7DsPHRLi.d.mts → control-D9rb0OBR.d.mts} +18 -48
  29. package/dist/{control-7DsPHRLi.d.mts.map → control-D9rb0OBR.d.mts.map} +1 -1
  30. package/dist/{control-AlBtrJUn.mjs → control-DPasGnOD.mjs} +23 -124
  31. package/dist/control-DPasGnOD.mjs.map +1 -0
  32. package/dist/{control-KsXr4fYD-DJm_48Db.mjs → control-KsXr4fYD-B23ri5vh.mjs} +2 -2
  33. package/dist/{control-KsXr4fYD-DJm_48Db.mjs.map → control-KsXr4fYD-B23ri5vh.mjs.map} +1 -1
  34. package/dist/declarations-BgUAq1RG-ShewcVdd.mjs +459 -0
  35. package/dist/declarations-BgUAq1RG-ShewcVdd.mjs.map +1 -0
  36. package/dist/errors.d.mts +4 -4
  37. package/dist/errors.mjs +3 -3
  38. package/dist/errors__control.d.mts +2 -2
  39. package/dist/errors__control.mjs +1 -1
  40. package/dist/errors__execution.d.mts +1 -1
  41. package/dist/errors__execution.mjs +1 -1
  42. package/dist/errors__migration.d.mts +1 -1
  43. package/dist/errors__migration.mjs +1 -1
  44. package/dist/{execution-BkcXd7Tn.d.mts → execution-C00_IFA7.d.mts} +3 -3
  45. package/dist/{execution-BkcXd7Tn.d.mts.map → execution-C00_IFA7.d.mts.map} +1 -1
  46. package/dist/{execution-KLhn9sSn.mjs → execution-C_4ICly-.mjs} +2 -2
  47. package/dist/{execution-KLhn9sSn.mjs.map → execution-C_4ICly-.mjs.map} +1 -1
  48. package/dist/{execution-DXQQRCfR.d.mts → execution-CktUHYP0.d.mts} +2 -2
  49. package/dist/{execution-DXQQRCfR.d.mts.map → execution-CktUHYP0.d.mts.map} +1 -1
  50. package/dist/expressions-CMQzbnHk-fqYn-D3z.mjs +895 -0
  51. package/dist/expressions-CMQzbnHk-fqYn-D3z.mjs.map +1 -0
  52. package/dist/{framework-authoring-hZgq-M2K-Daz3kgWL.d.mts → framework-authoring-Du7xSUmg-D85Toszi.d.mts} +27 -10
  53. package/dist/framework-authoring-Du7xSUmg-D85Toszi.d.mts.map +1 -0
  54. package/dist/{framework-components-B-yaLbst-nZJUGMuf.d.mts → framework-components-DQFte83L-CIIcH8Bj.d.mts} +3 -3
  55. package/dist/{framework-components-B-yaLbst-nZJUGMuf.d.mts.map → framework-components-DQFte83L-CIIcH8Bj.d.mts.map} +1 -1
  56. package/dist/{migration-CZik9OxU.mjs → migration-Dy-tXHxh.mjs} +2 -2
  57. package/dist/{migration-CZik9OxU.mjs.map → migration-Dy-tXHxh.mjs.map} +1 -1
  58. package/dist/{migration-BVDJBmyi.d.mts → migration-K3Co0dba.d.mts} +2 -2
  59. package/dist/{migration-BVDJBmyi.d.mts.map → migration-K3Co0dba.d.mts.map} +1 -1
  60. package/dist/{parse-BxcaGLV1-BxEIfxh3.mjs → parse-bZgfjovA-Bd80h0ox.mjs} +4 -4
  61. package/dist/{parse-BxcaGLV1-BxEIfxh3.mjs.map → parse-bZgfjovA-Bd80h0ox.mjs.map} +1 -1
  62. package/dist/{parse-CJtBvEYy-BCae0181.d.mts → parse-djL5wker-DYTP4HGq.d.mts} +7 -7
  63. package/dist/{parse-CJtBvEYy-BCae0181.d.mts.map → parse-djL5wker-DYTP4HGq.d.mts.map} +1 -1
  64. package/dist/{psl-ast-BIJIW24G-B8ptjyuO.d.mts → psl-ast-B6X_rlhZ-DCrq7Zie.d.mts} +3 -3
  65. package/dist/{psl-ast-BIJIW24G-B8ptjyuO.d.mts.map → psl-ast-B6X_rlhZ-DCrq7Zie.d.mts.map} +1 -1
  66. package/dist/psl-ast-DlmFfwfZ.d.mts +2 -0
  67. package/dist/psl-parser.d.mts +22 -11
  68. package/dist/psl-parser.d.mts.map +1 -1
  69. package/dist/psl-parser.mjs +14 -110
  70. package/dist/psl-parser.mjs.map +1 -1
  71. package/dist/psl-parser__format.d.mts +1 -1
  72. package/dist/psl-parser__format.mjs +3 -3
  73. package/dist/psl-parser__format.mjs.map +1 -1
  74. package/dist/psl-parser__interpret.d.mts +16 -13
  75. package/dist/psl-parser__interpret.d.mts.map +1 -1
  76. package/dist/psl-parser__interpret.mjs +52 -48
  77. package/dist/psl-parser__interpret.mjs.map +1 -1
  78. package/dist/psl-parser__syntax.d.mts +1 -1
  79. package/dist/psl-parser__syntax.mjs +3 -3
  80. package/dist/psl-printer.d.mts +4 -4
  81. package/dist/psl-printer.mjs +1 -1
  82. package/dist/read-expression-as-Dhyvx51C-Bpn_1X05.mjs +239 -0
  83. package/dist/read-expression-as-Dhyvx51C-Bpn_1X05.mjs.map +1 -0
  84. package/dist/{temporal-presets-Cumws2z--DcYWooYJ.d.mts → temporal-presets-D_TQBbXU-DLIsE1k-.d.mts} +42 -4
  85. package/dist/temporal-presets-D_TQBbXU-DLIsE1k-.d.mts.map +1 -0
  86. package/dist/{temporal-presets-BcDyr_hK-CFplJNGz.mjs → temporal-presets-DmZDnaZV-aUZPt1LX.mjs} +189 -22
  87. package/dist/temporal-presets-DmZDnaZV-aUZPt1LX.mjs.map +1 -0
  88. package/package.json +15 -15
  89. package/dist/ast-helpers-CzydMPdh-Mi0SrZRa.mjs +0 -424
  90. package/dist/ast-helpers-CzydMPdh-Mi0SrZRa.mjs.map +0 -1
  91. package/dist/authoring-so3aBYD8.mjs.map +0 -1
  92. package/dist/binder-WS9-1Mu9-MJi8x3Gm.d.mts.map +0 -1
  93. package/dist/control-AlBtrJUn.mjs.map +0 -1
  94. package/dist/control-CIEbQ0bK.d.mts +0 -1
  95. package/dist/declarations-DuSbyF44-D-Q7-GRi.mjs +0 -930
  96. package/dist/declarations-DuSbyF44-D-Q7-GRi.mjs.map +0 -1
  97. package/dist/framework-authoring-hZgq-M2K-Daz3kgWL.d.mts.map +0 -1
  98. package/dist/psl-ast-rf0UoVty.d.mts +0 -2
  99. package/dist/resolve-C8PUf8zv-QAvnPhCt.mjs +0 -146
  100. package/dist/resolve-C8PUf8zv-QAvnPhCt.mjs.map +0 -1
  101. package/dist/temporal-presets-BcDyr_hK-CFplJNGz.mjs.map +0 -1
  102. package/dist/temporal-presets-Cumws2z--DcYWooYJ.d.mts.map +0 -1
@@ -0,0 +1,239 @@
1
+ import { t as InternalError } from "./internal-error-ChGYPVpq-DhUD05u0.mjs";
2
+ import { n as notOk } from "./result-8OXF26MN.mjs";
3
+ import { m as describeTaggedLiteralFailure } from "./temporal-presets-DmZDnaZV-aUZPt1LX.mjs";
4
+ import { S as readWrittenValueAs, s as describeExpected, t as admittedForms } from "./authoring-qO6idK5H.mjs";
5
+ import { C as printSyntax, a as IdentifierAst, c as ObjectLiteralExprAst, d as StringLiteralExprAst, i as FunctionCallAst, m as TaggedLiteralExprAst, o as NumberLiteralExprAst, r as BooleanLiteralExprAst, t as ArrayLiteralAst } from "./expressions-CMQzbnHk-fqYn-D3z.mjs";
6
+ //#region ../../../1-framework/2-authoring/psl-parser/dist/written-scalar-DYAM5coP.mjs
7
+ function diagnosticSource(sources, node) {
8
+ return {
9
+ sources,
10
+ node,
11
+ at(span) {
12
+ const sourceFile = sources.sourceFileFor(node);
13
+ const range = span === void 0 ? {
14
+ start: sourceFile.positionAt(node.offset),
15
+ end: sourceFile.positionAt(node.endOffset)
16
+ } : sourceFile.pslSpanToRange(span);
17
+ return {
18
+ filename: sourceFile.filename,
19
+ range
20
+ };
21
+ }
22
+ };
23
+ }
24
+ function diagnosticFromSpan(diagnostic, source) {
25
+ if (diagnostic.span === void 0) throw new InternalError("Owned PSL diagnostic has no span");
26
+ return {
27
+ code: diagnostic.code,
28
+ message: diagnostic.message,
29
+ ...source.at(diagnostic.span),
30
+ ...diagnostic.data === void 0 ? {} : { data: diagnostic.data }
31
+ };
32
+ }
33
+ function mapPslDiagnostics(diagnostics, sources) {
34
+ return diagnostics.map(({ filename, code, message, range, data }) => ({
35
+ code,
36
+ message,
37
+ sourceId: filename,
38
+ span: sources.sourceFileNamed(filename).rangeToPslSpan(range),
39
+ ...data === void 0 ? {} : { data }
40
+ }));
41
+ }
42
+ function createPslDiagnosticCollector(sources) {
43
+ const entries = [];
44
+ return {
45
+ get length() {
46
+ return entries.length;
47
+ },
48
+ push(...diagnostics) {
49
+ for (const diagnostic of diagnostics) entries.push({
50
+ kind: "psl",
51
+ diagnostic
52
+ });
53
+ },
54
+ pushUnlocated(...diagnostics) {
55
+ for (const diagnostic of diagnostics) entries.push({
56
+ kind: "psl",
57
+ diagnostic,
58
+ omitSpan: true
59
+ });
60
+ },
61
+ pushExternal(...diagnostics) {
62
+ for (const diagnostic of diagnostics) entries.push({
63
+ kind: "external",
64
+ diagnostic
65
+ });
66
+ },
67
+ toExternal() {
68
+ return entries.flatMap((entry) => {
69
+ if (entry.kind === "external") return [entry.diagnostic];
70
+ if (entry.omitSpan) {
71
+ const { code, message, filename, data } = entry.diagnostic;
72
+ return [{
73
+ code,
74
+ message,
75
+ sourceId: filename,
76
+ ...data === void 0 ? {} : { data }
77
+ }];
78
+ }
79
+ return mapPslDiagnostics([entry.diagnostic], sources);
80
+ });
81
+ }
82
+ };
83
+ }
84
+ function readResolvedAttribute(attribute, sources) {
85
+ return {
86
+ name: attributeName(attribute.name()),
87
+ args: readResolvedArgList(attribute.argList(), sources),
88
+ span: nodePslSpan(attribute.syntax, sources),
89
+ node: attribute
90
+ };
91
+ }
92
+ function readResolvedAttributes(attributes, sources) {
93
+ return Array.from(attributes, (attribute) => readResolvedAttribute(attribute, sources));
94
+ }
95
+ function readResolvedConstructorCall(annotation, sources) {
96
+ const argList = annotation?.argList();
97
+ if (annotation === void 0 || argList === void 0) return void 0;
98
+ return {
99
+ path: annotation.name()?.path() ?? [],
100
+ args: readResolvedArgList(argList, sources),
101
+ span: nodePslSpan(annotation.syntax, sources)
102
+ };
103
+ }
104
+ function readResolvedArgList(argList, sources) {
105
+ if (argList === void 0) return [];
106
+ const args = [];
107
+ for (const arg of argList.args()) {
108
+ const name = arg.name()?.name();
109
+ const expression = arg.value();
110
+ args.push({
111
+ kind: name !== void 0 ? "named" : "positional",
112
+ ...name !== void 0 ? { name } : {},
113
+ value: renderExpression(expression),
114
+ ...expression !== void 0 ? { expression } : {},
115
+ span: nodePslSpan(arg.syntax, sources),
116
+ node: arg
117
+ });
118
+ }
119
+ return args;
120
+ }
121
+ function attributeName(name) {
122
+ return name?.path().join(".") ?? "";
123
+ }
124
+ function renderExpression(expression) {
125
+ if (expression === void 0) return "";
126
+ return printSyntax(expression.syntax).trim();
127
+ }
128
+ function nodePslSpan(node, sources) {
129
+ const sourceFile = sources.sourceFileFor(node);
130
+ const start = node.offset;
131
+ const end = start + node.green.textLength;
132
+ return {
133
+ start: sourceFile.offsetToPslPosition(start),
134
+ end: sourceFile.offsetToPslPosition(end)
135
+ };
136
+ }
137
+ /** Unsupported-top-level-block diagnostics are anchored to the keyword token. */
138
+ function keywordPslSpan(node, keyword, sources) {
139
+ const sourceFile = sources.sourceFileFor(node);
140
+ const start = node.offset;
141
+ const end = start + keyword.length;
142
+ return {
143
+ start: sourceFile.offsetToPslPosition(start),
144
+ end: sourceFile.offsetToPslPosition(end)
145
+ };
146
+ }
147
+ const AN_EXPRESSION = {
148
+ ok: false,
149
+ reason: "not-a-literal",
150
+ found: "an expression"
151
+ };
152
+ function written(value) {
153
+ return {
154
+ ok: true,
155
+ written: value
156
+ };
157
+ }
158
+ /** Reads a PSL literal expression as a `WrittenScalar`, for a position that takes a value of a data type. ADR 254. */
159
+ function readWrittenScalar(expression) {
160
+ const syntax = expression.syntax;
161
+ const string = StringLiteralExprAst.cast(syntax)?.value();
162
+ if (string !== void 0) return written({
163
+ kind: "string",
164
+ text: string
165
+ });
166
+ const number = NumberLiteralExprAst.cast(syntax);
167
+ if (number !== void 0) {
168
+ const text = number.token()?.text;
169
+ return text === void 0 ? AN_EXPRESSION : written({
170
+ kind: "number",
171
+ text
172
+ });
173
+ }
174
+ const boolean = BooleanLiteralExprAst.cast(syntax)?.value();
175
+ if (boolean !== void 0) return written({
176
+ kind: "boolean",
177
+ value: boolean
178
+ });
179
+ const tagged = TaggedLiteralExprAst.cast(syntax);
180
+ if (tagged !== void 0) {
181
+ const canonicalization = tagged.canonicalization();
182
+ return canonicalization.ok ? written({
183
+ kind: "tag",
184
+ tag: tagged.tagName(),
185
+ text: canonicalization.text
186
+ }) : {
187
+ ok: false,
188
+ reason: canonicalization.reason
189
+ };
190
+ }
191
+ if (IdentifierAst.cast(syntax) !== void 0) return {
192
+ ok: false,
193
+ reason: "not-a-literal",
194
+ found: "an identifier"
195
+ };
196
+ if (FunctionCallAst.cast(syntax) !== void 0) return {
197
+ ok: false,
198
+ reason: "not-a-literal",
199
+ found: "a function call"
200
+ };
201
+ if (ArrayLiteralAst.cast(syntax) !== void 0) return {
202
+ ok: false,
203
+ reason: "not-a-literal",
204
+ found: "a list"
205
+ };
206
+ if (ObjectLiteralExprAst.cast(syntax) !== void 0) return {
207
+ ok: false,
208
+ reason: "not-a-literal",
209
+ found: "an object"
210
+ };
211
+ return AN_EXPRESSION;
212
+ }
213
+ //#endregion
214
+ //#region ../../../1-framework/2-authoring/psl-parser/dist/read-expression-as-Dhyvx51C.mjs
215
+ const TAGGED_LITERAL_FAILURE_CODES = {
216
+ nul: "PSL_TAGGED_LITERAL_NUL",
217
+ "too-large": "PSL_TAGGED_LITERAL_TOO_LARGE"
218
+ };
219
+ /**
220
+ * 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.
221
+ */
222
+ function readExpressionAs(support, dataType, expression) {
223
+ if (!support.lookup.has(dataType)) throw new InternalError(`An argument receives data type "${dataType}", which this stack does not register.`);
224
+ const forms = admittedForms(support, [dataType]);
225
+ if (forms.length === 0) throw new InternalError(`An argument receives data type "${dataType}", which nothing in this stack writes.`);
226
+ const literal = readWrittenScalar(expression);
227
+ if (!literal.ok) return literal.reason === "not-a-literal" ? notOk({
228
+ code: "PSL_INVALID_ATTRIBUTE_SYNTAX",
229
+ message: `${describeExpected(forms)}; got ${literal.found}`
230
+ }) : notOk({
231
+ code: TAGGED_LITERAL_FAILURE_CODES[literal.reason],
232
+ message: describeTaggedLiteralFailure(literal.reason)
233
+ });
234
+ return readWrittenValueAs(support, dataType, literal.written);
235
+ }
236
+ //#endregion
237
+ export { keywordPslSpan as a, readResolvedAttribute as c, readWrittenScalar as d, diagnosticSource as i, readResolvedAttributes as l, createPslDiagnosticCollector as n, mapPslDiagnostics as o, diagnosticFromSpan as r, nodePslSpan as s, readExpressionAs as t, readResolvedConstructorCall as u };
238
+
239
+ //# sourceMappingURL=read-expression-as-Dhyvx51C-Bpn_1X05.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-expression-as-Dhyvx51C-Bpn_1X05.mjs","names":[],"sources":["../../../../1-framework/2-authoring/psl-parser/dist/written-scalar-DYAM5coP.mjs","../../../../1-framework/2-authoring/psl-parser/dist/read-expression-as-Dhyvx51C.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 { InternalError } from \"@internal/utils/internal-error\";\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\nexport { readResolvedAttributes as a, diagnosticFromSpan as c, readResolvedAttribute as i, diagnosticSource as l, keywordPslSpan as n, readResolvedConstructorCall as o, nodePslSpan as r, createPslDiagnosticCollector as s, readWrittenScalar as t, mapPslDiagnostics as u };\n\n//# sourceMappingURL=written-scalar-DYAM5coP.mjs.map","import { t as readWrittenScalar } from \"./written-scalar-DYAM5coP.mjs\";\nimport { admittedForms, describeExpected, readWrittenValueAs } from \"@internal/framework-components/authoring\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { notOk } from \"@internal/utils/result\";\nimport { describeTaggedLiteralFailure } from \"@internal/framework-components/control\";\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\nexport { readExpressionAs as t };\n\n//# sourceMappingURL=read-expression-as-Dhyvx51C.mjs.map"],"mappings":";;;;;;AAGA,SAAS,iBAAiB,SAAS,MAAM;CACxC,OAAO;EACN;EACA;EACA,GAAG,MAA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,GAAG,iBAAiB,KAAK,EAAE,QAAQ,QAAQ;CACrD,CAAC,IAAI,MAAM;EACV,MAAM,6BAA6B,QAAQ;EAC3C,SAAS,6BAA6B,QAAQ,MAAM;CACrD,CAAC;CACD,OAAO,mBAAmB,SAAS,UAAU,QAAQ,OAAO;AAC7D"}
@@ -1,6 +1,44 @@
1
- import { E as AuthoringTemplateValue, T as AuthoringStorageTypeTemplate, Y as ScalarTypeConstructorOutput } from "./framework-authoring-hZgq-M2K-Daz3kgWL.mjs";
1
+ import { _ as DataType, v as DataTypeId } from "./codec-types-DjozIOvT-BIcpyFea.mjs";
2
+ import { D as AuthoringTypeConstructorDescriptor, E as AuthoringTemplateValue, I as DataTypeAuthoringEntry, L as DataTypeSupport, T as AuthoringStorageTypeTemplate, Z as ScalarTypeConstructorOutput, a as AuthoringContributions, p as AuthoringFieldPresetDescriptor } from "./framework-authoring-Du7xSUmg-D85Toszi.mjs";
2
3
  import { c as MutationDefaultGeneratorDescriptor } from "./mutation-default-types-js6llINX-WGmpaAAL.mjs";
3
- //#region ../../../1-framework/1-core/framework-components/dist/temporal-presets-Cumws2z-.d.mts
4
+ //#region ../../../1-framework/1-core/framework-components/dist/temporal-presets-D_TQBbXU.d.mts
5
+ //#region src/shared/data-type-support.d.ts
6
+ /** A component as data type assembly reads it: the data types it registers, their authoring entries, the codecs that name them, and the type constructors and field presets whose value arguments name them. */
7
+ interface DataTypeComponent {
8
+ readonly id?: string;
9
+ readonly dataTypes?: ReadonlyArray<DataType>;
10
+ readonly authoring?: Pick<AuthoringContributions, 'dataTypes' | 'type' | 'field' | 'textDataTypes'>;
11
+ readonly types?: {
12
+ readonly [slot: string]: unknown;
13
+ readonly codecTypes?: {
14
+ readonly codecDescriptors?: ReadonlyArray<{
15
+ readonly codecId: string;
16
+ readonly dataType: DataTypeId;
17
+ }>;
18
+ };
19
+ };
20
+ }
21
+ /** A type constructor or field preset, the helpers that take arguments, with the path it is registered under and who registered it. */
22
+ interface ContributedHelper {
23
+ readonly path: string;
24
+ readonly descriptor: AuthoringTypeConstructorDescriptor | AuthoringFieldPresetDescriptor;
25
+ readonly contributedBy: string;
26
+ }
27
+ interface AssembledDataTypeSupport {
28
+ readonly support: DataTypeSupport;
29
+ /** Every data type the components register, with the id of the component that registered it. */
30
+ readonly declared: ReadonlyArray<{
31
+ readonly type: DataType;
32
+ readonly contributedBy: string;
33
+ }>;
34
+ }
35
+ /** Merge every component's PSL support for its data types, refusing two claims on one key. */
36
+ declare function assembleAuthoringDataTypes(components: ReadonlyArray<Pick<DataTypeComponent, 'id' | 'authoring'>>): Readonly<Record<string, DataTypeAuthoringEntry>>;
37
+ /**
38
+ * The data types the components register, with their authoring entries, as every contract source reads values with. Refuses two registrations of one data type or one entry key, every case {@link enforceDataTypeAssemblyInvariants} lists, and a value argument of a type constructor or field preset whose data type is unregistered or that no contract source can write. ADR 254.
39
+ */
40
+ declare function assembleDataTypeSupport(components: ReadonlyArray<DataTypeComponent>, dataTypeOfCodec: (codecId: string) => DataTypeId | undefined): AssembledDataTypeSupport;
41
+ //#endregion
4
42
  //#region src/shared/tagged-literal.d.ts
5
43
  /**
6
44
  * `text` is the canonical value of the literal. Every failure `offset` is an
@@ -186,5 +224,5 @@ declare function temporalCodecPreset<const Storage extends PresetStorageTemplate
186
224
  };
187
225
  };
188
226
  //#endregion
189
- export { timestampNowControlDescriptor as _, TIMESTAMP_NOW_GENERATOR_ID as a, describeTaggedLiteralFailure as c, resolvePslBacktickEscapes as d, resolveTemplateTagEscapes as f, temporalPhaseTemplateWithParams as g, temporalPhaseTemplate as h, TEMPORAL_ON_UPDATE_ARG as i, printTaggedLiteral as l, temporalCodecPreset as m, TAGGED_LITERAL_MAX_BYTES as n, TaggedLiteralCanonicalization as o, temporalAuthoringPresets as p, TEMPORAL_ON_CREATE_ARG as r, canonicalizeTaggedLiteralBody as s, PresetStorageTemplate as t, printedTaggedLiteralReadsBack as u, tsTaggedTemplateSource as v };
190
- //# sourceMappingURL=temporal-presets-Cumws2z--DcYWooYJ.d.mts.map
227
+ export { tsTaggedTemplateSource as C, timestampNowControlDescriptor as S, resolveTemplateTagEscapes as _, TAGGED_LITERAL_MAX_BYTES as a, temporalPhaseTemplate as b, TIMESTAMP_NOW_GENERATOR_ID as c, assembleDataTypeSupport as d, canonicalizeTaggedLiteralBody as f, resolvePslBacktickEscapes as g, printedTaggedLiteralReadsBack as h, PresetStorageTemplate as i, TaggedLiteralCanonicalization as l, printTaggedLiteral as m, ContributedHelper as n, TEMPORAL_ON_CREATE_ARG as o, describeTaggedLiteralFailure as p, DataTypeComponent as r, TEMPORAL_ON_UPDATE_ARG as s, AssembledDataTypeSupport as t, assembleAuthoringDataTypes as u, temporalAuthoringPresets as v, temporalPhaseTemplateWithParams as x, temporalCodecPreset as y };
228
+ //# sourceMappingURL=temporal-presets-D_TQBbXU-DLIsE1k-.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"temporal-presets-D_TQBbXU-DLIsE1k-.d.mts","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/temporal-presets-D_TQBbXU.d.mts"],"mappings":";;;;;;UAKU;WACC;WACA,YAAY,cAAc;WAC1B,YAAY,KAAK;WACjB;cACG;aACD;eACE,mBAAmB;iBACjB;iBACA,UAAU;;;;;;UAMjB;WACC;WACA,YAAY,qCAAqC;WACjD;;UAED;WACC,SAAS;;WAET,UAAU;aACR,MAAM;aACN;;;;iBAII,2BAA2B,YAAY,cAAc,KAAK,0CAA0C,SAAS,eAAe;;;;iBAI5H,wBAAwB,YAAY,cAAc,oBAAoB,kBAAkB,oBAAoB,yBAAyB;;;;;;;;KAQjJ;WACM;WACA;;WAEA;WACA;WACA;;cAEG;;iBAEG,6BAA6B;;iBAE7B,0BAA0B;;iBAE1B,0BAA0B;;;;;;;;;iBAS1B,8BAA8B,mBAAmB;;;;;;;;iBAQjD,mBAAmB,aAAa;;iBAEhC,8BAA8B;;;;;;;;iBAQ9B,uBAAuB,aAAa;WAC1C;WACA;;;;;;;KAON,wBAAwB,8BAA8B;;;;cAI7C;;iBAEG,iCAAiC;;;;iBAIjC,+BAA+B,gBAAgB,6BAA6B,oCAAoC,4BAA4B,OAAO;WACzJ,cAAc;;WAEd;aACE;aACA,QAAQ,KAAK;eACX,cAAc;;eAEd;iBACE;mBACE;mBACA,qBAAqB;;;;;WAK7B;aACE;aACA,QAAQ,KAAK;eACX,cAAc;;eAEd;iBACE;mBACE;mBACA,qBAAqB;;iBAEvB;mBACE;mBACA,qBAAqB;;;;;;cAM1B;WACH;WACA;WACA;WACA;;cAEG;WACH;WACA;WACA;WACA;;;;;iBAKM,4BAA4B,4BAA4B,4BAA4B,OAAO,OAAO,aAAa;WACrH;WACA,OAAO;WACP;aACE;eACE;eACA,IAAI;;;;;;;iBAOF,sCAAsC,4BAA4B,kCAAkC,eAAe,eAAe,yBAAyB,OAAO,OAAO,aAAa,aAAa,QAAQ;WACjN;WACA,OAAO;WACP;aACE;eACE;eACA,IAAI;eACJ,QAAQ;;;;;;;iBAON,0BAA0B,gBAAgB,6BAA6B,oCAAoC,4BAA4B,OAAO;WACpJ,cAAc;;WAEd;WACA;aACE;aACA;aACA;aACA;;aAEA;aACA;aACA;aACA;;WAEF,QAAQ,KAAK;aACX,cAAc;;aAEd;eACE;iBACE;iBACA;iBACA;mBACE;qBACE;qBACA,qBAAqB;;;;eAI3B;iBACE;iBACA;iBACA;mBACE;qBACE;qBACA,qBAAqB"}
@@ -3,9 +3,11 @@ import { t as ifDefined } from "./defined-BQWA85QH-BRSBMULx.mjs";
3
3
  import { t as InternalError } from "./internal-error-ChGYPVpq-DhUD05u0.mjs";
4
4
  import { d as isColumnDefaultLiteralInputValue, f as isExecutionMutationDefaultValue } from "./types-B8ULzMAX.mjs";
5
5
  import { n as invariant } from "./assertions-Dw1lZz_Q.mjs";
6
+ import { n as notOk, r as ok } from "./result-8OXF26MN.mjs";
6
7
  import { n as runtimeError } from "./runtime-error-BA9d7XjZ-BlT8t6LB.mjs";
8
+ import { o as assembleDataTypes } from "./data-type-CVNHtd6y-BFa_VnCb.mjs";
7
9
  import { c as tsTemplateText, o as tsQuotedTextSource } from "./dist-D1f6xr7F.mjs";
8
- //#region ../../../1-framework/1-core/framework-components/dist/temporal-presets-BcDyr_hK.mjs
10
+ //#region ../../../1-framework/1-core/framework-components/dist/temporal-presets-DmZDnaZV.mjs
9
11
  const AUTHORING_WARNING_BATCH_THRESHOLD = 5;
10
12
  /**
11
13
  * Emits collected authoring warnings once per build, grouped by `code`:
@@ -579,19 +581,7 @@ function validateAuthoringArgument(descriptor, value, path) {
579
581
  if (descriptor.optional) return;
580
582
  throw runtimeError("CONTRACT.ARGUMENT_INVALID", `${path} is missing`);
581
583
  }
582
- if (descriptor.kind === "string") {
583
- if (typeof value !== "string") throw runtimeError("CONTRACT.ARGUMENT_INVALID", `${path} must be a string`);
584
- return;
585
- }
586
- if (descriptor.kind === "boolean") {
587
- if (typeof value !== "boolean") throw runtimeError("CONTRACT.ARGUMENT_INVALID", `${path} must be a boolean`);
588
- return;
589
- }
590
- if (descriptor.kind === "stringArray") {
591
- if (!Array.isArray(value)) throw runtimeError("CONTRACT.ARGUMENT_INVALID", `${path} must be an array of strings`);
592
- for (const entry of value) if (typeof entry !== "string") throw runtimeError("CONTRACT.ARGUMENT_INVALID", `${path} must be an array of strings`);
593
- return;
594
- }
584
+ if (descriptor.kind === "value") return;
595
585
  if (descriptor.kind === "object") {
596
586
  if (typeof value !== "object" || value === null || Array.isArray(value)) throw runtimeError("CONTRACT.ARGUMENT_INVALID", `${path} must be an object`);
597
587
  const input = value;
@@ -638,17 +628,25 @@ function issueKey(issue) {
638
628
  const key = typeof first === "object" && first !== null ? first.key : first;
639
629
  return typeof key === "string" ? key : void 0;
640
630
  }
631
+ function authoringTypeParamsIssue(template, typeParams, paramsSchema) {
632
+ if (template.typeParams === void 0 || paramsSchema === void 0) return void 0;
633
+ const result = paramsSchema["~standard"].validate(typeParams ?? {});
634
+ if (result instanceof Promise) throw new InternalError(`The parameter schema of codec "${template.codecId}" is asynchronous; authoring requires a synchronous schema.`);
635
+ const [issue] = result.issues ?? [];
636
+ if (issue === void 0) return void 0;
637
+ const key = issueKey(issue);
638
+ return {
639
+ message: issue.message,
640
+ argumentIndex: key === void 0 ? void 0 : argumentIndexOf(template.typeParams[key])
641
+ };
642
+ }
641
643
  /**
642
644
  * Checks the type parameters a constructor or preset produced against its codec's parameter schema, which is where the bounds of a data type's parameters are written. A failure names the argument the failing parameter came from.
643
645
  */
644
646
  function validateAuthoringTypeParams(helperPath, template, typeParams, paramsSchema) {
645
- if (template.typeParams === void 0 || paramsSchema === void 0) return;
646
- const result = paramsSchema["~standard"].validate(typeParams ?? {});
647
- if (result instanceof Promise) throw new InternalError(`The parameter schema of codec "${template.codecId}" is asynchronous; authoring requires a synchronous schema.`);
648
- const [issue] = result.issues ?? [];
647
+ const issue = authoringTypeParamsIssue(template, typeParams, paramsSchema);
649
648
  if (issue === void 0) return;
650
- const key = issueKey(issue);
651
- const argumentIndex = key === void 0 ? void 0 : argumentIndexOf(template.typeParams[key]);
649
+ const { argumentIndex } = issue;
652
650
  throw runtimeError("CONTRACT.ARGUMENT_INVALID", argumentIndex === void 0 ? `The type parameters of ${helperPath} are invalid: ${issue.message}` : `Authoring helper argument at ${helperPath}[${argumentIndex}] is invalid: ${issue.message}`, {
653
651
  helperPath,
654
652
  ...ifDefined("argumentIndex", argumentIndex)
@@ -700,6 +698,14 @@ function resolveAuthoringExecutionDefaultsTemplate(template, args) {
700
698
  function instantiateAuthoringTypeConstructor(descriptor, args) {
701
699
  return resolveAuthoringStorageTypeTemplate(descriptor.output, args);
702
700
  }
701
+ /**
702
+ * The column a type constructor makes from the stored values of its arguments, as a reader that holds values rather than written arguments has them, or why its codec's parameter schema refuses the parameters they give. The schema check is {@link validateAuthoringTypeParams}'s.
703
+ */
704
+ function instantiateAuthoringTypeConstructorFromValues(descriptor, values, paramsSchema) {
705
+ const output = instantiateAuthoringTypeConstructor(descriptor, values);
706
+ const issue = authoringTypeParamsIssue(descriptor.output, output.typeParams, paramsSchema);
707
+ return issue === void 0 ? ok(output) : notOk(issue);
708
+ }
703
709
  function instantiateAuthoringEntityType(helperPath, descriptor, args, ctx) {
704
710
  if ("factory" in descriptor.output) {
705
711
  const input = args[0];
@@ -718,6 +724,167 @@ function instantiateAuthoringFieldPreset(descriptor, args) {
718
724
  unique: descriptor.output.unique ?? false
719
725
  };
720
726
  }
727
+ const UNKNOWN_CONTRIBUTOR = "<unknown>";
728
+ /** Merge every component's PSL support for its data types, refusing two claims on one key. */
729
+ function assembleAuthoringDataTypes(components) {
730
+ const merged = {};
731
+ const owners = /* @__PURE__ */ new Map();
732
+ for (const component of components) {
733
+ const contributedBy = component.id ?? UNKNOWN_CONTRIBUTOR;
734
+ for (const [key, entry] of Object.entries(component.authoring?.dataTypes ?? {})) {
735
+ const existingOwner = owners.get(key);
736
+ if (existingOwner !== void 0) throw runtimeError("CONTRACT.DATA_TYPE_ENTRY_DUPLICATE", `Duplicate authoring entry for "${key}". Component "${contributedBy}" conflicts with "${existingOwner}".`, {
737
+ key,
738
+ contributedBy,
739
+ owner: existingOwner
740
+ });
741
+ owners.set(key, contributedBy);
742
+ merged[key] = entry;
743
+ }
744
+ }
745
+ return merged;
746
+ }
747
+ function descriptorsIn(namespace, isLeaf, path = []) {
748
+ return Object.entries(namespace ?? {}).flatMap(([key, value]) => {
749
+ const currentPath = [...path, key];
750
+ if (isLeaf(value)) return [{
751
+ path: currentPath.join("."),
752
+ descriptor: value
753
+ }];
754
+ if (typeof value !== "object" || value === null || Array.isArray(value)) return [];
755
+ return descriptorsIn(value, isLeaf, currentPath);
756
+ });
757
+ }
758
+ /** Every type constructor and field preset a component contributes. */
759
+ function contributedHelpers(component) {
760
+ return [...descriptorsIn(component.authoring?.type, isAuthoringTypeConstructorDescriptor), ...descriptorsIn(component.authoring?.field, isAuthoringFieldPresetDescriptor)].map((entry) => ({
761
+ ...entry,
762
+ contributedBy: component.id ?? UNKNOWN_CONTRIBUTOR
763
+ }));
764
+ }
765
+ /** The data types a contract source can write: each entry's own, and every type a plain-number entry classifies a number as. */
766
+ function writableDataTypes(entries) {
767
+ return new Set(entries.flatMap(({ key, entry }) => [key, ...entry.written.kind === "plain" && entry.written.syntax === "number" ? entry.written.types : []]));
768
+ }
769
+ /** Refuses a value argument whose data type is unregistered, or that no contract source can write, directly or through a cast. */
770
+ function enforceValueArguments(support, contributed, writable) {
771
+ const { path, descriptor, contributedBy } = contributed;
772
+ const kind = descriptor.kind === "typeConstructor" ? "type constructor" : "field preset";
773
+ for (const [index, argument] of (descriptor.args ?? []).entries()) {
774
+ const label = `Argument ${argument.name === void 0 ? `#${index + 1}` : `"${argument.name}"`} of ${kind} "${path}"`;
775
+ if (argument.kind !== "value" && descriptor.kind === "typeConstructor") throw runtimeError("CONTRACT.PACK_CONTRIBUTION_INVALID", `${label} contributed by "${contributedBy}" is a "${argument.kind}" argument, but a type constructor's argument is a value of a data type. Declare it as { kind: 'value', dataType: ... }, naming the data type its value belongs to.`, {
776
+ packId: contributedBy,
777
+ contribution: path,
778
+ reason: "type-constructor-argument-not-a-value"
779
+ });
780
+ if (argument.kind !== "value") continue;
781
+ const type = support.lookup.get(argument.dataType);
782
+ if (type === void 0) throw runtimeError("CONTRACT.DATA_TYPE_UNREGISTERED", `${label} names data type "${argument.dataType}", which no component registers. Contributed by "${contributedBy}".`, {
783
+ dataType: argument.dataType,
784
+ contributedBy
785
+ });
786
+ if (![argument.dataType, ...Object.keys(type.casts)].some((admittedType) => writable.has(admittedType))) throw runtimeError("CONTRACT.DATA_TYPE_NOT_WRITABLE", `${label} contributed by "${contributedBy}" takes a value of data type "${argument.dataType}", which no contract source can write.`, {
787
+ dataType: argument.dataType,
788
+ contributedBy
789
+ });
790
+ }
791
+ }
792
+ function textDataTypesOf(components) {
793
+ return components.flatMap((component) => (component.authoring?.textDataTypes ?? []).map((dataType) => ({
794
+ dataType,
795
+ contributedBy: component.id ?? UNKNOWN_CONTRIBUTOR
796
+ })));
797
+ }
798
+ /**
799
+ * The checks assembly makes across components on their data types, each naming the component and the id at fault:
800
+ *
801
+ * 1. every codec names a registered data type;
802
+ * 2. every authoring entry, and every type a number classifier returns, names a registered data type;
803
+ * 3. every type a cast takes values of is registered and can be written, because a cast from a type nobody can write is never exercised;
804
+ * 4. no two entries claim one tag or one plain form;
805
+ * 5. every text data type a component names is registered.
806
+ */
807
+ function enforceDataTypeAssemblyInvariants(input) {
808
+ const unregistered = (contributedBy, id, what) => {
809
+ throw runtimeError("CONTRACT.DATA_TYPE_UNREGISTERED", `${what} names data type "${id}", which no component registers. Contributed by "${contributedBy}".`, {
810
+ dataType: id,
811
+ contributedBy
812
+ });
813
+ };
814
+ for (const codec of input.codecs) if (!input.lookup.has(codec.dataType)) unregistered(codec.contributedBy, codec.dataType, `Codec "${codec.codecId}"`);
815
+ for (const { key, entry, contributedBy } of input.authoringEntries) {
816
+ if (!input.lookup.has(key)) unregistered(contributedBy, key, "Authoring entry");
817
+ if (entry.written.kind === "plain" && entry.written.syntax === "number") {
818
+ for (const classified of entry.written.types) if (!input.lookup.has(classified)) unregistered(contributedBy, classified, `The classifier of authoring entry "${key}"`);
819
+ }
820
+ }
821
+ for (const { dataType, contributedBy } of input.textDataTypes) if (!input.lookup.has(dataType)) unregistered(contributedBy, dataType, "The text data types");
822
+ const writable = writableDataTypes(input.authoringEntries);
823
+ for (const { type, contributedBy } of input.declaredTypes) {
824
+ const sources = [...Object.keys(type.casts), ...type.listCast?.of ?? []];
825
+ for (const source of sources) {
826
+ if (!input.lookup.has(source)) unregistered(contributedBy, source, `The casts of data type "${type.id}"`);
827
+ if (!writable.has(source)) throw runtimeError("CONTRACT.DATA_TYPE_NOT_WRITABLE", `Data type "${type.id}" casts from "${source}", which no contract source can write, so the cast is never exercised. Contributed by "${contributedBy}".`, {
828
+ dataType: type.id,
829
+ source,
830
+ contributedBy
831
+ });
832
+ }
833
+ }
834
+ const claimants = /* @__PURE__ */ new Map();
835
+ for (const { key, entry, contributedBy } of input.authoringEntries) {
836
+ const written = entry.written;
837
+ const claim = written.kind === "tag" ? `tag "${written.tag}"` : `plain ${written.syntax}`;
838
+ const existing = claimants.get(claim);
839
+ if (existing !== void 0) throw runtimeError("CONTRACT.DATA_TYPE_WRITTEN_FORM_DUPLICATE", `Two authoring entries claim the ${claim}: "${key}" from "${contributedBy}" conflicts with "${existing.key}" from "${existing.contributedBy}".`, {
840
+ claim,
841
+ key,
842
+ contributedBy,
843
+ owner: existing.key,
844
+ ownerContributedBy: existing.contributedBy
845
+ });
846
+ claimants.set(claim, {
847
+ key,
848
+ contributedBy
849
+ });
850
+ }
851
+ }
852
+ /**
853
+ * The data types the components register, with their authoring entries, as every contract source reads values with. Refuses two registrations of one data type or one entry key, every case {@link enforceDataTypeAssemblyInvariants} lists, and a value argument of a type constructor or field preset whose data type is unregistered or that no contract source can write. ADR 254.
854
+ */
855
+ function assembleDataTypeSupport(components, dataTypeOfCodec) {
856
+ const { lookup, declared } = assembleDataTypes(components);
857
+ const entries = assembleAuthoringDataTypes(components);
858
+ const contributedBy = (component) => component.id ?? UNKNOWN_CONTRIBUTOR;
859
+ const authoringEntries = components.flatMap((component) => Object.entries(component.authoring?.dataTypes ?? {}).map(([key, entry]) => ({
860
+ key,
861
+ entry,
862
+ contributedBy: contributedBy(component)
863
+ })));
864
+ enforceDataTypeAssemblyInvariants({
865
+ lookup,
866
+ declaredTypes: declared,
867
+ codecs: components.flatMap((component) => (component.types?.codecTypes?.codecDescriptors ?? []).map(({ codecId, dataType }) => ({
868
+ codecId,
869
+ dataType,
870
+ contributedBy: contributedBy(component)
871
+ }))),
872
+ authoringEntries,
873
+ textDataTypes: textDataTypesOf(components)
874
+ });
875
+ const support = {
876
+ entries,
877
+ lookup,
878
+ dataTypeOfCodec,
879
+ textDataTypes: [...new Set(components.flatMap((component) => component.authoring?.textDataTypes ?? []))]
880
+ };
881
+ const writable = writableDataTypes(authoringEntries);
882
+ for (const contributed of components.flatMap(contributedHelpers)) enforceValueArguments(support, contributed, writable);
883
+ return {
884
+ support,
885
+ declared
886
+ };
887
+ }
721
888
  const TAGGED_LITERAL_MAX_BYTES = 65536;
722
889
  /** The message a tagged literal's canonicalization failure is reported with, in PSL and in TypeScript. */
723
890
  function describeTaggedLiteralFailure(reason) {
@@ -1008,6 +1175,6 @@ function temporalCodecPreset(input) {
1008
1175
  };
1009
1176
  }
1010
1177
  //#endregion
1011
- export { resolvePslBacktickEscapes as A, isAuthoringTypeConstructorDescriptor as C, printedTaggedLiteralReadsBack as D, printTaggedLiteral as E, temporalPhaseTemplateWithParams as F, timestampNowControlDescriptor as I, tsTaggedTemplateSource as L, temporalAuthoringPresets as M, temporalCodecPreset as N, resolveAuthoringTemplateValue as O, temporalPhaseTemplate as P, validateAuthoringHelperArguments as R, isAuthoringSelectRef as S, mergeAuthoringNamespaces as T, isAuthoringArgRef as _, assertNoCrossRegistryCollisions as a, isAuthoringModelAttributeDescriptor as b, classifyEnumMemberType as c, describeTaggedLiteralFailure as d, flushAuthoringWarnings as f, instantiateAuthoringTypeConstructor as g, instantiateAuthoringFieldPreset as h, TIMESTAMP_NOW_GENERATOR_ID as i, resolveTemplateTagEscapes as j, resolveEnumCodecId as k, collectContributedDescriptorPaths as l, instantiateAuthoringEntityType as m, TEMPORAL_ON_CREATE_ARG as n, assertResolvableTypeConstructorTemplates as o, getAuthoringTypeConstructor as p, TEMPORAL_ON_UPDATE_ARG as r, canonicalizeTaggedLiteralBody as s, TAGGED_LITERAL_MAX_BYTES as t, collectScalarTypeConstructors as u, isAuthoringEntityTypeDescriptor as v, mergeAuthoringAttributeSpecs as w, isAuthoringPslBlockDescriptor as x, isAuthoringFieldPresetDescriptor as y, validateAuthoringTypeParams as z };
1178
+ export { printTaggedLiteral as A, timestampNowControlDescriptor as B, isAuthoringFieldPresetDescriptor as C, isAuthoringTypeConstructorDescriptor as D, isAuthoringSelectRef as E, resolveTemplateTagEscapes as F, validateAuthoringHelperArguments as H, temporalAuthoringPresets as I, temporalCodecPreset as L, resolveAuthoringTemplateValue as M, resolveEnumCodecId as N, mergeAuthoringAttributeSpecs as O, resolvePslBacktickEscapes as P, temporalPhaseTemplate as R, isAuthoringEntityTypeDescriptor as S, isAuthoringPslBlockDescriptor as T, validateAuthoringTypeParams as U, tsTaggedTemplateSource as V, instantiateAuthoringEntityType as _, assembleAuthoringDataTypes as a, instantiateAuthoringTypeConstructorFromValues as b, assertResolvableTypeConstructorTemplates as c, collectContributedDescriptorPaths as d, collectScalarTypeConstructors as f, getAuthoringTypeConstructor as g, flushAuthoringWarnings as h, TIMESTAMP_NOW_GENERATOR_ID as i, printedTaggedLiteralReadsBack as j, mergeAuthoringNamespaces as k, canonicalizeTaggedLiteralBody as l, describeTaggedLiteralFailure as m, TEMPORAL_ON_CREATE_ARG as n, assembleDataTypeSupport as o, contributedHelpers as p, TEMPORAL_ON_UPDATE_ARG as r, assertNoCrossRegistryCollisions as s, TAGGED_LITERAL_MAX_BYTES as t, classifyEnumMemberType as u, instantiateAuthoringFieldPreset as v, isAuthoringModelAttributeDescriptor as w, isAuthoringArgRef as x, instantiateAuthoringTypeConstructor as y, temporalPhaseTemplateWithParams as z };
1012
1179
 
1013
- //# sourceMappingURL=temporal-presets-BcDyr_hK-CFplJNGz.mjs.map
1180
+ //# sourceMappingURL=temporal-presets-DmZDnaZV-aUZPt1LX.mjs.map