1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//! 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
// Re-export commonly used types at crate root for convenience
pub use ;
pub use ;
pub use AgentError;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use VerificationResult;
// Re-export prompt types from codive-prompts
pub use ;
// ============================================================================
// 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