@aestheticfunction/dspack-emit 0.4.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -6
- package/dist/cli.js +56 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.js +3 -1
- package/dist/targets/a2ui/diagnostics.d.ts +110 -0
- package/dist/targets/a2ui/diagnostics.js +94 -0
- package/dist/targets/a2ui/surface.d.ts +28 -9
- package/dist/targets/a2ui/surface.js +1004 -222
- package/dist/transform/desugar.d.ts +32 -0
- package/dist/transform/desugar.js +156 -0
- package/dist/transform/emit.js +59 -0
- package/dist/transform/index.js +4 -0
- package/dist/transform/mapping.d.ts +0 -6
- package/dist/transform/mapping.js +66 -2
- package/dist/transform/model.d.ts +368 -0
- package/dist/transform/model.js +169 -0
- package/dist/transform/parse-v2.d.ts +109 -0
- package/dist/transform/parse-v2.js +479 -0
- package/dist/transform/profile-load.d.ts +7 -6
- package/dist/transform/profile-load.js +99 -20
- package/dist/transform/profile-schema-v2.d.ts +9 -0
- package/dist/transform/profile-schema-v2.js +608 -0
- package/dist/transform/profiles.d.ts +31 -1
- package/dist/transform/scaffold.d.ts +29 -12
- package/dist/transform/scaffold.js +91 -31
- package/dist/transform/shadcn-v2-respelling.d.ts +77 -0
- package/dist/transform/shadcn-v2-respelling.js +456 -0
- package/dist/transform/validate-v2.d.ts +36 -0
- package/dist/transform/validate-v2.js +136 -0
- package/dist/types.d.ts +23 -0
- package/dist/validate/ajv.js +96 -25
- package/dist/validate/meta/a2ui-catalog.meta.0_9_1.json +39 -0
- package/dist/validate/meta/a2ui-catalog.meta.1_0.json +34 -0
- package/package.json +2 -2
- package/src/__snapshots__/byte-neutral.test.ts.snap +66 -0
- package/src/a0.test.ts +235 -0
- package/src/byte-neutral.test.ts +246 -0
- package/src/cli.ts +60 -0
- package/src/dangling-ref.test.ts +118 -0
- package/src/desugar.test.ts +162 -0
- package/src/engine-boundary.test.ts +248 -0
- package/src/eval-fixture.test.ts +102 -0
- package/src/functions.test.ts +182 -0
- package/src/index.ts +4 -1
- package/src/layered-dissolution.test.ts +139 -0
- package/src/profile-load.test.ts +99 -1
- package/src/profile-v2.test.ts +369 -0
- package/src/review-findings.test.ts +292 -0
- package/src/schema-mirrors.test.ts +5 -0
- package/src/surface-fidelity.test.ts +213 -0
- package/src/t1.test.ts +369 -0
- package/src/t2.test.ts +222 -0
- package/src/t3.test.ts +304 -0
- package/src/t4.test.ts +278 -0
- package/src/targets/a2ui/diagnostics.ts +136 -0
- package/src/targets/a2ui/surface.ts +1468 -235
- package/src/transform/desugar.ts +194 -0
- package/src/transform/emit.ts +65 -0
- package/src/transform/index.ts +5 -0
- package/src/transform/mapping.ts +60 -2
- package/src/transform/model.ts +427 -0
- package/src/transform/parse-v2.ts +608 -0
- package/src/transform/profile-load.ts +104 -22
- package/src/transform/profile-schema-v2.ts +608 -0
- package/src/transform/profile.v2.schema.json +600 -0
- package/src/transform/profiles.ts +32 -1
- package/src/transform/scaffold.ts +124 -47
- package/src/transform/shadcn-v2-respelling.ts +475 -0
- package/src/transform/validate-v2.ts +174 -0
- package/src/types.ts +32 -0
- package/src/validate/ajv.ts +89 -26
- package/src/validate-v2.test.ts +173 -0
|
@@ -0,0 +1,600 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://aestheticfunction.github.io/dspack-emit/schema/profile.v2.schema.json",
|
|
4
|
+
"title": "dspack-emit a2ui Profile v2",
|
|
5
|
+
"description": "JSON form of the a2ui target's mapping Profile, second language. A v2 plan authors the internal transformation model directly \u2014 Identity / Route / Collect in a closed string syntax \u2014 instead of the v1 surface-plan directives. One profile language per document: this schema refuses `surfacePlan` and `subCoverage`; profile.v1.schema.json refuses `surface` and `functions`. loadProfile() dispatches on `profileVersion` and validates against exactly one of the two.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"patternProperties": {
|
|
9
|
+
"^x-": {}
|
|
10
|
+
},
|
|
11
|
+
"required": [
|
|
12
|
+
"profileVersion",
|
|
13
|
+
"catalogTitle",
|
|
14
|
+
"catalogDescription",
|
|
15
|
+
"catalogIdBase",
|
|
16
|
+
"instructions",
|
|
17
|
+
"primaryColorToken",
|
|
18
|
+
"components",
|
|
19
|
+
"synthesized",
|
|
20
|
+
"casualtyComponents",
|
|
21
|
+
"surfaceSynthesis"
|
|
22
|
+
],
|
|
23
|
+
"properties": {
|
|
24
|
+
"profileVersion": {
|
|
25
|
+
"const": "2"
|
|
26
|
+
},
|
|
27
|
+
"catalogTitle": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"minLength": 1
|
|
30
|
+
},
|
|
31
|
+
"catalogDescription": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"minLength": 1
|
|
34
|
+
},
|
|
35
|
+
"catalogIdBase": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"format": "uri",
|
|
38
|
+
"pattern": "^https://"
|
|
39
|
+
},
|
|
40
|
+
"instructions": {
|
|
41
|
+
"type": "string"
|
|
42
|
+
},
|
|
43
|
+
"primaryColorToken": {
|
|
44
|
+
"type": "object",
|
|
45
|
+
"additionalProperties": false,
|
|
46
|
+
"required": [
|
|
47
|
+
"category",
|
|
48
|
+
"name"
|
|
49
|
+
],
|
|
50
|
+
"properties": {
|
|
51
|
+
"category": {
|
|
52
|
+
"type": "string",
|
|
53
|
+
"minLength": 1
|
|
54
|
+
},
|
|
55
|
+
"name": {
|
|
56
|
+
"type": "string",
|
|
57
|
+
"minLength": 1
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"components": {
|
|
62
|
+
"type": "array",
|
|
63
|
+
"items": {
|
|
64
|
+
"$ref": "#/$defs/componentPlan"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"synthesized": {
|
|
68
|
+
"type": "array",
|
|
69
|
+
"items": {
|
|
70
|
+
"$ref": "#/$defs/componentPlan"
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"casualtyComponents": {
|
|
74
|
+
"type": "array",
|
|
75
|
+
"items": {
|
|
76
|
+
"type": "object",
|
|
77
|
+
"additionalProperties": false,
|
|
78
|
+
"patternProperties": {
|
|
79
|
+
"^x-": {}
|
|
80
|
+
},
|
|
81
|
+
"required": [
|
|
82
|
+
"dspackId",
|
|
83
|
+
"attempted",
|
|
84
|
+
"class",
|
|
85
|
+
"reason"
|
|
86
|
+
],
|
|
87
|
+
"properties": {
|
|
88
|
+
"dspackId": {
|
|
89
|
+
"$ref": "#/$defs/dspackId"
|
|
90
|
+
},
|
|
91
|
+
"attempted": {
|
|
92
|
+
"type": "string",
|
|
93
|
+
"minLength": 1
|
|
94
|
+
},
|
|
95
|
+
"class": {
|
|
96
|
+
"enum": [
|
|
97
|
+
"maps-cleanly",
|
|
98
|
+
"synthesis-defaults",
|
|
99
|
+
"lossy",
|
|
100
|
+
"cannot-represent"
|
|
101
|
+
]
|
|
102
|
+
},
|
|
103
|
+
"reason": {
|
|
104
|
+
"type": "string",
|
|
105
|
+
"minLength": 1
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
"intentionallyOmitted": {
|
|
111
|
+
"type": "array",
|
|
112
|
+
"items": {
|
|
113
|
+
"$ref": "#/$defs/dspackId"
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
"surfaceSynthesis": {
|
|
117
|
+
"type": "object",
|
|
118
|
+
"additionalProperties": false,
|
|
119
|
+
"required": [
|
|
120
|
+
"textComponent",
|
|
121
|
+
"textProp",
|
|
122
|
+
"wrapComponent",
|
|
123
|
+
"wrapChildrenProp"
|
|
124
|
+
],
|
|
125
|
+
"properties": {
|
|
126
|
+
"textComponent": {
|
|
127
|
+
"$ref": "#/$defs/a2uiName"
|
|
128
|
+
},
|
|
129
|
+
"textProp": {
|
|
130
|
+
"type": "string",
|
|
131
|
+
"minLength": 1
|
|
132
|
+
},
|
|
133
|
+
"wrapComponent": {
|
|
134
|
+
"$ref": "#/$defs/a2uiName"
|
|
135
|
+
},
|
|
136
|
+
"wrapChildrenProp": {
|
|
137
|
+
"type": "string",
|
|
138
|
+
"minLength": 1
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
"functions": {
|
|
143
|
+
"type": "object",
|
|
144
|
+
"description": "A2UI catalog functions this profile declares, keyed by call name. Emitted into the catalog's functions section and enforced on every FunctionCall: an instance calling an undeclared function fails gate A3. Definitions are declarative schemas for the call's args \u2014 never executable code.",
|
|
145
|
+
"propertyNames": {
|
|
146
|
+
"pattern": "^[a-z][A-Za-z0-9]*$"
|
|
147
|
+
},
|
|
148
|
+
"additionalProperties": {
|
|
149
|
+
"type": "object",
|
|
150
|
+
"additionalProperties": false,
|
|
151
|
+
"required": [
|
|
152
|
+
"description",
|
|
153
|
+
"returns"
|
|
154
|
+
],
|
|
155
|
+
"properties": {
|
|
156
|
+
"description": {
|
|
157
|
+
"type": "string",
|
|
158
|
+
"minLength": 1
|
|
159
|
+
},
|
|
160
|
+
"returns": {
|
|
161
|
+
"enum": [
|
|
162
|
+
"string",
|
|
163
|
+
"number",
|
|
164
|
+
"boolean",
|
|
165
|
+
"array",
|
|
166
|
+
"object"
|
|
167
|
+
]
|
|
168
|
+
},
|
|
169
|
+
"args": {
|
|
170
|
+
"type": "object",
|
|
171
|
+
"description": "JSON Schema (object form) validating the call's args object; omit for arg-less functions."
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
"$defs": {
|
|
178
|
+
"dspackId": {
|
|
179
|
+
"type": "string",
|
|
180
|
+
"pattern": "^[a-z][a-z0-9-]*$"
|
|
181
|
+
},
|
|
182
|
+
"a2uiName": {
|
|
183
|
+
"type": "string",
|
|
184
|
+
"pattern": "^[A-Z][A-Za-z0-9]*$"
|
|
185
|
+
},
|
|
186
|
+
"componentPlan": {
|
|
187
|
+
"type": "object",
|
|
188
|
+
"additionalProperties": false,
|
|
189
|
+
"patternProperties": {
|
|
190
|
+
"^x-": {}
|
|
191
|
+
},
|
|
192
|
+
"required": [
|
|
193
|
+
"a2ui",
|
|
194
|
+
"commons",
|
|
195
|
+
"structural",
|
|
196
|
+
"required"
|
|
197
|
+
],
|
|
198
|
+
"properties": {
|
|
199
|
+
"a2ui": {
|
|
200
|
+
"$ref": "#/$defs/a2uiName"
|
|
201
|
+
},
|
|
202
|
+
"dspackId": {
|
|
203
|
+
"$ref": "#/$defs/dspackId"
|
|
204
|
+
},
|
|
205
|
+
"description": {
|
|
206
|
+
"type": "string"
|
|
207
|
+
},
|
|
208
|
+
"commons": {
|
|
209
|
+
"type": "array",
|
|
210
|
+
"items": {
|
|
211
|
+
"type": "string",
|
|
212
|
+
"minLength": 1
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
"structural": {
|
|
216
|
+
"type": "object",
|
|
217
|
+
"additionalProperties": {
|
|
218
|
+
"type": "object",
|
|
219
|
+
"additionalProperties": false,
|
|
220
|
+
"required": [
|
|
221
|
+
"schema",
|
|
222
|
+
"description",
|
|
223
|
+
"synthNote"
|
|
224
|
+
],
|
|
225
|
+
"properties": {
|
|
226
|
+
"schema": {},
|
|
227
|
+
"description": {
|
|
228
|
+
"type": "string",
|
|
229
|
+
"minLength": 1
|
|
230
|
+
},
|
|
231
|
+
"synthNote": {
|
|
232
|
+
"type": "string",
|
|
233
|
+
"minLength": 1
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
"propMap": {
|
|
239
|
+
"type": "object",
|
|
240
|
+
"additionalProperties": {
|
|
241
|
+
"type": "object",
|
|
242
|
+
"additionalProperties": false,
|
|
243
|
+
"required": [
|
|
244
|
+
"a2ui",
|
|
245
|
+
"kind"
|
|
246
|
+
],
|
|
247
|
+
"properties": {
|
|
248
|
+
"a2ui": {
|
|
249
|
+
"type": "string",
|
|
250
|
+
"minLength": 1
|
|
251
|
+
},
|
|
252
|
+
"kind": {
|
|
253
|
+
"enum": [
|
|
254
|
+
"enum",
|
|
255
|
+
"string",
|
|
256
|
+
"boolean",
|
|
257
|
+
"number"
|
|
258
|
+
]
|
|
259
|
+
},
|
|
260
|
+
"targetEnum": {
|
|
261
|
+
"type": "array",
|
|
262
|
+
"items": {
|
|
263
|
+
"type": "string"
|
|
264
|
+
},
|
|
265
|
+
"minItems": 1
|
|
266
|
+
},
|
|
267
|
+
"valueMap": {
|
|
268
|
+
"type": "object",
|
|
269
|
+
"additionalProperties": {
|
|
270
|
+
"type": "string"
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
"default": {
|
|
274
|
+
"type": "string"
|
|
275
|
+
},
|
|
276
|
+
"description": {
|
|
277
|
+
"type": "string"
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
"required": {
|
|
283
|
+
"type": "array",
|
|
284
|
+
"items": {
|
|
285
|
+
"type": "string"
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
"surface": {
|
|
289
|
+
"type": "object",
|
|
290
|
+
"additionalProperties": false,
|
|
291
|
+
"patternProperties": {
|
|
292
|
+
"^x-": {}
|
|
293
|
+
},
|
|
294
|
+
"properties": {
|
|
295
|
+
"transparent": {
|
|
296
|
+
"oneOf": [
|
|
297
|
+
{
|
|
298
|
+
"const": true
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
"type": "object",
|
|
302
|
+
"additionalProperties": false,
|
|
303
|
+
"required": [
|
|
304
|
+
"donate"
|
|
305
|
+
],
|
|
306
|
+
"properties": {
|
|
307
|
+
"donate": {
|
|
308
|
+
"type": "array",
|
|
309
|
+
"minItems": 1,
|
|
310
|
+
"items": {
|
|
311
|
+
"type": "object",
|
|
312
|
+
"additionalProperties": false,
|
|
313
|
+
"required": [
|
|
314
|
+
"from",
|
|
315
|
+
"to"
|
|
316
|
+
],
|
|
317
|
+
"properties": {
|
|
318
|
+
"from": {
|
|
319
|
+
"type": "string",
|
|
320
|
+
"pattern": "^(self\\.text|sub\\([a-z][a-z0-9-]*(\\|[a-z][a-z0-9-]*)*\\)\\.text)$"
|
|
321
|
+
},
|
|
322
|
+
"to": {
|
|
323
|
+
"type": "string",
|
|
324
|
+
"pattern": "^prop:[A-Za-z][A-Za-z0-9]*$"
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
]
|
|
332
|
+
},
|
|
333
|
+
"routes": {
|
|
334
|
+
"type": "array",
|
|
335
|
+
"items": {
|
|
336
|
+
"type": "object",
|
|
337
|
+
"additionalProperties": false,
|
|
338
|
+
"required": [
|
|
339
|
+
"from",
|
|
340
|
+
"to"
|
|
341
|
+
],
|
|
342
|
+
"properties": {
|
|
343
|
+
"from": {
|
|
344
|
+
"type": "array",
|
|
345
|
+
"minItems": 1,
|
|
346
|
+
"description": "Ordered fallback chain; the first selector that yields a value wins.",
|
|
347
|
+
"items": {
|
|
348
|
+
"type": "string",
|
|
349
|
+
"pattern": "^(self\\.text|self\\.props\\.[A-Za-z][A-Za-z0-9]*|sub\\([a-z][a-z0-9-]*(\\|[a-z][a-z0-9-]*)*\\)\\.(text|label|firstText|subtreeText|children)|children|synthesized\\.action)$"
|
|
350
|
+
}
|
|
351
|
+
},
|
|
352
|
+
"to": {
|
|
353
|
+
"type": "string",
|
|
354
|
+
"pattern": "^(prop|textChild|slot|slots|action):[A-Za-z][A-Za-z0-9]*$"
|
|
355
|
+
},
|
|
356
|
+
"overwrite": {
|
|
357
|
+
"type": "boolean"
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
},
|
|
362
|
+
"collects": {
|
|
363
|
+
"type": "array",
|
|
364
|
+
"items": {
|
|
365
|
+
"oneOf": [
|
|
366
|
+
{
|
|
367
|
+
"type": "object",
|
|
368
|
+
"additionalProperties": false,
|
|
369
|
+
"required": [
|
|
370
|
+
"of",
|
|
371
|
+
"into",
|
|
372
|
+
"item"
|
|
373
|
+
],
|
|
374
|
+
"properties": {
|
|
375
|
+
"of": {
|
|
376
|
+
"type": "array",
|
|
377
|
+
"minItems": 1,
|
|
378
|
+
"items": {
|
|
379
|
+
"type": "string",
|
|
380
|
+
"pattern": "^[a-z][a-z0-9-]*$"
|
|
381
|
+
}
|
|
382
|
+
},
|
|
383
|
+
"into": {
|
|
384
|
+
"type": "string",
|
|
385
|
+
"pattern": "^prop:[A-Za-z][A-Za-z0-9]*$"
|
|
386
|
+
},
|
|
387
|
+
"item": {
|
|
388
|
+
"type": "object",
|
|
389
|
+
"minProperties": 1,
|
|
390
|
+
"propertyNames": {
|
|
391
|
+
"pattern": "^[A-Za-z][A-Za-z0-9]*$"
|
|
392
|
+
},
|
|
393
|
+
"additionalProperties": {
|
|
394
|
+
"type": "string",
|
|
395
|
+
"pattern": "^(self\\.text|self\\.id|self\\.props\\.[A-Za-z][A-Za-z0-9]*)$"
|
|
396
|
+
},
|
|
397
|
+
"description": "T2 item-mode: one record per matching descendant; fields resolve on the item's own node (self.text, self.props.<prop>, self.id). Joins and sibling reads are T3."
|
|
398
|
+
},
|
|
399
|
+
"join": {
|
|
400
|
+
"type": "object",
|
|
401
|
+
"additionalProperties": false,
|
|
402
|
+
"required": [
|
|
403
|
+
"with",
|
|
404
|
+
"on",
|
|
405
|
+
"fields"
|
|
406
|
+
],
|
|
407
|
+
"properties": {
|
|
408
|
+
"with": {
|
|
409
|
+
"type": "array",
|
|
410
|
+
"minItems": 1,
|
|
411
|
+
"items": {
|
|
412
|
+
"type": "string",
|
|
413
|
+
"pattern": "^[a-z][a-z0-9-]*$"
|
|
414
|
+
}
|
|
415
|
+
},
|
|
416
|
+
"on": {
|
|
417
|
+
"type": "object",
|
|
418
|
+
"additionalProperties": false,
|
|
419
|
+
"required": [
|
|
420
|
+
"left",
|
|
421
|
+
"right"
|
|
422
|
+
],
|
|
423
|
+
"properties": {
|
|
424
|
+
"left": {
|
|
425
|
+
"type": "string",
|
|
426
|
+
"pattern": "^(self\\.text|self\\.id|self\\.props\\.[A-Za-z][A-Za-z0-9]*)$"
|
|
427
|
+
},
|
|
428
|
+
"right": {
|
|
429
|
+
"type": "string",
|
|
430
|
+
"pattern": "^(self\\.text|self\\.id|self\\.props\\.[A-Za-z][A-Za-z0-9]*)$"
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
},
|
|
434
|
+
"fields": {
|
|
435
|
+
"type": "object",
|
|
436
|
+
"minProperties": 1,
|
|
437
|
+
"propertyNames": {
|
|
438
|
+
"pattern": "^[A-Za-z][A-Za-z0-9]*$"
|
|
439
|
+
},
|
|
440
|
+
"additionalProperties": {
|
|
441
|
+
"type": "string",
|
|
442
|
+
"pattern": "^(children|self\\.text|self\\.id|self\\.props\\.[A-Za-z][A-Za-z0-9]*)$"
|
|
443
|
+
},
|
|
444
|
+
"description": "Record fields sourced from the JOINED side \u2014 item-local selectors, or the literal \"children\" for the slot-valued field (the counterpart's children emit as instances; the record carries the reference)."
|
|
445
|
+
},
|
|
446
|
+
"optional": {
|
|
447
|
+
"type": "boolean",
|
|
448
|
+
"description": "0..1 counterparts allowed when true; exactly one required otherwise."
|
|
449
|
+
}
|
|
450
|
+
},
|
|
451
|
+
"description": "T3 declared key join onto a sibling sub-family. The profile names the relation; the emitter never infers one \u2014 no positional pairing, no nearest-sibling, no similarity."
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
"type": "object",
|
|
457
|
+
"additionalProperties": false,
|
|
458
|
+
"required": [
|
|
459
|
+
"of",
|
|
460
|
+
"into",
|
|
461
|
+
"shape",
|
|
462
|
+
"row",
|
|
463
|
+
"cells"
|
|
464
|
+
],
|
|
465
|
+
"properties": {
|
|
466
|
+
"of": {
|
|
467
|
+
"type": "array",
|
|
468
|
+
"minItems": 1,
|
|
469
|
+
"items": {
|
|
470
|
+
"type": "string",
|
|
471
|
+
"pattern": "^[a-z][a-z0-9-]*$"
|
|
472
|
+
}
|
|
473
|
+
},
|
|
474
|
+
"into": {
|
|
475
|
+
"type": "string",
|
|
476
|
+
"pattern": "^prop:[A-Za-z][A-Za-z0-9]*$"
|
|
477
|
+
},
|
|
478
|
+
"shape": {
|
|
479
|
+
"enum": [
|
|
480
|
+
"flat",
|
|
481
|
+
"records"
|
|
482
|
+
]
|
|
483
|
+
},
|
|
484
|
+
"field": {
|
|
485
|
+
"type": "string",
|
|
486
|
+
"pattern": "^[A-Za-z][A-Za-z0-9]*$"
|
|
487
|
+
},
|
|
488
|
+
"row": {
|
|
489
|
+
"type": "array",
|
|
490
|
+
"minItems": 1,
|
|
491
|
+
"items": {
|
|
492
|
+
"type": "string",
|
|
493
|
+
"pattern": "^[a-z][a-z0-9-]*$"
|
|
494
|
+
}
|
|
495
|
+
},
|
|
496
|
+
"cells": {
|
|
497
|
+
"type": "array",
|
|
498
|
+
"minItems": 1,
|
|
499
|
+
"items": {
|
|
500
|
+
"type": "string",
|
|
501
|
+
"pattern": "^[a-z][a-z0-9-]*$"
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
]
|
|
507
|
+
}
|
|
508
|
+
},
|
|
509
|
+
"subs": {
|
|
510
|
+
"type": "object",
|
|
511
|
+
"propertyNames": {
|
|
512
|
+
"pattern": "^[a-z][a-z0-9-]*$"
|
|
513
|
+
},
|
|
514
|
+
"additionalProperties": {
|
|
515
|
+
"oneOf": [
|
|
516
|
+
{
|
|
517
|
+
"const": "transparent"
|
|
518
|
+
},
|
|
519
|
+
{
|
|
520
|
+
"type": "object",
|
|
521
|
+
"additionalProperties": false,
|
|
522
|
+
"required": [
|
|
523
|
+
"transparent"
|
|
524
|
+
],
|
|
525
|
+
"properties": {
|
|
526
|
+
"transparent": {
|
|
527
|
+
"oneOf": [
|
|
528
|
+
{
|
|
529
|
+
"const": true
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
"type": "object",
|
|
533
|
+
"additionalProperties": false,
|
|
534
|
+
"required": [
|
|
535
|
+
"donate"
|
|
536
|
+
],
|
|
537
|
+
"properties": {
|
|
538
|
+
"donate": {
|
|
539
|
+
"type": "array",
|
|
540
|
+
"minItems": 1,
|
|
541
|
+
"items": {
|
|
542
|
+
"type": "object",
|
|
543
|
+
"additionalProperties": false,
|
|
544
|
+
"required": [
|
|
545
|
+
"from",
|
|
546
|
+
"to"
|
|
547
|
+
],
|
|
548
|
+
"properties": {
|
|
549
|
+
"from": {
|
|
550
|
+
"type": "string",
|
|
551
|
+
"pattern": "^(self\\.text|sub\\([a-z][a-z0-9-]*(\\|[a-z][a-z0-9-]*)*\\)\\.text)$"
|
|
552
|
+
},
|
|
553
|
+
"to": {
|
|
554
|
+
"type": "string",
|
|
555
|
+
"pattern": "^prop:[A-Za-z][A-Za-z0-9]*$"
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
]
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
},
|
|
566
|
+
{
|
|
567
|
+
"type": "object",
|
|
568
|
+
"additionalProperties": false,
|
|
569
|
+
"required": [
|
|
570
|
+
"asText"
|
|
571
|
+
],
|
|
572
|
+
"properties": {
|
|
573
|
+
"asText": {
|
|
574
|
+
"type": "string",
|
|
575
|
+
"minLength": 1
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
},
|
|
579
|
+
{
|
|
580
|
+
"type": "object",
|
|
581
|
+
"additionalProperties": false,
|
|
582
|
+
"required": [
|
|
583
|
+
"drop"
|
|
584
|
+
],
|
|
585
|
+
"properties": {
|
|
586
|
+
"drop": {
|
|
587
|
+
"type": "string",
|
|
588
|
+
"minLength": 1
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
]
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
}
|
|
@@ -44,6 +44,30 @@ export interface Profile {
|
|
|
44
44
|
wrapComponent: string;
|
|
45
45
|
wrapChildrenProp: string;
|
|
46
46
|
};
|
|
47
|
+
/**
|
|
48
|
+
* A2UI catalog functions this profile declares (v2 language only), keyed by
|
|
49
|
+
* call name. Emitted into the catalog's `functions` section and enforced on
|
|
50
|
+
* every FunctionCall an instance makes: calling an undeclared function fails
|
|
51
|
+
* gate A3. Definitions are declarative schemas for the call's args — the
|
|
52
|
+
* implementations live in renderers, exactly as A2UI intends; nothing
|
|
53
|
+
* executable can be expressed here.
|
|
54
|
+
*/
|
|
55
|
+
functions?: Record<string, FunctionPlan>;
|
|
56
|
+
/**
|
|
57
|
+
* Which profile language this Profile was loaded from. Stamped by
|
|
58
|
+
* loadProfile ("v2" only); absent for v1 documents and TS-authored
|
|
59
|
+
* profiles. The transform layer keys fail-closed contract validation on it —
|
|
60
|
+
* v1 behaviour is frozen, v2 refuses what v1 merely warned about.
|
|
61
|
+
*/
|
|
62
|
+
language?: "v2";
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** One declared A2UI catalog function: the schema of its wire-level call. */
|
|
66
|
+
export interface FunctionPlan {
|
|
67
|
+
description: string;
|
|
68
|
+
returns: "string" | "number" | "boolean" | "array" | "object";
|
|
69
|
+
/** JSON Schema (object form) validating the call's `args`; omit when arg-less. */
|
|
70
|
+
args?: Record<string, unknown>;
|
|
47
71
|
}
|
|
48
72
|
|
|
49
73
|
export interface ComponentPlan {
|
|
@@ -60,8 +84,15 @@ export interface ComponentPlan {
|
|
|
60
84
|
propMap?: Record<string, PropPlan>;
|
|
61
85
|
/** A2UI required property names (the `component` const is added automatically). */
|
|
62
86
|
required: string[];
|
|
63
|
-
/** How the surface emitter projects a dspack-surface node onto this component. */
|
|
87
|
+
/** How the surface emitter projects a dspack-surface node onto this component (v1 language). */
|
|
64
88
|
surfacePlan?: SurfacePlanDirectives;
|
|
89
|
+
/**
|
|
90
|
+
* The v2 spelling of the same question, authored in the internal
|
|
91
|
+
* Identity / Route / Collect vocabulary (see parse-v2.ts). A plan carries
|
|
92
|
+
* one language or the other, never both — the schemas enforce it per
|
|
93
|
+
* document, and surfaceModelOf dispatches on which is present.
|
|
94
|
+
*/
|
|
95
|
+
surface?: import("./parse-v2.js").SurfaceV2;
|
|
65
96
|
/**
|
|
66
97
|
* Explicit per-sub-component disposition for compound components: every
|
|
67
98
|
* contract sub id -> one line naming how the surface emitter treats it
|