Skip to main content

turul_a2a_types/
lib.rs

1//! Ergonomic Rust types for the A2A Protocol v1.0.
2//!
3//! This crate wraps the prost-generated proto types from [`turul_a2a_proto`]
4//! with idiomatic Rust APIs, state machine enforcement on [`TaskState`], and
5//! builder helpers on [`Task`], [`Message`], and [`Artifact`].
6//!
7//! All public types are `#[non_exhaustive]` — additive changes will not break
8//! downstream code.
9//!
10//! # Primary entry points
11//!
12//! - [`Task`], [`TaskStatus`], [`TaskState`] — the core task object and its lifecycle
13//! - [`Message`], [`Part`], [`Role`] — conversational payloads
14//! - [`Artifact`] — outputs produced during task execution
15//! - [`wire`] — JSON-RPC method constants and SSE event shapes
16//!
17//! Raw proto access is available via [`proto`] for advanced use.
18
19pub mod artifact;
20pub mod error;
21pub mod message;
22pub mod pbjson;
23pub mod push_config;
24pub mod state_machine;
25pub mod task;
26pub mod wire;
27
28/// Re-export proto types for advanced users.
29pub mod proto {
30    pub use turul_a2a_proto::*;
31}
32
33pub use artifact::Artifact;
34pub use error::A2aTypeError;
35pub use message::{Message, Part, Role};
36pub use push_config::{PushAuth, PushConfig, PushConfigBuilder, PushConfigPage};
37pub use task::{Task, TaskState, TaskStatus};