tirea_extension_a2ui/lib.rs
1//! A2UI (Agent-to-UI) extension for Tirea.
2//!
3//! Provides a tool-based interface for agents to emit [A2UI](https://a2ui.org)
4//! declarative UI messages. The LLM calls [`A2uiRenderTool`] with A2UI JSON
5//! payloads; the tool validates the structure and returns the validated payload
6//! as its result, which flows through the AG-UI event stream to the frontend.
7//!
8//! # Protocol overview
9//!
10//! A2UI defines four server-to-client message types:
11//!
12//! - `createSurface` — initialize a rendering surface
13//! - `updateComponents` — define/update the component tree
14//! - `updateDataModel` — populate or change data values
15//! - `deleteSurface` — remove a surface
16//!
17//! Each message carries `"version": "v0.9"` and exactly one of the above keys.
18
19mod plugin;
20mod tool;
21mod validate;
22
23pub use plugin::A2uiPlugin;
24pub use tool::A2uiRenderTool;
25pub use validate::{validate_a2ui_messages, A2uiValidationError};