# flykit-cc/dsh-flykit architecture

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

- Interactive diagram: https://gitdiagram.com/flykit-cc/dsh-flykit
- Repository: https://github.com/flykit-cc/dsh-flykit

## Overview

dsh-flykit extends DeepSeek Harness’s web GUI into an agent cockpit. A user opens the session panel to browse and edit workspace files, preview supported documents, and watch filesystem changes; they can also start or control coding-agent PTYs and inspect their output. The host plugin scopes workspace operations to the session and exposes routes consumed by the browser client. Separate branches provide model selection and status, Claude usage, OpenRouter catalog refresh, and an embedded WhatsApp viewer. The README documents these capabilities; unsampled implementation details and uncertain wiring are omitted.

Main entry points: [`src/index.ts`](https://github.com/flykit-cc/dsh-flykit/blob/main/src/index.ts) (Host routes), [`src/client/FilePanel.tsx`](https://github.com/flykit-cc/dsh-flykit/blob/main/src/client/FilePanel.tsx) (File panel), [`src/terminals.ts`](https://github.com/flykit-cc/dsh-flykit/blob/main/src/terminals.ts) (PTY service), [`src/client/index.ts`](https://github.com/flykit-cc/dsh-flykit/blob/main/src/client/index.ts) (Client plugin)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_host["Host services"]
  node_files["Workspace files<br/>[files.ts]"]
  node_git["Git status<br/>[git.ts]"]
  node_watch["File watcher<br/>[watch.ts]"]
  node_host_plugin["Host routes<br/>[index.ts]"]
end

subgraph group_cockpit["Browser cockpit"]
  node_client_plugin["Client plugin<br/>[index.ts]"]
  node_file_panel["File panel<br/>[FilePanel.tsx]"]
  node_explorer["Explorer tree<br/>[Explorer.tsx]"]
  node_editor["Editor and preview<br/>[Editor.tsx]"]
  node_preview["Document preview<br/>[Preview.tsx]"]
  node_terminal_ui["Terminal views<br/>[Terminals.tsx]"]
end

subgraph group_agents["Agent terminals"]
  node_terminal_service["PTY service<br/>[terminals.ts]"]
  node_terminal_io["Terminal output<br/>[term-io.ts]"]
  node_agent_tools["Agent tools<br/>[agent-tools.ts]"]
  node_notify["Agent notifications<br/>[notify.ts]"]
end

subgraph group_models["Models and status"]
  node_status["Status line<br/>[StatusLine.tsx]"]
  node_model_picker["Model picker<br/>[ModelPicker.tsx]"]
  node_catalog["Catalog sync<br/>[catalog-sync.ts]"]
  node_usage["Claude usage<br/>[claude-usage.ts]"]
end

subgraph group_apps["Embedded apps"]
  node_apps_ui["Apps tab<br/>[Apps.tsx]"]
  node_apps_service["App startup<br/>[apps.ts]"]
  node_app_proxy["App proxy<br/>[apps-proxy.ts]"]
  node_whatsapp["WhatsApp viewer<br/>[wa.mjs]"]
end

node_user(("DSH user"))
node_harness{{"DSH host"}}
node_workspace["Session workspace"]
node_settings[("DSH settings")]
node_openrouter{{"OpenRouter catalog"}}
node_anthropic{{"Anthropic usage API"}}
node_chrome{{"Headless Chrome"}}

node_user -->|"opens web UI"| node_harness
node_harness -->|"loads plugin"| node_host_plugin
node_harness -->|"loads client"| node_client_plugin
node_user -->|"uses panel"| node_file_panel
node_client_plugin -->|"injects panel"| node_file_panel
node_file_panel -->|"shows files"| node_explorer
node_file_panel -->|"opens files"| node_editor
node_editor -->|"renders documents"| node_preview
node_file_panel -->|"requests session data"| node_host_plugin
node_host_plugin -->|"lists and accesses"| node_files
node_files -->|"reads and writes"| node_workspace
node_host_plugin -->|"gets status"| node_git
node_git -->|"checks repository"| node_workspace
node_host_plugin -->|"streams changes"| node_watch
node_watch -->|"watches files"| node_workspace
node_user -->|"uses agents tab"| node_terminal_ui
node_terminal_ui -->|"sends terminal requests"| node_host_plugin
node_host_plugin -->|"manages PTYs"| node_terminal_service
node_terminal_service -->|"starts in workspace"| node_workspace
node_terminal_service -->|"buffers output"| node_terminal_io
node_terminal_ui -->|"renders stream"| node_terminal_io
node_harness -->|"registers tools"| node_agent_tools
node_agent_tools -->|"starts and controls"| node_terminal_service
node_agent_tools -->|"reads output"| node_terminal_io
node_terminal_service -->|"signals output changes"| node_notify
node_notify -->|"sends agent message"| node_harness
node_client_plugin -->|"injects status"| node_status
node_client_plugin -->|"injects picker"| node_model_picker
node_model_picker -->|"uses model directory"| node_harness
node_host_plugin -->|"runs catalog refresh"| node_catalog
node_catalog -.->|"fetches models"| node_openrouter
node_catalog -->|"writes model list"| node_settings
node_host_plugin -->|"serves usage"| node_usage
node_usage -.->|"fetches usage"| node_anthropic
node_user -->|"opens Apps tab"| node_apps_ui
node_apps_ui -->|"requests app list"| node_host_plugin
node_host_plugin -->|"ensures apps running"| node_apps_service
node_apps_service -->|"starts app server"| node_whatsapp
node_apps_ui -->|"loads proxied viewer"| node_app_proxy
node_host_plugin -->|"registers proxy"| node_app_proxy
node_app_proxy -->|"proxies viewer and CDP"| node_whatsapp
node_whatsapp -->|"controls and streams"| node_chrome

click node_files "https://github.com/flykit-cc/dsh-flykit/blob/main/src/files.ts"
click node_git "https://github.com/flykit-cc/dsh-flykit/blob/main/src/git.ts"
click node_watch "https://github.com/flykit-cc/dsh-flykit/blob/main/src/watch.ts"
click node_host_plugin "https://github.com/flykit-cc/dsh-flykit/blob/main/src/index.ts"
click node_client_plugin "https://github.com/flykit-cc/dsh-flykit/blob/main/src/client/index.ts"
click node_file_panel "https://github.com/flykit-cc/dsh-flykit/blob/main/src/client/FilePanel.tsx"
click node_explorer "https://github.com/flykit-cc/dsh-flykit/blob/main/src/client/Explorer.tsx"
click node_editor "https://github.com/flykit-cc/dsh-flykit/blob/main/src/client/Editor.tsx"
click node_preview "https://github.com/flykit-cc/dsh-flykit/blob/main/src/client/Preview.tsx"
click node_terminal_ui "https://github.com/flykit-cc/dsh-flykit/blob/main/src/client/Terminals.tsx"
click node_terminal_service "https://github.com/flykit-cc/dsh-flykit/blob/main/src/terminals.ts"
click node_terminal_io "https://github.com/flykit-cc/dsh-flykit/blob/main/src/term-io.ts"
click node_agent_tools "https://github.com/flykit-cc/dsh-flykit/blob/main/src/agent-tools.ts"
click node_notify "https://github.com/flykit-cc/dsh-flykit/blob/main/src/notify.ts"
click node_status "https://github.com/flykit-cc/dsh-flykit/blob/main/src/client/StatusLine.tsx"
click node_model_picker "https://github.com/flykit-cc/dsh-flykit/blob/main/src/client/ModelPicker.tsx"
click node_catalog "https://github.com/flykit-cc/dsh-flykit/blob/main/src/catalog-sync.ts"
click node_usage "https://github.com/flykit-cc/dsh-flykit/blob/main/src/claude-usage.ts"
click node_apps_ui "https://github.com/flykit-cc/dsh-flykit/blob/main/src/client/Apps.tsx"
click node_apps_service "https://github.com/flykit-cc/dsh-flykit/blob/main/src/apps.ts"
click node_app_proxy "https://github.com/flykit-cc/dsh-flykit/blob/main/src/apps-proxy.ts"
click node_whatsapp "https://github.com/flykit-cc/dsh-flykit/blob/main/apps/whatsapp/wa.mjs"

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_files,node_git,node_watch,node_host_plugin,node_user toneBlue
class node_client_plugin,node_file_panel,node_explorer,node_editor,node_preview,node_terminal_ui,node_settings toneAmber
class node_terminal_service,node_terminal_io,node_agent_tools,node_notify,node_openrouter,node_anthropic toneMint
class node_status,node_model_picker,node_catalog,node_usage toneRose
class node_apps_ui,node_apps_service,node_app_proxy,node_whatsapp,node_harness,node_workspace,node_chrome toneIndigo
```

## Components

### Host services

- [Workspace files](https://github.com/flykit-cc/dsh-flykit/blob/main/src/files.ts): `src/files.ts`
- [Git status](https://github.com/flykit-cc/dsh-flykit/blob/main/src/git.ts): `src/git.ts`
- [File watcher](https://github.com/flykit-cc/dsh-flykit/blob/main/src/watch.ts): `src/watch.ts`
- [Host routes](https://github.com/flykit-cc/dsh-flykit/blob/main/src/index.ts): `src/index.ts`

### Browser cockpit

- [Client plugin](https://github.com/flykit-cc/dsh-flykit/blob/main/src/client/index.ts): `src/client/index.ts`
- [File panel](https://github.com/flykit-cc/dsh-flykit/blob/main/src/client/FilePanel.tsx): `src/client/FilePanel.tsx`
- [Explorer tree](https://github.com/flykit-cc/dsh-flykit/blob/main/src/client/Explorer.tsx): `src/client/Explorer.tsx`
- [Editor and preview](https://github.com/flykit-cc/dsh-flykit/blob/main/src/client/Editor.tsx): `src/client/Editor.tsx`
- [Document preview](https://github.com/flykit-cc/dsh-flykit/blob/main/src/client/Preview.tsx): `src/client/Preview.tsx`
- [Terminal views](https://github.com/flykit-cc/dsh-flykit/blob/main/src/client/Terminals.tsx): `src/client/Terminals.tsx`

### Agent terminals

- [PTY service](https://github.com/flykit-cc/dsh-flykit/blob/main/src/terminals.ts): `src/terminals.ts`
- [Terminal output](https://github.com/flykit-cc/dsh-flykit/blob/main/src/term-io.ts): `src/term-io.ts`
- [Agent tools](https://github.com/flykit-cc/dsh-flykit/blob/main/src/agent-tools.ts): `src/agent-tools.ts`
- [Agent notifications](https://github.com/flykit-cc/dsh-flykit/blob/main/src/notify.ts): `src/notify.ts`

### Models and status

- [Status line](https://github.com/flykit-cc/dsh-flykit/blob/main/src/client/StatusLine.tsx): `src/client/StatusLine.tsx`
- [Model picker](https://github.com/flykit-cc/dsh-flykit/blob/main/src/client/ModelPicker.tsx): `src/client/ModelPicker.tsx`
- [Catalog sync](https://github.com/flykit-cc/dsh-flykit/blob/main/src/catalog-sync.ts): `src/catalog-sync.ts`
- [Claude usage](https://github.com/flykit-cc/dsh-flykit/blob/main/src/claude-usage.ts): `src/claude-usage.ts`

### Embedded apps

- [Apps tab](https://github.com/flykit-cc/dsh-flykit/blob/main/src/client/Apps.tsx): `src/client/Apps.tsx`
- [App startup](https://github.com/flykit-cc/dsh-flykit/blob/main/src/apps.ts): `src/apps.ts`
- [App proxy](https://github.com/flykit-cc/dsh-flykit/blob/main/src/apps-proxy.ts): `src/apps-proxy.ts`
- [WhatsApp viewer](https://github.com/flykit-cc/dsh-flykit/blob/main/apps/whatsapp/wa.mjs): `apps/whatsapp/wa.mjs`

### Other components

- **DSH user**
- **DSH host**
- **Session workspace**
- **DSH settings**
- **OpenRouter catalog**
- **Anthropic usage API**
- **Headless Chrome**

## Connections

- DSH user → DSH host: opens web UI
- DSH host → Host routes: loads plugin
- DSH host → Client plugin: loads client
- DSH user → File panel: uses panel
- Client plugin → File panel: injects panel
- File panel → Explorer tree: shows files
- File panel → Editor and preview: opens files
- Editor and preview → Document preview: renders documents
- File panel → Host routes: requests session data
- Host routes → Workspace files: lists and accesses
- Workspace files → Session workspace: reads and writes
- Host routes → Git status: gets status
- Git status → Session workspace: checks repository
- Host routes → File watcher: streams changes
- File watcher → Session workspace: watches files
- DSH user → Terminal views: uses agents tab
- Terminal views → Host routes: sends terminal requests
- Host routes → PTY service: manages PTYs
- PTY service → Session workspace: starts in workspace
- PTY service → Terminal output: buffers output
- Terminal views → Terminal output: renders stream
- DSH host → Agent tools: registers tools
- Agent tools → PTY service: starts and controls
- Agent tools → Terminal output: reads output
- PTY service → Agent notifications: signals output changes
- Agent notifications → DSH host: sends agent message
- Client plugin → Status line: injects status
- Client plugin → Model picker: injects picker
- Model picker → DSH host: uses model directory
- Host routes → Catalog sync: runs catalog refresh
- Catalog sync → OpenRouter catalog: fetches models
- Catalog sync → DSH settings: writes model list
- Host routes → Claude usage: serves usage
- Claude usage → Anthropic usage API: fetches usage
- DSH user → Apps tab: opens Apps tab
- Apps tab → Host routes: requests app list
- Host routes → App startup: ensures apps running
- App startup → WhatsApp viewer: starts app server
- Apps tab → App proxy: loads proxied viewer
- Host routes → App proxy: registers proxy
- App proxy → WhatsApp viewer: proxies viewer and CDP
- WhatsApp viewer → Headless Chrome: controls and streams
