# minomiao/deepseek-harness-desktop architecture

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

- Interactive diagram: https://gitdiagram.com/minomiao/deepseek-harness-desktop
- Repository: https://github.com/minomiao/deepseek-harness-desktop

## Overview

DSH Desktop wraps the DeepSeek Harness web interface in Electron. A user launches the app; the main process starts the bundled local DSH web server, waits for its address, and loads it in the app window. The settings window exposes plugin management and desktop preferences through a preload IPC bridge. Tray behavior, theme synchronization, and window integration support the desktop experience. Plugin install sources and update checks are external integrations. The README documents additional upstream UI capabilities; unsampled source limits confirmation of their internal wiring.

Main entry points: [`src/main.js`](https://github.com/minomiao/deepseek-harness-desktop/blob/main/src/main.js) (Electron main), [`src/preload.js`](https://github.com/minomiao/deepseek-harness-desktop/blob/main/src/preload.js) (Preload bridge), [`src/loading.html`](https://github.com/minomiao/deepseek-harness-desktop/blob/main/src/loading.html) (Startup screen), [`src/loading.js`](https://github.com/minomiao/deepseek-harness-desktop/blob/main/src/loading.js) (Startup status UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Desktop runtime"]
  node_main["Electron main<br/>[main.js]"]
  node_preload["Preload bridge<br/>[preload.js]"]
  node_tray["System tray<br/>[main.js]"]
  node_theme["Theme and chrome<br/>[preload.js]"]
  node_preferences[("Desktop preferences<br/>[main.js]")]
end

subgraph group_ui["Application UI"]
  node_webui["Harness interface"]
  node_loading["Startup screen<br/>[loading.html]"]
  node_loadingjs["Startup status UI<br/>[loading.js]"]
  node_settings["Settings window<br/>[settings.html]"]
  node_settingsjs["Settings UI<br/>[settings.js]"]
end

subgraph group_plugins["Plugin management"]
  node_pluginutil["Plugin utilities<br/>[plugin-util.js]"]
end

subgraph group_integrations["External integrations"]
  node_dsh["DSH web server"]
  node_pluginpackages["Plugin packages"]
  node_pluginrepo["Git repositories"]
  node_updater["GitHub releases"]
end

node_user(("User"))

node_user -->|"launches"| node_main
node_main -->|"starts process"| node_dsh
node_dsh -->|"prints address"| node_main
node_main -->|"shows while starting"| node_loading
node_loading -->|"loads script"| node_loadingjs
node_loadingjs -->|"queries status"| node_preload
node_preload -->|"IPC status"| node_main
node_main -->|"loads local URL"| node_webui
node_user -->|"opens settings"| node_settings
node_settings -->|"loads script"| node_settingsjs
node_settingsjs -->|"calls settings API"| node_preload
node_preload -->|"forwards IPC"| node_main
node_main -->|"normalizes plugin specs"| node_pluginutil
node_main -->|"installs npm packages"| node_pluginpackages
node_main -->|"fetches or installs sources"| node_pluginrepo
node_main -->|"verifies after install"| node_dsh
node_main -->|"checks releases"| node_updater
node_main -->|"creates tray controls"| node_tray
node_user -->|"uses tray menu"| node_tray
node_webui -->|"reports theme"| node_preload
node_preload -->|"sends theme signal"| node_main
node_main -->|"synchronizes chrome"| node_theme
node_main -->|"reads and writes"| node_preferences
node_main -->|"stops process"| node_dsh

click node_main "https://github.com/minomiao/deepseek-harness-desktop/blob/main/src/main.js"
click node_loading "https://github.com/minomiao/deepseek-harness-desktop/blob/main/src/loading.html"
click node_loadingjs "https://github.com/minomiao/deepseek-harness-desktop/blob/main/src/loading.js"
click node_settings "https://github.com/minomiao/deepseek-harness-desktop/blob/main/src/settings.html"
click node_settingsjs "https://github.com/minomiao/deepseek-harness-desktop/blob/main/src/settings.js"
click node_preload "https://github.com/minomiao/deepseek-harness-desktop/blob/main/src/preload.js"
click node_pluginutil "https://github.com/minomiao/deepseek-harness-desktop/blob/main/src/plugin-util.js"
click node_tray "https://github.com/minomiao/deepseek-harness-desktop/blob/main/src/main.js"
click node_theme "https://github.com/minomiao/deepseek-harness-desktop/blob/main/src/preload.js"
click node_preferences "https://github.com/minomiao/deepseek-harness-desktop/blob/main/src/main.js"

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_main,node_preload,node_tray,node_theme,node_preferences,node_user toneBlue
class node_webui,node_loading,node_loadingjs,node_settings,node_settingsjs toneAmber
class node_pluginutil toneMint
class node_dsh,node_pluginpackages,node_pluginrepo,node_updater toneRose
```

## Components

### Desktop runtime

- [Electron main](https://github.com/minomiao/deepseek-harness-desktop/blob/main/src/main.js): `src/main.js`
- [Preload bridge](https://github.com/minomiao/deepseek-harness-desktop/blob/main/src/preload.js): `src/preload.js`
- [System tray](https://github.com/minomiao/deepseek-harness-desktop/blob/main/src/main.js): `src/main.js`
- [Theme and chrome](https://github.com/minomiao/deepseek-harness-desktop/blob/main/src/preload.js): `src/preload.js`
- [Desktop preferences](https://github.com/minomiao/deepseek-harness-desktop/blob/main/src/main.js): `src/main.js`

### Application UI

- **Harness interface**
- [Startup screen](https://github.com/minomiao/deepseek-harness-desktop/blob/main/src/loading.html): `src/loading.html`
- [Startup status UI](https://github.com/minomiao/deepseek-harness-desktop/blob/main/src/loading.js): `src/loading.js`
- [Settings window](https://github.com/minomiao/deepseek-harness-desktop/blob/main/src/settings.html): `src/settings.html`
- [Settings UI](https://github.com/minomiao/deepseek-harness-desktop/blob/main/src/settings.js): `src/settings.js`

### Plugin management

- [Plugin utilities](https://github.com/minomiao/deepseek-harness-desktop/blob/main/src/plugin-util.js): `src/plugin-util.js`

### External integrations

- **DSH web server**
- **Plugin packages**
- **Git repositories**
- **GitHub releases**

### Other components

- **User**

## Connections

- User → Electron main: launches
- Electron main → DSH web server: starts process
- DSH web server → Electron main: prints address
- Electron main → Startup screen: shows while starting
- Startup screen → Startup status UI: loads script
- Startup status UI → Preload bridge: queries status
- Preload bridge → Electron main: IPC status
- Electron main → Harness interface: loads local URL
- User → Settings window: opens settings
- Settings window → Settings UI: loads script
- Settings UI → Preload bridge: calls settings API
- Preload bridge → Electron main: forwards IPC
- Electron main → Plugin utilities: normalizes plugin specs
- Electron main → Plugin packages: installs npm packages
- Electron main → Git repositories: fetches or installs sources
- Electron main → DSH web server: verifies after install
- Electron main → GitHub releases: checks releases
- Electron main → System tray: creates tray controls
- User → System tray: uses tray menu
- Harness interface → Preload bridge: reports theme
- Preload bridge → Electron main: sends theme signal
- Electron main → Theme and chrome: synchronizes chrome
- Electron main → Desktop preferences: reads and writes
- Electron main → DSH web server: stops process
