dshbase

插件目录 / Developer / dsh-plugin-reloader

dsh-plugin-reloader

未验证 deepforce

✓ 持续维护 基于 4 个官方 DSH 包

查看 GitHub ↗ ← 返回插件目录

1Stars
0Forks
0未关闭 issue
语言
2026-08-15最近推送
跨平台平台

功能简介

Hot-reload DeepSeek Harness plugins without restarting dsh web — auto-watch, /reload command, dependency-change restart

我们的评价
未验证 — 尚未实测

Hot-reload DeepSeek Harness plugins without restarting dsh web — auto-watch, /reload command, dependency-change restart 尚未验证——请自行安装测试。

「未验证」表示我们的自动化 CI 尚未安装过该插件。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。

你是插件作者? 想拿到「已验证」标签——提交你自己的验证证据(截图、日志或短视频),我们审核通过后即改为「已验证」。

提交验证证据 ↗

README

dsh-plugin-reloader

English | 中文

Hot-reload installed DeepSeek Harness
plugins without restarting dsh web. After you upgrade a plugin (e.g. dsh plugin add github:...), the new code takes effect in place; only a dependency-tree change restarts the
process (through an external supervisor script).

It reuses the same reload pipeline dsh's built-in HMR uses for user code — clear the module
caches, re-import the plugin entry, dispose the old fibers, mount fresh ones, roll back on
failure — minus the node_modules exclusion that keeps the built-in HMR away from installed
plugins. The loader's internal module cache is reachable through dsh's vendored loader
without any special flag.

Features

  • Auto hot-reload — polls the installed plugins' entry and package.json files (every
    pollIntervalMs, default 2s) and hot-reloads a plugin in place when its code changes.
    Polling (stat mtime+size) is used instead of a file-watcher library: chokidar's fs-watch
    never reached ready inside the long-lived dsh web process on Windows, and polling is
    immune to pnpm's whole-directory replacements (the stat simply sees the new files on the
    next tick). Plugin upgrades are low-frequency, so a 2-second stat of a handful of files is
    negligible.
  • /reload <plugin> command — manually hot-reload one installed plugin; with no
    argument it lists the loaded plugins, marking non-reloadable ones ([official],
    [service], [self]).
  • /watch-status command — prints live watch diagnostics: watched scopes, event count,
    the last observed change, reload count, skipped reloads, and any startup error. Read it
    after upgrading a plugin to confirm the auto-reload fired (events and reloads
    incremented).
  • Dependency-change restart — if a plugin's package.json changes its
    dependencies/peerDependencies, the process exits with code 42 (configurable) so a
    supervisor relaunches it.
  • Reloadability guard — official @deepseek-ai plugins and plugins that provide
    services other plugins depend on are not hot-reloaded by default: the attempt is
    skipped, logged, and counted in /watch-status. Reloading a service provider would
    cascade restarts through every plugin that injects its services, and reloading an
    official plugin is equivalent to patching dsh itself mid-session. Override per category
    with allowOfficial / allowServiceProviders.
  • Rollback on failure — a failed re-import or mount restores the module caches and the
    previous plugin; the session keeps running.

Install

dsh plugin --profile web add github:deepforce/dsh-plugin-reloader

Restart dsh web once so the plugin loads. For the dependency-change restart to be useful,
start dsh through the supervisor instead of directly:

# Windows (cmd)
scripts\dsh-restart.cmd web

# Windows (PowerShell)
powershell -File scripts\dsh-restart.ps1 web

Usage

After upgrading an installed plugin:

dsh plugin --profile web add github:deepforce/dsh-balance   # upgrade

The watcher notices the changed lib/ files and hot-reloads it — no restart. To force it
manually, type /reload @deepforce/dsh-balance in a session, or /reload with no argument
to list candidates.

If the upgrade also changed the plugin's dependency tree, the process exits 42 and the
supervisor relaunches dsh web automatically (a supervisor is required — a plain dsh web
just exits).

Configuration

Field Default Meaning
watchEnabled true Poll installed plugins and hot-reload on code changes
watchRoots ["@deepseek-ai", "@deepforce"] Scoped directories under the profile's node_modules to consider
debounceMs 400 Change coalescing window before a reload fires
pollIntervalMs 2000 Polling interval for change detection
restartExitCode 42 Exit code used when a dependency tree changed (supervisor restarts on it)
allowOfficial false Also hot-reload official @deepseek-ai plugins (not recommended)
allowServiceProviders false Also hot-reload plugins that provide services other plugins depend on (not recommended)

Example overlay:

# reloader.cordis.yml
- patch:
    - id: plugin-reloader
      config:
        debounceMs: 600
        restartExitCode: 50

Compatibility

Tested against DeepSeek Harness 0.1.0-rc.6 (web profile, Windows 11, Node 24). It depends
on the loader's internal module cache (loader.internal), which the vendored loader exposes
by default; if a future dsh removes that surface, the plugin degrades to /reload reporting
"loader internal is unavailable".

Security

  • The watcher only reads files; it never executes anything itself.
  • A reload failure rolls back instead of leaving a half-mounted plugin.
  • The dependency-change exit is intentional and announced in the log before exiting.

Building locally

pnpm install        # uses pnpm-workspace.yaml overrides for upstream npm gaps
pnpm run build      # tsc emits lib/index.js

License

MIT

安装

🧩 让 Agent 自动装(推荐)

装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:

dsh plugin add dshbase-catalog

然后对 agent 说「帮我装 dsh-plugin-reloader」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包

该插件是 GitHub 源码(未发 npm)——直接从仓库装:

Web profile:

dsh plugin --profile web add github:deepforce/dsh-plugin-reloader

Headless(CLI)profile:

dsh plugin --profile headless add github:deepforce/dsh-plugin-reloader

实测报告

尚未 L3 验证——若已跑过,见下方失败备注。

状态:pending · 最近测试 2026-08-27
备注:验证: runtime-fail 浏览全部待验证失败 →
安全:尚未扫描——我们的每日静态扫描将很快覆盖它。

分享徽章

Developer 里更多

浏览全部 7795 个插件 →