DSH HUB
HomePlugin StorePlugin PacksCommunityRankingsResourcesPublish Guide
Plugin source
Back to catalog

zcslack17858645276-del /

zcslack17858645276-del/dsh-app-restart

Verified

DeepSeek Harness plugin: adds a restart button to the Windows title bar of the DSH desktop app, left of the minimize/maximize/close buttons.

★ 0 Stars0 Forks0 IssuesN/A Community rating0 Confirmed installs
View on GitHub
READMESource: main@7d2449a5

App Restart (@local/dsh-app-restart)

Adds a restart button to the Windows title bar of the DSH desktop app, right where the native window controls start — one click opens a confirmation popover, and confirming restarts the whole application (Electron main + Host).

Why a bundle plugin

The desktop shell has no renderer-visible restart action: app.relaunch() lives only in the Electron main process (development menu, fatal recovery dialog), the preload dshDesktop API has no restart method, and the desktop IPC channel list has no restart message. This plugin therefore has two halves:

  • host half (index.js): registers same-origin routes under /dsh-app-restart/* on the Host web server and, on POST /dsh-app-restart/restart, starts a hidden helper (launch-helper.vbs -> restart.ps1) that terminates the Electron main process (the Host's parent) and starts the app executable again. The Host itself shuts down gracefully when its IPC channel disconnects, so no Host-specific handling is needed. The launcher is started through wscript.exe: the host is a console-less ELECTRON_RUN_AS_NODE process, and spawning powershell.exe directly with DETACHED_PROCESS creates a process that exits before running a single statement. wscript.exe is a GUI-subsystem process, so it starts detached reliably and its helper survives the host exit; the VBScript starts PowerShell with a hidden window and does not wait for it.
  • client half (client.js): mounts in the shell.overlay slot, renders a 28×28 icon button only when the desktop preload marks the page with html[data-windows-titlebar] (and not in fullscreen), positions it with position: fixed to the left of the native caption buttons using navigator.windowControlsOverlay.getTitlebarAreaRect(), and hands the restart request to the host half with a same-origin fetch.

Layout

index.js          host half: routes + helper spawn
client.js         client half: title-bar button + confirmation popover
launch-helper.vbs hidden wscript launcher for the restart helper
restart.ps1       restart helper: kill Electron main, wait, relaunch
cordis.patch.yml  bundle mount
locale/en.json    display metadata (title / description)
locale/zh.json    display metadata (Chinese)
icon.svg          bundle icon (64×64)

Notes

  • Windows only. On other platforms the restart route answers 501.
  • The button is invisible in a plain browser tab (the desktop preload attributes are absent), so the web GUI is unchanged.
  • The helper waits (up to 45 s) for both the old Electron main and the old Host to exit before starting the new instance, so the single-instance lock is free. If the Host somehow lingers it is terminated after the timeout.
  • The Host runs as a plain Node process (ELECTRON_RUN_AS_NODE=1), so the helper strips inherited ELECTRON_*, NODE_* and DSH_* variables before launching the app again; otherwise the relaunched Electron would immediately fall back to Node mode. This was verified with a marker executable that reports its environment.
  • Restarting interrupts running agent tasks; the confirmation popover says so.
  • Debug logs: %TEMP%\dsh-app-restart\plugin.log and helper.log; a GET /dsh-app-restart/log route returns their tails, and the helper log records the relaunched process id.
  • GET /dsh-app-restart/health reports electronPid (the Host's parent), hostPid, helperExists and launcherExists for quick diagnostics.
—/ 5

No ratings yet

Verified DSH bundle

Commit 7d2449a5abdd

Community comments

No comments yet. Be the first to write one.

DSH HUB

A community index for DSH plugins. Not an official GitHub or DeepSeek AI product.

CommunityResourcesAPIAbout