DeepSeek Harness plugin

dsh-quick-restart-desktop

DSH Desktop 快速重启:一键重启应用本体(desktopRuntime 安全重启路径,profile 不变)或切换 profile 并重启(官方 desktopProfiles 契约)。提供 desktop-restart / desktop-profiles 命令、设置面板「快速重启」页面与独立 Web 面板 /desktop-restart。

Jump to install

Source facts

Repository
MicroWearld/dsh-quick-restart-desktop
Latest update
Aug 16, 2026
Category
Security & Permissions
GitHub stars
0
Format
plugin
Catalog evidence
Upstream dsh.bundle evidence
Evidence path
package.json#dsh.bundle
Checked against
0.1.0-rc.8
Upstream check date
2026-08-20

This evidence comes from the upstream catalog. This site has not installed, run, or security-reviewed the plugin.

Install

Start with a prompt that asks an agent to review the GitHub repository and source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to review the GitHub repository and source first.

Do not install or run any commands yet. Read this plugin's GitHub repository, README, and relevant source code. Then answer the questions below clearly and directly so I can decide whether it fits my needs:

1. What is this plugin, and what problem does it solve?
2. Who is it for, and what are its typical use cases?
3. How is it used after installation? Include one minimal example.
4. What known limitations or privacy, security, compatibility, or maintenance risks does it have?
5. Give a clear recommendation: recommend, conditionally recommend, or do not recommend, with reasons.

Distinguish statements documented by the repository, inferences from source code, and unknowns. If evidence is insufficient, say so explicitly. Do not guess or simply repeat the README.

GitHub: https://github.com/MicroWearld/dsh-quick-restart-desktop
Plugin: dsh-quick-restart-desktop
Author: MicroWearld

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer3 files
README.mdSource · read only

dsh-quick-restart-desktop

DSH Desktop「快速重启」插件,两个能力:

1. 重启 DSH Desktop 应用本体(当前 profile 不变,应用 relaunch)—— 走 launcher 的 desktopRuntime.requestRestart()(与桌面「安装更新后重启」同一条安全路径: 标记 relaunch → 干净关停 generation → app.relaunch())。 2. 切换 profile 并重启 —— 走官方 desktopProfiles.select() 契约。

功能

入口说明
设置 →「快速重启」面板当前 profile 行 = 「重启 DSH Desktop」主按钮(重启本体);其他行 = 「切换并重启到此 profile」
独立页面 /desktop-restart同样的面板 + 「重启 DSH Desktop」主按钮(浏览器直接打开)
命令 /desktop-restart重启 DSH Desktop 应用本体(无参,profile 不变)
命令 /desktop-restart <profile>切换并重启到指定 profile
命令 /desktop-profiles列出当前 profile 与全部可发现 profile(含可选择性)

契约说明(重要)

两条路径、两套契约:

  • 重启应用本体desktopRuntime.requestRestart()desktopRuntime

plugin-development.md 中被列为内部接口(不属于第三方兼容 contract,升级可能有变化)——但它是当前版本下 「重启应用本身」的唯一路径(同 profile 的 desktopProfiles.select() 被服务层刻意 定义为 no-op)。插件做了降级:若未来版本移除该服务,重启本体路径如实报错, 切换重启不受影响。

  • 切换 profile 并重启desktopProfiles.select(name),官方契约。

只接受可选 profile(存在、webCapable、无 problem),非法目标明确报错。

  • 重启请求一旦受理,进程立即退出 —— 插件在受理后马上返回响应,不等待进程结束。

与系统托盘的关系

DSH Desktop 托盘已内置 profile 切换:托盘菜单 Profile: <当前 profile> 子菜单 (launcher 自带的 desktop-profiles 插件)选中其他 profile 即安全重启。托盘 注册表本身(desktopRuntime.registerTrayItem)是内部接口,第三方插件不应注册 托盘条目——本插件不碰托盘,入口统一在设置页 / 独立页面 / 命令。

兼容性

在普通 dsh web(无 desktopProfiles)中,本插件正常加载但不挂载任何功能 (满足 plugin-development.md 的测试要求:没有 Desktop service 时仍能加载)。

安装(官方装配路径)

# 在 DSH Desktop 终端(或任何 dsh CLI)中,针对 desktop profile:
dsh plugin --profile desktop add "link:D:/workspace/dsh-quick-restart-desktop"
# 或等价的 pnpm 写法(会自动加入 dsh.profile.bundles 并应用 cordis.patch.yml)

然后重启 DSH Desktop,插件随下一次 Loader 组合激活 (插件变更后需要重启才能进入组合 —— 这正是本插件解决的场景)。

等效的手动装配(不经过 CLI 时的最终状态):

1. pnpm --dir ~/.dsh/profiles/desktop add "link:D:/workspace/dsh-quick-restart-desktop" 2. 在 ~/.dsh/profiles/desktop/package.jsondsh.profile.bundles 追加 "dsh-quick-restart-desktop"

卸载

dsh plugin --profile desktop remove dsh-quick-restart-desktop

开源协议

[MIT License](./LICENSE)。版权归 dsh-quick-restart-desktop contributors 所有; 如需署名自己的名字/组织,修改 LICENSE 文件顶部的 Copyright 行即可。

包结构

package.json         # dsh.bundle.patch(cordis.patch.yml)+ dsh.client(设置页)
cordis.patch.yml     # 向组合插入一行宿主插件
index.js             # Host:命令 + /desktop-restart 路由 + JSON API(ESM,零依赖)
client.js            # Client:设置页「快速重启」面板(__ModuleLoader__ 格式,零依赖)
README.md
test/harness.mjs     # 24 项逻辑自检(node test/harness.mjs)

行为细节

  • POST /desktop-restart/api/restart:body { profile?: string }

无 profile 或 = 当前 profile → 重启应用本体(desktopRuntime.requestRestart); 其他 profile → 校验后 select() 切换重启。均 fire-and-forget 立即返回「已受理」, 错误路径返回 400 + 原因;body 超过 64 KiB 返回 413。

  • GET /desktop-restart/api/state 返回 { current, profiles[] },供面板轮询。
  • 所有命令与路由均通过 ctx.effect 注册,插件卸载即全部释放。
  • 安全边界:API 无鉴权,但 webServer 仅绑定回环(127.0.0.1),且重启请求要求

JSON content-type(跨源表单无法触发,CSRF 免疫);本机进程本可自行结束桌面, 不构成新增攻击面。

客户端组件契约(踩坑记录)

ctx.slots.register(options, Component)Component 必须是 React 函数组件 (渲染器直接 jsx(Comp, props) 渲染)。早期版本把组件写成 options.component = () => ({ render(){} }) 的普通 DOM 工厂——渲染器拿到 undefined 组件导致渲染崩溃,slot 系统把条目标记为 abdicated(退休), 表现就是「设置卡片存在但内容空白」。client.js 现按要求使用 React.createElement 构建的 React 函数组件(require("react"))。