Skip to main content

koda_core/engine/
mod.rs

1//! Engine module — the protocol boundary between Koda's core and any client.
2//!
3//! The engine communicates exclusively through `EngineEvent` (output) and
4//! `EngineCommand` (input) enums. This decoupling allows the same engine
5//! to power the CLI, a future ACP server, VS Code extension, or desktop app.
6//!
7//! ## Event flow
8//!
9//! ```text
10//! Client (TUI/CLI)
11//!   ── EngineCommand::UserMessage → Engine
12//!   ── EngineCommand::ApproveAction → Engine
13//!   ── EngineCommand::Cancel → Engine
14//!
15//! Engine
16//!   ── EngineEvent::Token → Client  (streaming text)
17//!   ── EngineEvent::ToolCall → Client  (tool invocation)
18//!   ── EngineEvent::ToolResult → Client  (tool output)
19//!   ── EngineEvent::NeedApproval → Client  (confirmation request)
20//!   ── EngineEvent::Done → Client  (turn complete)
21//! ```
22//!
23//! See `DESIGN.md` for the full architectural rationale.
24
25/// Event and command enums — the engine's public protocol.
26pub mod event;
27/// Event sink trait — how clients receive engine events.
28pub mod sink;
29
30/// Re-export all event/command types at module level.
31pub use event::*;
32/// Re-export sink types at module level.
33pub use sink::*;