Skip to main content

Crate syncable_ag_ui_core

Crate syncable_ag_ui_core 

Source
Expand description

AG-UI Core Types

This crate provides the core type definitions for the AG-UI (Agent-User Interaction) protocol. It includes event types, message structures, state management primitives, and error handling for building AG-UI compatible agents.

§Overview

AG-UI is an event-based protocol that standardizes how AI agents communicate with user-facing applications. This crate provides:

  • Event types: All ~25 AG-UI protocol event types (text messages, tool calls, state, etc.)
  • Message types: Structured message formats for agent-user communication
  • State management: State snapshots and JSON Patch delta operations
  • Error handling: Comprehensive error types for protocol operations

§Usage

use ag_ui_core::{Event, Result};

Re-exports§

pub use error::AgUiError;
pub use error::Result;
pub use state::diff_states;
pub use state::AgentState;
pub use state::FwdProps;
pub use state::StateManager;
pub use state::TypedStateManager;
pub use event::BaseEvent;
pub use event::Event;
pub use event::EventType;
pub use event::EventValidationError;
pub use event::TextMessageChunkEvent;
pub use event::TextMessageContentEvent;
pub use event::TextMessageEndEvent;
pub use event::TextMessageStartEvent;
pub use event::ThinkingTextMessageContentEvent;
pub use event::ThinkingTextMessageEndEvent;
pub use event::ThinkingTextMessageStartEvent;
pub use event::ToolCallArgsEvent;
pub use event::ToolCallChunkEvent;
pub use event::ToolCallEndEvent;
pub use event::ToolCallResultEvent;
pub use event::ToolCallStartEvent;
pub use event::ThinkingEndEvent;
pub use event::ThinkingStartEvent;
pub use event::MessagesSnapshotEvent;
pub use event::StateDeltaEvent;
pub use event::StateSnapshotEvent;
pub use event::ActivityDeltaEvent;
pub use event::ActivitySnapshotEvent;
pub use event::CustomEvent;
pub use event::RawEvent;
pub use event::InterruptInfo;
pub use event::RunErrorEvent;
pub use event::RunFinishedEvent;
pub use event::RunFinishedOutcome;
pub use event::RunStartedEvent;
pub use event::StepFinishedEvent;
pub use event::StepStartedEvent;
pub use types::*;

Modules§

error
Error types for AG-UI core operations.
event
AG-UI Event Types
patch
JSON Patch utilities for AG-UI state delta generation.
state
AG-UI State Management
types
AG-UI Protocol Types

Enums§

JsonValue
Re-export serde_json::Value for consistent JSON handling across the crate Represents any valid JSON value.