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