A2uiSurface

@Stable
class A2uiSurface(source)

One A2UI surface: its components (an adjacency list keyed by id; root mounts first) and its data model. Both are Compose state, so a surface re-renders as messages arrive and as inputs write through two-way bindings.

Properties

Link copied to clipboard
Link copied to clipboard
var dataModel: JsonElement

The surface's data model (a JSON object).

Link copied to clipboard

Whether the tree can render yet (a root component has arrived).

Link copied to clipboard
val id: String
Link copied to clipboard

Send the whole data model with every action (createSurface.sendDataModel).

Functions

Link copied to clipboard
fun component(id: String): JsonObject?
Link copied to clipboard
fun read(path: String): JsonElement?

The value at an absolute JSON Pointer in the data model.

Link copied to clipboard
fun write(path: String, value: JsonElement?)

Two-way binding: write value at path locally (no network until an action).