# tonulls/dsh-vscode architecture

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

- Interactive diagram: https://gitdiagram.com/tonulls/dsh-vscode
- Repository: https://github.com/tonulls/dsh-vscode

## Overview

DSH for VS Code embeds the DeepSeek Harness web interface and manages its local or remote service. The main workflow starts from a VS Code panel or command: the extension configures and coordinates service discovery or launch, handles browser-session authentication and relay, resolves a panel URL, and renders the DSH page. Separate branches provide bridge installation and page-to-editor features, status reporting, remote tunneling, and image fallback. Relationships are based on the supplied excerpts, SOURCE INDEX references, and README; unsampled implementation details are not inferred.

Main entry points: [`src/extension.ts`](https://github.com/tonulls/dsh-vscode/blob/tonulls/src/extension.ts) (Extension coordinator), [`src/panel/provider.ts`](https://github.com/tonulls/dsh-vscode/blob/tonulls/src/panel/provider.ts) (Webview panel), [`src/service/manager.ts`](https://github.com/tonulls/dsh-vscode/blob/tonulls/src/service/manager.ts) (Service manager), [`bridge-client/lib/client.js`](https://github.com/tonulls/dsh-vscode/blob/tonulls/bridge-client/lib/client.js) (Browser bridge client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Extension entry and UI"]
  node_extension["Extension coordinator<br/>[extension.ts]"]
  node_panel["Webview panel<br/>[provider.ts]"]
  node_panelhtml["Panel pages and handshake<br/>[html.ts]"]
  node_statusbar["Status bar<br/>[statusbar.ts]"]
end

subgraph group_service["Service lifecycle and access"]
  node_manager["Service manager<br/>[manager.ts]"]
  node_detect["Port detection<br/>[detect.ts]"]
  node_launchurl["Launch URL parsing<br/>[launchUrl.ts]"]
  node_process["DSH process runner<br/>[process.ts]"]
  node_session["Session authentication<br/>[session.ts]"]
  node_proxy["Loopback relay<br/>[proxy.ts]"]
end

subgraph group_bridge["DSH bridge features"]
  node_installer["Bridge installer<br/>[installer.ts]"]
  node_bridgestatus["Bridge status<br/>[status.ts]"]
  node_bridgehost["Editor bridge handlers<br/>[host.ts]"]
  node_client["Browser bridge client<br/>[client.js]"]
  node_core["Bridge core logic<br/>[core.js]"]
end

subgraph group_support["Configuration and remote"]
  node_remote["Remote URL resolver<br/>[remote.ts]"]
  node_config["Extension settings<br/>[config.ts]"]
  node_i18n["Runtime translations<br/>[i18n.ts]"]
end

node_user(("VS Code user"))
node_vscode["VS Code host"]
node_dsh["DSH web service"]

node_user -->|"invokes commands"| node_extension
node_extension -->|"coordinates service"| node_manager
node_extension -->|"creates panel"| node_panel
node_panel -->|"reads service state"| node_manager
node_panel -->|"renders pages"| node_panelhtml
node_panel -->|"dispatches messages"| node_bridgehost
node_extension -->|"updates status"| node_statusbar
node_statusbar -->|"reads service state"| node_manager
node_manager -->|"probes ports"| node_detect
node_manager -->|"parses launch URL"| node_launchurl
node_manager -->|"manages process"| node_process
node_process -->|"launches dsh web"| node_dsh
node_extension -->|"reads settings"| node_config
node_extension -->|"exchanges session"| node_session
node_session -->|"exchanges launch token"| node_dsh
node_extension -->|"starts relay"| node_proxy
node_proxy -->|"forwards requests"| node_dsh
node_panel -->|"resolves remote URL"| node_remote
node_extension -->|"configures remote access"| node_remote
node_extension -->|"installs bridge"| node_installer
node_extension -->|"evaluates bridge health"| node_bridgestatus
node_extension -->|"uses translations"| node_i18n
node_panelhtml -->|"renders translated text"| node_i18n
node_client -->|"uses core logic"| node_core
node_installer -->|"installs browser client"| node_client
node_panelhtml -->|"sends bridge handshake"| node_client
node_client -->|"posts bridge messages"| node_panel
node_bridgehost -->|"opens links and files"| node_vscode
node_vscode -->|"hosts extension"| node_extension

click node_extension "https://github.com/tonulls/dsh-vscode/blob/tonulls/src/extension.ts"
click node_panel "https://github.com/tonulls/dsh-vscode/blob/tonulls/src/panel/provider.ts"
click node_panelhtml "https://github.com/tonulls/dsh-vscode/blob/tonulls/src/panel/html.ts"
click node_statusbar "https://github.com/tonulls/dsh-vscode/blob/tonulls/src/statusbar.ts"
click node_manager "https://github.com/tonulls/dsh-vscode/blob/tonulls/src/service/manager.ts"
click node_detect "https://github.com/tonulls/dsh-vscode/blob/tonulls/src/service/detect.ts"
click node_launchurl "https://github.com/tonulls/dsh-vscode/blob/tonulls/src/service/launchUrl.ts"
click node_process "https://github.com/tonulls/dsh-vscode/blob/tonulls/src/service/process.ts"
click node_session "https://github.com/tonulls/dsh-vscode/blob/tonulls/src/service/session.ts"
click node_proxy "https://github.com/tonulls/dsh-vscode/blob/tonulls/src/service/proxy.ts"
click node_remote "https://github.com/tonulls/dsh-vscode/blob/tonulls/src/remote.ts"
click node_config "https://github.com/tonulls/dsh-vscode/blob/tonulls/src/config.ts"
click node_i18n "https://github.com/tonulls/dsh-vscode/blob/tonulls/src/i18n.ts"
click node_installer "https://github.com/tonulls/dsh-vscode/blob/tonulls/src/bridge/installer.ts"
click node_bridgestatus "https://github.com/tonulls/dsh-vscode/blob/tonulls/src/bridge/status.ts"
click node_bridgehost "https://github.com/tonulls/dsh-vscode/blob/tonulls/src/bridge/host.ts"
click node_client "https://github.com/tonulls/dsh-vscode/blob/tonulls/bridge-client/lib/client.js"
click node_core "https://github.com/tonulls/dsh-vscode/blob/tonulls/bridge-client/lib/core.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_extension,node_panel,node_panelhtml,node_statusbar,node_user toneBlue
class node_manager,node_detect,node_launchurl,node_process,node_session,node_proxy toneAmber
class node_installer,node_bridgestatus,node_bridgehost,node_client,node_core toneMint
class node_remote,node_config,node_i18n toneRose
class node_vscode,node_dsh toneIndigo
```

## Components

### Extension entry and UI

- [Extension coordinator](https://github.com/tonulls/dsh-vscode/blob/tonulls/src/extension.ts): `src/extension.ts`
- [Webview panel](https://github.com/tonulls/dsh-vscode/blob/tonulls/src/panel/provider.ts): `src/panel/provider.ts`
- [Panel pages and handshake](https://github.com/tonulls/dsh-vscode/blob/tonulls/src/panel/html.ts): `src/panel/html.ts`
- [Status bar](https://github.com/tonulls/dsh-vscode/blob/tonulls/src/statusbar.ts): `src/statusbar.ts`

### Service lifecycle and access

- [Service manager](https://github.com/tonulls/dsh-vscode/blob/tonulls/src/service/manager.ts): `src/service/manager.ts`
- [Port detection](https://github.com/tonulls/dsh-vscode/blob/tonulls/src/service/detect.ts): `src/service/detect.ts`
- [Launch URL parsing](https://github.com/tonulls/dsh-vscode/blob/tonulls/src/service/launchUrl.ts): `src/service/launchUrl.ts`
- [DSH process runner](https://github.com/tonulls/dsh-vscode/blob/tonulls/src/service/process.ts): `src/service/process.ts`
- [Session authentication](https://github.com/tonulls/dsh-vscode/blob/tonulls/src/service/session.ts): `src/service/session.ts`
- [Loopback relay](https://github.com/tonulls/dsh-vscode/blob/tonulls/src/service/proxy.ts): `src/service/proxy.ts`

### DSH bridge features

- [Bridge installer](https://github.com/tonulls/dsh-vscode/blob/tonulls/src/bridge/installer.ts): `src/bridge/installer.ts`
- [Bridge status](https://github.com/tonulls/dsh-vscode/blob/tonulls/src/bridge/status.ts): `src/bridge/status.ts`
- [Editor bridge handlers](https://github.com/tonulls/dsh-vscode/blob/tonulls/src/bridge/host.ts): `src/bridge/host.ts`
- [Browser bridge client](https://github.com/tonulls/dsh-vscode/blob/tonulls/bridge-client/lib/client.js): `bridge-client/lib/client.js`
- [Bridge core logic](https://github.com/tonulls/dsh-vscode/blob/tonulls/bridge-client/lib/core.js): `bridge-client/lib/core.js`

### Configuration and remote

- [Remote URL resolver](https://github.com/tonulls/dsh-vscode/blob/tonulls/src/remote.ts): `src/remote.ts`
- [Extension settings](https://github.com/tonulls/dsh-vscode/blob/tonulls/src/config.ts): `src/config.ts`
- [Runtime translations](https://github.com/tonulls/dsh-vscode/blob/tonulls/src/i18n.ts): `src/i18n.ts`

### Other components

- **VS Code user**
- **VS Code host**
- **DSH web service**

## Connections

- VS Code user → Extension coordinator: invokes commands (evidence: `README.md`)
- Extension coordinator → Service manager: coordinates service (evidence: `src/extension.ts`)
- Extension coordinator → Webview panel: creates panel (evidence: `src/extension.ts`)
- Webview panel → Service manager: reads service state (evidence: `src/panel/provider.ts`)
- Webview panel → Panel pages and handshake: renders pages (evidence: `src/panel/provider.ts`)
- Webview panel → Editor bridge handlers: dispatches messages (evidence: `src/panel/provider.ts`)
- Extension coordinator → Status bar: updates status (evidence: `src/extension.ts`)
- Status bar → Service manager: reads service state (evidence: `src/statusbar.ts`)
- Service manager → Port detection: probes ports (evidence: `src/service/manager.ts`)
- Service manager → Launch URL parsing: parses launch URL (evidence: `src/service/manager.ts`)
- Service manager → DSH process runner: manages process (evidence: `src/service/manager.ts`)
- DSH process runner → DSH web service: launches dsh web (evidence: `README.md`)
- Extension coordinator → Extension settings: reads settings (evidence: `src/extension.ts`)
- Extension coordinator → Session authentication: exchanges session (evidence: `src/extension.ts`)
- Session authentication → DSH web service: exchanges launch token (evidence: `src/service/session.ts`)
- Extension coordinator → Loopback relay: starts relay (evidence: `README.md`)
- Loopback relay → DSH web service: forwards requests (evidence: `README.md`)
- Webview panel → Remote URL resolver: resolves remote URL (evidence: `src/panel/provider.ts`)
- Extension coordinator → Remote URL resolver: configures remote access (evidence: `src/extension.ts`)
- Extension coordinator → Bridge installer: installs bridge (evidence: `src/extension.ts`)
- Extension coordinator → Bridge status: evaluates bridge health (evidence: `src/extension.ts`)
- Extension coordinator → Runtime translations: uses translations (evidence: `src/extension.ts`)
- Panel pages and handshake → Runtime translations: renders translated text (evidence: `src/panel/html.ts`)
- Browser bridge client → Bridge core logic: uses core logic (evidence: `bridge-client/lib/client.js`)
- Bridge installer → Browser bridge client: installs browser client (evidence: `src/bridge/installer.ts`)
- Panel pages and handshake → Browser bridge client: sends bridge handshake (evidence: `src/panel/html.ts`)
- Browser bridge client → Webview panel: posts bridge messages
- Editor bridge handlers → VS Code host: opens links and files (evidence: `src/bridge/host.ts`)
- VS Code host → Extension coordinator: hosts extension (evidence: `README.md`)
