orchflow_core/
lib.rs

1//! # OrchFlow Core
2//!
3//! A transport-agnostic orchestration engine for managing terminal sessions,
4//! panes, and plugins with an event-driven architecture.
5//!
6//! ## Architecture
7//!
8//! The core is designed to be independent of any specific UI framework or
9//! transport mechanism. It provides:
10//!
11//! - **Manager**: The main orchestration engine that coordinates all operations
12//! - **State Management**: Persistent state management with event notifications
13//! - **Plugin System**: Extensible plugin architecture for custom functionality
14//! - **Backend Abstraction**: Support for different terminal multiplexers (tmux, etc.)
15//! - **Event System**: Reactive event-driven architecture for real-time updates
16//!
17//! ## Usage Example
18//!
19//! ```rust,no_run
20//! use orchflow_core::{Manager, storage::MemoryStore, state::StateManager};
21//! use std::sync::Arc;
22//!
23//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
24//! // Create a storage backend
25//! let store = Arc::new(MemoryStore::new());
26//!
27//! // Create state manager
28//! let state_manager = StateManager::new(store);
29//!
30//! // Create a backend (implement the MuxBackend trait)
31//! // let backend = Arc::new(MyBackend::new());
32//!
33//! // Create the manager
34//! // let manager = Manager::new(backend, state_manager);
35//!
36//! // Execute actions
37//! // let result = manager.execute_action(Action::CreateSession {
38//! //     name: "main".to_string(),
39//! // }).await?;
40//! # Ok(())
41//! # }
42//! ```
43
44pub mod backend;
45pub mod error;
46pub mod manager;
47pub mod state;
48pub mod storage;
49
50// Re-export main types
51pub use backend::{MuxBackend, PaneInfo, SessionInfo, WindowInfo};
52pub use error::{OrchflowError, Result};
53pub use manager::{
54    Action, CommandHistory, Event, FileManager, Manager, ManagerBuilder, PaneType, Plugin,
55    PluginContext, PluginInfo, PluginMetadata, SearchProvider, ShellType,
56};
57pub use state::{PaneState, SessionState, StateEvent, StateManager};
58pub use storage::{MemoryStore, StateStore};
59
60#[cfg(test)]
61mod tests;