# dsh-self-restart **任意 DeepSeek Harness 会话可以重启 Desktop,再用自己的任务接回来。** [English](README.md) · [MIT](LICENSE) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) [![dsh.bundle](https://img.shields.io/badge/dsh.bundle-required-0f766e.svg)](https://deepseek-harness.github.io/deepseek-harness/develop/basic/publish.html) [![topic: dsh-plugin](https://img.shields.io/badge/topic-dsh--plugin-111827.svg)](https://github.com/topics/dsh-plugin) [![Node.js 22+](https://img.shields.io/badge/Node.js-22%2B-339933.svg?logo=node.js&logoColor=white)](https://nodejs.org/)
> [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 社区插件。不是 DeepSeek 官方产品。 仅 Host。给**调用方会话**写 handoff,走官方 Desktop 重启,起来后若该会话还没活就 `agents.resume`,再 followup。不必等人在 GUI 里点开那个标签。 ## 安装 ```sh dsh plugin --profile desktop add github:NecromanAlbert/dsh-self-restart ``` 装完重启 Desktop。该 profile 上任意会话都能看到 `dsh_restart_session`。 ## 工具 ```json { "mission": "Reload plugin copies, then verify the notes pad still opens.", "reason": "reload-client" } ``` | 参数 | | | --- | --- | | `mission` | 必填。自包含。起来后下一轮只看见这段。 | | `reason` | 可选。写进 handoff 文件。 | | `sessionId` | 可选。默认 `currentInitiator`。不要随便指到别的会话。 | 开机后插件会: 1. 读 `$DSH_HOME/self-restart/handoff.json`(超过 30 分钟作废)。 2. 目标会话不在线则 `agents.resume({ resumeSessionId })`。 3. `followup` 一条带 mission 的插件通知。 4. 清空文件,避免下次开机重放。 handoff 同时只有一条。重启前再调一次会盖掉上一条。 ## 这不是什么 - 不是杀 `dsh web` / 计划任务拉起。 - 不是侧栏 / 托盘重启按钮。 - 不是「请人重启,再等他把标签点开」。 - 不是管家身份纤维。 - 不是 [shengyvself/dsh-autoresume](https://github.com/shengyvself/dsh-autoresume)(写死一个 `targetSessionId`)。 - 不是 [edusrez/dsh-smart-restart](https://github.com/edusrez/dsh-smart-restart)(systemd / web)。 Host 没有 `desktopActions.requestRestart` 时,工具仍写 handoff,并告诉你自己重启 Desktop。 ## 开发 ```sh node --test ``` Host:`lib/index.js`。共享:`lib/handoff.js`、`lib/paths.js`、`lib/followup.js`。没有 Client。 ## License MIT.