|
15 | 15 |
|
16 | 16 | # a2ui_schema.py |
17 | 17 |
|
18 | | -A2UI_SCHEMA = """ |
| 18 | +A2UI_SCHEMA = r''' |
19 | 19 | { |
20 | 20 | "title": "A2UI Message Schema", |
21 | | - "description": "Describes a JSON payload for an A2UI message, which is used to dynamically construct and update user interfaces. A message MUST contain exactly ONE of the action properties: 'beginRendering', 'surfaceUpdate', 'dataModelUpdate', or 'deleteSurface'.", |
| 21 | + "description": "Describes a JSON payload for an A2UI (Agent to UI) message, which is used to dynamically construct and update user interfaces. A message MUST contain exactly ONE of the action properties: 'beginRendering', 'surfaceUpdate', 'dataModelUpdate', or 'deleteSurface'.", |
22 | 22 | "type": "object", |
23 | 23 | "properties": { |
24 | 24 | "beginRendering": { |
|
84 | 84 | "properties": { |
85 | 85 | "text": { |
86 | 86 | "type": "object", |
87 | | - "description": "The text content for the heading. This can be a literal string or a reference to a value in the data model ('path', e.g. 'doc.title').", |
| 87 | + "description": "The text content for the heading. This can be a literal string or a reference to a value in the data model ('path', e.g. '/doc/title').", |
88 | 88 | "properties": { |
89 | 89 | "literalString": { |
90 | 90 | "type": "string" |
|
107 | 107 | "properties": { |
108 | 108 | "text": { |
109 | 109 | "type": "object", |
110 | | - "description": "The text content to display. This can be a literal string or a reference to a value in the data model ('path', e.g. 'hotel.description').", |
| 110 | + "description": "The text content to display. This can be a literal string or a reference to a value in the data model ('path', e.g. '/hotel/description').", |
111 | 111 | "properties": { |
112 | 112 | "literalString": { |
113 | 113 | "type": "string" |
|
125 | 125 | "properties": { |
126 | 126 | "url": { |
127 | 127 | "type": "object", |
128 | | - "description": "The URL of the image to display. This can be a literal string ('literal') or a reference to a value in the data model ('path', e.g. 'thumbnail.url').", |
| 128 | + "description": "The URL of the image to display. This can be a literal string ('literal') or a reference to a value in the data model ('path', e.g. '/thumbnail/url').", |
129 | 129 | "properties": { |
130 | 130 | "literalString": { |
131 | 131 | "type": "string" |
|
154 | 154 | "properties": { |
155 | 155 | "name": { |
156 | 156 | "type": "object", |
157 | | - "description": "The name of the icon to display. This can be a literal string ('literal') or a reference to a value in the data model ('path', e.g. 'icon.name').", |
| 157 | + "description": "The name of the icon to display. This can be a literal string ('literal') or a reference to a value in the data model ('path', e.g. '/icon/name').", |
158 | 158 | "properties": { |
159 | 159 | "literalString": { |
160 | 160 | "type": "string" |
|
172 | 172 | "properties": { |
173 | 173 | "url": { |
174 | 174 | "type": "object", |
175 | | - "description": "The URL of the video to display. This can be a literal string or a reference to a value in the data model ('path', e.g. 'video.url').", |
| 175 | + "description": "The URL of the video to display. This can be a literal string or a reference to a value in the data model ('path', e.g. '/video/url').", |
176 | 176 | "properties": { |
177 | 177 | "literalString": { |
178 | 178 | "type": "string" |
|
190 | 190 | "properties": { |
191 | 191 | "url": { |
192 | 192 | "type": "object", |
193 | | - "description": "The URL of the audio to be played. This can be a literal string ('literal') or a reference to a value in the data model ('path', e.g. 'song.url').", |
| 193 | + "description": "The URL of the audio to be played. This can be a literal string ('literal') or a reference to a value in the data model ('path', e.g. '/song/url').", |
194 | 194 | "properties": { |
195 | 195 | "literalString": { |
196 | 196 | "type": "string" |
|
202 | 202 | }, |
203 | 203 | "description": { |
204 | 204 | "type": "object", |
205 | | - "description": "A description of the audio, such as a title or summary. This can be a literal string or a reference to a value in the data model ('path', e.g. 'song.title').", |
| 205 | + "description": "A description of the audio, such as a title or summary. This can be a literal string or a reference to a value in the data model ('path', e.g. '/song/title').", |
206 | 206 | "properties": { |
207 | 207 | "literalString": { |
208 | 208 | "type": "string" |
|
230 | 230 | }, |
231 | 231 | "template": { |
232 | 232 | "type": "object", |
233 | | - "description": "A template for generating a dynamic list of children from a data model list. `componentId` is the component to use as a template, and `dataBinding` is the path to the list in the data model.", |
| 233 | + "description": "A template for generating a dynamic list of children from a data model list. `componentId` is the component to use as a template, and `dataBinding` is the path to the map of components in the data model. Values in the map will define the list of children.", |
234 | 234 | "properties": { |
235 | 235 | "componentId": { |
236 | 236 | "type": "string" |
|
278 | 278 | }, |
279 | 279 | "template": { |
280 | 280 | "type": "object", |
281 | | - "description": "A template for generating a dynamic list of children from a data model list. `componentId` is the component to use as a template, and `dataBinding` is the path to the list in the data model.", |
| 281 | + "description": "A template for generating a dynamic list of children from a data model list. `componentId` is the component to use as a template, and `dataBinding` is the path to the map of components in the data model. Values in the map will define the list of children.", |
282 | 282 | "properties": { |
283 | 283 | "componentId": { |
284 | 284 | "type": "string" |
|
326 | 326 | }, |
327 | 327 | "template": { |
328 | 328 | "type": "object", |
329 | | - "description": "A template for generating a dynamic list of children from a data model list. `componentId` is the component to use as a template, and `dataBinding` is the path to the list in the data model.", |
| 329 | + "description": "A template for generating a dynamic list of children from a data model list. `componentId` is the component to use as a template, and `dataBinding` is the path to the map of components in the data model. Values in the map will define the list of children.", |
330 | 330 | "properties": { |
331 | 331 | "componentId": { |
332 | 332 | "type": "string" |
|
373 | 373 | "properties": { |
374 | 374 | "title": { |
375 | 375 | "type": "object", |
376 | | - "description": "The tab title. Defines the value as either a literal value or a path to data model value (e.g. 'options.title').", |
| 376 | + "description": "The tab title. Defines the value as either a literal value or a path to data model value (e.g. '/options/title').", |
377 | 377 | "properties": { |
378 | 378 | "literalString": { |
379 | 379 | "type": "string" |
|
441 | 441 | }, |
442 | 442 | "value": { |
443 | 443 | "type": "object", |
444 | | - "description": "Defines the value to be included in the context as either a literal value or a path to a data model value (e.g. 'user.name').", |
| 444 | + "description": "Defines the value to be included in the context as either a literal value or a path to a data model value (e.g. '/user/name').", |
445 | 445 | "properties": { |
446 | 446 | "path": { |
447 | 447 | "type": "string" |
|
472 | 472 | "properties": { |
473 | 473 | "label": { |
474 | 474 | "type": "object", |
475 | | - "description": "The text to display next to the checkbox. Defines the value as either a literal value or a path to data model ('path', e.g. 'option.label').", |
| 475 | + "description": "The text to display next to the checkbox. Defines the value as either a literal value or a path to data model ('path', e.g. '/option/label').", |
476 | 476 | "properties": { |
477 | 477 | "literalString": { |
478 | 478 | "type": "string" |
|
484 | 484 | }, |
485 | 485 | "value": { |
486 | 486 | "type": "object", |
487 | | - "description": "The current state of the checkbox (true for checked, false for unchecked). This can be a literal boolean ('literalBoolean') or a reference to a value in the data model ('path', e.g. 'filter.open').", |
| 487 | + "description": "The current state of the checkbox (true for checked, false for unchecked). This can be a literal boolean ('literalBoolean') or a reference to a value in the data model ('path', e.g. '/filter/open').", |
488 | 488 | "properties": { |
489 | 489 | "literalBoolean": { |
490 | 490 | "type": "boolean" |
|
502 | 502 | "properties": { |
503 | 503 | "label": { |
504 | 504 | "type": "object", |
505 | | - "description": "The text label for the input field. This can be a literal string or a reference to a value in the data model ('path, e.g. 'user.name').", |
| 505 | + "description": "The text label for the input field. This can be a literal string or a reference to a value in the data model ('path, e.g. '/user/name').", |
506 | 506 | "properties": { |
507 | 507 | "literalString": { |
508 | 508 | "type": "string" |
|
514 | 514 | }, |
515 | 515 | "text": { |
516 | 516 | "type": "object", |
517 | | - "description": "The value of the text field. This can be a literal string or a reference to a value in the data model ('path', e.g. 'user.name').", |
| 517 | + "description": "The value of the text field. This can be a literal string or a reference to a value in the data model ('path', e.g. '/user/name').", |
518 | 518 | "properties": { |
519 | 519 | "literalString": { |
520 | 520 | "type": "string" |
|
547 | 547 | "properties": { |
548 | 548 | "value": { |
549 | 549 | "type": "object", |
550 | | - "description": "The selected date and/or time value. This can be a literal string ('literalString') or a reference to a value in the data model ('path', e.g. 'user.dob').", |
| 550 | + "description": "The selected date and/or time value. This can be a literal string ('literalString') or a reference to a value in the data model ('path', e.g. '/user/dob').", |
551 | 551 | "properties": { |
552 | 552 | "literalString": { |
553 | 553 | "type": "string" |
|
577 | 577 | "properties": { |
578 | 578 | "selections": { |
579 | 579 | "type": "object", |
580 | | - "description": "The currently selected values for the component. This can be a literal array of strings or a path to an array in the data model('path', e.g. 'hotel.options').", |
| 580 | + "description": "The currently selected values for the component. This can be a literal array of strings or a path to an array in the data model('path', e.g. '/hotel/options').", |
581 | 581 | "properties": { |
582 | 582 | "literalArray": { |
583 | 583 | "type": "array", |
|
598 | 598 | "properties": { |
599 | 599 | "label": { |
600 | 600 | "type": "object", |
601 | | - "description": "The text to display for this option. This can be a literal string or a reference to a value in the data model (e.g. 'option.label').", |
| 601 | + "description": "The text to display for this option. This can be a literal string or a reference to a value in the data model (e.g. '/option/label').", |
602 | 602 | "properties": { |
603 | 603 | "literalString": { |
604 | 604 | "type": "string" |
|
628 | 628 | "properties": { |
629 | 629 | "value": { |
630 | 630 | "type": "object", |
631 | | - "description": "The current value of the slider. This can be a literal number ('literalNumber') or a reference to a value in the data model ('path', e.g. 'restaurant.cost').", |
| 631 | + "description": "The current value of the slider. This can be a literal number ('literalNumber') or a reference to a value in the data model ('path', e.g. '/restaurant/cost').", |
632 | 632 | "properties": { |
633 | 633 | "literalNumber": { |
634 | 634 | "type": "number" |
|
668 | 668 | }, |
669 | 669 | "path": { |
670 | 670 | "type": "string", |
671 | | - "description": "An optional path to a location within the data model (e.g., 'user.name'). If omitted, the entire data model will be replaced." |
| 671 | + "description": "An optional path to a location within the data model (e.g., '/user/name'). If omitted, or set to '/', the entire data model will be replaced." |
672 | 672 | }, |
673 | 673 | "contents": { |
674 | 674 | "type": "array", |
|
690 | 690 | "valueBoolean": { |
691 | 691 | "type": "boolean" |
692 | 692 | }, |
693 | | - "valueList": { |
| 693 | + "valueMap": { |
| 694 | + "description": "Represents a map as an adjacency list.", |
694 | 695 | "type": "array", |
695 | 696 | "items": { |
696 | 697 | "type": "object", |
| 698 | + "description": "One entry in the map. Exactly one 'value*' property should be provided alongside the key.", |
697 | 699 | "properties": { |
| 700 | + "key": { |
| 701 | + "type": "string" |
| 702 | + }, |
698 | 703 | "valueString": { |
699 | 704 | "type": "string" |
700 | 705 | }, |
|
704 | 709 | "valueBoolean": { |
705 | 710 | "type": "boolean" |
706 | 711 | } |
707 | | - } |
| 712 | + }, |
| 713 | + "required": ["key"] |
708 | 714 | } |
709 | 715 | } |
710 | 716 | }, |
|
727 | 733 | } |
728 | 734 | } |
729 | 735 | } |
730 | | -""" |
| 736 | +''' |
0 commit comments