# dsh-lightweight-plugin-enhance 轻量插件增强(Lightweight plugin enhance)for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness):在 Web 设置里**区分官方插件与第三方插件**,并对第三方插件**一键启用/停用**(写用户补丁层,配置 HMR 生效,无需重启)。 [English](README.md) | [中文](README.zh.md) ## 特性 - **官方/第三方分类**:官方 = `@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/list` remote,分类在浏览器侧完成;开关走插件自有环回路由。DSH 核心保持原始纯净。 ## 安装 要求:DSH ≥ 0.1.0-rc.6(web profile,含 `dsh-host-plugin-inventory` / `dsh-client-modules` / `dsh-api-remotes`)。 ```sh # 已发布到 npm 时: dsh plugin --profile web add dsh-lightweight-plugin-enhance # 或从 GitHub 直装: dsh plugin --profile web add github:/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 小时自动收录)。 ## 开发 ```sh 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