Skip to content

Ouro UI for Android v0.4.0

Choose a tag to compare

@github-actions github-actions released this 19 Nov 07:12
· 5 commits to main since this release
803227e

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).
    • validateMessages checks a stream of createSurface, updateComponents, updateDataModel and deleteSurface messages against the app's catalog. Its problems come in A2UI's error format, word for word as core writes them.
    • resolveMessages gives 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 @label goes last, a pointer through __proto__, constructor or prototype is refused, and every name is the catalog's own.
    • actionMessage wraps a person's press in A2UI's action message. messagesOf reads structuredContent.a2ui, and mcpAppToolResult writes 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.receive takes structuredContent.a2ui as well as structuredContent.ouro, and receiveA2UI returns A2UI's problems. The resolved tree must pass OuroComposed.validateTree, so every button is exactly the catalog's. A failing stream shows the same "This card can't be shown" alert. OuroComposedSurface(state, ...) takes onA2UIAction, which receives each press as A2UI's action message.
  • The sample shows the same card arriving as A2UI messages on its a2ui screen (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.