Architecture Overview
oxide-code (ox) is a minimal Rust core agent harness designed around process-isolated external extensions. The core owns the session loop, wire adapters, built-in filesystem / shell tools, terminal UI, and Agent Client Protocol (ACP) frontend. Extensions such as MCP bridges, hooks, and custom tools run out of process.
Workspace Layout
Section titled “Workspace Layout”| Path | Role |
|---|---|
crates/ox-jsonrpc |
Protocol-agnostic leaf crate providing JSON-RPC 2.0 wire types and NDJSON async framing helpers. |
crates/ox-core |
Frontend-agnostic core library: message types, provider configuration, wire adapters, tools, and extension hosts. |
crates/ox-tui-svg |
Leaf crate rendering a ratatui::buffer::Buffer to deterministic SVG snapshots with vector box-drawing. |
crates/ox-tui |
Terminal UI crate built on ox-core. |
crates/ox-acp |
Agent Client Protocol (ACP) stdio server crate built on ox-core. |
crates/ox |
Binary crate (ox): CLI parsing and runtime bootstrap. |
plugins/ox-plugin-compaction |
Reference conversation compaction plugin communicating with ox-core over stdio JSON-RPC. |
plugins/ox-plugin-mcp |
Standalone MCP bridge plugin communicating with ox-core over stdio JSON-RPC. |
plugins/ox-plugin-stats |
Reference /stats usage summary plugin communicating with ox-core over stdio JSON-RPC. |
Dependency Boundaries
Section titled “Dependency Boundaries”flowchart LR ox["crates/ox"] --> ox_tui["crates/ox-tui"] --> ox_core["crates/ox-core"] ox --> ox_acp["crates/ox-acp"] --> ox_core ox --> ox_core ox_core --> ox_jsonrpc["crates/ox-jsonrpc"] ox_acp --> ox_jsonrpc ox_core -. "stdio JSON-RPC" .-> compaction["plugins/ox-plugin-compaction"] compaction --> ox_jsonrpc ox_core -. "stdio JSON-RPC" .-> mcp["plugins/ox-plugin-mcp"] mcp --> ox_jsonrpc ox_core -. "stdio JSON-RPC" .-> stats["plugins/ox-plugin-stats"] stats --> ox_jsonrpc ox_tui -. "dev" .-> ox_tui_svg["crates/ox-tui-svg"]
oxis the only crate that parses CLI flags and bootstraps the runtime.ox-tuidepends onox-corefor domain types, events, and commands. It does not perform direct network I/O or CLI parsing.ox-acpdepends onox-coreandox-jsonrpcto expose sessions over stdio JSON-RPC 2.0. It does not perform CLI parsing or terminal rendering.ox-corenever depends onox-tui,ox-acp, orox.ox-jsonrpcis a protocol-agnostic leaf crate with no dependency onox-core, shared byox-core,ox-acp, and the plugins underplugins/.- External plugins under
plugins/are separate executables with no Rust crate dependency onox-coreinternals.