@aestheticfunction/dspack-emit 0.7.0 → 0.8.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 +18 -12
- package/dist/cli.js +4 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/transform/emit-v1_0.d.ts +45 -0
- package/dist/transform/emit-v1_0.js +190 -0
- package/dist/transform/emit.d.ts +6 -9
- package/dist/transform/emit.js +5 -44
- package/dist/transform/index.js +3 -1
- package/dist/types.d.ts +4 -0
- package/dist/validate/ajv.d.ts +7 -0
- package/dist/validate/ajv.js +73 -11
- package/dist/validate/meta/a2ui-v1_0.d.ts +9 -0
- package/dist/validate/meta/a2ui-v1_0.js +811 -0
- package/dist/validate/meta/catalog-meta.js +34 -21
- package/package.json +1 -1
- package/src/byte-neutral.test.ts +6 -3
- package/src/cli.ts +5 -2
- package/src/functions.test.ts +48 -1
- package/src/index.ts +1 -1
- package/src/profile-v2.test.ts +1 -1
- package/src/transform/emit-v1_0.ts +215 -0
- package/src/transform/emit.ts +10 -54
- package/src/transform/index.ts +3 -1
- package/src/transform.test.ts +33 -1
- package/src/types.ts +4 -0
- package/src/v1_0-catalog.test.ts +267 -0
- package/src/validate/ajv.ts +74 -11
- package/src/validate/meta/a2ui-catalog.meta.1_0.json +67 -13
- package/src/validate/meta/a2ui-v1_0.ts +820 -0
- package/src/validate/meta/catalog-meta.ts +34 -21
|
@@ -0,0 +1,820 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime mirrors of the pinned A2UI 1.0 schemas (fixtures/a2ui/PIN.md): the official catalog definition, which is the
|
|
3
|
+
* 1.0 catalog-shape gate, and the final common_types, which a 1.0 catalog references for every standard type. They are
|
|
4
|
+
* constants because validation must also run in a browser bundle; src/schema-mirrors.test.ts keeps each identical to
|
|
5
|
+
* its vendored file. Do not edit by hand: re-vendor the fixture and regenerate this module.
|
|
6
|
+
*/
|
|
7
|
+
import type { Json } from "../../types.js";
|
|
8
|
+
|
|
9
|
+
export const catalogDefinitionV1_0: Json = {
|
|
10
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
11
|
+
"$id": "https://a2ui.org/specification/v1_0/catalog_definition.json",
|
|
12
|
+
"title": "A2UI Catalog Definition Schema",
|
|
13
|
+
"description": "A collection of component and function definitions.",
|
|
14
|
+
"type": "object",
|
|
15
|
+
"properties": {
|
|
16
|
+
"$schema": {
|
|
17
|
+
"type": "string"
|
|
18
|
+
},
|
|
19
|
+
"$id": {
|
|
20
|
+
"type": "string"
|
|
21
|
+
},
|
|
22
|
+
"protocolVersion": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"pattern": "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(?:\\.(0|[1-9][0-9]*))?(?:-((?:0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",
|
|
25
|
+
"default": "0.9",
|
|
26
|
+
"description": "The A2UI specification version of this catalog definition (e.g. '1.0'). Defaults to '0.9' if omitted."
|
|
27
|
+
},
|
|
28
|
+
"$defs": {
|
|
29
|
+
"type": "object",
|
|
30
|
+
"description": "Standardized schema definitions referenced from outside the catalog file, and custom leaf definitions.",
|
|
31
|
+
"properties": {
|
|
32
|
+
"anyComponent": {
|
|
33
|
+
"title": "A2UI Any Component Schema",
|
|
34
|
+
"description": "Unified validation schema for all components.",
|
|
35
|
+
"$ref": "https://json-schema.org/draft/2020-12/schema"
|
|
36
|
+
},
|
|
37
|
+
"anyFunction": {
|
|
38
|
+
"title": "A2UI Any Function Schema",
|
|
39
|
+
"description": "Unified validation schema for all functions.",
|
|
40
|
+
"$ref": "https://json-schema.org/draft/2020-12/schema"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"required": [
|
|
44
|
+
"anyComponent",
|
|
45
|
+
"anyFunction"
|
|
46
|
+
],
|
|
47
|
+
"additionalProperties": {
|
|
48
|
+
"$ref": "#/$defs/LeafDefinition"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"title": {
|
|
52
|
+
"type": "string",
|
|
53
|
+
"description": "The title of the catalog."
|
|
54
|
+
},
|
|
55
|
+
"description": {
|
|
56
|
+
"type": "string",
|
|
57
|
+
"description": "A human-readable description of the catalog."
|
|
58
|
+
},
|
|
59
|
+
"catalogId": {
|
|
60
|
+
"type": "string",
|
|
61
|
+
"description": "Unique identifier for this catalog."
|
|
62
|
+
},
|
|
63
|
+
"metadata": {
|
|
64
|
+
"type": "object",
|
|
65
|
+
"description": "Optional catalog-level metadata.",
|
|
66
|
+
"properties": {
|
|
67
|
+
"extensions": {
|
|
68
|
+
"$ref": "common_types.json#/$defs/Extensions"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"additionalProperties": false
|
|
72
|
+
},
|
|
73
|
+
"instructions": {
|
|
74
|
+
"type": "string",
|
|
75
|
+
"description": "Markdown-formatted design guidelines or instructions specific to this catalog."
|
|
76
|
+
},
|
|
77
|
+
"components": {
|
|
78
|
+
"type": "object",
|
|
79
|
+
"description": "Definitions for UI components supported by this catalog.",
|
|
80
|
+
"propertyNames": {
|
|
81
|
+
"not": {
|
|
82
|
+
"const": "Surface"
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"additionalProperties": {
|
|
86
|
+
"$ref": "#/$defs/ComponentDefinition"
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"functions": {
|
|
90
|
+
"type": "object",
|
|
91
|
+
"description": "Definitions for functions supported by this catalog.",
|
|
92
|
+
"additionalProperties": {
|
|
93
|
+
"$ref": "#/$defs/FunctionDefinition"
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"required": [
|
|
98
|
+
"catalogId"
|
|
99
|
+
],
|
|
100
|
+
"additionalProperties": false,
|
|
101
|
+
"$defs": {
|
|
102
|
+
"FunctionCallValidationSchema": {
|
|
103
|
+
"type": "object",
|
|
104
|
+
"description": "JSON Schema structure that validates a wire-level FunctionCall object.",
|
|
105
|
+
"properties": {
|
|
106
|
+
"type": {
|
|
107
|
+
"const": "object"
|
|
108
|
+
},
|
|
109
|
+
"description": {
|
|
110
|
+
"type": "string"
|
|
111
|
+
},
|
|
112
|
+
"properties": {
|
|
113
|
+
"type": "object",
|
|
114
|
+
"properties": {
|
|
115
|
+
"@call": {
|
|
116
|
+
"type": "object",
|
|
117
|
+
"properties": {
|
|
118
|
+
"const": {
|
|
119
|
+
"type": "string"
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
"required": [
|
|
123
|
+
"const"
|
|
124
|
+
]
|
|
125
|
+
},
|
|
126
|
+
"args": {
|
|
127
|
+
"type": "object",
|
|
128
|
+
"description": "A JSON Schema describing the expected arguments (args) for this function.",
|
|
129
|
+
"$ref": "https://json-schema.org/draft/2020-12/schema"
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
"required": [
|
|
133
|
+
"@call"
|
|
134
|
+
],
|
|
135
|
+
"additionalProperties": false
|
|
136
|
+
},
|
|
137
|
+
"required": {
|
|
138
|
+
"type": "array",
|
|
139
|
+
"items": {
|
|
140
|
+
"type": "string"
|
|
141
|
+
},
|
|
142
|
+
"contains": {
|
|
143
|
+
"const": "@call"
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
"required": [
|
|
148
|
+
"type",
|
|
149
|
+
"properties",
|
|
150
|
+
"required"
|
|
151
|
+
]
|
|
152
|
+
},
|
|
153
|
+
"FunctionDefinition": {
|
|
154
|
+
"type": "object",
|
|
155
|
+
"description": "Describes a function's validation schema and interface metadata.",
|
|
156
|
+
"allOf": [
|
|
157
|
+
{
|
|
158
|
+
"$ref": "#/$defs/FunctionCallValidationSchema"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"type": "object",
|
|
162
|
+
"properties": {
|
|
163
|
+
"returnType": {
|
|
164
|
+
"type": "string",
|
|
165
|
+
"enum": [
|
|
166
|
+
"string",
|
|
167
|
+
"number",
|
|
168
|
+
"boolean",
|
|
169
|
+
"array",
|
|
170
|
+
"object",
|
|
171
|
+
"validationResult",
|
|
172
|
+
"any",
|
|
173
|
+
"void"
|
|
174
|
+
],
|
|
175
|
+
"description": "The type of value this function returns."
|
|
176
|
+
},
|
|
177
|
+
"allowedCallers": {
|
|
178
|
+
"type": "string",
|
|
179
|
+
"enum": [
|
|
180
|
+
"rendererOnly",
|
|
181
|
+
"agentOnly",
|
|
182
|
+
"rendererOrAgent"
|
|
183
|
+
],
|
|
184
|
+
"default": "rendererOnly",
|
|
185
|
+
"description": "Specifies which roles are authorized to invoke this function."
|
|
186
|
+
},
|
|
187
|
+
"requiresUserActivation": {
|
|
188
|
+
"type": "boolean",
|
|
189
|
+
"default": false,
|
|
190
|
+
"description": "Specifies whether this function requires a user activation context to execute."
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
"required": [
|
|
194
|
+
"returnType"
|
|
195
|
+
]
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"if": {
|
|
199
|
+
"properties": {
|
|
200
|
+
"requiresUserActivation": {
|
|
201
|
+
"const": true
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
"required": [
|
|
205
|
+
"requiresUserActivation"
|
|
206
|
+
]
|
|
207
|
+
},
|
|
208
|
+
"then": {
|
|
209
|
+
"properties": {
|
|
210
|
+
"allowedCallers": {
|
|
211
|
+
"enum": [
|
|
212
|
+
"rendererOnly"
|
|
213
|
+
]
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
],
|
|
219
|
+
"unevaluatedProperties": false
|
|
220
|
+
},
|
|
221
|
+
"LeafDefinition": {
|
|
222
|
+
"type": "object",
|
|
223
|
+
"description": "Describes a reusable leaf data type (e.g. design token, value union, or payload structure). Must not define a component schema.",
|
|
224
|
+
"allOf": [
|
|
225
|
+
{
|
|
226
|
+
"$ref": "https://json-schema.org/draft/2020-12/schema"
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
"not": {
|
|
230
|
+
"anyOf": [
|
|
231
|
+
{
|
|
232
|
+
"properties": {
|
|
233
|
+
"properties": {
|
|
234
|
+
"type": "object",
|
|
235
|
+
"properties": {
|
|
236
|
+
"component": {
|
|
237
|
+
"type": "object",
|
|
238
|
+
"required": [
|
|
239
|
+
"const"
|
|
240
|
+
]
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
"required": [
|
|
244
|
+
"component"
|
|
245
|
+
]
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
"required": [
|
|
249
|
+
"properties"
|
|
250
|
+
]
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
"properties": {
|
|
254
|
+
"allOf": {
|
|
255
|
+
"type": "array",
|
|
256
|
+
"contains": {
|
|
257
|
+
"properties": {
|
|
258
|
+
"properties": {
|
|
259
|
+
"type": "object",
|
|
260
|
+
"properties": {
|
|
261
|
+
"component": {
|
|
262
|
+
"type": "object",
|
|
263
|
+
"required": [
|
|
264
|
+
"const"
|
|
265
|
+
]
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
"required": [
|
|
269
|
+
"component"
|
|
270
|
+
]
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
"required": [
|
|
274
|
+
"properties"
|
|
275
|
+
]
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
},
|
|
279
|
+
"required": [
|
|
280
|
+
"allOf"
|
|
281
|
+
]
|
|
282
|
+
}
|
|
283
|
+
]
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
]
|
|
287
|
+
},
|
|
288
|
+
"ComponentDefinition": {
|
|
289
|
+
"type": "object",
|
|
290
|
+
"description": "Describes a component's validation schema and composition constraints.",
|
|
291
|
+
"allOf": [
|
|
292
|
+
{
|
|
293
|
+
"$ref": "https://json-schema.org/draft/2020-12/schema"
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
"type": "object",
|
|
297
|
+
"properties": {
|
|
298
|
+
"allowedParents": {
|
|
299
|
+
"type": "array",
|
|
300
|
+
"items": {
|
|
301
|
+
"type": "string"
|
|
302
|
+
},
|
|
303
|
+
"description": "The list of parent component type names that can contain this component type. If omitted, all parent component types are allowed. To restrict a component so it can appear only as the top-level component (id='root') of a surface, set \"allowedParents\": [\"Surface\"]. To allow a component as either the top-level component of a surface or a child of a specific container, specify both (e.g., \"allowedParents\": [\"Surface\", \"CanvasContainer\"]).",
|
|
304
|
+
"uniqueItems": true
|
|
305
|
+
},
|
|
306
|
+
"allowedChildren": {
|
|
307
|
+
"type": "array",
|
|
308
|
+
"items": {
|
|
309
|
+
"type": "string"
|
|
310
|
+
},
|
|
311
|
+
"description": "The list of child component type names allowed inside this container or slot. If omitted, all child component types are allowed.",
|
|
312
|
+
"uniqueItems": true
|
|
313
|
+
},
|
|
314
|
+
"metadata": {
|
|
315
|
+
"type": "object",
|
|
316
|
+
"description": "Optional static metadata.",
|
|
317
|
+
"properties": {
|
|
318
|
+
"extensions": {
|
|
319
|
+
"$ref": "common_types.json#/$defs/Extensions"
|
|
320
|
+
}
|
|
321
|
+
},
|
|
322
|
+
"additionalProperties": false
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
"not": {
|
|
326
|
+
"anyOf": [
|
|
327
|
+
{
|
|
328
|
+
"required": [
|
|
329
|
+
"anyOf"
|
|
330
|
+
]
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
"required": [
|
|
334
|
+
"oneOf"
|
|
335
|
+
]
|
|
336
|
+
}
|
|
337
|
+
]
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
]
|
|
341
|
+
},
|
|
342
|
+
"ValidationResult": {
|
|
343
|
+
"type": "object",
|
|
344
|
+
"description": "Dynamic validation result object returned by a validation condition function or data binding.",
|
|
345
|
+
"properties": {
|
|
346
|
+
"valid": {
|
|
347
|
+
"type": "boolean",
|
|
348
|
+
"description": "Whether the check passed."
|
|
349
|
+
},
|
|
350
|
+
"code": {
|
|
351
|
+
"type": "string",
|
|
352
|
+
"description": "Machine-readable error code (e.g. EXPIRED_CARD, OUT_OF_RANGE)."
|
|
353
|
+
},
|
|
354
|
+
"message": {
|
|
355
|
+
"type": "string",
|
|
356
|
+
"description": "Human-readable error or warning message."
|
|
357
|
+
},
|
|
358
|
+
"severity": {
|
|
359
|
+
"type": "string",
|
|
360
|
+
"enum": [
|
|
361
|
+
"error",
|
|
362
|
+
"warning",
|
|
363
|
+
"info"
|
|
364
|
+
],
|
|
365
|
+
"default": "error",
|
|
366
|
+
"description": "Severity level of the validation result."
|
|
367
|
+
}
|
|
368
|
+
},
|
|
369
|
+
"required": [
|
|
370
|
+
"valid"
|
|
371
|
+
]
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
};
|
|
375
|
+
|
|
376
|
+
export const commonTypesV1_0: Json = {
|
|
377
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
378
|
+
"$id": "https://a2ui.org/specification/v1_0/common_types.json",
|
|
379
|
+
"title": "A2UI Common Types",
|
|
380
|
+
"description": "Common type definitions used across A2UI schemas.",
|
|
381
|
+
"$defs": {
|
|
382
|
+
"ComponentId": {
|
|
383
|
+
"type": "string",
|
|
384
|
+
"description": "The unique identifier for a component, used for both definitions and references within the same surface."
|
|
385
|
+
},
|
|
386
|
+
"CallId": {
|
|
387
|
+
"type": "string",
|
|
388
|
+
"description": "The unique identifier for a function call."
|
|
389
|
+
},
|
|
390
|
+
"AccessibilityAttributes": {
|
|
391
|
+
"type": "object",
|
|
392
|
+
"description": "Attributes to enhance accessibility when using assistive technologies like screen readers or model understanding.",
|
|
393
|
+
"properties": {
|
|
394
|
+
"label": {
|
|
395
|
+
"$ref": "#/$defs/DynamicString",
|
|
396
|
+
"description": "A short string, typically 1 to 3 words, used by assistive technologies to convey the purpose or intent of an element. For example, an input field might have an accessible label of 'User ID' or a button might be labeled 'Submit'."
|
|
397
|
+
},
|
|
398
|
+
"description": {
|
|
399
|
+
"$ref": "#/$defs/DynamicString",
|
|
400
|
+
"description": "Additional information provided by assistive technologies about an element such as instructions, format requirements, or result of an action. For example, a mute button might have a label of 'Mute' and a description of 'Silences notifications about this conversation'."
|
|
401
|
+
},
|
|
402
|
+
"live": {
|
|
403
|
+
"type": "string",
|
|
404
|
+
"description": "Controls screen reader announcements for dynamic updates (WAI-ARIA aria-live). 'polite' waits for user pause; 'assertive' interrupts immediately for alerts.",
|
|
405
|
+
"enum": [
|
|
406
|
+
"off",
|
|
407
|
+
"polite",
|
|
408
|
+
"assertive"
|
|
409
|
+
],
|
|
410
|
+
"default": "off"
|
|
411
|
+
},
|
|
412
|
+
"hidden": {
|
|
413
|
+
"$ref": "#/$defs/DynamicBoolean",
|
|
414
|
+
"description": "Hides the element and its children from assistive technologies when true. Default is false."
|
|
415
|
+
}
|
|
416
|
+
},
|
|
417
|
+
"additionalProperties": false
|
|
418
|
+
},
|
|
419
|
+
"Extensions": {
|
|
420
|
+
"type": "object",
|
|
421
|
+
"description": "Optional extension metadata. Keys MUST be Unicode identifiers (UAX #31). Keys starting with 'a2ui_' are reserved for official extensions.",
|
|
422
|
+
"patternProperties": {
|
|
423
|
+
"^[\\p{XID_Start}_][\\p{XID_Continue}]*$": {}
|
|
424
|
+
},
|
|
425
|
+
"additionalProperties": false
|
|
426
|
+
},
|
|
427
|
+
"ComponentCommon": {
|
|
428
|
+
"type": "object",
|
|
429
|
+
"properties": {
|
|
430
|
+
"id": {
|
|
431
|
+
"$ref": "#/$defs/ComponentId"
|
|
432
|
+
},
|
|
433
|
+
"@catalogId": {
|
|
434
|
+
"type": "string",
|
|
435
|
+
"description": "The catalog ID for this component, overriding any surface-level default catalogId."
|
|
436
|
+
},
|
|
437
|
+
"@accessibility": {
|
|
438
|
+
"$ref": "#/$defs/AccessibilityAttributes"
|
|
439
|
+
},
|
|
440
|
+
"@metadata": {
|
|
441
|
+
"type": "object",
|
|
442
|
+
"description": "Optional component-level metadata for vendor extensions.",
|
|
443
|
+
"properties": {
|
|
444
|
+
"extensions": {
|
|
445
|
+
"$ref": "#/$defs/Extensions"
|
|
446
|
+
}
|
|
447
|
+
},
|
|
448
|
+
"additionalProperties": false
|
|
449
|
+
}
|
|
450
|
+
},
|
|
451
|
+
"required": [
|
|
452
|
+
"id"
|
|
453
|
+
]
|
|
454
|
+
},
|
|
455
|
+
"Child": {
|
|
456
|
+
"$ref": "#/$defs/ComponentId",
|
|
457
|
+
"description": "A reference to a single child component ID."
|
|
458
|
+
},
|
|
459
|
+
"ChildList": {
|
|
460
|
+
"oneOf": [
|
|
461
|
+
{
|
|
462
|
+
"type": "array",
|
|
463
|
+
"description": "A static list of child component IDs.",
|
|
464
|
+
"items": {
|
|
465
|
+
"$ref": "#/$defs/ComponentId"
|
|
466
|
+
}
|
|
467
|
+
},
|
|
468
|
+
{
|
|
469
|
+
"type": "object",
|
|
470
|
+
"description": "A template for generating a dynamic list of children from a data model list. The `componentId` is the component to use as a template.",
|
|
471
|
+
"properties": {
|
|
472
|
+
"componentId": {
|
|
473
|
+
"$ref": "#/$defs/ComponentId"
|
|
474
|
+
},
|
|
475
|
+
"path": {
|
|
476
|
+
"type": "string",
|
|
477
|
+
"description": "The path to the list of component property objects in the data model."
|
|
478
|
+
}
|
|
479
|
+
},
|
|
480
|
+
"required": [
|
|
481
|
+
"componentId",
|
|
482
|
+
"path"
|
|
483
|
+
],
|
|
484
|
+
"additionalProperties": false
|
|
485
|
+
}
|
|
486
|
+
]
|
|
487
|
+
},
|
|
488
|
+
"DataBinding": {
|
|
489
|
+
"type": "object",
|
|
490
|
+
"properties": {
|
|
491
|
+
"@path": {
|
|
492
|
+
"type": "string",
|
|
493
|
+
"description": "A JSON Pointer path to a value in the data model."
|
|
494
|
+
}
|
|
495
|
+
},
|
|
496
|
+
"required": [
|
|
497
|
+
"@path"
|
|
498
|
+
],
|
|
499
|
+
"additionalProperties": false
|
|
500
|
+
},
|
|
501
|
+
"DynamicValue": {
|
|
502
|
+
"description": "A value that can be a literal, a path, or a function call returning any type.",
|
|
503
|
+
"oneOf": [
|
|
504
|
+
{
|
|
505
|
+
"type": "string"
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
"type": "number"
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
"type": "boolean"
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
"type": "array"
|
|
515
|
+
},
|
|
516
|
+
{
|
|
517
|
+
"type": "object",
|
|
518
|
+
"propertyNames": {
|
|
519
|
+
"not": {
|
|
520
|
+
"pattern": "^@([^@]|$)"
|
|
521
|
+
}
|
|
522
|
+
},
|
|
523
|
+
"not": {
|
|
524
|
+
"anyOf": [
|
|
525
|
+
{
|
|
526
|
+
"required": [
|
|
527
|
+
"@path"
|
|
528
|
+
]
|
|
529
|
+
},
|
|
530
|
+
{
|
|
531
|
+
"required": [
|
|
532
|
+
"@call"
|
|
533
|
+
]
|
|
534
|
+
}
|
|
535
|
+
]
|
|
536
|
+
}
|
|
537
|
+
},
|
|
538
|
+
{
|
|
539
|
+
"$ref": "#/$defs/DataBinding"
|
|
540
|
+
},
|
|
541
|
+
{
|
|
542
|
+
"$ref": "#/$defs/FunctionCall"
|
|
543
|
+
}
|
|
544
|
+
]
|
|
545
|
+
},
|
|
546
|
+
"DynamicString": {
|
|
547
|
+
"description": "Represents a string",
|
|
548
|
+
"oneOf": [
|
|
549
|
+
{
|
|
550
|
+
"type": "string"
|
|
551
|
+
},
|
|
552
|
+
{
|
|
553
|
+
"$ref": "#/$defs/DataBinding"
|
|
554
|
+
},
|
|
555
|
+
{
|
|
556
|
+
"$ref": "#/$defs/FunctionCall"
|
|
557
|
+
}
|
|
558
|
+
]
|
|
559
|
+
},
|
|
560
|
+
"DynamicNumber": {
|
|
561
|
+
"description": "Represents a value that can be either a literal number, a path to a number in the data model, or a function call returning a number.",
|
|
562
|
+
"oneOf": [
|
|
563
|
+
{
|
|
564
|
+
"type": "number"
|
|
565
|
+
},
|
|
566
|
+
{
|
|
567
|
+
"$ref": "#/$defs/DataBinding"
|
|
568
|
+
},
|
|
569
|
+
{
|
|
570
|
+
"$ref": "#/$defs/FunctionCall"
|
|
571
|
+
}
|
|
572
|
+
]
|
|
573
|
+
},
|
|
574
|
+
"DynamicBoolean": {
|
|
575
|
+
"description": "A boolean value that can be a literal, a path, or a function call returning a boolean or a validation result object (coerced to its 'valid' boolean).",
|
|
576
|
+
"oneOf": [
|
|
577
|
+
{
|
|
578
|
+
"type": "boolean"
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
"$ref": "#/$defs/DataBinding"
|
|
582
|
+
},
|
|
583
|
+
{
|
|
584
|
+
"$ref": "#/$defs/FunctionCall"
|
|
585
|
+
}
|
|
586
|
+
]
|
|
587
|
+
},
|
|
588
|
+
"DynamicStringList": {
|
|
589
|
+
"description": "Represents a value that can be either a literal array of strings, a path to a string array in the data model, or a function call returning a string array.",
|
|
590
|
+
"oneOf": [
|
|
591
|
+
{
|
|
592
|
+
"type": "array",
|
|
593
|
+
"items": {
|
|
594
|
+
"type": "string"
|
|
595
|
+
}
|
|
596
|
+
},
|
|
597
|
+
{
|
|
598
|
+
"$ref": "#/$defs/DataBinding"
|
|
599
|
+
},
|
|
600
|
+
{
|
|
601
|
+
"$ref": "#/$defs/FunctionCall"
|
|
602
|
+
}
|
|
603
|
+
]
|
|
604
|
+
},
|
|
605
|
+
"FunctionCommon": {
|
|
606
|
+
"type": "object",
|
|
607
|
+
"description": "Baseline envelope properties common to all function calls. Function-specific argument schemas ('args') are defined individually by each function in the active catalog.",
|
|
608
|
+
"properties": {
|
|
609
|
+
"@call": {
|
|
610
|
+
"type": "string",
|
|
611
|
+
"description": "The name of the function to call."
|
|
612
|
+
},
|
|
613
|
+
"catalogId": {
|
|
614
|
+
"type": "string",
|
|
615
|
+
"description": "The catalog ID for this function, overriding any surface-level default catalogId."
|
|
616
|
+
}
|
|
617
|
+
},
|
|
618
|
+
"required": [
|
|
619
|
+
"@call"
|
|
620
|
+
]
|
|
621
|
+
},
|
|
622
|
+
"IndexSystemFunction": {
|
|
623
|
+
"type": "object",
|
|
624
|
+
"description": "Returns the 0-based index of the current item when rendering a dynamic list from a template. This function MUST ONLY be available when evaluating template items within a list context.",
|
|
625
|
+
"properties": {
|
|
626
|
+
"@call": {
|
|
627
|
+
"const": "@index"
|
|
628
|
+
},
|
|
629
|
+
"args": {
|
|
630
|
+
"type": "object",
|
|
631
|
+
"properties": {
|
|
632
|
+
"offset": {
|
|
633
|
+
"$ref": "#/$defs/DynamicNumber",
|
|
634
|
+
"description": "Optional. An offset to add to the 0-based index (e.g., 1 for 1-based indexing). Defaults to 0.",
|
|
635
|
+
"default": 0
|
|
636
|
+
}
|
|
637
|
+
},
|
|
638
|
+
"unevaluatedProperties": false
|
|
639
|
+
}
|
|
640
|
+
},
|
|
641
|
+
"required": [
|
|
642
|
+
"@call"
|
|
643
|
+
],
|
|
644
|
+
"unevaluatedProperties": false,
|
|
645
|
+
"returnType": "number"
|
|
646
|
+
},
|
|
647
|
+
"FunctionCall": {
|
|
648
|
+
"type": "object",
|
|
649
|
+
"description": "Invokes a named function, combining common function properties with the catalog function definition.",
|
|
650
|
+
"allOf": [
|
|
651
|
+
{
|
|
652
|
+
"$ref": "#/$defs/FunctionCommon"
|
|
653
|
+
},
|
|
654
|
+
{
|
|
655
|
+
"oneOf": [
|
|
656
|
+
{
|
|
657
|
+
"$ref": "catalog.json#/$defs/anyFunction"
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
"$ref": "#/$defs/IndexSystemFunction"
|
|
661
|
+
}
|
|
662
|
+
]
|
|
663
|
+
}
|
|
664
|
+
],
|
|
665
|
+
"unevaluatedProperties": false
|
|
666
|
+
},
|
|
667
|
+
"CheckRule": {
|
|
668
|
+
"type": "object",
|
|
669
|
+
"description": "A single validation check rule applied to an input component. The condition function or path evaluates to a structured validation result object or a boolean (which is coerced to a validation result object).",
|
|
670
|
+
"properties": {
|
|
671
|
+
"condition": {
|
|
672
|
+
"description": "Path or function call evaluating to a structured validation result object or a boolean.",
|
|
673
|
+
"oneOf": [
|
|
674
|
+
{
|
|
675
|
+
"$ref": "#/$defs/DataBinding"
|
|
676
|
+
},
|
|
677
|
+
{
|
|
678
|
+
"$ref": "#/$defs/FunctionCall"
|
|
679
|
+
}
|
|
680
|
+
]
|
|
681
|
+
},
|
|
682
|
+
"message": {
|
|
683
|
+
"type": "string",
|
|
684
|
+
"description": "Optional fallback error message."
|
|
685
|
+
}
|
|
686
|
+
},
|
|
687
|
+
"required": [
|
|
688
|
+
"condition"
|
|
689
|
+
],
|
|
690
|
+
"additionalProperties": false
|
|
691
|
+
},
|
|
692
|
+
"Checkable": {
|
|
693
|
+
"type": "object",
|
|
694
|
+
"description": "Properties for components that support renderer-side checks.",
|
|
695
|
+
"properties": {
|
|
696
|
+
"@checks": {
|
|
697
|
+
"type": "array",
|
|
698
|
+
"description": "A list of validation check rules to perform on the component.",
|
|
699
|
+
"items": {
|
|
700
|
+
"$ref": "#/$defs/CheckRule"
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
},
|
|
705
|
+
"Action": {
|
|
706
|
+
"description": "Defines an interaction handler that can either trigger an agent-side event or execute a local renderer-side function.",
|
|
707
|
+
"oneOf": [
|
|
708
|
+
{
|
|
709
|
+
"type": "object",
|
|
710
|
+
"description": "Triggers an agent-side event.",
|
|
711
|
+
"properties": {
|
|
712
|
+
"event": {
|
|
713
|
+
"type": "object",
|
|
714
|
+
"description": "The event to dispatch to the agent.",
|
|
715
|
+
"properties": {
|
|
716
|
+
"name": {
|
|
717
|
+
"type": "string",
|
|
718
|
+
"description": "The name of the action to be dispatched to the agent."
|
|
719
|
+
},
|
|
720
|
+
"userMessage": {
|
|
721
|
+
"$ref": "#/$defs/DynamicString",
|
|
722
|
+
"description": "An optional human-readable message describing the action performed by the user, resolved by the renderer and included in the outbound action message."
|
|
723
|
+
},
|
|
724
|
+
"context": {
|
|
725
|
+
"type": "object",
|
|
726
|
+
"description": "A JSON object containing the key-value pairs for the action context. Values can be literals or paths. Use literal values unless the value must be dynamically bound to the data model. Do NOT use paths for static IDs.",
|
|
727
|
+
"additionalProperties": {
|
|
728
|
+
"$ref": "#/$defs/DynamicValue"
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
},
|
|
732
|
+
"required": [
|
|
733
|
+
"name"
|
|
734
|
+
],
|
|
735
|
+
"additionalProperties": false
|
|
736
|
+
}
|
|
737
|
+
},
|
|
738
|
+
"required": [
|
|
739
|
+
"event"
|
|
740
|
+
],
|
|
741
|
+
"additionalProperties": false
|
|
742
|
+
},
|
|
743
|
+
{
|
|
744
|
+
"type": "object",
|
|
745
|
+
"description": "Executes a renderer or agent-side function.",
|
|
746
|
+
"properties": {
|
|
747
|
+
"functionCall": {
|
|
748
|
+
"$ref": "#/$defs/FunctionCall"
|
|
749
|
+
}
|
|
750
|
+
},
|
|
751
|
+
"required": [
|
|
752
|
+
"functionCall"
|
|
753
|
+
],
|
|
754
|
+
"additionalProperties": false
|
|
755
|
+
}
|
|
756
|
+
]
|
|
757
|
+
},
|
|
758
|
+
"Surface": {
|
|
759
|
+
"title": "Surface Container Component",
|
|
760
|
+
"description": "The reserved canonical container component representing an A2UI surface. The Surface component is immutable and always has 'child': 'root'.",
|
|
761
|
+
"type": "object",
|
|
762
|
+
"allowedParents": [],
|
|
763
|
+
"properties": {
|
|
764
|
+
"component": {
|
|
765
|
+
"const": "Surface"
|
|
766
|
+
},
|
|
767
|
+
"child": {
|
|
768
|
+
"const": "root"
|
|
769
|
+
}
|
|
770
|
+
},
|
|
771
|
+
"additionalProperties": false
|
|
772
|
+
},
|
|
773
|
+
"FunctionResponse": {
|
|
774
|
+
"type": "object",
|
|
775
|
+
"description": "The return response matching a callAgentFunction or callRendererFunction invocation.",
|
|
776
|
+
"properties": {
|
|
777
|
+
"functionCallId": {
|
|
778
|
+
"$ref": "#/$defs/CallId",
|
|
779
|
+
"description": "The unique ID matching the initiating function call."
|
|
780
|
+
},
|
|
781
|
+
"value": {
|
|
782
|
+
"description": "The return value of the function."
|
|
783
|
+
},
|
|
784
|
+
"error": {
|
|
785
|
+
"type": "object",
|
|
786
|
+
"description": "An error object indicating failure of the function execution.",
|
|
787
|
+
"properties": {
|
|
788
|
+
"code": {
|
|
789
|
+
"type": "string"
|
|
790
|
+
},
|
|
791
|
+
"message": {
|
|
792
|
+
"type": "string"
|
|
793
|
+
}
|
|
794
|
+
},
|
|
795
|
+
"required": [
|
|
796
|
+
"code",
|
|
797
|
+
"message"
|
|
798
|
+
],
|
|
799
|
+
"additionalProperties": false
|
|
800
|
+
}
|
|
801
|
+
},
|
|
802
|
+
"required": [
|
|
803
|
+
"functionCallId"
|
|
804
|
+
],
|
|
805
|
+
"oneOf": [
|
|
806
|
+
{
|
|
807
|
+
"required": [
|
|
808
|
+
"value"
|
|
809
|
+
]
|
|
810
|
+
},
|
|
811
|
+
{
|
|
812
|
+
"required": [
|
|
813
|
+
"error"
|
|
814
|
+
]
|
|
815
|
+
}
|
|
816
|
+
],
|
|
817
|
+
"additionalProperties": false
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
};
|