| Crates.io | orchflow-core |
| lib.rs | orchflow-core |
| version | 0.1.0 |
| created_at | 2025-07-15 17:15:51.053893+00 |
| updated_at | 2025-07-15 17:15:51.053893+00 |
| description | Transport-agnostic orchestration engine for managing terminal sessions, panes, and plugins with an event-driven architecture |
| homepage | https://github.com/foofork/orchflow |
| repository | https://github.com/foofork/orchflow |
| max_upload_size | |
| id | 1753626 |
| size | 111,270 |
A transport-agnostic orchestration engine for managing terminal sessions, panes, and plugins with an event-driven architecture.
OrchFlow Core provides the foundational orchestration engine that powers the OrchFlow ecosystem. It's designed to be independent of any specific UI framework or transport mechanism, making it suitable for integration into various environments including desktop apps, web services, and CLI tools.
The core is built around several key components:
use orchflow_core::{Manager, storage::MemoryStore, state::StateManager};
use std::sync::Arc;
// Create a storage backend
let store = Arc::new(MemoryStore::new());
// Create state manager
let state_manager = StateManager::new(store);
// Create a backend (implement the MuxBackend trait)
let backend = Arc::new(MyTmuxBackend::new());
// Create the manager
let manager = Manager::new(backend, state_manager);
// Execute actions
let result = manager.execute_action(Action::CreateSession {
name: "main".to_string(),
}).await?;
To integrate with a terminal multiplexer, implement the MuxBackend trait:
use orchflow_core::MuxBackend;
use async_trait::async_trait;
struct MyBackend;
#[async_trait]
impl MuxBackend for MyBackend {
async fn create_session(&self, name: &str) -> Result<String, String> {
// Implementation
}
// ... other methods
}
Extend functionality by implementing the Plugin trait:
use orchflow_core::{Plugin, PluginContext, Event};
use async_trait::async_trait;
struct MyPlugin;
#[async_trait]
impl Plugin for MyPlugin {
fn id(&self) -> &str {
"my-plugin"
}
async fn handle_event(&mut self, event: &Event) -> Result<(), String> {
// Handle events
}
// ... other methods
}
MIT OR Apache-2.0