Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ futures-util = "0.3"
rig-core = { version = "0.28", features = ["derive", "image"] }

# AG-UI Protocol - enables frontend connectivity for agent mode
ag-ui-core = { path = "../ag-ui-sdk/crates/ag-ui-core" }
ag-ui-server = { path = "../ag-ui-sdk/crates/ag-ui-server" }
ag-ui-core = { path = "crates/ag-ui-core" }
ag-ui-server = { path = "crates/ag-ui-server" }
axum = { version = "0.8", features = ["ws"] }
tower-http = { version = "0.6", features = ["cors"] }
tokio-stream = { version = "0.1", features = ["sync"] }
Expand Down
16 changes: 16 additions & 0 deletions crates/ag-ui-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[package]
name = "ag-ui-core"
version = "0.1.0"
edition = "2024"
rust-version = "1.88"
license = "MIT"
description = "Core type library for AG-UI protocol - Syncable SDK"
readme = "README.md"

[dependencies]
thiserror = "2"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
json-patch = "3"
jsonptr = "0.6"
uuid = { version = "1", features = ["v4", "serde"] }
30 changes: 30 additions & 0 deletions crates/ag-ui-core/src/error.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//! Error types for AG-UI core operations.

use thiserror::Error;

/// Errors that can occur in AG-UI core operations.
#[derive(Debug, Error)]
pub enum AgUiError {
/// Error during JSON serialization/deserialization
#[error("Serialization error: {0}")]
Serialization(#[from] serde_json::Error),

/// Validation error for event or message data
#[error("Validation error: {0}")]
Validation(String),

/// Invalid event format or structure
#[error("Invalid event: {0}")]
InvalidEvent(String),

/// Invalid message format or content
#[error("Invalid message: {0}")]
InvalidMessage(String),

/// State operation error
#[error("State error: {0}")]
State(String),
}

/// Result type alias using AgUiError
pub type Result<T> = std::result::Result<T, AgUiError>;
Loading
Loading