Skip to content

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.

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.
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"]
  • ox is the only crate that parses CLI flags and bootstraps the runtime.
  • ox-tui depends on ox-core for domain types, events, and commands. It does not perform direct network I/O or CLI parsing.
  • ox-acp depends on ox-core and ox-jsonrpc to expose sessions over stdio JSON-RPC 2.0. It does not perform CLI parsing or terminal rendering.
  • ox-core never depends on ox-tui, ox-acp, or ox.
  • ox-jsonrpc is a protocol-agnostic leaf crate with no dependency on ox-core, shared by ox-core, ox-acp, and the plugins under plugins/.
  • External plugins under plugins/ are separate executables with no Rust crate dependency on ox-core internals.