Skip to main content

Module engine

Module engine 

Source
Expand description

Engine protocol: EngineEvent / EngineCommand enums. Engine module — the protocol boundary between Koda’s core and any client.

The engine communicates exclusively through EngineEvent (output) and EngineCommand (input) enums. This decoupling allows the same engine to power the CLI, a future ACP server, VS Code extension, or desktop app.

§Event flow

Client (TUI/CLI)
  ── EngineCommand::UserMessage → Engine
  ── EngineCommand::ApproveAction → Engine
  ── EngineCommand::Cancel → Engine

Engine
  ── EngineEvent::Token → Client  (streaming text)
  ── EngineEvent::ToolCall → Client  (tool invocation)
  ── EngineEvent::ToolResult → Client  (tool output)
  ── EngineEvent::NeedApproval → Client  (confirmation request)
  ── EngineEvent::Done → Client  (turn complete)

See DESIGN.md for the full architectural rationale.

Re-exports§

pub use event::*;
pub use sink::*;

Modules§

event
Event and command enums — the engine’s public protocol. Protocol types for engine ↔ client communication.
sink
Event sink trait — how clients receive engine events. Engine output sink trait.