Skip to content

Ouro UI for Android v0.3.0

Choose a tag to compare

@github-actions github-actions released this 18 Nov 12:45
· 8 commits to main since this release
8ba5196

An agent can now update a composed card it sent instead of resending the whole card, as core 0.19.0 adds. Android applies the update, and the person keeps what they entered.

  • OuroComposed.applyTreeUpdate: applies an update, all or nothing, as core's applyTreeUpdate does. It ports treeUpdateProblems too.
    • An update is { nodes?, data? }. Each node replaces the tree's one node with its id. Each data entry sets a value at a JSON pointer, and null deletes it.
    • These are refused: an id the tree lacks, an id that several template instances share, an unsafe or relative path, and a list written past its length.
    • The tree it gives is validated in full, so an update can't relabel a button or loosen its consent.
  • Reading an update: OuroComposed.read takes a tool result's structuredContent.ouro.update as Read.Update.
  • OuroComposedState and rememberOuroComposedState: they hold the card an agent sends and then updates. Call receive(result) with a tool result or update(update) with an update, and draw it with OuroComposedSurface(state, ...).
  • The person's answers stay across an update, except where the agent changed the value or the list item it sits in, as web's ComposedSurface does. The other overload, OuroComposedSurface(tree, catalog, ...), now keeps answers across a new tree or data the same way; before, it started the fields over.
  • A short alert: a tree or update that fails the checks now shows "This card can't be shown", as web does, where the surface used to draw nothing. While an update can't apply, the last card that did, with what the person entered, waits for the next one.
  • The sample: the composed screen shows the agent's update, and the emulator checks that the person's typing survives it.
  • Core 0.19.0: the pin moved from 0.18.2. Core's five tree-update conformance cases (standard/hx/composed/updates/) are vendored by tag and SHA-256, and all five pass.

Checked on: CI only. The Robolectric tests run core's claims, the composed and update cases, and the snapshots. The sample's X-ray and its composed card, with the update, run on an Android 17 (API 37) emulator. 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.3.0"). The Maven files are also attached below.