# johnteller722/deepseek-harness architecture

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

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

## Overview

DeepSeek Harness is a plugin-oriented agent harness with a Web UI and Desktop host. The documented user path is launching `dsh web`, which starts the local UI; the broader runtime includes session management and persistence, API transport, plugin tooling, and optional extensions. The graph preserves major subsystems visible in the tree and source index. Several internal connections are not shown because the sampled excerpts do not establish their callers; those paths are therefore left unconnected.

Main entry points: [`packages/api/session-controller/src/client/sessions/manager.ts`](https://github.com/johnteller722/deepseek-harness/blob/master/packages/api/session-controller/src/client/sessions/manager.ts) (Session manager), [`apps/cli/src/bin.ts`](https://github.com/johnteller722/deepseek-harness/blob/master/apps/cli/src/bin.ts) (DSH CLI), [`packages/api/session-controller/src/client/sessions/session.ts`](https://github.com/johnteller722/deepseek-harness/blob/master/packages/api/session-controller/src/client/sessions/session.ts) (Session instances), [`packages/session/session-persistence-jsonl/src/storage.ts`](https://github.com/johnteller722/deepseek-harness/blob/master/packages/session/session-persistence-jsonl/src/storage.ts) (Session persistence)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Launch and hosts"]
  node_cli["DSH CLI<br/>[bin.ts]"]
  node_web["Web UI<br/>[main.ts]"]
end

subgraph group_core["Agent runtime"]
  node_session_client["Session manager<br/>[manager.ts]"]
  node_session_state["Session instances<br/>[session.ts]"]
  node_session_contract["Session contracts<br/>[session.ts]"]
  node_persistence[("Session persistence<br/>[storage.ts]")]
  node_persistence_contract["Persistence validation"]
  node_schedule[("Scheduled tasks<br/>[storage.ts]")]
end

subgraph group_api["Client and APIs"]
  node_gateway["API gateway<br/>[stream-server.ts]"]
  node_connection["Client connection<br/>[connection.ts]"]
  node_workspace["Workspace API<br/>[commands.ts]"]
  node_terminal["Terminal API<br/>[terminal.ts]"]
  node_sdk["SDK server<br/>[server.ts]"]
end

subgraph group_extensions["Plugins and extensions"]
  node_plugin_manager["Plugin manager UI"]
  node_plugin_runtime["Plugin manager<br/>[operations.ts]"]
  node_mods["Claude Code mods<br/>[engine.ts]"]
  node_inspector["Runtime inspector<br/>[query-router.ts]"]
end

subgraph group_desktop["Desktop product"]
  node_desktop_app["Desktop app<br/>[main.ts]"]
  node_desktop_host["Desktop host<br/>[office-engine.ts]"]
  node_project_manager["Project manager<br/>[project-manager.ts]"]
  node_runtime_tree["Runtime tree<br/>[runtime-tree.ts]"]
end

node_user(("User"))

node_user -->|"launches"| node_cli
node_cli -->|"starts"| node_web
node_project_manager -->|"validates"| node_runtime_tree
node_session_client -->|"checks remote failures"| node_gateway
node_persistence -->|"materializes writes"| node_persistence_contract
node_session_client -->|"constructs sessions"| node_session_state
node_session_state -->|"uses contract"| node_session_contract

click node_cli "https://github.com/johnteller722/deepseek-harness/blob/master/apps/cli/src/bin.ts"
click node_web "https://github.com/johnteller722/deepseek-harness/blob/master/apps/web/src/main.ts"
click node_desktop_app "https://github.com/johnteller722/deepseek-harness/blob/master/apps/desktop/src/main.ts"
click node_desktop_host "https://github.com/johnteller722/deepseek-harness/blob/master/apps/desktop-host/src/office-engine.ts"
click node_project_manager "https://github.com/johnteller722/deepseek-harness/blob/master/apps/desktop/src/project-manager.ts"
click node_runtime_tree "https://github.com/johnteller722/deepseek-harness/blob/master/apps/desktop/src/runtime-tree.ts"
click node_session_client "https://github.com/johnteller722/deepseek-harness/blob/master/packages/api/session-controller/src/client/sessions/manager.ts"
click node_session_state "https://github.com/johnteller722/deepseek-harness/blob/master/packages/api/session-controller/src/client/sessions/session.ts"
click node_session_contract "https://github.com/johnteller722/deepseek-harness/blob/master/packages/api/session-controller/src/client/contract/session.ts"
click node_persistence "https://github.com/johnteller722/deepseek-harness/blob/master/packages/session/session-persistence-jsonl/src/storage.ts"
click node_persistence_contract "https://github.com/johnteller722/deepseek-harness/blob/master/packages/session/session-persistence/src/storage-contract.ts"
click node_gateway "https://github.com/johnteller722/deepseek-harness/blob/master/packages/api/gateway/src/stream-server.ts"
click node_connection "https://github.com/johnteller722/deepseek-harness/blob/master/packages/client/connection/src/client/connection.ts"
click node_workspace "https://github.com/johnteller722/deepseek-harness/blob/master/packages/api/workspace-controller/src/commands.ts"
click node_terminal "https://github.com/johnteller722/deepseek-harness/blob/master/packages/api/terminal-controller/src/terminal.ts"
click node_plugin_manager "https://github.com/johnteller722/deepseek-harness/blob/master/packages/client/ui-plugin-manager/src/client/PluginManagerPage.tsx"
click node_plugin_runtime "https://github.com/johnteller722/deepseek-harness/blob/master/packages/boot/plugin-manager/src/operations.ts"
click node_mods "https://github.com/johnteller722/deepseek-harness/blob/master/packages/experimental/claude-code-mods/src/engine.ts"
click node_inspector "https://github.com/johnteller722/deepseek-harness/blob/master/packages/experimental/inspector/src/worker/inspection/query-router.ts"
click node_schedule "https://github.com/johnteller722/deepseek-harness/blob/master/packages/schedule/schedule/src/storage.ts"
click node_sdk "https://github.com/johnteller722/deepseek-harness/blob/master/packages/sdk/server/src/server.ts"

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_cli,node_web,node_user toneBlue
class node_session_client,node_session_state,node_session_contract,node_persistence,node_persistence_contract,node_schedule toneAmber
class node_gateway,node_connection,node_workspace,node_terminal,node_sdk toneMint
class node_plugin_manager,node_plugin_runtime,node_mods,node_inspector toneRose
class node_desktop_app,node_desktop_host,node_project_manager,node_runtime_tree toneIndigo
```

## Components

### Launch and hosts

- [DSH CLI](https://github.com/johnteller722/deepseek-harness/blob/master/apps/cli/src/bin.ts): `apps/cli/src/bin.ts`
- [Web UI](https://github.com/johnteller722/deepseek-harness/blob/master/apps/web/src/main.ts): `apps/web/src/main.ts`

### Agent runtime

- [Session manager](https://github.com/johnteller722/deepseek-harness/blob/master/packages/api/session-controller/src/client/sessions/manager.ts): `packages/api/session-controller/src/client/sessions/manager.ts`
- [Session instances](https://github.com/johnteller722/deepseek-harness/blob/master/packages/api/session-controller/src/client/sessions/session.ts): `packages/api/session-controller/src/client/sessions/session.ts`
- [Session contracts](https://github.com/johnteller722/deepseek-harness/blob/master/packages/api/session-controller/src/client/contract/session.ts): `packages/api/session-controller/src/client/contract/session.ts`
- [Session persistence](https://github.com/johnteller722/deepseek-harness/blob/master/packages/session/session-persistence-jsonl/src/storage.ts): `packages/session/session-persistence-jsonl/src/storage.ts`
- [Persistence validation](https://github.com/johnteller722/deepseek-harness/blob/master/packages/session/session-persistence/src/storage-contract.ts): `packages/session/session-persistence/src/storage-contract.ts`
- [Scheduled tasks](https://github.com/johnteller722/deepseek-harness/blob/master/packages/schedule/schedule/src/storage.ts): `packages/schedule/schedule/src/storage.ts`

### Client and APIs

- [API gateway](https://github.com/johnteller722/deepseek-harness/blob/master/packages/api/gateway/src/stream-server.ts): `packages/api/gateway/src/stream-server.ts`
- [Client connection](https://github.com/johnteller722/deepseek-harness/blob/master/packages/client/connection/src/client/connection.ts): `packages/client/connection/src/client/connection.ts`
- [Workspace API](https://github.com/johnteller722/deepseek-harness/blob/master/packages/api/workspace-controller/src/commands.ts): `packages/api/workspace-controller/src/commands.ts`
- [Terminal API](https://github.com/johnteller722/deepseek-harness/blob/master/packages/api/terminal-controller/src/terminal.ts): `packages/api/terminal-controller/src/terminal.ts`
- [SDK server](https://github.com/johnteller722/deepseek-harness/blob/master/packages/sdk/server/src/server.ts): `packages/sdk/server/src/server.ts`

### Plugins and extensions

- [Plugin manager UI](https://github.com/johnteller722/deepseek-harness/blob/master/packages/client/ui-plugin-manager/src/client/PluginManagerPage.tsx): `packages/client/ui-plugin-manager/src/client/PluginManagerPage.tsx`
- [Plugin manager](https://github.com/johnteller722/deepseek-harness/blob/master/packages/boot/plugin-manager/src/operations.ts): `packages/boot/plugin-manager/src/operations.ts`
- [Claude Code mods](https://github.com/johnteller722/deepseek-harness/blob/master/packages/experimental/claude-code-mods/src/engine.ts): `packages/experimental/claude-code-mods/src/engine.ts`
- [Runtime inspector](https://github.com/johnteller722/deepseek-harness/blob/master/packages/experimental/inspector/src/worker/inspection/query-router.ts): `packages/experimental/inspector/src/worker/inspection/query-router.ts`

### Desktop product

- [Desktop app](https://github.com/johnteller722/deepseek-harness/blob/master/apps/desktop/src/main.ts): `apps/desktop/src/main.ts`
- [Desktop host](https://github.com/johnteller722/deepseek-harness/blob/master/apps/desktop-host/src/office-engine.ts): `apps/desktop-host/src/office-engine.ts`
- [Project manager](https://github.com/johnteller722/deepseek-harness/blob/master/apps/desktop/src/project-manager.ts): `apps/desktop/src/project-manager.ts`
- [Runtime tree](https://github.com/johnteller722/deepseek-harness/blob/master/apps/desktop/src/runtime-tree.ts): `apps/desktop/src/runtime-tree.ts`

### Other components

- **User**

## Connections

- User → DSH CLI: launches (evidence: `README.md`)
- DSH CLI → Web UI: starts (evidence: `README.md`)
- Project manager → Runtime tree: validates (evidence: `apps/desktop/src/project-manager.ts`)
- Session manager → API gateway: checks remote failures (evidence: `packages/api/session-controller/src/client/sessions/manager.ts`)
- Session persistence → Persistence validation: materializes writes (evidence: `packages/session/session-persistence-jsonl/src/storage.ts`)
- Session manager → Session instances: constructs sessions (evidence: `packages/api/session-controller/src/client/sessions/manager.ts`)
- Session instances → Session contracts: uses contract (evidence: `packages/api/session-controller/src/client/sessions/session.ts`)
