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
//! # Session Management System
//!
//! Provides comprehensive session lifecycle management with atomic persistence,
//! checkpoint creation, and intelligent recovery capabilities for long-running
//! coding automation sessions.
//!
//! ## Core Components
//!
//! - **[`SessionManager`]**: Central orchestrator for session lifecycle
//! - **`PersistenceManager`**: Atomic file operations with transaction support
//! - **`RecoveryManager`**: State validation and corruption recovery
//! - **[`SessionMetadata`]**: Version tracking and performance metrics
//!
//! ## Key Features
//!
//! ### 💾 Atomic Persistence
//! - Thread-safe file operations with rollback capability
//! - Transactional writes with integrity validation
//! - Automatic backup creation before modifications
//!
//! ### 🔄 Checkpoint System
//! - UUID-based checkpoint creation and management
//! - Automatic cleanup of old checkpoints
//! - Fast restoration from any checkpoint
//!
//! ### 🛡️ Recovery & Validation
//! - Comprehensive state integrity checking
//! - Automatic corruption detection and repair
//! - Graceful degradation and error recovery
//!
//! ### 📊 Performance Tracking
//! - Session duration and activity metrics
//! - Memory usage and resource consumption
//! - Task completion statistics
//!
//! ## Example Usage
//!
//! ```rust,no_run
//! use aca::session::{SessionManager, SessionManagerConfig, SessionInitOptions};
//! use std::path::PathBuf;
//!
//! #[tokio::main]
//! async fn main() -> anyhow::Result<()> {
//! let config = SessionManagerConfig::default();
//! let init_options = SessionInitOptions {
//! name: "My Coding Session".to_string(),
//! workspace_root: std::env::current_dir()?,
//! enable_auto_save: true,
//! ..Default::default()
//! };
//!
//! let session_manager = SessionManager::new(
//! PathBuf::from("/path/to/session"),
//! config,
//! init_options
//! ).await?;
//!
//! // Session state is automatically persisted
//! Ok(())
//! }
//! ```
/// Central session lifecycle management and coordination.
///
/// The [`SessionManager`] orchestrates all session operations including
/// persistence, recovery, and state management.
/// Session metadata and configuration tracking.
///
/// Handles version information, performance metrics, and session
/// configuration state.
/// Atomic persistence operations and transaction support.
///
/// Provides thread-safe file operations with rollback capabilities
/// and integrity validation for session state.
/// State validation and corruption recovery.
///
/// Handles integrity checking, automatic recovery from corruption,
/// and graceful error handling for session data.
pub use *;
pub use *;
pub use *;
pub use *;