- Updated markdown rendering logic to use more concise methods for obtaining vector lengths. - Changed review status display to use the correct flag from settings. - Cleaned up sidebar rendering code for better formatting and readability. - Enhanced status bar rendering with improved string formatting and consistent style application. - Refined workflow panel rendering, ensuring consistent style usage and improved readability. - Added architecture overview and detailed documentation for backend, data, dependencies, and frontend structures.
4.3 KiB
4.3 KiB
Architecture Overview
System Layout
Zesdex is an autonomous AI coding agent with a TUI — an LLM client wrapped in a tool-use harness with 37 built-in tools.
┌─────────────────────────────────────────────────────────────┐
│ Process Mode │
│ Single-Process ─── Daemon (background) ─── Attach (client) │
└──────────────────────────┬──────────────────────────────────┘
│ IPC (Unix domain socket)
▼
┌─────────────────────────────────────────────────────────────┐
│ src/main.rs │
│ ┌──────────────┐ ┌──────────────┐ ┌────────────────┐ │
│ │ Controller │──▶│ Runtime │──▶│ View │ │
│ │ (input.rs) │ │ (actions.rs) │ │ (chat,status,…)│ │
│ └──────────────┘ └──────┬───────┘ └────────────────┘ │
│ │ │
│ ┌───────▼────────┐ │
│ │ Harness │ │
│ │ (tool dispatch)│ │
│ └───────┬────────┘ │
│ │ │
│ ┌─────────────────┼─────────────────┐ │
│ ▼ ▼ ▼ │
│ ┌─────────┐ ┌────────────┐ ┌───────────────┐ │
│ │ Tools │ │ Subagents │ │ Workflow │ │
│ │ (37x) │ │ (auto/gen) │ │ Engine │ │
│ └─────────┘ └────────────┘ │ (hive_mind) │ │
│ └───────────────┘ │
└─────────────────────────────────────────────────────────────┘
Process Modes
| Mode | Description |
|---|---|
| Single-process | TUI + agent run in the same process. Simplest mode. |
| Daemon | --daemon flag. Agent processes state in background; clients attach to render. |
| Attach | --attach <id> flag. Connect to existing daemon with IPC. |
In daemon mode, the daemon runs the full agent loop; clients are stateless renderers that sync via Unix domain sockets with diff-based state synchronization.
Data Flow
- Input →
controller/input.rshandles key events and autocomplete - Dispatch →
app/runtime/actions/mod.rsapplies actions to state (AppStateRest) - LLM Stream →
app/runtime/stream/mod.rsparses SSE chunks into typed events - Tool Execution →
app/harness.rsgates and runs tool calls via theTooltrait - Rendering →
view/modules readAppStateRestand render via ratatui
Key Files
| File | Purpose |
|---|---|
src/main.rs |
Entry point, process mode dispatch, TUI init |
src/app/state/rest.rs |
Single source-of-truth state struct |
src/app/runtime/actions/mod.rs |
State reducer (apply_action) |
src/app/runtime/stream/mod.rs |
SSE stream parser |
src/app/harness.rs |
Tool harness with safety gating |
src/app/workflow/hive_mind.rs |
Multi-agent orchestration |
src/tool/mod.rs |
Tool trait + registry (37 tools) |
src/view/mod.rs |
TUI render pipeline |