READMESource: main@dd8f0bf8
dsh-lightweight-plugin-enhance
轻量插件增强(Lightweight plugin enhance)for DeepSeek Harness:在 Web 设置里区分官方插件与第三方插件,并对第三方插件一键启用/停用(写用户补丁层,配置 HMR 生效,无需重启)。
特性
- 官方/第三方分类:官方 =
@deepseek-ai作用域(覆盖所有随附 profile bundle 与内置插件包)+ DSH 自有 Loader 内置(cordis:include根组合条目、cordis:group);其余(用户dsh plugin add安装的)为第三方。 - 分组与筛选:官方插件组 / 第三方插件组 + 实时计数;「全部 / 官方 / 第三方」分段筛选,与搜索框组合。
- 一键开关(仅第三方):展开卡片可查看完整模块名与带标签的 Loader 条目 id;展开第三方插件卡片另有「启用 / 停用」。宿主经环回路由写 profile 用户补丁层
cordis.patch.yml(- id: X+disabled: true|false),纯配置 HMR 约 1 秒重组合,无需重启。 - 基础设施受保护:官方行一律拒绝开关(宿主侧判定,无需维护模式列表);本插件自身也禁止开关(自保护,避免管理面板随开关一起消失)。
- 零核心修改:数据来自官方
pluginInventory/listremote,分类在浏览器侧完成;开关走插件自有环回路由。DSH 核心保持原始纯净。
安装
要求:DSH ≥ 0.1.0-rc.6(web profile,含 dsh-host-plugin-inventory / dsh-client-modules / dsh-api-remotes)。
# 已发布到 npm 时:
dsh plugin --profile web add dsh-lightweight-plugin-enhance
# 或从 GitHub 直装:
dsh plugin --profile web add github:<owner>/dsh-lightweight-plugin-enhance
# 本地开发:
dsh plugin --profile web add file:/absolute/path/to/dsh-lightweight-plugin-enhance
然后重启 dsh 服务(宿主行经 bundle 层加入组合树,需重启一次),刷新页面 → 设置 → 插件 → 轻量插件增强。
之后插件自身迭代:宿主变更需再重启;仅客户端变更刷新页面即可。
给插件作者:GitHub 收录
想让社区索引站(如 dsh-plugin-hub 的自动收录)搜到本仓库,请在 GitHub 仓库设置中添加 Topic:
dsh-plugin—— 必打,社区插件的统一发现标签(索引站按此 topic 每 6 小时自动收录)。
开发
pnpm install
pnpm run build # 产出 lib/index.js(宿主)+ lib/client.js(浏览器 ModuleLoader bundle)
pnpm test # 宿主开关逻辑 + 浏览器组件测试
测试通过 vitest alias 解析 DSH 本地 checkout(vendor/cordis、vendor/loader、client/ui-primitives),可在 vitest.config.ts 中调整。
安全说明
/plugin-enhance/*路由仅允许回环地址访问(127.0.0.1 / ::1)。- 开关只写用户补丁层
cordis.patch.yml,不执行任何代码、不触碰 bundle 层与cordis.yml。 - 官方/基础设施行无法通过本插件停用。
License
MIT
No comments yet. Be the first to write one.