dsh-tray-restart
Identified★ 1Adds a restart item to the DeepSeek Harness desktop tray and application menus by patching app.asar.
dsh-tray-restart
Adds “重启 DeepSeek Harness” (fixed Chinese label) to DeepSeek Harness Desktop’s existing menus:
- the system-tray context menu (
Open/重启 DeepSeek Harness/Quit); - the application menu (Windows title-bar “Application”, macOS menu bar), where the item normally exists only in development builds.
The action is the app’s own app.relaunch() + quitWithoutConfirmation(), so it shuts the Host down through the normal quit path and then relaunches the app.
How it works
The tray and application menus live in the Electron main process (resources/app.asar → lib/main.js). DSH plugins run in the Host child process and have no runtime hook for those native menus. On every Host start this plugin therefore patches lib/main.js in place:
- skip when the
dsh-tray-restart:menu:v2marker is present; - apply two text edits, remove an equal number of bytes of comments, and pad with spaces so the file keeps its exact byte length (asar offsets are fixed);
- run
node --checkon the patched ESM; on failureapp.asaris left untouched; - back up the original
main.js, write the patch, update the per-file SHA256 in the asar header, read it back and verify; - restart DSH once — the running main process still has the old code loaded.
An app update replaces app.asar; the next launch patches the new file automatically.
Plugin page
The plugin page in the plugin manager renders a plugins.bundle.config card with:
- patch state, desktop app version, patch version;
app.asar, backup directory and log path;- Re-check, Apply now and Restore original menu actions.
Restoring writes the backup back and pauses automatic patching, so the next launch does not immediately re-apply it; Apply now resumes. A written patch still needs one DSH restart to take effect.
Install
Install from npm with the DSH plugin manager:
@hxhxh/dsh-tray-restart
or from GitHub:
github:hxh230802/dsh-tray-restart
plugin_manager target for npm:
{ "action": "install_bundle", "target": "@hxhxh/dsh-tray-restart" }
Manual one-shot patch (also useful for debugging):
node scripts/apply.mjs
Restore
Backups:
%USERPROFILE%\.dsh\dsh-tray-restart\backup\main.original.js
%USERPROFILE%\.dsh\dsh-tray-restart\backup\manifest.json
node scripts/restore.mjs
The restore refuses when the current main.js is not the exact copy this plugin wrote (e.g. after an app update).
If the asar header itself is damaged and the normal restore cannot parse it:
node scripts/emergency-restore.mjs
Config
- id: dsh-tray-restart
config:
enabled: true
dryRun: false # generate + syntax-check only, never write app.asar
verifySyntax: true
asarPath: '' # debug / non-standard installs
Notes
- Verified against desktop
0.2.0-rc.2. If a later build changes the menu source, the plugin logsunsupportedand leavesapp.asaruntouched. - This modifies installed application files, not an official API. A syntax check and a backup are taken before writing. If the app stops starting, run
node scripts/restore.mjs. - Restarting interrupts running tasks; there is no extra confirmation, matching the official development-build menu item.
Comments
Loading…
From the same category
by awesome-dsh-plugin
A curated list of plugins for DeepSeek Harness (dsh) · DeepSeek Harness 插件精选列表
★ 21.1k
CC0-1.0
Python
Oct 26, 2026
by 0xsline
DeepSeek Harness (DSH) ecosystem: curated plugins, tools, and infrastructure from dsh-external/hub and the public dsh-plugin topic.
★ 1.3k
CC0-1.0
Python
Oct 16, 2026
by Yuuyuko-uu
DSH 鱼的记忆:给会话一份会淡忘的长期记忆,每条都带时间
★ 300
MIT
JavaScript
Oct 27, 2026
dsh plugin --profile web add dsh-fish-memoryby pax-beehive
Open-source CLI, schemas, resolver, and DSH agent tools for DSH Plugin Hub
★ 277
MIT
TypeScript
Oct 20, 2026
by xiajiajun516
DeepSeek Harness (DSH) backup & restore plugin — export, import, migrate and sync your complete DSH configuration, plugins, MCP servers, skills and workspace. One-click migration to another machine.
★ 255
MIT
TypeScript
Oct 25, 2026
dsh plugin --profile web add dsh-config-managerby yjh051108
推荐组件(非必须):DeepSeek Harness 运行时注入器;已随 dsh-routing-suite 单仓库化保留,本仓库继续维护/发布。
★ 167
TypeScript
Oct 16, 2026
dsh plugin --profile web add @dsh-external/dsh-super-injector