Repository navigation
Ouro UI for Android v0.4.0
Android now draws agent cards sent as A2UI v1.0 messages, as web, Apple and Windows do, by adapting them into Ouro's composed tree (#17).
OuroA2UI(bot.ouro.ui.hx.composed) ports core's A2UI adapter (a2ui.mts, core v0.19.0; unchanged in v0.20.0).validateMessageschecks a stream ofcreateSurface,updateComponents,updateDataModelanddeleteSurfacemessages against the app's catalog. Its problems come in A2UI's error format, word for word as core writes them.resolveMessagesgives each surface's composed tree and data model, with core's rules. A button binding stays a binding only when a field writes that exact path, and a value read from data is never followed as a binding. A button's@labelgoes last, a pointer through__proto__,constructororprototypeis refused, and every name is the catalog's own.actionMessagewraps a person's press in A2UI's action message.messagesOfreadsstructuredContent.a2ui, andmcpAppToolResultwrites it.- A surface may go at most 24 components deep, resolve to at most 5,000 nodes, and copy at most a million characters out of its data, as on Windows. Core has no such limits yet (ourostack/ouro-ui-core#100).
OuroComposedState.receivetakesstructuredContent.a2uias well asstructuredContent.ouro, andreceiveA2UIreturns A2UI's problems. The resolved tree must passOuroComposed.validateTree, so every button is exactly the catalog's. A failing stream shows the same "This card can't be shown" alert.OuroComposedSurface(state, ...)takesonA2UIAction, which receives each press as A2UI's action message.- The sample shows the same card arriving as A2UI messages on its
a2uiscreen (assets/agent-card-a2ui.json). - README: a new "Agent cards" section covers both formats, how to wire each from a tool result, and what's still missing.
Checked on: CI only. The unit tests resolve all 13 of core's A2UI conformance cases to their expect, byte for byte, and check every tree they give against the tree validator. A Robolectric test draws an A2UI card and presses it. On an Android 17 (API 37) emulator, the sample's A2UI card is checked the way its composed card is: its buttons are the declared actions, add sends A2UI's action message and runs, share runs only on confirm, and place order hands off. The maintainer owns no Android device, so nothing here has run on real hardware yet. If you have a device and something differs, please open an issue.
Install: add maven { url = uri("https://ourostack.github.io/ouro-ui-android/maven") } to your repositories and implementation("bot.ouro.ui:ouro-hx:0.4.0"). The Maven files are also attached below.