deepseek-harness
deepseek-ai
DeepSeek Harness: Everything is a Plugin.
PROJECT TOPICS
PROJECT README
Languages: English | 简体中文
DSH desktop surface: one command starts DSH + a native Electron window with no local HTTP server, reusing the DSH Web UI with zero customization.
dsh-desktop is a DSH bundle patch plugin (cordis.patch.yml) that provides a desktop surface. Starting with DSH 0.1.5, the desktop profile name is reserved for the official Electron application and the CLI rejects boot, config-dump, and plugin-management requests for it; this project therefore uses the non-reserved dsh-desktop profile. The plugin disables DSH's node:http web server, provides a non-listening webServer-shaped service, and launches a native Electron window that loads the DSH Web UI through a custom dsh-desktop:// protocol.
Unlike dsh web, which starts a local HTTP server and requires you to open a browser manually, dsh --profile dsh-desktop reuses the entire DSH Web frontend and Cordis services with no TCP listener: Electron loads the frontend through a custom protocol, and fetch plus the event streams are bridged over IPC to the host process.
dsh --profile dsh-desktop opens the desktop window automatically — no need to visit the browser.~/.dsh/desktop.log.node:http and no TCP listening port; static assets, APIs, and event streams all travel over Electron IPC / custom protocol.dsh --profile dsh-desktop
│ interactive terminal? → hand off to a detached child, then exit
▼
DSH boot (web-app bundle + desktop patch)
│ patch disables dsh-host-webserver;
│ the desktop plugin provides a non-listening webServer-shaped service
▼
src/index.js apply(ctx)
│ after the loader settles, spawns Electron and establishes an fd-3 pipe RPC
▼
Electron creates a frameless BrowserWindow and loads dsh-desktop://127.0.0.1/
│ the main process forwards static/API requests over fd-3 to DSH
▼
preload.cjs bridges fetch and /api/remote.mux → ipcRenderer → main process → fd-3 → DSH services
│
▼
preload.cjs injects the DSH-styled title bar and bridges fetch plus /api/remote.mux to IPC
The Electron main process completes DSH 0.1.2's token/cookie exchange and injects the signed cookie into every bridged request; the desktop still never opens a TCP listener.
"type": "module")dsh, 0.1.2-rc.1 or later with the Remote API; use the dsh-desktop profile on DSH 0.1.5+)DEEPSEEK_API_KEY)dsh-desktop-0.1.0-win32-x64.zip (Windows),
dsh-desktop-0.1.0-linux-x64.tar.gz (Linux), or
dsh-desktop-0.1.0-darwin-* (macOS).dsh-desktop profile. If the profile does not exist yet, initialize it once first:# First use only; DSH >= 0.1.5
dsh --profile dsh-desktop --from-default-profile web --dump-config
Then install the plugin:
# Windows
dsh plugin --profile dsh-desktop add link:D:\path\to\dsh-desktop-0.4.0-win32-x64
# macOS / Linux
dsh plugin --profile dsh-desktop add "link:/path/to/dsh-desktop-0.4.0-linux-x64"
Release archives bundle a platform-specific Electron runtime under
dist/electron/runtime/, and the plugin prefers it, so no npm install is
required.
# 1. Clone and enter the project
git clone <repo-url>
cd dsh-desktop
# 2. Install development dependencies (includes Electron; this package has no dependencies)
npm install
# 3. Link this plugin into DSH's dsh-desktop profile
# If the profile does not exist yet, initialize it first:
dsh --profile dsh-desktop --from-default-profile web --dump-config
# Windows
dsh plugin --profile dsh-desktop add link:D:\path\to\dsh-desktop
# macOS / Linux
dsh plugin --profile dsh-desktop add "link:$(pwd)"
Notes:
dsh plugin add forwards the remaining arguments to pnpm inside the profile directory, so pnpm's link: protocol is supported.electron from this repo's node_modules (so step 2, npm install, is required); if that is missing, it falls back to the packaged Electron runtime under dist/electron/runtime/.dsh-web-app, dsh-client-connection, dsh-api-gateway, dsh-api-remotes, etc.) are resolved by the DSH runtime, so this package declares no runtime dependencies.dsh --profile dsh-desktop
After startup, the Electron window opens automatically and loads the DSH Web UI — just chat in the window.
Run from an interactive terminal, the command returns immediately: the plugin notices it is on a foreground terminal and hands the desktop instance to a detached child process before exiting itself, so it never occupies a terminal window or tab; closing the window still shuts the background instance down (unchanged behavior).
| Situation | Behavior |
|---|---|
| Interactive terminal (stdin/stdout/stderr are all TTYs) | Detaches automatically; the command returns at once |
| Pipe / redirect / CI (any stream is not a TTY) | Runs in the foreground, exactly as before |
DSH_DESKTOP_NO_DETACH=1 |
Forces the foreground behavior, useful when debugging plugin startup |
DSH_DESKTOP_DETACHED=1 |
Internal marker (set by the plugin) preventing recursive detaching |
The detached instance appends stdout/stderr to ~/.dsh/desktop.log (override with DSH_DESKTOP_LOG): when no window appears, that file is the first place to look — startup failures and Electron crashes both land there.
To inspect arguments forwarded to the web app:
dsh --profile dsh-desktop --help
Run from the repository root:
| Command | Description |
|---|---|
npm test |
Run node:test unit tests |
npm run lint |
ESLint check |
npm run lint:fix |
ESLint auto-fix |
npm run format |
Prettier formatting |
npm run format:check |
Prettier format check (same as CI) |
npm run package |
Package apps/electron into a platform Electron runtime under dist/electron/runtime/ |
npm run dist |
Package the runtime and create a release archive under dist/release/ (override with -- --platform=win32 --arch=x64) |
Commit conventions:
commit-msg hook runs commitlint; commit messages must follow Conventional Commits.lint, test, and format:check on pushes and PRs to main (Node 24).dsh-desktop/
├── src/
│ ├── index.js # desktop surface plugin: provides the webServer-shaped service and launches Electron
│ ├── electron-web-server.js # non-listening webServer service: route registry + IPC dispatch + fallback
│ ├── ipc-channel.js # DSH ↔ Electron main-process fd-3 framing + RPC
│ └── startup.js # session-identity helper (not referenced by the current patch)
├── apps/electron/
│ ├── main.js # Electron main process: dsh-desktop:// protocol, fd-3 RPC, frameless window
│ ├── preload.cjs # preload: fetch + /api/remote.mux bridge + DSH-styled title bar
│ └── package.json # Electron app metadata
├── test/
│ ├── index.test.js
│ ├── electron-web-server.test.js
│ ├── ipc-channel.test.js
│ └── startup.test.js
├── scripts/
│ └── package.mjs # packages the Electron runtime + creates release archives
├── dist/ # build output (git-ignored; generated by npm run package / dist)
├── cordis.patch.yml # DSH bundle patch: desktop plugin + disables webserver + suppresses fake URL
├── package.json # package metadata, npm scripts, dsh.bundle.patch pointer
├── eslint.config.js
├── .prettierrc.json
├── commitlint.config.js
├── .husky/commit-msg # Conventional Commits gate
├── .github/workflows/ci.yml # CI: lint + test + format check
├── .agent-workflow/ # Dev Agent Workflow docs
└── LICENSE # MIT
The plugin sets the following variables automatically when launching Electron; they only need to be set manually when running apps/electron standalone.
| Variable | Description |
|---|---|
DSH_ELECTRON_MODE |
Set to offline by the plugin; makes the Electron main process use the dsh-desktop:// protocol and the fd-3 IPC bridge |
DSH_ELECTRON_IPC_FD |
File descriptor number for the DSH ↔ Electron pipe (default 3) |
DSH_ELECTRON_PARENT_PID |
Parent process PID. Electron probes it every 2 seconds and quits when the parent exits. The plugin sets it to the DSH process PID; standalone default is process.ppid |
DSH_ELECTRON_URL |
URL loaded by Electron when running apps/electron standalone in non-offline mode; default http://127.0.0.1:3080 |
DSH_DESKTOP_NO_DETACH |
Any non-empty value disables the automatic foreground detach, keeping the command attached to the terminal (debugging) |
DSH_DESKTOP_DETACHED |
Written by the plugin into the background child to mark it as the detached instance, preventing recursive detaching |
DSH_DESKTOP_LOG |
Log path for the detached instance's stdout/stderr; defaults to $DSH_HOME/desktop.log (~/.dsh/desktop.log) |
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 无有效分类标签。