Skip to main content

defect_core/
lib.rs

1//! `defect-core` — foundational shared types for the defect workspace.
2//!
3//! This crate holds the **pure types and traits** that both the agent runtime
4//! (`defect-agent`) and the provider/transport crates (`defect-llm`, `defect-http`) need,
5//! with **zero dependency on the agent runtime** (no session / turn loop / hooks). Pulling
6//! these out of `defect-agent` lets a provider or HTTP-stack crate be depended on
7//! independently — e.g. via a git dependency — without dragging in the whole session
8//! machinery.
9//!
10//! `defect-agent` re-exports everything here under its original paths
11//! (`defect_agent::error`, `defect_agent::llm::*`, `defect_agent::http`,
12//! `defect_agent::tool::ToolSchema`), so existing call sites are unaffected.
13//!
14//! What lives here: [`error::BoxError`], the LLM protocol types in [`llm`], the
15//! [`http::HttpClient`] trait, and [`tool::ToolSchema`]. What does **not**: the
16//! `ProviderRegistry` (depends on session capabilities config), the full `Tool` trait /
17//! `ToolContext`, events, policy, and the session runtime — those stay in `defect-agent`.
18
19pub mod error;
20pub mod http;
21pub mod llm;
22pub mod tool;