codive-core 0.1.0

Core types, traits, and utilities for Codive
Documentation
//! Codive Core - Core types, traits, and utilities for the AI Coding Agent
//!
//! This crate contains the foundational types and abstractions used throughout
//! the agent system. It's designed to be a dependency of all other agent crates.
//!
//! # Modules
//!
//! - [`agent`] - The core agent loop
//! - [`config`] - Configuration types
//! - [`error`] - Error types for the agent system
//! - [`event`] - Event bus for pub/sub
//! - [`message`] - Message and conversation types
//! - [`provider`] - LLM provider trait and types
//! - [`session`] - Session management
//! - [`tool`] - Tool trait and registry

pub mod agent;
pub mod config;
pub mod error;
pub mod event;
pub mod message;
pub mod provider;
pub mod session;
pub mod tool;
pub mod verification;

// Re-export commonly used types at crate root for convenience
pub use agent::{Agent, AgentRunError, CancellationToken, TurnResult};
pub use config::{
    AgentConfig, AppConfig, ConfigError, ModelConfig, PromptConfig, ServerConfig, TuiConfig,
    VerificationConfig,
};
pub use error::AgentError;
pub use event::{Event, EventBus};
pub use message::{ContentPart, Message, Role, ToolCall, ToolResult};
pub use provider::{CompletionRequest, CompletionStream, Provider, ProviderError, StreamEvent};
pub use session::{Session, SessionStatus, SessionSummary};
pub use tool::{FileChangeMetadata, Tool, ToolInfo, ToolOutput, ToolRegistry};
pub use verification::VerificationResult;

// Re-export prompt types from codive-prompts
pub use codive_prompts::{
    compose_standard, EnvironmentContext, PromptComposer, PromptStore, ProviderFamily,
};

// ============================================================================
// RUST CONCEPTS EXPLAINED (for learning)
// ============================================================================
//
// 1. `lib.rs` vs `main.rs`
//    - `lib.rs` = library crate entry point (can be used by other crates)
//    - `main.rs` = binary crate entry point (produces an executable)
//    - A crate can have both (library + binary)
//
// 2. `pub mod error;`
//    - `mod` declares a module (looks for error.rs or error/mod.rs)
//    - `pub` makes it public (accessible from outside this crate)
//    - Without `pub`, the module is private to this crate
//
// 3. `pub use error::AgentError;`
//    - Re-exports AgentError at the crate root
//    - Users can do `use codive_core::AgentError` instead of
//      `use codive_core::error::AgentError`
//    - This is called "facade pattern" or "prelude pattern"
//
// 4. `//!` doc comments
//    - These are "inner" doc comments - they document the containing item
//    - In lib.rs, they document the entire crate
//    - Appear in generated documentation (cargo doc)
//
// 5. Crate naming
//    - Directory: `codive-core` (with hyphen)
//    - Rust identifier: `codive_core` (with underscore)
//    - Cargo automatically converts hyphens to underscores