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
//! OpenCode Server integration
//!
//! Provides HTTP client and SSE event streaming for OpenCode Server mode.
//! This module enables SCUD to communicate with OpenCode's headless server
//! for agent orchestration with structured events and graceful cancellation.
//!
//! # Architecture
//!
//! ```text
//! SCUD Swarm ──HTTP──► OpenCode Server (localhost:4096)
//! ◄─SSE── real-time events
//! ```
//!
//! # Usage
//!
//! ```no_run
//! use scud::opencode::{OpenCodeClient, OpenCodeManager};
//!
//! #[tokio::main]
//! async fn main() -> anyhow::Result<()> {
//! // Get global manager (auto-starts server if needed)
//! let manager = scud::opencode::global_manager();
//! manager.ensure_running().await?;
//!
//! // Create session and send prompt
//! let client = manager.client();
//! let session = client.create_session("Task 1").await?;
//! client.send_message(&session.id, "Implement feature X", None).await?;
//!
//! Ok(())
//! }
//! ```
pub use OpenCodeClient;
pub use ;
pub use ;
pub use ;
pub use *;