Skip to main content

bamboo_agent/process/
mod.rs

1//! Process management for external agent runs and Claude sessions
2//!
3//! This module provides comprehensive process lifecycle management:
4//!
5//! # Features
6//! - Registration and tracking of running processes
7//! - Graceful and forceful termination strategies
8//! - Live output capture for agent runs
9//! - Cross-platform process killing (Windows + Unix)
10//!
11//! # Process Types
12//! - **AgentRun**: External agent execution processes
13//! - **ClaudeSession**: Claude Code session processes
14//!
15//! # Example
16//!
17//! ```rust,ignore
18//! use bamboo_agent::process::ProcessRegistry;
19//! use std::sync::{Arc, Mutex};
20//!
21//! #[tokio::main]
22//! async fn main() {
23//!     let registry = Arc::new(ProcessRegistry::new());
24//!
25//!     // Register a Claude session
26//!     let run_id = registry.register_claude_session(
27//!         "session-123".to_string(),
28//!         12345,
29//!         "/path/to/project".to_string(),
30//!         "Implement feature X".to_string(),
31//!         "claude-sonnet-4.6".to_string(),
32//!         Arc::new(Mutex::new(None)),
33//!     ).await.unwrap();
34//!
35//!     // Append live output
36//!     registry.append_live_output(run_id, "Processing...").await.unwrap();
37//!
38//!     // Get output
39//!     let output = registry.get_live_output(run_id).await.unwrap();
40//!
41//!     // Kill process when done
42//!     registry.kill_process(run_id).await.unwrap();
43//! }
44//! ```
45
46pub mod registry;
47
48pub use registry::{
49    ProcessHandle, ProcessInfo, ProcessRegistrationConfig, ProcessRegistry, ProcessType,
50};