packages/dsh-task-board
zhu1090093659/dsh-web侧边栏多列任务看板:卡片交给真实 DSH 智能体会话执行,支持 cron 定时(Host 侧到点执行,关浏览器也生效)。
A restart button for the DeepSeek Harness Desktop sidebar. One click fully quits the Electron application and opens it again — no tray menu, no terminal, no hunting for the window.
中文说明:README.zh.md
dsh web or on unsupported platforms it hides itself.%TEMP%\dsh-restart-desktop\restart.log, and the launch is verified with a retry.| DeepSeek Harness | Desktop build (Electron), dsh >= 0.2.0-rc.1 |
| OS | Windows 10/11 |
| Node | 20+ (only for development) |
The plugin is a DSH bundle: a Host half plus a browser half. It is not an npm dependency of your project; it installs into a DSH profile.
Add the bundle to your profile (~/.dsh/profiles/<profile>/package.json) and restart the app — keep your existing entries and add one line in each list:
{
"dependencies": {
// ...your existing entries
"dsh-restart-desktop": "github:StarMoon-win/dsh-restart-plugin"
},
"dsh": {
"profile": {
"bundles": [
// ...your existing entries
"dsh-restart-desktop"
]
}
}
}
Or use your build's plugin manager (Settings → Plugins) to install from the GitHub source. New bundles activate live; refresh the page if the sidebar does not show the button yet.
git clone https://github.com/StarMoon-win/dsh-restart-plugin.git
Then point the profile at the checkout:
"dependencies": {
"dsh-restart-desktop": "link:/absolute/path/to/dsh-restart-plugin"
}
and add "dsh-restart-desktop" to dsh.profile.bundles, or install the directory through the plugin manager.
Remove dsh-restart-desktop from dsh.profile.bundles (and from dependencies), then restart the app.
Restart / 重启.Restarting…, the app exits after about a second, and a fresh instance opens.If the button shows Restart failed, wait a few seconds and try again, then read the log:
%TEMP%\dsh-restart-desktop\restart.log
Sidebar button (client.js)
│ GET /dsh-restart-desktop/status → render only when supported
│ POST /dsh-restart-desktop/restart → 202, then the page dies with the app
▼
Host routes (index.js)
│ write %TEMP%\dsh-restart-desktop\request.json
│ spawn helper.mjs (detached, ELECTRON_RUN_AS_NODE=1)
▼
Relauncher (helper.mjs)
1. wait 1.2 s so the HTTP response can leave the Host
2. compute the application process tree by image name
(Windows PowerShell; excludes the helper and the PowerShell child)
3. terminate the tree: main process, renderers, GPU, Host,
and the tool processes those started
4. start the same executable with a clean environment
5. verify after 4 s; retry up to three times; log everything
The desktop shell turns a window close into hide to tray, and quitting asks the Host whether tasks are active before showing a confirmation dialog. app.asar exposes no app.quit() / app.relaunch() channel to plugins — the only Host-facing control messages are quit-inspection and update-tasks, both initiated by the Electron main process.
So the only way a plugin can produce a complete restart is to end the application tree from outside it and start the executable again. That is exactly what the detached helper does.
The two routes are reachable only from the same machine and the same page:
127.0.0.1 / ::1);Forwarded, X-Forwarded-For, or X-Real-IP are rejected;Host must be a loopback authority (127.0.0.1, localhost, [::1]), which also refuses DNS rebinding;Origin is present it must match Host;POST; GET /dsh-restart-desktop/restart answers 405.git clone https://github.com/StarMoon-win/dsh-restart-plugin.git
cd dsh-restart-plugin
node --check index.js
node --check client.js
node --check helper.mjs
node scripts/validate.mjs
scripts/validate.mjs checks the manifest exports, the locale files, the icon, and the patch file without activating the plugin.
To exercise the relauncher without touching the app, point a request file at a harmless program (for example notepad.exe, image notepad, a 200 ms delay) and run node helper.mjs <request.json>; the log shows the stop, launch, and verification steps.
A profile installed with link: points at your working tree. Host code is not hot-reloaded across that junction, so after editing index.js or helper.mjs:
dsh-restart-desktop in Settings → Plugins (or via the plugin manager), orThe browser half (client.js) is picked up on the next page load.
| Symptom | Check |
|---|---|
| No button in the sidebar | Is the profile the desktop one and the bundle in dsh.profile.bundles? Open /dsh-restart-desktop/status on the app origin; supported must be true. |
| Button always says “Restart failed” | Read %TEMP%\dsh-restart-desktop\restart.log. A missing launched pid=… line means the helper could not start the executable. |
Install fails with timed out waiting for the writer lock | A stale package.json.lock in the profile; restart the app so the recorded holder PID is gone, then install again. |
| App exits but does not reopen | The log ends with FAILED: the application did not come back. Start the app manually and report the log. |
MIT © Star_Moon_win
This repository is tagged:
deepseek-harness · dsh · dsh-plugin · deepseek · cordis · cordis-plugin · electron · desktop · restart · windows
They are also mirrored in package.json → keywords for npm and search.