huntersxy
dsh-plugin-toggle
DSH 第三方插件开关 | Settings-page toggle for third-party DSH plugins. Install: dsh plugin --profile web add dsh-plugin-toggle
- Stars
- 0
- Language
- JavaScript
- Created
- Aug 15, 2026
- Updated
- Aug 15, 2026
Introduction
dsh-plugin-toggle
第三方插件开关 —— 在 DSH Web 设置页里启用/禁用第三方插件。
A settings-page toggle for third-party plugins in DeepSeek Harness Web.
安装
dsh plugin --profile web add dsh-plugin-toggle
或本地包:
dsh plugin --profile web add ./dsh-plugin-toggle-0.1.0.tgz
安装后重启 dsh web。设置 → 插件 → 「第三方插件」页签即可使用。
功能
- 插件开关:列出每个 profile 中非官方(第三方)插件行(bundle 栈里非
@deepseek-ai/*的 bundle + 用户补丁插入的行),带版本/描述/状态,一键启用/禁用。 - 热重载生效:开关直接改写 profile 的
cordis.patch.yml(disabled: true标记),DSH 监视该文件并热重载,无需重启;状态持久,重启后保持。 - DSH 重启按钮:页签底部提供两段式确认的重启按钮,用于加载 profile 变更(新增插件、bundle 栈调整等);重启以原启动命令拉起,日志落在系统临时目录(
dsh-plugin-toggle-restart-*.log)。
工作原理
- Host:注册自定义 Web 路由
POST /plugin-toggle/api/<method>(list/set-enabled/restart),读取各 profile 的 bundle 栈与补丁文件,改写补丁。路由仅接受本机回路 + 同源请求,重启端点另有转发头校验。 - Client:
__ModuleLoader__bundle,注册到settings.plugins.tab(页签 idthird-party)。 - 为什么不用内置 settings RPC:DSH 的 api-proxy 对第三方 settings 命名空间有写死的暴露白名单(
WEB_SETTINGS_NAMESPACES),第三方插件无法通过该通道写入,因此本插件采用与dsh-better-sidebar一致的自定义路由通道。
局限
- 列表来自 profile 补丁文件的静态解析:只管理 bundle 栈中非
@deepseek-ai/*的 bundle 行与用户补丁插入的行;include:运行时前缀会自动归一化。 - 修改 bundle 栈(安装/卸载插件)需要重启生效,可用页签里的重启按钮完成。
License
MIT