# edsuuu/magoagent architecture

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

- Interactive diagram: https://gitdiagram.com/edsuuu/magoagent
- Repository: https://github.com/edsuuu/magoagent

## Overview

MagoAgent is a native canvas for coordinating AI agents that run in real terminals. The main workflow is to arrange agents and project resources on the canvas, connect them, and let agents communicate through the CLI or MCP; people can monitor work in chat and the agent panel, including by voice. The README documents the major product branches; source excerpts and the index support selected internal relationships, but many UI and domain implementations were not sampled, so uncertain wiring is omitted.

Main entry points: [`src/app/mod.rs`](https://github.com/edsuuu/magoagent/blob/main/src/app/mod.rs) (Canvas App), [`src/app/filetree/mod.rs`](https://github.com/edsuuu/magoagent/blob/main/src/app/filetree/mod.rs) (File Tree), [`src/render/mod.rs`](https://github.com/edsuuu/magoagent/blob/main/src/render/mod.rs) (Canvas Rendering), [`src/app/terminal/mod.rs`](https://github.com/edsuuu/magoagent/blob/main/src/app/terminal/mod.rs) (Agent Terminals)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_canvas["Canvas and Agents"]
  node_canvas_app["Canvas App<br/>[mod.rs]"]
  node_canvas_tools["Canvas Editing<br/>[tool.rs]"]
  node_agents["Agent Panel<br/>[agents.rs]"]
  node_maestro["Maestro Teams<br/>[mod.rs]"]
  node_terminals["Agent Terminals<br/>[mod.rs]"]
  node_terminal_runtime["PTY Runtime<br/>[mod.rs]"]
  node_chat["Agent Chat<br/>[mod.rs]"]
  node_notes["Sticky Notes<br/>[stack.rs]"]
end

subgraph group_project["Project Workspace"]
  node_portals["Browser Portals<br/>[mod.rs]"]
  node_filetree["File Tree<br/>[mod.rs]"]
  node_ide["Code IDE<br/>[mod.rs]"]
  node_ide_text["Text Editing<br/>[text.rs]"]
  node_ide_hints["Code Hints<br/>[hints.rs]"]
  node_git["Git Tools<br/>[merge.rs]"]
  node_databases["Database Panel<br/>[mod.rs]"]
  node_db_grid["Data Grid<br/>[grid.rs]"]
  node_webview["Web View"]
end

subgraph group_interfaces["Agent Interfaces"]
  node_cli_bridge["Local Agent Bridge<br/>[server.rs]"]
  node_bridge_client["Bridge Client<br/>[client.rs]"]
  node_mcp["MCP Server<br/>[mod.rs]"]
  node_mcp_tools["MCP App Tools<br/>[app_tools.rs]"]
end

subgraph group_core["App and Rendering"]
  node_model["Canvas Model<br/>[scene.rs]"]
  node_file_storage["Drawing Storage<br/>[mod.rs]"]
  node_render["Canvas Rendering<br/>[mod.rs]"]
  node_replay["Stroke Replay<br/>[replay.rs]"]
  node_rough["Hand Drawn Style<br/>[rough.rs]"]
  node_svg["SVG Export<br/>[svg.rs]"]
end

subgraph group_voice["Voice Control"]
  node_voice["Voice Call<br/>[mod.rs]"]
  node_voice_window["Voice UI<br/>[mod.rs]"]
  node_speech_service["Speech Services"]
end

node_person(("Person"))

node_person -->|"uses"| node_canvas_app
node_canvas_app -.->|"provides editing"| node_canvas_tools
node_canvas_app -->|"shows status"| node_agents
node_canvas_app -->|"hosts agents"| node_terminals
node_terminals -->|"runs shell"| node_terminal_runtime
node_canvas_app -->|"shows conversations"| node_chat
node_canvas_app -->|"hosts notes"| node_notes
node_maestro -->|"recruits agents"| node_terminals
node_terminals -->|"uses CLI"| node_cli_bridge
node_cli_bridge -.->|"exchanges requests"| node_bridge_client
node_person -->|"connects AI client"| node_mcp
node_mcp -->|"dispatches app tools"| node_mcp_tools
node_mcp_tools -->|"controls app"| node_canvas_app
node_mcp -->|"reads shared autosave"| node_file_storage
node_canvas_app -->|"hosts project tree"| node_filetree
node_filetree -->|"opens code pane"| node_ide
node_ide -->|"uses text tools"| node_ide_text
node_ide -->|"provides hints"| node_ide_hints
node_filetree -->|"shows changes"| node_git
node_filetree -->|"hosts database panel"| node_databases
node_databases -->|"displays tables"| node_db_grid
node_canvas_app -->|"hosts portals"| node_portals
node_portals -.->|"displays pages"| node_webview
node_canvas_app -.->|"edits scene"| node_model
node_canvas_app -->|"draws canvas"| node_render
node_render -->|"replays strokes"| node_replay
node_render -->|"uses hand style"| node_rough
node_render -->|"exports SVG"| node_svg
node_person -->|"gives spoken commands"| node_voice_window
node_voice_window -.->|"controls call"| node_voice
node_voice -->|"uses speech engines"| node_speech_service
node_voice -->|"triggers app actions"| node_canvas_app

click node_canvas_app "https://github.com/edsuuu/magoagent/blob/main/src/app/mod.rs"
click node_canvas_tools "https://github.com/edsuuu/magoagent/blob/main/src/app/canvas/tool.rs"
click node_agents "https://github.com/edsuuu/magoagent/blob/main/src/app/ui/agents.rs"
click node_maestro "https://github.com/edsuuu/magoagent/blob/main/src/app/maestro/mod.rs"
click node_terminals "https://github.com/edsuuu/magoagent/blob/main/src/app/terminal/mod.rs"
click node_terminal_runtime "https://github.com/edsuuu/magoagent/blob/main/src/terminal/mod.rs"
click node_chat "https://github.com/edsuuu/magoagent/blob/main/src/app/chat/mod.rs"
click node_notes "https://github.com/edsuuu/magoagent/blob/main/src/app/notes/stack.rs"
click node_portals "https://github.com/edsuuu/magoagent/blob/main/src/app/browser/mod.rs"
click node_filetree "https://github.com/edsuuu/magoagent/blob/main/src/app/filetree/mod.rs"
click node_ide "https://github.com/edsuuu/magoagent/blob/main/src/ide/mod.rs"
click node_ide_text "https://github.com/edsuuu/magoagent/blob/main/src/ide/text.rs"
click node_ide_hints "https://github.com/edsuuu/magoagent/blob/main/src/ide/hints.rs"
click node_git "https://github.com/edsuuu/magoagent/blob/main/src/ide/merge.rs"
click node_databases "https://github.com/edsuuu/magoagent/blob/main/src/db/mod.rs"
click node_db_grid "https://github.com/edsuuu/magoagent/blob/main/src/db/grid.rs"
click node_cli_bridge "https://github.com/edsuuu/magoagent/blob/main/src/bridge/server.rs"
click node_bridge_client "https://github.com/edsuuu/magoagent/blob/main/src/bridge/client.rs"
click node_mcp "https://github.com/edsuuu/magoagent/blob/main/src/mcp/mod.rs"
click node_mcp_tools "https://github.com/edsuuu/magoagent/blob/main/src/mcp/app_tools.rs"
click node_model "https://github.com/edsuuu/magoagent/blob/main/src/model/scene.rs"
click node_file_storage "https://github.com/edsuuu/magoagent/blob/main/src/file/mod.rs"
click node_render "https://github.com/edsuuu/magoagent/blob/main/src/render/mod.rs"
click node_replay "https://github.com/edsuuu/magoagent/blob/main/src/render/replay.rs"
click node_rough "https://github.com/edsuuu/magoagent/blob/main/src/render/rough.rs"
click node_svg "https://github.com/edsuuu/magoagent/blob/main/src/render/svg.rs"
click node_voice "https://github.com/edsuuu/magoagent/blob/main/src/voice/mod.rs"
click node_voice_window "https://github.com/edsuuu/magoagent/blob/main/src/app/voice/mod.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_canvas_app,node_canvas_tools,node_agents,node_maestro,node_terminals,node_terminal_runtime,node_chat,node_notes toneBlue
class node_portals,node_filetree,node_ide,node_ide_text,node_ide_hints,node_git,node_databases,node_db_grid,node_webview toneAmber
class node_cli_bridge,node_bridge_client,node_mcp,node_mcp_tools toneMint
class node_model,node_file_storage,node_render,node_replay,node_rough,node_svg toneRose
class node_voice,node_voice_window,node_speech_service,node_person toneIndigo
```

## Components

### Canvas and Agents

- [Canvas App](https://github.com/edsuuu/magoagent/blob/main/src/app/mod.rs): `src/app/mod.rs`
- [Canvas Editing](https://github.com/edsuuu/magoagent/blob/main/src/app/canvas/tool.rs): `src/app/canvas/tool.rs`
- [Agent Panel](https://github.com/edsuuu/magoagent/blob/main/src/app/ui/agents.rs): `src/app/ui/agents.rs`
- [Maestro Teams](https://github.com/edsuuu/magoagent/blob/main/src/app/maestro/mod.rs): `src/app/maestro/mod.rs`
- [Agent Terminals](https://github.com/edsuuu/magoagent/blob/main/src/app/terminal/mod.rs): `src/app/terminal/mod.rs`
- [PTY Runtime](https://github.com/edsuuu/magoagent/blob/main/src/terminal/mod.rs): `src/terminal/mod.rs`
- [Agent Chat](https://github.com/edsuuu/magoagent/blob/main/src/app/chat/mod.rs): `src/app/chat/mod.rs`
- [Sticky Notes](https://github.com/edsuuu/magoagent/blob/main/src/app/notes/stack.rs): `src/app/notes/stack.rs`

### Project Workspace

- [Browser Portals](https://github.com/edsuuu/magoagent/blob/main/src/app/browser/mod.rs): `src/app/browser/mod.rs`
- [File Tree](https://github.com/edsuuu/magoagent/blob/main/src/app/filetree/mod.rs): `src/app/filetree/mod.rs`
- [Code IDE](https://github.com/edsuuu/magoagent/blob/main/src/ide/mod.rs): `src/ide/mod.rs`
- [Text Editing](https://github.com/edsuuu/magoagent/blob/main/src/ide/text.rs): `src/ide/text.rs`
- [Code Hints](https://github.com/edsuuu/magoagent/blob/main/src/ide/hints.rs): `src/ide/hints.rs`
- [Git Tools](https://github.com/edsuuu/magoagent/blob/main/src/ide/merge.rs): `src/ide/merge.rs`
- [Database Panel](https://github.com/edsuuu/magoagent/blob/main/src/db/mod.rs): `src/db/mod.rs`
- [Data Grid](https://github.com/edsuuu/magoagent/blob/main/src/db/grid.rs): `src/db/grid.rs`
- **Web View**

### Agent Interfaces

- [Local Agent Bridge](https://github.com/edsuuu/magoagent/blob/main/src/bridge/server.rs): `src/bridge/server.rs`
- [Bridge Client](https://github.com/edsuuu/magoagent/blob/main/src/bridge/client.rs): `src/bridge/client.rs`
- [MCP Server](https://github.com/edsuuu/magoagent/blob/main/src/mcp/mod.rs): `src/mcp/mod.rs`
- [MCP App Tools](https://github.com/edsuuu/magoagent/blob/main/src/mcp/app_tools.rs): `src/mcp/app_tools.rs`

### App and Rendering

- [Canvas Model](https://github.com/edsuuu/magoagent/blob/main/src/model/scene.rs): `src/model/scene.rs`
- [Drawing Storage](https://github.com/edsuuu/magoagent/blob/main/src/file/mod.rs): `src/file/mod.rs`
- [Canvas Rendering](https://github.com/edsuuu/magoagent/blob/main/src/render/mod.rs): `src/render/mod.rs`
- [Stroke Replay](https://github.com/edsuuu/magoagent/blob/main/src/render/replay.rs): `src/render/replay.rs`
- [Hand Drawn Style](https://github.com/edsuuu/magoagent/blob/main/src/render/rough.rs): `src/render/rough.rs`
- [SVG Export](https://github.com/edsuuu/magoagent/blob/main/src/render/svg.rs): `src/render/svg.rs`

### Voice Control

- [Voice Call](https://github.com/edsuuu/magoagent/blob/main/src/voice/mod.rs): `src/voice/mod.rs`
- [Voice UI](https://github.com/edsuuu/magoagent/blob/main/src/app/voice/mod.rs): `src/app/voice/mod.rs`
- **Speech Services**

### Other components

- **Person**

## Connections

- Person → Canvas App: uses (evidence: `README.md`)
- Canvas App → Canvas Editing: provides editing
- Canvas App → Agent Panel: shows status (evidence: `README.md`)
- Canvas App → Agent Terminals: hosts agents (evidence: `README.md`)
- Agent Terminals → PTY Runtime: runs shell (evidence: `README.md`)
- Canvas App → Agent Chat: shows conversations (evidence: `README.md`)
- Canvas App → Sticky Notes: hosts notes (evidence: `README.md`)
- Maestro Teams → Agent Terminals: recruits agents (evidence: `README.md`)
- Agent Terminals → Local Agent Bridge: uses CLI (evidence: `README.md`)
- Local Agent Bridge → Bridge Client: exchanges requests
- Person → MCP Server: connects AI client (evidence: `README.md`)
- MCP Server → MCP App Tools: dispatches app tools (evidence: `src/mcp/mod.rs`)
- MCP App Tools → Canvas App: controls app (evidence: `README.md`)
- MCP Server → Drawing Storage: reads shared autosave (evidence: `src/mcp/mod.rs`)
- Canvas App → File Tree: hosts project tree (evidence: `README.md`)
- File Tree → Code IDE: opens code pane (evidence: `src/app/filetree/mod.rs`)
- Code IDE → Text Editing: uses text tools (evidence: `src/ide/mod.rs`)
- Code IDE → Code Hints: provides hints (evidence: `src/ide/mod.rs`)
- File Tree → Git Tools: shows changes (evidence: `README.md`)
- File Tree → Database Panel: hosts database panel (evidence: `src/app/filetree/mod.rs`)
- Database Panel → Data Grid: displays tables (evidence: `src/db/mod.rs`)
- Canvas App → Browser Portals: hosts portals (evidence: `README.md`)
- Browser Portals → Web View: displays pages
- Canvas App → Canvas Model: edits scene
- Canvas App → Canvas Rendering: draws canvas (evidence: `src/main.rs`)
- Canvas Rendering → Stroke Replay: replays strokes (evidence: `src/render/mod.rs`)
- Canvas Rendering → Hand Drawn Style: uses hand style (evidence: `src/render/mod.rs`)
- Canvas Rendering → SVG Export: exports SVG (evidence: `src/render/mod.rs`)
- Person → Voice UI: gives spoken commands (evidence: `README.md`)
- Voice UI → Voice Call: controls call
- Voice Call → Speech Services: uses speech engines (evidence: `src/voice/mod.rs`)
- Voice Call → Canvas App: triggers app actions (evidence: `README.md`)
