deadbushxw/dsh-self-restart ↗★ 0
dsh-self-restart
支持通过工具调用或接口在同会话中重启应用 适合需要频繁调试或重启桌面端,且希望保持当前对话不中断的开发人员。
同名套件的其他儲存庫
安裝
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:deadbushxw/dsh-self-restart說明文件
閱讀完整 README ↗Configuration
There is no settings page. The plugin declares no schema, because a schema would mean importing a second copy of a Host runtime package - see Known limitations. Configuration is two layers, the later one winning per field:
-
the plugin row's
configblock incordis.patch.yml, and -
an optional JSON file you own, outside this repository:
%DSH_HOME%\plugin-data\dsh-self-restart\config.json
%DSH_HOME% is %USERPROFILE%\.dsh by default. The JSON file is re-read while
DSH runs, so you can correct a value without restarting. A file that is not valid
JSON, or holds a value of the wrong type, is reported in the log and then
ignored: the last good configuration stays in force and dsh_status lists the
problem. A key that is not a setting is reported too, because a mistyped key is the
failure mode that costs an hour.
| Field | Default | Meaning |
|---|---|---|
enabled | true | Master switch. When false, the tools stay registered but every action refuses. |
restart.appPath | (derived) | The executable to relaunch. Derived from the running Host's own executable; set it only if that is wrong. |
restart.appArgs | [] | Arguments for the relaunched process. |
restart.appCwd | (derived) | Working directory for the relaunched process. |
restart.port | 0 | The port that must be released before starting again. 0 derives it from the origin DSH publishes to its children, and when that is unavailable the restarter resolves it from the process table before it closes anything. Set it only when neither can be right. |
restart.readyMode | "turn-end" | turn-end waits for a clean end of the turn that asked for the restart; immediate does not wait at all. |
restart.closeMode | "graceful-then-force" | force skips the graceful path entirely. |
restart.primitive | "auto" | auto tries wmi and then, if allowed, scheduled-task. Naming a primitive still measures it, because "the user asked for WMI" is not evidence that WMI works - with one exception: "detached" is taken on your word, because it is the one primitive whose success rests on an assumption nothing inside DSH can check. The trail records which it was. |
restart.powershellPath | (derived) | powershell.exe on Windows; set it to use pwsh. |
restart.allowScheduledTask | false | Permit the Task Scheduler primitive. It is as sound as WMI and leaves a trace in the system, so it is the fallback rather than the default. |
restart.gracefulMs | 15000 | How long to wait for DSH's own shutdown before forcing. |
restart.deadlineMs | 90000 | How long the restarter waits for the readiness gate. On timeout it continues and records forced: true. |
restart.bootMs | 120000 | How long to wait for the new generation's boot record. |
restart.ttlMs | 86400000 | How long a ticket stays meaningful. An expired ticket is never delivered, so yesterday's request cannot turn up as a message today. |
resume.enabled | true | Whether the new generation resumes the conversation. |
resume.locale | "auto" | auto follows DSH_LOCALE/LANG; or force "en"/"zh". |
guard.refuseWhenOthersAreActive | true | Refuse a restart while another session is running or recent. |
guard.activeWindowMs | 120000 | How recently another session must have been active to count as "in the way". |
watchdog.retryCooldownMs | 5000 | Minimum interval the undelivered-ticket watchdog honours. |
staleness.clientChanges | "auto" | auto treats a client-only change as covered by the hot reloader; reload-ui offers a reload; none reports nothing to do. |