Dependency Flow

Dependencies flow downward only. A crate may depend on crates below it in the stack but never above.

rho (binary) ──────────────────────────────────────────
    │
    ├── rho-ext ──── rho-core ──── rho-ai ──────────────
    │
    ├── rho-tools ── rho-highlight ── rho-core ─────────
    │           └──── rho-memory ── rho-core ────────────
    │
    └── rho-core ──── rho-ai ──────────────────────────

rho-test-helpers ── rho-core, rho-ai ────────────────
xtask ──────────────────────────────────────────────
CrateDepends onNotes
rhorho-core, rho-tools, rho-ext, rho-aiHeadless JSON-RPC 2.0 agent
rho-extrho-core, deno_core, deno_astTypeScript extension runtime
rho-toolsrho-core, rho-highlight, rho-memoryTool implementations; highlight for node-splitting, memory for MemoryTool
rho-memoryrho-corePersistent knowledge base (SQLite/FTS5)
rho-highlightrho-coreTree-sitter grammar; uses core diagnostic types
rho-corerho-aiKernel — the foundation everything else builds on
rho-ainone (external only)Unified LLM provider abstraction
rho-test-helpersrho-core, rho-aiDev-only — provides mocks and fixtures for testing
xtasknone (cargo integration)Dev-only — task runner, no rho crate dependencies

Key external dependencies

DependencyUsed byPurpose
reqwestrho-aiHTTP client for model API
tokiorho-core, rho-tools, rho-extAsync runtime
serde / serde_jsoneverywhereSerialization
tomlrho-coreConfiguration parsing
tree-sitter + grammarsrho-highlightSyntax analysis
ignorerho-tools.gitignore-aware directory listing
claprhoCLI argument parsing
tracingrho-core, rho-extStructured logging
deno_corerho-extV8 JavaScript runtime
deno_astrho-extTypeScript transpilation
thiserrorrho-core, rho-extError type derivation
futuresrho-aiStream traits for SSE
sqlxrho-memorySQLite + FTS5 for the knowledge base

What this buys you

The layered structure means:

  • rho-core is UI-agnostic — no shell, no filesystem, no terminal. Any frontend (REPL, TUI, editor integration) consumes it through the JSON-RPC 2.0 protocol.
  • Tools are pluggableToolRegistry stores Box<dyn Tool>, so adding a tool is registry.register(Box::new(MyTool)).
  • Testing is isolatedrho-test-helpers mocks the core traits (MockChatClient, MockShellExecutor, ApprovalGate) so tool and agent loop tests run without a model server.