Skip to main content

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,no_run
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 context_optimizer;
39pub mod decision_tracker;
40pub mod error_recovery;
41pub mod interfaces;
42pub mod loop_detector;
43pub mod memory_pool;
44pub mod orchestrator_retry;
45pub mod performance_profiler;
46pub mod prompt_caching;
47pub mod telemetry;
48pub mod threads;
49pub mod timeout_detector;
50pub mod trajectory;
51
52/// Number of seconds in one day (24 * 60 * 60).
53pub(crate) const SECONDS_PER_DAY: u64 = 24 * 60 * 60;
54
55// Re-export main types
56pub use context_optimizer::ContextOptimizer;
57pub use memory_pool::{MemoryPool, global_pool};
58pub use performance_profiler::{BenchmarkResults, BenchmarkUtils, PerformanceProfiler};
59pub use threads::{
60    SubmissionId, ThreadBootstrap, ThreadEventRecord, ThreadId, ThreadManager, ThreadRuntimeHandle,
61    ThreadSnapshot, build_thread_archive_metadata, loaded_skills_from_session_listing,
62    messages_from_session_listing,
63};