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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
//! # Automatic Coding Agent
//!
//! A Rust-based agentic tool that automates coding tasks using multiple LLM providers.
//! The system operates with dynamic task trees, comprehensive session persistence,
//! and full resumability for long-running automated coding sessions.
//!
//! ## Architecture Overview
//!
//! The system consists of several key components organized into modules:
//!
//! - **[`cli`]**: Command-line interface with intelligent task parsing and simple task loading
//! - **[`llm`]**: Provider-agnostic LLM interface supporting multiple providers (Claude Code CLI/API, OpenAI Codex CLI, etc.)
//! - **[`claude`]**: Claude Code integration with rate limiting and error recovery
//! - **[`task`]**: Hierarchical task management with intelligent scheduling
//! - **[`session`]**: Complete session lifecycle management with atomic persistence
//! - **[`integration`]**: High-level system orchestration and agent coordination
//!
//! ## Features
//!
//! ### 🤖 Intelligent Task Parsing
//! - **LLM-based decomposition**: Analyzes complex tasks and breaks them into structured hierarchies
//! - **Markdown file resolution**: Automatically follows and includes referenced files
//! - **Detail preservation**: Expands 6 high-level tasks into 42+ detailed subtasks
//! - **Dependency mapping**: Automatic TaskId generation and dependency graph construction
//!
//! ### 🔌 LLM Provider System
//! - **Multi-Provider Support**: Claude Code CLI (default), Claude API, OpenAI Codex CLI, local models (Ollama)
//! - **CLI Mode (default)**: Uses `claude` command, no API key required
//! - **API Mode**: Direct Anthropic API access with API key
//! - **Provider-Agnostic Interface**: Unified API across all LLM providers
//! - **Rate Limiting**: Provider-specific rate limiting and cost optimization
//!
//! ### 🎯 Task Management
//! - **Dynamic Task Tree**: Hierarchical task organization with parent-child relationships
//! - **Intelligent Scheduling**: Multi-factor scoring system with resource-aware prioritization
//! - **Dependency Resolution**: Complex dependency tracking with circular dependency detection
//! - **Progress Tracking**: Real-time statistics and completion estimation
//!
//! ### 💾 Session Persistence
//! - **Atomic Operations**: Thread-safe persistence with transaction support and rollback
//! - **Checkpoint System**: UUID-based checkpoint creation with automatic cleanup
//! - **Recovery Manager**: Intelligent recovery from corruption and failures
//! - **State Validation**: Comprehensive integrity checking with auto-correction
//!
//! ## Quick Start
//!
//! ```rust,no_run
//! use aca::{AgentSystem, AgentConfig};
//!
//! #[tokio::main]
//! async fn main() -> anyhow::Result<()> {
//! // Initialize the agent system
//! let config = AgentConfig::default();
//! let agent = AgentSystem::new(config).await?;
//!
//! // Create and process a task
//! let task_id = agent.create_and_process_task(
//! "Implement feature",
//! "Add new functionality to the codebase"
//! ).await?;
//!
//! println!("Task completed: {}", task_id);
//! Ok(())
//! }
//! ```
/// Session management and persistence functionality.
///
/// This module provides comprehensive session lifecycle management including
/// atomic persistence, checkpoint creation, and intelligent recovery capabilities.
/// Hierarchical task management system.
///
/// Provides dynamic task trees, intelligent scheduling, dependency resolution,
/// and progress tracking for complex coding automation workflows.
/// Claude Code integration layer.
///
/// Handles direct integration with Claude Code including rate limiting,
/// error recovery, context management, and usage tracking.
/// OpenAI Codex integration layer.
///
/// Executes the Codex CLI headlessly with session logging and rate limiting.
/// Provider-agnostic LLM interface.
///
/// Abstraction layer supporting multiple LLM providers (Claude, OpenAI, local models)
/// with unified API, automatic fallback, and provider-specific optimizations.
/// High-level system integration and orchestration.
///
/// Combines all subsystems into a cohesive agent architecture with
/// coordinated task processing and system-wide status monitoring.
/// Environment constants and path utilities.
///
/// Centralizes all hardcoded paths and directory names used throughout
/// the application for easier maintenance and consistency.
// Re-export main session types
pub use ;
// Re-export main task types
pub use ;
// Re-export main Claude types
pub use ;
// Re-export OpenAI types
pub use ;
// Re-export LLM abstraction types
pub use ;
// Re-export integration types
pub use ;
// CLI module for command-line interface
/// Prints "Hello, World!" to stdout.
///
/// # Examples
///
/// ```
/// use aca::hello_world;
///
/// hello_world();
/// ```