BrainZombie/dsh-restart-win ↗★ 0

@brainzombie/dsh-restart-win

Safe, verified restart of a DSH Web host on Windows: port-based instance discovery, fail-closed preflight, detached restart with a result file, and four host tools (win_restart / win_restart_status / win_restart_preflight / win_restart_result).

包名
@brainzombie/dsh-restart-win
兼容性
待验证
Harness 依赖范围
>=0.2.1-rc.1
版本
0.1.0
许可证
MIT
最近更新
2026年11月14日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:BrainZombie/dsh-restart-win

7. Configuration

Configuration lives under the plugin row's config in cordis.patch.yml (or in the host's plugin settings UI). The defaults are exactly the behaviour the engine already had on Windows.

KeyTypeDefaultMeaning
profilestringwebDSH profile being restarted
portinteger3080Host port; also the mutex name and the discovery key
bindHoststring127.0.0.1Address used for probes and status display. Changing it does not change the host's listen address (see §8)
dshHomestring''Empty = %DSH_HOME%, then %USERPROFILE%\.dsh
stateDirstring''Empty = %DSH_RESTART_HOME%, then %LOCALAPPDATA%\dsh-restart. Keep the default to reuse existing logs, boot records and resume notices
taskNamestringDSH RestartScheduled-task name (used by -ViaTask / -RegisterTask / -UnregisterTask)
pwshPathstring''Empty = auto: pwsh first, then powershell.exe
readySecinteger90Wait budget for the restarted host to become ready
verifyReadySecinteger150Readiness budget for the isolated verification instance
graceSecinteger3Graceful stop grace period
portFreeSecinteger30Wait budget for the port to be released
restartDelayMsinteger1500The tool returns first, then waits this long before touching the host
toolTimeoutMsinteger30000Foreground short-task timeout
verifyTimeoutMsinteger600000Budget for a detached verification run (also bounds how long win_restart_result waits)
injectHostEnvbooleantrueWhether to inject DSH_UC_PROFILE_NODE_MODULES / NPM_CONFIG_LEGACY_PEER_DEPS into the child process that becomes the host (see 7.1); false starts the engine with DSH_RESTART_INJECT_HOST_ENV=0 so it skips them
tools.restartbooleantrueRegister win_restart
tools.statusbooleantrueRegister win_restart_status
tools.preflightbooleantrueRegister win_restart_preflight
tools.resultbooleantrueRegister win_restart_result

An invalid value fails plugin load with the field name (dsh-restart-win config: : ...); nothing silently falls back to a default.

7.1 The two environment variables injected when launching the host

Before launching the host, the engine writes two variables into the environment of the process it is about to start:

VariableValueWhy it exists
DSH_UC_PROFILE_NODE_MODULES\profiles\node_modulesPlugins live under the profile's node_modules; without an explicit pointer the update checker can install a package into node_modules without updating package.json and pnpm-lock.yaml, so the next install drops it
NPM_CONFIG_LEGACY_PEER_DEPStrueThe rc host's peer ranges rarely agree; without this flag npm fetching packages in a temporary directory fails with ERESOLVE

Three things to know:

  1. Process scope only. The values are set in the engine's own process environment and reach the new host through Start-Process. Nothing is written at user or machine level, so nothing survives the host and the npm in your own terminal is unaffected.
  2. You can turn it off. With injectHostEnv: false (default true) the plugin starts the engine with DSH_RESTART_INJECT_HOST_ENV=0; the engine skips both injections and records a skip step. Use it on a machine that does not need these workarounds — the default reproduces the old behaviour.
  3. Check that nothing leaked into the system (both must print nothing):
[Environment]::GetEnvironmentVariable('NPM_CONFIG_LEGACY_PEER_DEPS', 'User')
[Environment]::GetEnvironmentVariable('DSH_UC_PROFILE_NODE_MODULES', 'User')