RFC: Agent-Composed UI via A2UI Protocol#25
Open
joshuajbouw wants to merge 8 commits into
Open
Conversation
Proposes adopting Google's A2UI protocol as the rendering contract between capsules, the agent, and frontends. The agent owns the full layout composition with no predefined zones or hardcoded regions. The TUI is a dumb renderer. Key decisions: - A2UI adopted as-is, no custom extensions - Bus-based component discovery (same pattern as tools) - Agent composes the entire component tree - Natural language layout customization - Frontend-agnostic (CLI/web/Discord all render same descriptions) Tracks astrid#629.
Topics carry no version — A2UI messages self-describe via the version field in every payload. Decouples IPC routing from spec evolution.
The LLM calls tools (compose_ui, delete_surface). A UI capsule bridges tool calls to A2UI IPC messages. IPC topics are internal plumbing between capsules and frontends, not the LLM's interface. Adds layers section, tool definitions, and updates composition flow.
Major revision: - Agent observes existing IPC traffic directly, no ui_describe needed - Capsules don't change — their existing events ARE the data sources - Agent publishes to a2ui.* as a bus participant, not through tools - Default layout on boot without LLM (static, cached on subsequent boots) - Multi-principal surfaces — each agent gets its own A2UI scope - Removed tool definitions, component discovery protocol, capsule changes
Components bind to IPC events via {topic, path} references. The runtime
subscribes to referenced topics and routes payload values to bound components
automatically. The agent describes structure + bindings, the runtime handles
plumbing. No agent involvement in routine data updates.
Traced through actual IpcPayload types and wire format:
- Custom payloads: field path is /payload/data/<field>
- Typed payloads (AgentResponse etc): path is /payload/<field>
Added end-to-end flow examples:
- Model name update: registry event → binding extraction → component render
- Layout change: user request → LLM → new structure+bindings → render
Binding syntax: {topic, path} where path is a JSON Pointer into the
full IPC message as it arrives on the wire.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Proposes adopting Google's A2UI protocol as the rendering contract between capsules, the agent, and frontends. The agent owns the full layout composition — no predefined zones, slots, or hardcoded regions. The TUI is a dumb renderer that draws whatever component tree the agent describes.
Key decisions
ui.v1.request.describe, same pattern as tool discovery viatool.v1.request.describe. No manifest extensions.Tracking