-
Notifications
You must be signed in to change notification settings - Fork 780
Align apps with schema #42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
bbad424
c86d758
b4b51d4
de109bd
4b6c9ec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |
| A2UI_SCHEMA = """ | ||
| { | ||
| "title": "A2UI Message Schema", | ||
| "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 'surfaceDeletion'.", | ||
| "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'.", | ||
| "type": "object", | ||
| "properties": { | ||
| "beginRendering": { | ||
|
|
@@ -25,10 +25,6 @@ | |
| "type": "string", | ||
| "description": "The primary font for the UI." | ||
| }, | ||
| "logoUrl": { | ||
| "type": "string", | ||
| "description": "A URL for the logo image." | ||
| }, | ||
| "primaryColor": { | ||
| "type": "string", | ||
| "description": "The primary UI color as a hexadecimal code (e.g., '#00BFFF').", | ||
|
|
@@ -641,23 +637,37 @@ | |
| "description": "An array of data entries. Each entry must contain a 'key' and exactly one corresponding typed 'value*' property.", | ||
| "items": { | ||
| "type": "object", | ||
| "description": "A single data entry. Exactly one 'value_' property should be provided alongside the key.", | ||
| "description": "A single data entry. Exactly one 'value*' property should be provided alongside the key.", | ||
| "properties": { | ||
| "key": { | ||
| "type": "string", | ||
| "description": "The key for this data entry." | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know this is an issue with the schema source of truth, but we should be clear on the key format, and how it handles lists of objects, e.g. how do you define an object like: {
"books": [
{
"title": "Dune",
"author": "Frank Herbert"
},
{
"title": "1984",
"author": "George Orwell"
},
{
"title": "The Hobbit",
"author": "J.R.R. Tolkien"
}
]
}
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're right, there's no good way to define that right now. The closest you could get would be a list of titles: {
"/book_titles": {
"valueList" : [{"valueString": "Dune"}, {"valueString":"1984"}, {"valueString": "The Hobbit"}]
}
}You could define individual paths, e.g. "/books/dune/title", "/books/dune/author", and use those as valus for a card, and then collect the cards in a list by id. I agree we want to support your scenario, though. |
||
| }, | ||
| "valueString": { | ||
| "type": "string", | ||
| "description": "A string value." | ||
| "type": "string" | ||
| }, | ||
| "valueNumber": { | ||
| "type": "number", | ||
| "description": "A number value." | ||
| "type": "number" | ||
| }, | ||
| "valueBoolean": { | ||
| "type": "boolean", | ||
| "description": "A boolean value." | ||
| "type": "boolean" | ||
| }, | ||
| "valueList": { | ||
| "type": "array", | ||
| "items": { | ||
| "type": "object", | ||
| "properties": { | ||
| "valueString": { | ||
| "type": "string" | ||
| }, | ||
| "valueNumber": { | ||
| "type": "number" | ||
| }, | ||
| "valueBoolean": { | ||
| "type": "boolean" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "required": ["key"] | ||
|
|
@@ -684,7 +694,7 @@ | |
| RESTAURANT_UI_EXAMPLES = """ | ||
| ---BEGIN SINGLE_COLUMN_LIST_EXAMPLE--- | ||
| [ | ||
| {{ "beginRendering": {{ "surfaceId": "default", "root": "root-column", "styles": {{ "primaryColor": "#FF0000", "font": "Roboto", "logoUrl": "{base_url}/static/logo.png" }} }} }}, | ||
| {{ "beginRendering": {{ "surfaceId": "default", "root": "root-column", "styles": {{ "primaryColor": "#FF0000", "font": "Roboto" }} }} }}, | ||
| {{ "surfaceUpdate": {{ | ||
| "surfaceId": "default", | ||
| "components": [ | ||
|
|
@@ -699,7 +709,8 @@ | |
| {{ "id": "template-rating", "componentProperties": {{ "Text": {{ "text": {{ "path": "rating" }} }} }} }}, | ||
| {{ "id": "template-detail", "componentProperties": {{ "Text": {{ "text": {{ "path": "detail" }} }} }} }}, | ||
| {{ "id": "template-link", "componentProperties": {{ "Text": {{ "text": {{ "path": "infoLink" }} }} }} }}, | ||
| {{ "id": "template-book-button", "componentProperties": {{ "Button": {{ "label": {{ "literalString": "Book Now" }}, "action": {{ "action": "book_restaurant", "context": [ {{ "key": "restaurantName", "value": {{ "path": "name" }} }}, {{ "key": "imageUrl", "value": {{ "path": "imageUrl" }} }}, {{ "key": "address", "value": {{ "path": "address" }} }} ] }} }} }} }} | ||
| {{ "id": "template-book-button", "componentProperties": {{ "Button": {{ "child": "book-now-text", "action": {{ "name": "book_restaurant", "context": [ {{ "key": "restaurantName", "value": {{ "path": "name" }} }}, {{ "key": "imageUrl", "value": {{ "path": "imageUrl" }} }}, {{ "key": "address", "value": {{ "path": "address" }} }} ] }} }} }} }}, | ||
| {{ "id": "book-now-text", "componentProperties": {{ "Text": {{ "text": {{ "literalString": "Book Now" }} }} }} }} | ||
| ] | ||
| }} }}, | ||
| {{ "dataModelUpdate": {{ | ||
|
|
@@ -714,7 +725,7 @@ | |
| ---BEGIN TWO_COLUMN_LIST_EXAMPLE--- | ||
| [ | ||
| {{ "beginRendering": {{ "surfaceId": "default", "root": "root-column", "styles": {{ "primaryColor": "#FF0000", "font": "Roboto", "logoUrl": "{base_url}/static/logo.png" }} }} }}, | ||
| {{ "beginRendering": {{ "surfaceId": "default", "root": "root-column", "styles": {{ "primaryColor": "#FF0000", "font": "Roboto" }} }} }}, | ||
| {{ "surfaceUpdate": {{ | ||
| "surfaceId": "default", | ||
| "components": [ | ||
|
|
@@ -729,7 +740,8 @@ | |
| {{ "id": "template-rating-1", "componentProperties": {{ "Text": {{ "text": {{ "path": "/items/0/rating" }} }} }} }}, | ||
| {{ "id": "template-detail-1", "componentProperties": {{ "Text": {{ "text": {{ "path": "/items/0/detail" }} }} }} }}, | ||
| {{ "id": "template-link-1", "componentProperties": {{ "Text": {{ "text": {{ "path": "/items/0/infoLink" }} }} }} }}, | ||
| {{ "id": "template-book-button-1", "componentProperties": {{ "Button": {{ "label": {{ "literalString": "Book Now" }}, "action": {{ "action": "book_restaurant", "context": [ {{ "key": "restaurantName", "value": {{ "path": "/items/0/name" }} }}, {{ "key": "imageUrl", "value": {{ "path": "/items/0/imageUrl" }} }}, {{ "key": "address", "value": {{ "path": "/items/0/address" }} }} ] }} }} }} }}, | ||
| {{ "id": "template-book-button-1", "componentProperties": {{ "Button": {{ "child": "book-now-text-1", "action": {{ "name": "book_restaurant", "context": [ {{ "key": "restaurantName", "value": {{ "path": "/items/0/name" }} }}, {{ "key": "imageUrl", "value": {{ "path": "/items/0/imageUrl" }} }}, {{ "key": "address", "value": {{ "path": "/items/0/address" }} }} ] }} }} }} }}, | ||
| {{ "id": "book-now-text-1", "componentProperties": {{ "Text": {{ "text": {{ "literalString": "Book Now" }} }} }} }}, | ||
| {{ "id": "item-card-2", "weight": 1, "componentProperties": {{ "Card": {{ "child": "card-layout-2" }} }} }}, | ||
| {{ "id": "card-layout-2", "componentProperties": {{ "Column": {{ "children": {{ "explicitList": ["template-image-2", "card-details-2"] }} }} }} }}, | ||
| {{ "id": "template-image-2", "componentProperties": {{ "Image": {{ "url": {{ "path": "/items/1/imageUrl" }}, "width": "100%" }} }} }}, | ||
|
|
@@ -738,7 +750,8 @@ | |
| {{ "id": "template-rating-2", "componentProperties": {{ "Text": {{ "text": {{ "path": "/items/1/rating" }} }} }} }}, | ||
| {{ "id": "template-detail-2", "componentProperties": {{ "Text": {{ "text": {{ "path": "/items/1/detail" }} }} }} }}, | ||
| {{ "id": "template-link-2", "componentProperties": {{ "Text": {{ "text": {{ "path": "/items/1/infoLink" }} }} }} }}, | ||
| {{ "id": "template-book-button-2", "componentProperties": {{ "Button": {{ "label": {{ "literalString": "Book Now" }}, "action": {{ "action": "book_restaurant", "context": [ {{ "key": "restaurantName", "value": {{ "path": "/items/1/name" }} }}, {{ "key": "imageUrl", "value": {{ "path": "/items/1/imageUrl" }} }}, {{ "key": "address", "value": {{ "path": "/items/1/address" }} }} ] }} }} }} }} | ||
| {{ "id": "template-book-button-2", "componentProperties": {{ "Button": {{ "child": "book-now-text-2", "action": {{ "name": "book_restaurant", "context": [ {{ "key": "restaurantName", "value": {{ "path": "/items/1/name" }} }}, {{ "key": "imageUrl", "value": {{ "path": "/items/1/imageUrl" }} }}, {{ "key": "address", "value": {{ "path": "/items/1/address" }} }} ] }} }} }} }}, | ||
| {{ "id": "book-now-text-2", "componentProperties": {{ "Text": {{ "text": {{ "literalString": "Book Now" }} }} }} }} | ||
| ] | ||
| }} }}, | ||
| {{ "dataModelUpdate": {{ | ||
|
|
@@ -753,7 +766,7 @@ | |
| ---BEGIN BOOKING_FORM_EXAMPLE--- | ||
| [ | ||
| {{ "beginRendering": {{ "surfaceId": "booking-form", "root": "booking-form-column", "styles": {{ "primaryColor": "#FF0000", "font": "Roboto", "logoUrl": "{base_url}/static/logo.png" }} }} }}, | ||
| {{ "beginRendering": {{ "surfaceId": "booking-form", "root": "booking-form-column", "styles": {{ "primaryColor": "#FF0000", "font": "Roboto" }} }} }}, | ||
| {{ "surfaceUpdate": {{ | ||
| "surfaceId": "booking-form", | ||
| "components": [ | ||
|
|
@@ -764,7 +777,8 @@ | |
| {{ "id": "party-size-field", "componentProperties": {{ "TextField": {{ "label": {{ "literalString": "Party Size" }}, "text": {{ "path": "partySize" }}, "type": "number" }} }} }}, | ||
| {{ "id": "datetime-field", "componentProperties": {{ "DateTimeInput": {{ "label": {{ "literalString": "Date & Time" }}, "value": {{ "path": "reservationTime" }}, "enableDate": true, "enableTime": true }} }} }}, | ||
| {{ "id": "dietary-field", "componentProperties": {{ "TextField": {{ "label": {{ "literalString": "Dietary Requirements" }}, "text": {{ "path": "dietary" }} }} }} }}, | ||
| {{ "id": "submit-button", "componentProperties": {{ "Button": {{ "label": {{ "literalString": "Submit Reservation" }}, "action": {{ "action": "submit_booking", "context": [ {{ "key": "restaurantName", "value": {{ "path": "restaurantName" }} }}, {{ "key": "partySize", "value": {{ "path": "partySize" }} }}, {{ "key": "reservationTime", "value": {{ "path": "reservationTime" }} }}, {{ "key": "dietary", "value": {{ "path": "dietary" }} }}, {{ "key": "imageUrl", "value": {{ "path": "imageUrl" }} }} ] }} }} }} }} | ||
| {{ "id": "submit-button", "componentProperties": {{ "Button": {{ "child": "submit-reservation-text", "action": {{ "name": "submit_booking", "context": [ {{ "key": "restaurantName", "value": {{ "path": "restaurantName" }} }}, {{ "key": "partySize", "value": {{ "path": "partySize" }} }}, {{ "key": "reservationTime", "value": {{ "path": "reservationTime" }} }}, {{ "key": "dietary", "value": {{ "path": "dietary" }} }}, {{ "key": "imageUrl", "value": {{ "path": "imageUrl" }} }} ] }} }} }} }}, | ||
| {{ "id": "submit-reservation-text", "componentProperties": {{ "Text": {{ "text": {{ "literalString": "Submit Reservation" }} }} }} }} | ||
| ] | ||
| }} }}, | ||
| {{ "dataModelUpdate": {{ | ||
|
|
@@ -785,7 +799,7 @@ | |
| ---BEGIN CONFIRMATION_EXAMPLE--- | ||
| [ | ||
| {{ "beginRendering": {{ "surfaceId": "confirmation", "root": "confirmation-card", "styles": {{ "primaryColor": "#FF0000", "font": "Roboto", "logoUrl": "{base_url}/static/logo.png" }} }} }}, | ||
| {{ "beginRendering": {{ "surfaceId": "confirmation", "root": "confirmation-card", "styles": {{ "primaryColor": "#FF0000", "font": "Roboto" }} }} }}, | ||
| {{ "surfaceUpdate": {{ | ||
| "surfaceId": "confirmation", | ||
| "components": [ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we also update this in the a2a extension? spec.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OKay, done, but note that the links don't actually work (they get 404) until the repo is public. There's a token I could add to the URL now to make them work, but I figured it was better to have the final version.