Preface¶
When doing full-stack or backend development in DSH (DeepSeek Harness), a session often corresponds to a repository: the frontend dev server, Spring Boot, the Python API, and Docker Compose each run their own command. The common practice is to open separate terminal windows, or rely on run configurations inside the IDE. The DSH session header itself has no unified entry point that lists “which services should be started for the current project, whether the ports are occupied, and where the output can be viewed”. dsh-service-runner, published by community maintainer sqzssg12138 and categorized as a client plugin, provides an IDEA-like service start/stop panel in the top-right corner of the session header: multi-workspace isolation, multi-language auto-detection, real-time logs, as well as querying and handling port occupants.
What Is This¶
dsh-service-runner (GitHub: sqzssg12138/dsh-service-runner) adds a workspace-level service management UI and host-side process control to DSH Desktop. Service definitions are persisted locally; start/stop and logs are exposed via HTTP interfaces under the /service-runner prefix for same-origin calls from the panel. The host side uses only Node built-in modules and DSH’s webServer seam, without depending on any @deepseek-ai/* internal packages; the client side depends only on react, avoiding issues caused by two copies of React (such as hooks exceptions).
Core Features¶
Session Header Panel¶
After installing and restarting DSH Desktop, a “Services” button appears in the top-right corner of the session header (next to the background task button). The status dot meanings are: gray = stopped, flashing yellow = starting, green = running, red = failed; when green, the number on the button indicates the number of running services.
Multi-Workspace Isolation¶
Services are stored separately per workspace root directory; switching sessions switches project configurations. Workspace paths are first obtained from the session’s authoritative workspace (the host reads the cwd in the session header via sessionPersistence); if that fails, it falls back to reverse-resolving from the session directory name; if that also fails, you can manually enter an absolute path at the bottom of the panel — it will be remembered once entered.
Auto-Detection and Editing¶
For first-time use, you can enter edit mode and click “Probe Workspace” to generate a candidate list. It supports Node/frontend, Maven/Gradle/Java, Python, and Docker Compose; the scan scope covers the workspace root directory and one level of subdirectories (such as apps/, packages/), and skips node_modules, target, .git, etc. The package manager is selected among pnpm/yarn/bun/npm based on the lockfile; ports can be inferred from vite.config.*, application.y[a]ml, .env, script parameters, etc.
When the workspace contains .idea, JetBrains run configurations are parsed first (both the new-style .idea/runConfigurations/*.xml and the RunManager in the legacy workspace.xml are supported); these candidates are placed before the heuristic results. Configuration types that cannot be faithfully restored as command-line commands are skipped, to avoid flooding the list with default templates. For multi-module Maven aggregate projects, commands are generated in the form of -pl … -am at the root directory to match reactor semantics.
A summary of detection rules is shown in the table below (details are subject to the repository README):
| Language | Trigger files | Generated command (example) |
|---|---|---|
| node | package.json containing dev/develop/serve/start |
Select package manager according to lockfile, e.g. pnpm run dev |
| java | pom.xml |
wrapper or mvn spring-boot:run, etc. |
| java | build.gradle[.kts] |
gradlew bootRun or gradle bootRun |
| java | target/*.jar |
java -jar target/xxx.jar |
| python | manage.py |
python manage.py runserver |
| python | main.py/app.py + dependency manifest |
python -m uvicorn main:app --reload |
| docker | compose files | docker compose up |
In edit mode, you can modify the name, command, and port, delete unwanted rows, and then save; in list mode, you can start, stop, or restart individual services and view real-time output via “Logs”.
Logs and Ports¶
The log area supports timestamps, substring filtering, clearing the buffer, and downloading as <service-name>.log with ISO timestamps. Each service retains the most recent 2000 lines in its buffer.
After expanding a service, if a port is configured, the panel can display the listening process for that port (pid, process name, startup time, command line) and provides “Kill this process” and “Re-check”. The kill operation requires a secondary confirmation; the host re-verifies the pid before execution, and refuses to kill if the port has been taken over by another process, to avoid accidental kills.
When stopping and restarting: on Windows, it first tries a gentle shutdown (taskkill /T without /F, about 1.5s), then force-kills the process tree, and finally cleans up any possible residual dev servers by the declared ports; on POSIX, it corresponds to SIGTERM followed by SIGKILL. When DSH exits or the plugin is uninstalled, processes started by this plugin are terminated as well, leaving no orphan processes occupying ports.
Data and Security¶
- Service definition file:
<DSH_HOME>/service-runner/services.json(can be edited directly; refresh the panel to take effect). - Runtime state exists only in memory.
All HTTP routes are constrained by a trusted fence: the Host must be a loopback address, must not be a cross-site sec-fetch-site, and if an Origin is present it must match the Host, to reduce the CSRF risk of malicious web pages against the local /service-runner/action endpoint.
Installation and Enablement¶
Prerequisites (from the repository README):
| Dependency | Requirement |
|---|---|
| DSH Desktop | Developed and validated on 0.1.5-rc.2 |
| Node.js | ≥ 20 |
| pnpm | Used for dependency installation and building |
The official documentation gives the installation method as cloning the repository, building, and then adding it to the profile via link (the following commands are excerpted from the README; replace the paths with local absolute paths):
git clone https://github.com/sqzssg12138/dsh-service-runner.git
cd dsh-service-runner
pnpm install
pnpm run build
dsh plugin --profile desktop add "link:<cloned absolute path>"
Uninstall:
dsh plugin --profile desktop remove dsh-service-runner
After modifying the plugin code, you need to re-run pnpm run build and restart DSH: the profile’s bundle composition and client registration occur at startup, and hot-loading new bundles is not supported.
The plugin starts and stops child processes locally with the permissions of the current DSH process; before installing, you should read the source code and the MIT License to confirm it meets your security and compliance requirements.
Typical Usage¶
- Restart DSH Desktop, open a session for the target project, and click “Services” in the top-right corner.
- First-time use: click “Edit” → “Probe Workspace”, adjust the names, commands, and ports in the list, then “Save”.
- In list mode, click “Start / Stop / Restart” for services; when you need to troubleshoot output, click “Logs”.
- If startup fails and it is related to a port, check the occupant above the log area, and if necessary, kill that process after confirmation before starting.
To locally debug detection results without starting DSH, the repository provides scripts such as node scripts/probe-detect.mjs "<workspace path>" (see the “Development and Testing” section on GitHub).
Applicable Scenarios and Notes¶
Suitable for: developers who frequently switch between frontend/backend or multi-module Java projects within DSH sessions, want to manage dev servers alongside DSH on the same screen, and need port-conflict visualization.
Notes:
- The port-readiness check does not count when the port is occupied by another process; the plugin marks the readiness state as “port not confirmed” to avoid false positives.
- On Windows, processes are not started with
detached: true, otherwise stdout/stderr cannot reach the panel. - Auto-detection generates candidate commands; complex VM arguments and custom scripts are still recommended to be reviewed in edit mode; configurations that IDEA cannot restore are skipped rather than guessed.
- The community directory SkillHub plugin page has no official affiliation with DeepSeek / High-Flyer; the DSH ecosystem follows the direction of “everything is a plugin”, and this plugin is a community-contributed client extension.
Links¶
- Directory page: https://www.skillhub.cn/plugins/sqzssg12138/dsh-service-runner
- Source code, full API, detection rules, and known limitations: https://github.com/sqzssg12138/dsh-service-runner