Preface¶
During daily development of DeepSeek Harness (DSH) plugins, common frictions are not always found in business code: changing a profile requires restarting the entire process, the desktop client prompts “Restart Required” but offers no entry point, host logs are scattered in pipes making post-mortem difficult, and a specific plugin entry in a combination explodes only upon the next startup. Official capabilities are scattered across components like the loader, HMR, and plugin_manager, lacking a client-side tool that brings “restart, diagnosis, logs, and configuration repair” together in one place.
Below introduces dsh-shell-kit, maintained by M-eang, open-sourced on SkillHub (M-eang/dsh-shell-kit, v1.0.0, client-side plugin). It splits an installation package into multiple independently switchable modules, sharing lib/core.js and read-only audit logic, using slash commands, agent tools, local HTTP API, and settings page cards to translate operational actions into reproducible steps.
What is it¶
DSH Shell Kit is an MIT-licensed DSH client plugin (package.json specifies engines.node as >=20). In one sentence, it provides a process operations toolbox for Harness hosts: one-click restart, real-time log streaming, HMR status reporting, port probes on the restart chain, profile health checks and fixes, and legacy agent preset inspections.
Architecturally, it is “one package, multiple modules”: each module handles its own routing, slash commands, and tools; modules.<name>: false can turn off individual modules; dynamic import adds try/catch per module, so if one module fails to mount, it only logs without dragging down the rest. Aggregate health status can be accessed via GET /api/shell-kit/status (accepts only local loopback).
Core Features¶
Module Overview¶
| Module | Capability Summary |
|---|---|
restart |
Desktop title bar “Restart”, settings card, /restart, restart_dsh tool, CLI; prioritizes window.dshDesktop.restartHarness(), otherwise uses built-in assistant to restart the whole app |
doctor |
Live loader + cordis.patch.yml static surface + host crash logs, with evidence-tiered reports: /diag, diagnose_plugins, GET /api/shell-kit/doctor/report |
profile |
Reuses doctor audit, uses official override lines disabled: true to stop bad entries; backs up first, default dry-run: /fix, fix_profile, /api/shell-kit/profile/{plan,apply,restore} |
logs |
ctx.logger.exporter writes to disk harness-<date>.log, optionally passes through stdout/stderr; /logs, read_harness_log, /api/shell-kit/logs/{list,tail,stream} |
hmr |
Reports official dsh-hmr conclusions and hmr/change, hmr/reload events; only reports, does not trigger reload, restart still goes through restart |
presets |
Inspects legacy .agent-presets, generates migration bundle skeletons; does not install on behalf, installation goes through official plugin_manager |
One-Click Restart (restart)¶
The desktop client often displays “N changes require restart to take effect,” but the market restart button is hard-coded as disabled for the desktop client. This module fills this gap: when a desktop bridge is present, it takes 3–6 seconds to just restart the Harness subprocess; without a bridge (e.g., official client 0.2.0-rc.2), it uses the built-in assistant, taking about 10–18 seconds to launch the whole application using the original command line.
Before restarting, a guard runs (e.g., do not restart if plugin operations are in progress). The assistant prioritizes WMI on Windows to launch, avoiding the job object KILL_ON_JOB_CLOSE taking the detached assistant with it; port release relies solely on ECONNREFUSED and uses netstat to check the new instance’s listening port. Output directory: $DSH_HOME\dsh-shell-kit\restart\ (falls back to %USERPROFILE%\.dsh if $DSH_HOME is not set).
Diagnosis and Profile Fix¶
doctor provides a read-only report answering “Is the combination healthy, where is the evidence?”; profile writes cordis.patch.yml override lines after confirmation and only touches that layer. The three steps before writing are: merge, self-audit, atomic replace; rollback relies on cordis.patch.yml.bak-shellkit-<timestamp> in the same directory.
Logs and HMR¶
logs solves the issue of desktop host output having no file; single files roll over at ~2 MB, keeping the latest 6 local log files in the directory. hmr helps distinguish “config changes hot-reload” from “source code changes still require restart”; the settings page can subscribe to SSE to watch reload events.
Installation and Enablement¶
The installation guide on SkillHub is: let the running DeepSeek Harness read and install the plugin M-eang/dsh-shell-kit (you can also send instructions to the host via the community directory page). The README also provides manual PowerShell steps to link dependencies within the desktop profile; please review the GitHub repository source code and MIT license yourself before installing.
The two steps below are taken from the README “Install / Uninstall” section: first link the package into the profile, then register the entry in cordis.patch.yml.
$kit = '<dsh-shell-kit 的绝对路径>' # 例如 <插件目录>
$profile = "$env:DSH_HOME\profiles\desktop" # 未设 DSH_HOME 时用 "$env:USERPROFILE\.dsh\profiles\desktop"
# 1) 以 link 依赖登记(这样后续 pnpm install 不会把它当成多余的包删掉)
# profile/package.json 的 dependencies 里加(路径用正斜杠):
# "dsh-shell-kit": "link:D:/Desktop/DSH插件/dsh-shell-kit"
New-Item -ItemType Junction -Path "$profile\node_modules\dsh-shell-kit" -Target $kit
# 2) 在 profile/cordis.patch.yml 末尾追加一行 insert(改前请备份)
# - insert:
# - id: shell-kit
# name: dsh-shell-kit
After the semantic change of cordis.patch.yml, the loader recombines within about 1 second, usually without needing a full process restart. If you only need partial capabilities, you can disable modules under config.modules in that entry, for example doctor: false.
- id: shell-kit
name: dsh-shell-kit
config:
modules:
restart: true
doctor: false
captureStdio: false # logs:只要 cordis 结构化日志时可设
Uninstall: delete the insert in the patch, package.json dependency, and the node_modules\dsh-shell-kit link; log files under $DSH_HOME\dsh-shell-kit\ can be cleaned up manually.
Typical Usage¶
Restart and CLI¶
| Entry | Usage |
|---|---|
| Settings | Settings → Shell Kit → Restart Now |
| Slash Command | /restart (/restart force skips silent period and plugin operation guard) |
| Agent | Call restart_dsh |
| CLI | node bin/dsh-shell-kit.mjs --status / --restart [--wait] [--force] |
Diagnosis, Fix, and Logs¶
/diag # 插件组合诊断结论
/fix # profile 修复方案(dry-run)
/fix apply # 显式确认后写入(见 README 完整说明)
/logs # 默认尾部 60 行
/logs 200 # 指定行数
/presets # 预设与旧目录巡检
/presets migrate <id> # 生成迁移骨架(不安装)
Local API examples (all protected by loopback guard):
GET /api/shell-kit/status
GET /api/shell-kit/doctor/report
GET /api/shell-kit/logs/stream?from=begin&intervalMs=1000 # SSE 实时日志
GET /api/shell-kit/hmr/status
Common tool names on the Agent side: diagnose_plugins, fix_profile, read_harness_log, audit_presets.
Applicable Scenarios and Notes¶
Who is it for: Harness users who develop and debug multi-plugin combinations on DSH Desktop or the official client for a long time; people who need to have restart, diagnosis, log archiving, and profile fallback fixes in a single workflow.
Permissions and Security: The plugin runs with the current DSH process permissions; routing and API design allows access only to local loopback. Please read the source code before installation to understand that restart terminates and launches host-related processes. The profile module will rewrite cordis.patch.yml; although it has backup and dry-run, it is still recommended to version control or manually backup production profiles.
Boundaries: hmr does not replace the official dsh-hmr trigger for reload; presets does not copy plugin_manager installation steps; doctor does not change configuration. The logs module can only record output after mounting; earlier load failures need to be combined with the doctor’s crash report.
Conclusion¶
DSH Shell Kit consolidates high-frequency process-side operations of Harness into a client-side toolbox: modules are trimmable, entry points are unified, and output paths are clear. If you want to understand version and module details further, you can check the community directory page SkillHub: M-eang/dsh-shell-kit and the README on GitHub: M-eang/dsh-shell-kit.