syncable-ag-ui-client 0.2.0

Client-side AG-UI event consumer for Rust applications - Syncable SDK
Documentation
//! AG-UI Client Consumer
//!
//! This crate provides client-side event consumption for AG-UI streams.
//! It enables Rust applications to connect to AG-UI agents and receive
//! real-time event streams via SSE or WebSocket.
//!
//! # Features
//!
//! - **SSE Client**: Connect to Server-Sent Events endpoints
//! - **WebSocket Client**: Connect to WebSocket endpoints
//! - **Event Stream**: Unified stream abstraction for both transports
//! - **State Reconstruction**: Apply state deltas to reconstruct agent state
//!
//! # Example
//!
//! ```rust,ignore
//! use ag_ui_client::{SseClient, EventStream};
//! use futures::StreamExt;
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//!     // Connect to SSE endpoint
//!     let client = SseClient::connect("http://localhost:3000/events").await?;
//!
//!     // Process events
//!     let mut stream = client.into_stream();
//!     while let Some(event) = stream.next().await {
//!         match event {
//!             Ok(event) => println!("Received: {:?}", event.event_type()),
//!             Err(e) => eprintln!("Error: {}", e),
//!         }
//!     }
//!
//!     Ok(())
//! }
//! ```

pub mod error;
pub mod sse;
pub mod state;
pub mod ws;

// Re-export key types
pub use error::ClientError;
pub use sse::SseClient;
pub use state::StateReconstructor;
pub use ws::WsClient;

/// Re-export core types for convenience
pub use syncable_ag_ui_core::{Event, EventType, JsonValue};