rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:Re-qi/dsh-topbar-restart
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
在 DSH 桌面端(Windows)的标题栏、最小化按钮左边加一个 ⏻ 重启 按钮:点一下,DSH 关闭,
随后自动重新拉起同一个应用。

已发布 npm 包 dsh-topbar-restart,仓库也打了
dsh-plugin topic,所以市场既能读到清单、也能一键装。
设置 → 插件 → 市场 → 搜
dsh-topbar-restart→ 添加
市场的静态索引由 GitHub Actions 每 6 小时按 star 重建一轮(前 500 名);新仓库还排在榜外时, 用市场的实时搜索(GitHub 源)同样能搜到本仓库。有 npm 包时安装走 registry 通道,最稳。
dsh plugin --profile desktop add dsh-topbar-restart
--profile 换成你自己的 profile 名(桌面客户端默认 desktop),装完重启 DSH。
没有 npm 时市场会降级到 GitHub Release 资产 → git 克隆,把包物化到 ~/.dsh/plugin-src/<pkg>、
在 profile 里写 link:。手动照做:
git clone https://github.com/Re-qi/dsh-topbar-restart.git "$env:USERPROFILE\.dsh\plugins-src\dsh-topbar-restart"
然后在 profile(例如 ~/.dsh/profiles/desktop/)里:
package.json 的 dependencies 加一行
"dsh-topbar-restart": "link:C:/Users/<you>/.dsh/plugins-src/dsh-topbar-restart"package.json 的 dsh.profile.bundles 末尾加 "dsh-topbar-restart"点击 ⏻ 重启
└─ 页面 POST /__dsh-topbar-restart/restart (client.js)
└─ Host 判定:真在桌面客户端?execPath 是应用?ppid 是窗口主进程? (index.js)
└─ lib/spawn-detached.ps1 用 Win32_Process.Create 造出 lib/restart.cmd
└─ restart.cmd:等 2s → taskkill /PID <主进程> /T /F → 等进程消失 → start 同一个 exe
三个关键取舍:
taskkill /T 会把自己也杀掉,
永远走不到「重新拉起」。所以真正的助手必须在进程树之外创建 —— Win32_Process.Create 造出来的进程父进程是
WmiPrvSE.exe,/T 杀不到它。Win32_Process.Create 默认会给助手开一个可见的控制台窗口,所以创建时带
Win32_ProcessStartup.ShowWindow = 0(SW_HIDE)——控制台存在但从不显示,点按钮不会闪黑窗。
依次尝试 CIM → WMI 类型加速器 → 无 startup 信息(最后一档宁可闪窗也要能重启)。.cmd 而不是 .ps1:实测在装有 HIPS/脚本防护的机器上,由 WMI 创建的 PowerShell 会在脚本执行前
就被拦掉(拒绝访问),而 taskkill / tasklist / start 组成的批处理能正常跑。app.relaunch():桌面外壳没有向页面开放重启 IPC,它自带的「重启应用与 Host」只存在于开发构建的托盘菜单。%TEMP%\dsh-topbar-restart.log(时间、PID、taskkill 结果、启动目标、失败原因)——
窗口已经关掉之后仍然可以查。GET /__dsh-topbar-restart/restart → 是否支持、平台;POST /__dsh-topbar-restart/restart?dry=1(带头 x-dsh-topbar-restart: restart)→ 只返回将要执行的计划。taskkill /F),不弹「还有任务在跑」的确认框。已落盘的会话数据不受影响,
但正在流式写入的最后一条记录可能被截断(与在任务管理器里结束进程相同)。start-dsh.bat 里的 cookie 清理也不会重跑。titleBarOverlay 的固定几何计算(标题栏 40px、右侧三个原生按钮共占 138px);
若上游改了这两项,改 client.js 里的两个常量即可。DSH 0.2.1-rc.3 桌面端实测通过。插件只用了三个稳定接口(webServer.register、ctx.slots、ctx.locale)
加一个 shell.overlay 槽位,没有读取任何别的插件的 DOM 或样式。
| 文件 | 作用 |
|---|---|
index.js |
Host 半:重启路由、可用性判定、启动器调用 |
client.js |
浏览器半:标题栏按钮(shell.overlay)、文案、状态机 |
lib/spawn-detached.ps1 |
用 WMI 在进程树外创建助手 |
lib/restart.cmd |
助手:杀进程树 + 重新拉起 |
locale/*.json |
插件列表里的标题与描述 |
icon.svg |
插件图标 |
docs/titlebar*.png |
标题栏实拍 |
插件页里关掉或卸载 dsh-topbar-restart 即可:按钮随客户端模块一起消失,Host 路由注销。
A one-click restart button for the DSH desktop client on Windows. It sits in the caption strip, immediately left of the native minimise button:
POSTs to a loopback Host route → the Host stops the whole application
process tree (taskkill /PID <main> /T /F) and then starts the same executable again.taskkill /T would kill the
helper too. lib/spawn-detached.ps1 therefore creates lib/restart.cmd through
Win32_Process.Create, whose parent is WmiPrvSE.exe and therefore survives the kill. The
helper is a batch file rather than PowerShell because WMI-launched PowerShell is blocked by
HIPS/script-guard software before it can run.Install: published on npm as dsh-topbar-restart and tagged with the dsh-plugin topic, so the
DSH plugin market both reads its manifest and installs it in one click —
Settings → Plugins → Market → search dsh-topbar-restart, or
dsh plugin --profile desktop add dsh-topbar-restart. Without npm the market falls back to the
GitHub Release asset, then to a git clone plus a link: entry.
Diagnostics: %TEMP%\dsh-topbar-restart.log, GET /__dsh-topbar-restart/restart, and
POST /__dsh-topbar-restart/restart?dry=1 (header x-dsh-topbar-restart: restart) which reports
the plan without touching a process.
Limits: it is a hard kill (no "tasks are still running" confirmation), and only the executable is replayed — extra CLI arguments are not.
MIT licensed.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。