# ariakage/soyo-harness architecture

> Architecture diagram of the GitHub repository ariakage/soyo-harness, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ariakage/soyo-harness
- Repository: https://github.com/ariakage/soyo-harness

## Overview

Soyo Harness is a Rust agent runtime for programming and general tasks. Users submit work through the CLI or TUI; the shared runtime drives model/tool execution, with approvals, modes, and services around that loop. The tree also contains a desktop GUI and substantial memory, browser, plugin, and MCP subsystems. The supplied excerpts show the CLI and TUI runtime calls and runtime-service imports; connections to unsampled subsystems are omitted rather than inferred from names or layout.

Main entry points: [`crates/soyo-core/src/runtime_services.rs`](https://github.com/ariakage/soyo-harness/blob/main/crates/soyo-core/src/runtime_services.rs) (Runtime services), [`crates/soyo-tui/src/controller.rs`](https://github.com/ariakage/soyo-harness/blob/main/crates/soyo-tui/src/controller.rs) (TUI controller), [`crates/soyo-core/src/runtime/mod.rs`](https://github.com/ariakage/soyo-harness/blob/main/crates/soyo-core/src/runtime/mod.rs) (Agent runtime), [`crates/soyo-cli/src/main.rs`](https://github.com/ariakage/soyo-harness/blob/main/crates/soyo-cli/src/main.rs) (CLI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_cli["CLI<br/>[main.rs]"]
  node_tui["TUI controller<br/>[controller.rs]"]
  node_tui_view["TUI rendering<br/>[mod.rs]"]
  node_desktop["Desktop app<br/>[App.tsx]"]
  node_desktop_state["Desktop state<br/>[useAppStore.ts]"]
  node_desktop_bindings["Desktop bindings<br/>[bindings.ts]"]
  node_host["Desktop host<br/>[service.rs]"]
  node_desktop_commands["Desktop commands<br/>[commands.rs]"]
end

subgraph group_runtime["Agent runtime"]
  node_runtime_engine["Agent runtime<br/>[mod.rs]"]
  node_runtime_services["Runtime services"]
  node_approvals["Approvals<br/>[approvals.rs]"]
  node_modes["Work modes<br/>[mode.rs]"]
end

subgraph group_capabilities["Runtime capabilities"]
  node_execution["Tool execution<br/>[execution.rs]"]
  node_browser["Browser tools<br/>[mod.rs]"]
  node_network["Network policy<br/>[network.rs]"]
  node_plugins["Plugin runtime<br/>[plugin_runtime.rs]"]
  node_hooks["Hooks<br/>[hooks.rs]"]
  node_mcp["MCP integration<br/>[mcp.rs]"]
end

subgraph group_persistence["State and services"]
  node_memory[("Global memory<br/>[query.rs]")]
  node_session[("Session storage<br/>[sqlite.rs]")]
end

node_user(("User"))

node_user -->|"submits work"| node_cli
node_user -->|"interacts"| node_tui
node_cli -->|"runs task"| node_runtime_engine
node_tui -->|"runs or compacts"| node_runtime_engine
node_tui -.->|"updates state"| node_tui_view
node_desktop -->|"uses state"| node_desktop_state
node_desktop_state -->|"invokes commands"| node_desktop_bindings
node_desktop_bindings -->|"calls IPC"| node_desktop_commands
node_desktop_commands -.->|"dispatches to host"| node_host
node_runtime_engine -.->|"uses services"| node_runtime_services
node_runtime_services -->|"imports"| node_approvals
node_runtime_services -->|"imports"| node_modes
node_runtime_services -->|"imports"| node_execution
node_runtime_services -->|"imports"| node_browser
node_runtime_services -->|"imports"| node_network
node_runtime_services -->|"imports"| node_plugins
node_runtime_services -->|"imports"| node_hooks
node_runtime_services -->|"configures servers"| node_mcp

click node_cli "https://github.com/ariakage/soyo-harness/blob/main/crates/soyo-cli/src/main.rs"
click node_tui "https://github.com/ariakage/soyo-harness/blob/main/crates/soyo-tui/src/controller.rs"
click node_tui_view "https://github.com/ariakage/soyo-harness/blob/main/crates/soyo-tui/src/view/mod.rs"
click node_desktop "https://github.com/ariakage/soyo-harness/blob/main/desktop/src/App.tsx"
click node_desktop_state "https://github.com/ariakage/soyo-harness/blob/main/desktop/src/store/useAppStore.ts"
click node_desktop_bindings "https://github.com/ariakage/soyo-harness/blob/main/desktop/src/bindings.ts"
click node_host "https://github.com/ariakage/soyo-harness/blob/main/crates/soyo-host/src/service.rs"
click node_runtime_engine "https://github.com/ariakage/soyo-harness/blob/main/crates/soyo-core/src/runtime/mod.rs"
click node_runtime_services "https://github.com/ariakage/soyo-harness/blob/main/crates/soyo-core/src/runtime_services.rs"
click node_approvals "https://github.com/ariakage/soyo-harness/blob/main/crates/soyo-core/src/approvals.rs"
click node_modes "https://github.com/ariakage/soyo-harness/blob/main/crates/soyo-core/src/mode.rs"
click node_execution "https://github.com/ariakage/soyo-harness/blob/main/crates/soyo-core/src/execution.rs"
click node_browser "https://github.com/ariakage/soyo-harness/blob/main/crates/soyo-core/src/browser/mod.rs"
click node_network "https://github.com/ariakage/soyo-harness/blob/main/crates/soyo-core/src/network.rs"
click node_plugins "https://github.com/ariakage/soyo-harness/blob/main/crates/soyo-core/src/plugin_runtime.rs"
click node_hooks "https://github.com/ariakage/soyo-harness/blob/main/crates/soyo-core/src/hooks.rs"
click node_mcp "https://github.com/ariakage/soyo-harness/blob/main/crates/soyo-core/src/mcp.rs"
click node_memory "https://github.com/ariakage/soyo-harness/blob/main/crates/soyo-core/src/global_memory/query.rs"
click node_session "https://github.com/ariakage/soyo-harness/blob/main/crates/soyo-core/src/sqlite.rs"
click node_desktop_commands "https://github.com/ariakage/soyo-harness/blob/main/desktop/src-tauri/src/commands.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_tui,node_tui_view,node_desktop,node_desktop_state,node_desktop_bindings,node_host,node_desktop_commands,node_user toneBlue
class node_runtime_engine,node_runtime_services,node_approvals,node_modes toneAmber
class node_execution,node_browser,node_network,node_plugins,node_hooks,node_mcp toneMint
class node_memory,node_session toneRose
```

## Components

### User interfaces

- [CLI](https://github.com/ariakage/soyo-harness/blob/main/crates/soyo-cli/src/main.rs): `crates/soyo-cli/src/main.rs`
- [TUI controller](https://github.com/ariakage/soyo-harness/blob/main/crates/soyo-tui/src/controller.rs): `crates/soyo-tui/src/controller.rs`
- [TUI rendering](https://github.com/ariakage/soyo-harness/blob/main/crates/soyo-tui/src/view/mod.rs): `crates/soyo-tui/src/view/mod.rs`
- [Desktop app](https://github.com/ariakage/soyo-harness/blob/main/desktop/src/App.tsx): `desktop/src/App.tsx`
- [Desktop state](https://github.com/ariakage/soyo-harness/blob/main/desktop/src/store/useAppStore.ts): `desktop/src/store/useAppStore.ts`
- [Desktop bindings](https://github.com/ariakage/soyo-harness/blob/main/desktop/src/bindings.ts): `desktop/src/bindings.ts`
- [Desktop host](https://github.com/ariakage/soyo-harness/blob/main/crates/soyo-host/src/service.rs): `crates/soyo-host/src/service.rs`
- [Desktop commands](https://github.com/ariakage/soyo-harness/blob/main/desktop/src-tauri/src/commands.rs): `desktop/src-tauri/src/commands.rs`

### Agent runtime

- [Agent runtime](https://github.com/ariakage/soyo-harness/blob/main/crates/soyo-core/src/runtime/mod.rs): `crates/soyo-core/src/runtime/mod.rs`
- [Runtime services](https://github.com/ariakage/soyo-harness/blob/main/crates/soyo-core/src/runtime_services.rs): `crates/soyo-core/src/runtime_services.rs`
- [Approvals](https://github.com/ariakage/soyo-harness/blob/main/crates/soyo-core/src/approvals.rs): `crates/soyo-core/src/approvals.rs`
- [Work modes](https://github.com/ariakage/soyo-harness/blob/main/crates/soyo-core/src/mode.rs): `crates/soyo-core/src/mode.rs`

### Runtime capabilities

- [Tool execution](https://github.com/ariakage/soyo-harness/blob/main/crates/soyo-core/src/execution.rs): `crates/soyo-core/src/execution.rs`
- [Browser tools](https://github.com/ariakage/soyo-harness/blob/main/crates/soyo-core/src/browser/mod.rs): `crates/soyo-core/src/browser/mod.rs`
- [Network policy](https://github.com/ariakage/soyo-harness/blob/main/crates/soyo-core/src/network.rs): `crates/soyo-core/src/network.rs`
- [Plugin runtime](https://github.com/ariakage/soyo-harness/blob/main/crates/soyo-core/src/plugin_runtime.rs): `crates/soyo-core/src/plugin_runtime.rs`
- [Hooks](https://github.com/ariakage/soyo-harness/blob/main/crates/soyo-core/src/hooks.rs): `crates/soyo-core/src/hooks.rs`
- [MCP integration](https://github.com/ariakage/soyo-harness/blob/main/crates/soyo-core/src/mcp.rs): `crates/soyo-core/src/mcp.rs`

### State and services

- [Global memory](https://github.com/ariakage/soyo-harness/blob/main/crates/soyo-core/src/global_memory/query.rs): `crates/soyo-core/src/global_memory/query.rs`
- [Session storage](https://github.com/ariakage/soyo-harness/blob/main/crates/soyo-core/src/sqlite.rs): `crates/soyo-core/src/sqlite.rs`

### Other components

- **User**

## Connections

- User → CLI: submits work
- User → TUI controller: interacts
- CLI → Agent runtime: runs task (evidence: `crates/soyo-cli/src/main.rs`)
- TUI controller → Agent runtime: runs or compacts (evidence: `crates/soyo-tui/src/controller.rs`)
- TUI controller → TUI rendering: updates state
- Desktop app → Desktop state: uses state (evidence: `desktop/src/App.tsx`)
- Desktop state → Desktop bindings: invokes commands (evidence: `desktop/src/store/useAppStore.ts`)
- Desktop bindings → Desktop commands: calls IPC (evidence: `desktop/src/bindings.ts`)
- Desktop commands → Desktop host: dispatches to host
- Agent runtime → Runtime services: uses services
- Runtime services → Approvals: imports (evidence: `crates/soyo-core/src/runtime_services.rs`)
- Runtime services → Work modes: imports (evidence: `crates/soyo-core/src/runtime_services.rs`)
- Runtime services → Tool execution: imports (evidence: `crates/soyo-core/src/runtime_services.rs`)
- Runtime services → Browser tools: imports (evidence: `crates/soyo-core/src/runtime_services.rs`)
- Runtime services → Network policy: imports (evidence: `crates/soyo-core/src/runtime_services.rs`)
- Runtime services → Plugin runtime: imports (evidence: `crates/soyo-core/src/runtime_services.rs`)
- Runtime services → Hooks: imports (evidence: `crates/soyo-core/src/runtime_services.rs`)
- Runtime services → MCP integration: configures servers (evidence: `crates/soyo-core/src/runtime_services.rs`)
