GenerativeUiInterfaceShowSurfaceMessage
HTTP API schema
Show a UI on the device's screen and bring the Port OS app to the foreground. It replaces any surface already on screen (a device shows one surface at a time) and starts a new sequence for the surface at 1. How to use this interface: call get-components first to learn the components and the screen (960 by 540 dp on a TV, ten-foot viewing distance: use large text and few items). Send show-surface with the whole first UI, then small update-surface calls to change it in place, then close-surface. Confirm what is on screen with get-surface. Shape: `surfaceId` names the surface; `a2ui` is a list of A2UI v1.0 server-to-client messages for that surface. Include a `createSurface` message and a component with the id `root`. Components are a flat list; containers name their children by id. Every message must target `surfaceId` and use only supported components and properties, otherwise the call is refused with BAD_REQUEST naming the component or property. Minimal example: ```json {"surfaceId": "hello", "a2ui": [ {"version": "1.0", "createSurface": {"surfaceId": "hello", "catalogId": "https://a2ui.org/specification/v1_0/catalogs/basic/catalog.json", "components": [ {"id": "root", "component": "Column", "children": ["title", "body"]}, {"id": "title", "component": "Text", "text": "# Dinner at 7"}, {"id": "body", "component": "Text", "text": "Pasta is almost ready."}]}}]} ``` Completion: accepted means the message reached the device gateway, not that it is on screen. Messages to one surface apply in the order Port OS accepted them; two calls made concurrently may apply in either order, so wait for each call to return before the next if order matters. No ordering across surfaces or with other interfaces (for example play-media). An update to a surface that is no longer held is dropped by the device. One call carries at most the device's `maxPayloadBytes` (512 KiB) of A2UI. Images are URLs the device fetches, never inline data. If the device is not connected, Port OS wakes it and the surface appears when it connects; if it never connects, the queued message expires after 60 seconds. The properties each component accepts are in the [A2UI component reference](https://a2ui.org/reference/components/); get-components lists the ones this device renders. Not supported: Button, TextField, CheckBox, Slider, DateTimeInput, MultipleChoice, Tabs and Modal (a surface has no interactivity), Video and AudioPlayer, A2UI function calls, and template child lists. Playing media (play-media) or launching an app opens that app over the surface; call show-surface again to bring it back.
GenerativeUiInterfaceShowSurfaceMessage fields
- surfaceId
stringRequired Names the surface. Every A2UI message in `a2ui` must target it.
minLength: 1
maxLength: 128
pattern: "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
- a2ui
array<GenerativeUiA2uiMessage>Required A2UI v1.0 messages that create the surface, starting with `createSurface`.