rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:w17her/dsh-power-control
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
Reload, restart, or shut down the DeepSeek Harness desktop app from inside its own window — no trip to the taskbar, no hunting for the tray icon.
A small, dependency-free DSH plugin: one power button in the sidebar footer, one menu, one confirmation dialog. Refresh works in any DSH surface; restart and shut down are Windows-desktop only, because that is where the app process tree lives.
在 DSH 界面里直接「刷新界面 / 重启应用 / 关闭应用」,不用再去任务栏关窗口。 刷新在任何 DSH 环境都能用;重启与关机只支持 Windows 桌面版。
dsh-power-control-1.3.0.zip — unzip it and install the folder (see below).package.json, index.js,
client.js, cordis.patch.yml, locale/, icon.svg. There is no build step and no
compiled output to fetch.| Action | What happens |
|---|---|
| Reload window | window.location.reload() — rebuilds the web UI from the running Host. |
| Restart app | Flushes open sessions to disk, then restarts the whole desktop app (same executable, same profile, same workspace). |
| Shut down app | Flushes open sessions to disk, then quits the whole desktop app. |
backdrop-filter blurs and saturates whatever is behind it, so the page (or wallpaper) shows through. It opens upward as a frame-wide popover, so no sidebar scroll container can clip it.--dsw-alias-*).The plugin is a local DSH bundle, not an npm package. Either way works:
Option 1 — the release zip. Download
dsh-power-control-1.3.0.zip,
unzip it, and install the unzipped folder (the one that contains package.json) with DSH's
plugin manager:
plugin_manager install_bundle target = <path to the unzipped dsh-power-control folder>
Option 2 — clone. Clone it somewhere stable and install the same folder:
git clone https://github.com/w17her/dsh-power-control.git "$env:USERPROFILE\dsh-power-control"
In both cases DSH links the directory into the active profile and reloads the Host, and the power button appears in the sidebar footer immediately. In the GUI, Settings → Plugins shows the same entry; installing from a local folder is the supported path for a bundle that is not published to a registry.
To update a clone: git pull. Client changes hot-reload; Host changes need the plugin to
be toggled off and on (or the app restarted).
Disable the plugin in Settings → Plugins, or ask your DSH agent to uninstall the
bundle @local/dsh-power-control. Nothing outside the DSH profile is touched.
DSH's desktop shell gives the page no quit or relaunch channel. The main window's close
is intercepted and turned into "hide to tray", and the Host process is a child of the
Electron main process: if the Host exits on its own, the parent treats it as a crash and
shows the fatal-recovery dialog.
So the plugin splits the job in two:
index.js, ESM) registers one route, POST /__dsh-power, with
{ "action": "probe" | "restart" | "shutdown" }. It:Origin is rejected),DSH_DESKTOP_NODE_EXECUTABLE, else the parent
process image via Get-Process -Id <ppid>, and refuses to act unless the parent is
the same executable (this is what keeps dsh web in a terminal safe),ctx.get('sessions') → flush) with a 3 s budget,200, then hands the job to a Windows scheduled task and returns. The
task runs outside the Host, which is the point: it is the only actor that can kill
the process tree the Host lives in.client.js, window.__ModuleLoader__) renders the button and menu in
sidebar.footer.action, and the menu/confirmation overlay in shell.overlay.The Host writes two small scripts into %TEMP%\dsh-power-<id>\ and starts a launcher
that stays attached to the Host, so the Host always sees its child. The launcher creates a
one-shot scheduled task (dsh-power-control-<id>, schtasks.exe /Create /SC ONCE),
runs it, and reports back whether the task actually executed. The task body
(teardown.ps1) logs to %TEMP%\dsh-power-control.log, waits 900 ms so the HTTP response
lands, then Stop-Process -Name <image> -Force. For a restart it waits for the old
instance to disappear (up to 30 s), clears the desktop-only environment variables, and
Start-Process the executable again — it never starts a second instance while the old
one is still alive, so two instances can't race over the profile lock. The task deletes
itself and its temp folder on the way out.
Why a scheduled task instead of a detached child: in DSH 0.2.x the Host's detached
powershell.exe gets a pid but is never scheduled — the script does not run a single
line. An ordinary attached child works, so the task is created by an attached launcher,
and the killing runs in the Task Scheduler service, outside the tree it is about to end.
taskkill is deliberately not used: it is unreliable here (it can report
Access denied even for a PID that no longer exists), while Stop-Process behaves.
%TEMP%\dsh-power-control.log. A normal run starts with launcher start, then
task create / task run, then teardown-start action=… image=…, then either
stopped or relaunched. A missing log means the task never ran.task-did-not-run in the log. Task Scheduler refused to start it (policy, UAC, or a
locked-down machine). Check schtasks /Query /TN dsh-power-control-*.POST /__dsh-power {"action":"probe"} and read the JSON.{"action":"selftest"} runs a harmless task and
returns its marker; {"action":"verify"} starts a throwaway ping.exe, tears it down
through the real path, and returns before/after counts.Origin.index.js Host half: the /__dsh-power route, launcher and teardown task
client.js Client half: sidebar button, menu, confirmation overlay
cordis.patch.yml Bundle patch that inserts the plugin into the profile
locale/en.json Plugin display metadata (English)
locale/zh.json Plugin display metadata (Chinese)
icon.svg Plugin icon
POST /__dsh-power {"action":"selftest"} and {"action":"verify"} prove the teardown
without closing the app.dsh-app://app), probe retry,
status line, selftest/verify endpoints.MIT — see LICENSE.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。