scud/rpc/mod.rs
1//! JSON RPC IPC module for subagent communication
2//!
3//! Provides a JSON RPC 2.0 protocol for inter-process communication between
4//! SCUD and external orchestrators. The server reads requests from stdin
5//! and emits events/responses to stdout.
6//!
7//! ## Protocol
8//!
9//! Requests (stdin):
10//! ```json
11//! {"jsonrpc": "2.0", "method": "spawn", "params": {"task_id": "1", "prompt": "..."}, "id": 1}
12//! {"jsonrpc": "2.0", "method": "ping", "id": 2}
13//! {"jsonrpc": "2.0", "method": "shutdown", "id": 3}
14//! ```
15//!
16//! Responses/Events (stdout):
17//! ```json
18//! {"jsonrpc": "2.0", "result": {"status": "ok"}, "id": 1}
19//! {"jsonrpc": "2.0", "method": "agent.started", "params": {"task_id": "1"}}
20//! {"jsonrpc": "2.0", "method": "agent.output", "params": {"task_id": "1", "line": "..."}}
21//! {"jsonrpc": "2.0", "method": "agent.completed", "params": {"task_id": "1", "success": true}}
22//! ```
23
24mod server;
25mod types;
26
27pub use server::{RpcServer, RpcServerConfig};
28pub use types::*;