# dedene/zentty architecture

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

- Interactive diagram: https://gitdiagram.com/dedene/zentty
- Repository: https://github.com/dedene/zentty

## Overview

Zentty is a native macOS terminal for agent-driven development, built around Ghostty. Users arrange worklanes and panes, run shell sessions or coding agents, and monitor agent and project activity from the sidebar and menu bar. The app also restores workspaces, discovers task runners and local servers, supports remote file pasting, and exposes an embedded CLI. The graph combines documented capabilities with source-index references and excerpts; many feature implementations were not sampled, so only documented or indexed relationships are connected.

Main entry points: [`Zentty/UI/RootViewController.swift`](https://github.com/dedene/zentty/blob/main/Zentty/UI/RootViewController.swift) (App interface), [`Zentty/AppState/WorklaneStore.swift`](https://github.com/dedene/zentty/blob/main/Zentty/AppState/WorklaneStore.swift) (Worklane state), [`Zentty/Terminal/LibghosttyView.swift`](https://github.com/dedene/zentty/blob/main/Zentty/Terminal/LibghosttyView.swift) (Terminal surface), [`Zentty/MainWindowController.swift`](https://github.com/dedene/zentty/blob/main/Zentty/MainWindowController.swift) (Window controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Workspace and UI"]
  node_window["Window controller"]
  node_root["App interface"]
  node_canvas["Worklane canvas"]
  node_layout["Pane layout state"]
  node_worklanes["Worklane state"]
  node_restore["Workspace restore"]
end

subgraph group_terminal["Terminal and remote"]
  node_terminalview["Terminal surface"]
  node_ghostty["libghostty"]
  node_clean["Clean copy"]
  node_remote["Remote file paste"]
end

subgraph group_agents["Agent integrations"]
  node_agents["Agent event integration"]
  node_adapters["Agent event adapters"]
  node_presentation["Agent presentation"]
  node_status["Agent status UI"]
  node_agenttools["Supported agents"]
end

subgraph group_projects["Project tooling"]
  node_servers["Server discovery"]
  node_taskrunners["Task runner discovery"]
  node_search["Global search"]
end

subgraph group_platform["Configuration and control"]
  node_config[("App configuration")]
  node_cli["Embedded CLI<br/>[ZenttyCLI.swift]"]
end

node_user(("Developer"))
node_developer(("Coding agent"))

node_user -->|"uses"| node_window
node_window -->|"hosts"| node_root
node_root -->|"displays"| node_canvas
node_root -->|"coordinates"| node_worklanes
node_worklanes -->|"manages"| node_layout
node_worklanes -.->|"restores"| node_restore
node_canvas -.->|"shows panes"| node_terminalview
node_terminalview -.->|"renders with"| node_ghostty
node_user -->|"copies output"| node_clean
node_user -->|"pastes files"| node_remote
node_remote -->|"uploads via SSH"| node_terminalview
node_developer -.->|"runs in pane"| node_terminalview
node_developer -.->|"sends events"| node_adapters
node_adapters -.->|"adapts events"| node_agents
node_agents -.->|"resolves phase"| node_presentation
node_presentation -.->|"drives status"| node_status
node_agenttools -.->|"integrates"| node_agents
node_root -->|"coordinates"| node_servers
node_servers -->|"uses workspace state"| node_worklanes
node_root -->|"discovers tasks"| node_taskrunners
node_user -->|"searches panes"| node_search
node_window -->|"loads settings"| node_config
node_user -->|"commands workspace"| node_cli

click node_window "https://github.com/dedene/zentty/blob/main/Zentty/MainWindowController.swift"
click node_root "https://github.com/dedene/zentty/blob/main/Zentty/UI/RootViewController.swift"
click node_canvas "https://github.com/dedene/zentty/blob/main/Zentty/UI/Canvas/AppCanvasView.swift"
click node_layout "https://github.com/dedene/zentty/blob/main/Zentty/Layout/PaneStripState.swift"
click node_worklanes "https://github.com/dedene/zentty/blob/main/Zentty/AppState/WorklaneStore.swift"
click node_restore "https://github.com/dedene/zentty/blob/main/Zentty/Restore/SessionRestoreStore.swift"
click node_terminalview "https://github.com/dedene/zentty/blob/main/Zentty/Terminal/LibghosttyView.swift"
click node_clean "https://github.com/dedene/zentty/blob/main/Zentty/Terminal/CleanCopyPipeline.swift"
click node_remote "https://github.com/dedene/zentty/blob/main/Zentty/UI/RemotePaste/RemoteImagePasteController.swift"
click node_agents "https://github.com/dedene/zentty/blob/main/Zentty/AppState/Agent/AgentEventBridge.swift"
click node_adapters "https://github.com/dedene/zentty/tree/main/Zentty/AppState/Agent/EventAdapters"
click node_presentation "https://github.com/dedene/zentty/blob/main/Zentty/AppState/Agent/Presentation/PresentationPipeline.swift"
click node_status "https://github.com/dedene/zentty/blob/main/Zentty/UI/MenuBar/MenuBarStatusController.swift"
click node_agenttools "https://github.com/dedene/zentty/tree/main/Zentty/AppState/Agent"
click node_servers "https://github.com/dedene/zentty/blob/main/Zentty/Servers/WindowServerCommandService.swift"
click node_taskrunners "https://github.com/dedene/zentty/blob/main/Zentty/TaskRunners/TaskRunnerDiscoveryService.swift"
click node_search "https://github.com/dedene/zentty/blob/main/Zentty/UI/Search/GlobalSearchCoordinator.swift"
click node_config "https://github.com/dedene/zentty/blob/main/Zentty/Config/AppConfigStore.swift"
click node_cli "https://github.com/dedene/zentty/blob/main/ZenttyCLI/ZenttyCLI.swift"

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_window,node_root,node_canvas,node_layout,node_worklanes,node_restore toneBlue
class node_terminalview,node_ghostty,node_clean,node_remote toneAmber
class node_agents,node_adapters,node_presentation,node_status,node_agenttools toneMint
class node_servers,node_taskrunners,node_search toneRose
class node_config,node_cli,node_user,node_developer toneIndigo
```

## Components

### Workspace and UI

- [Window controller](https://github.com/dedene/zentty/blob/main/Zentty/MainWindowController.swift): `Zentty/MainWindowController.swift`
- [App interface](https://github.com/dedene/zentty/blob/main/Zentty/UI/RootViewController.swift): `Zentty/UI/RootViewController.swift`
- [Worklane canvas](https://github.com/dedene/zentty/blob/main/Zentty/UI/Canvas/AppCanvasView.swift): `Zentty/UI/Canvas/AppCanvasView.swift`
- [Pane layout state](https://github.com/dedene/zentty/blob/main/Zentty/Layout/PaneStripState.swift): `Zentty/Layout/PaneStripState.swift`
- [Worklane state](https://github.com/dedene/zentty/blob/main/Zentty/AppState/WorklaneStore.swift): `Zentty/AppState/WorklaneStore.swift`
- [Workspace restore](https://github.com/dedene/zentty/blob/main/Zentty/Restore/SessionRestoreStore.swift): `Zentty/Restore/SessionRestoreStore.swift`

### Terminal and remote

- [Terminal surface](https://github.com/dedene/zentty/blob/main/Zentty/Terminal/LibghosttyView.swift): `Zentty/Terminal/LibghosttyView.swift`
- **libghostty**
- [Clean copy](https://github.com/dedene/zentty/blob/main/Zentty/Terminal/CleanCopyPipeline.swift): `Zentty/Terminal/CleanCopyPipeline.swift`
- [Remote file paste](https://github.com/dedene/zentty/blob/main/Zentty/UI/RemotePaste/RemoteImagePasteController.swift): `Zentty/UI/RemotePaste/RemoteImagePasteController.swift`

### Agent integrations

- [Agent event integration](https://github.com/dedene/zentty/blob/main/Zentty/AppState/Agent/AgentEventBridge.swift): `Zentty/AppState/Agent/AgentEventBridge.swift`
- [Agent event adapters](https://github.com/dedene/zentty/tree/main/Zentty/AppState/Agent/EventAdapters): `Zentty/AppState/Agent/EventAdapters`
- [Agent presentation](https://github.com/dedene/zentty/blob/main/Zentty/AppState/Agent/Presentation/PresentationPipeline.swift): `Zentty/AppState/Agent/Presentation/PresentationPipeline.swift`
- [Agent status UI](https://github.com/dedene/zentty/blob/main/Zentty/UI/MenuBar/MenuBarStatusController.swift): `Zentty/UI/MenuBar/MenuBarStatusController.swift`
- [Supported agents](https://github.com/dedene/zentty/tree/main/Zentty/AppState/Agent): `Zentty/AppState/Agent`

### Project tooling

- [Server discovery](https://github.com/dedene/zentty/blob/main/Zentty/Servers/WindowServerCommandService.swift): `Zentty/Servers/WindowServerCommandService.swift`
- [Task runner discovery](https://github.com/dedene/zentty/blob/main/Zentty/TaskRunners/TaskRunnerDiscoveryService.swift): `Zentty/TaskRunners/TaskRunnerDiscoveryService.swift`
- [Global search](https://github.com/dedene/zentty/blob/main/Zentty/UI/Search/GlobalSearchCoordinator.swift): `Zentty/UI/Search/GlobalSearchCoordinator.swift`

### Configuration and control

- [App configuration](https://github.com/dedene/zentty/blob/main/Zentty/Config/AppConfigStore.swift): `Zentty/Config/AppConfigStore.swift`
- [Embedded CLI](https://github.com/dedene/zentty/blob/main/ZenttyCLI/ZenttyCLI.swift): `ZenttyCLI/ZenttyCLI.swift`

### Other components

- **Developer**
- **Coding agent**

## Connections

- Developer → Window controller: uses (evidence: `README.md`)
- Window controller → App interface: hosts (evidence: `Zentty/MainWindowController.swift`)
- App interface → Worklane canvas: displays (evidence: `Zentty/UI/RootViewController.swift`)
- App interface → Worklane state: coordinates (evidence: `Zentty/UI/RootViewController.swift`)
- Worklane state → Pane layout state: manages (evidence: `Zentty/Layout/PaneStripState.swift`)
- Worklane state → Workspace restore: restores (evidence: `README.md`)
- Worklane canvas → Terminal surface: shows panes (evidence: `README.md`)
- Terminal surface → libghostty: renders with (evidence: `README.md`)
- Developer → Clean copy: copies output (evidence: `README.md`)
- Developer → Remote file paste: pastes files (evidence: `README.md`)
- Remote file paste → Terminal surface: uploads via SSH (evidence: `Zentty/UI/RemotePaste/RemoteImagePasteController.swift`)
- Coding agent → Terminal surface: runs in pane (evidence: `README.md`)
- Coding agent → Agent event adapters: sends events (evidence: `README.md`)
- Agent event adapters → Agent event integration: adapts events
- Agent event integration → Agent presentation: resolves phase (evidence: `Zentty/AppState/Agent/Presentation/PresentationPipeline.swift`)
- Agent presentation → Agent status UI: drives status (evidence: `README.md`)
- Supported agents → Agent event integration: integrates (evidence: `README.md`)
- App interface → Server discovery: coordinates (evidence: `Zentty/UI/RootViewController.swift`)
- Server discovery → Worklane state: uses workspace state (evidence: `Zentty/Servers/WindowServerCommandService.swift`)
- App interface → Task runner discovery: discovers tasks (evidence: `Zentty/UI/RootViewController.swift`)
- Developer → Global search: searches panes (evidence: `README.md`)
- Window controller → App configuration: loads settings (evidence: `Zentty/MainWindowController.swift`)
- Developer → Embedded CLI: commands workspace (evidence: `README.md`)
