vtcode_core/core/mod.rs
1//! # Core Agent Architecture
2//!
3//! This module contains the core components of the VT Code agent system,
4//! implementing the main agent loop, context management, and supporting infrastructure.
5//!
6//! ## Architecture Overview
7//!
8//! The core system is built around several key components:
9//!
10//! - **Agent**: Main agent implementation with conversation management
11
12//! - **Prompt Caching**: Strategic caching for improved response times
13//! - **Decision Tracking**: Audit trail of agent decisions and actions
14//! - **Error Recovery**: Intelligent error handling with context preservation
15//! - **Timeout Detection**: Prevents runaway operations
16//! - **Trajectory Management**: Session state and history tracking
17//!
18//! ## Key Components
19//!
20//! ### Agent System
21//! ```rust,ignore
22//! use vtcode_core::core::agent::core::Agent;
23//! use vtcode_core::VTCodeConfig;
24//!
25//! #[tokio::main]
26//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
27//! let config = VTCodeConfig::load()?;
28//! let agent = Agent::new(config).await?;
29//! agent.run().await?;
30//! Ok(())
31//! }
32//! ```
33//!
34
35//!
36pub mod agent;
37
38pub mod decision_tracker;
39pub mod error_recovery;
40pub mod interfaces;
41pub mod loop_detector;
42pub mod memory_pool;
43pub mod message_metadata;
44pub mod orchestrator_retry;
45pub mod pending_actions;
46pub mod performance_profiler;
47pub mod prompt_caching;
48pub mod state_schema;
49pub mod telemetry;
50pub mod threads;
51pub mod timeout_detector;
52pub mod trajectory;
53
54/// Number of seconds in one day (24 * 60 * 60).
55pub(crate) const SECONDS_PER_DAY: u64 = 24 * 60 * 60;
56
57// Re-export main types
58pub use memory_pool::{MemoryPool, global_pool};
59pub use performance_profiler::{BenchmarkResults, BenchmarkUtils, PerformanceProfiler};
60pub use threads::{
61 SubmissionId, ThreadBootstrap, ThreadEventRecord, ThreadId, ThreadManager, ThreadRuntimeHandle, ThreadSnapshot,
62 build_thread_archive_metadata, loaded_skills_from_session_listing, messages_from_session_listing,
63};