Skip to main content

edgecrab_types/
lib.rs

1//! # edgecrab-types
2//!
3//! Shared types for the EdgeCrab agent ecosystem.
4//! This is the leaf crate — no internal dependencies.
5//!
6//! ```text
7//!   edgecrab-types  ←  (all other crates depend on this)
8//!     ├── message.rs    — Message, Role, Content, ContentPart
9//!     ├── tool.rs       — ToolCall, FunctionCall, ToolSchema
10//!     ├── usage.rs      — Usage, Cost, billing normalization
11//!     ├── config.rs     — ApiMode, Platform, constants
12//!     ├── trajectory.rs — Trajectory, reasoning extraction
13//!     └── error.rs      — AgentError, ToolError
14//! ```
15
16#![deny(clippy::unwrap_used)]
17
18pub mod config;
19pub mod error;
20pub mod message;
21pub mod tool;
22pub mod trajectory;
23pub mod usage;
24
25pub use config::{ApiMode, DEFAULT_MODEL, OPENROUTER_BASE_URL, Platform};
26pub use error::{AgentError, ToolError, ToolErrorRecord, ToolErrorResponse};
27pub use message::{Content, ContentPart, ImageUrl, Message, Role};
28pub use tool::{FunctionCall, ToolCall, ToolSchema};
29pub use trajectory::Trajectory;
30pub use usage::{Cost, Usage};
31
32/// Crate-level Result alias
33pub type Result<T> = std::result::Result<T, AgentError>;