全部插件

DSH / BUNDLE / CLIENT-UI

@osskn4w7/dsh-plugin-manager

v0.1.2OSSKn4w7 / dsh-plugin-managerc052a22a0d

可安装组合包UI 与客户端插件社区 · Topic 自动分析Web UI

概览

@osskn4w7/dsh-plugin-manager

Manage DeepSeek Harness plugins from the web GUI and CLI: install, enable/disable, uninstall — no manual config-file editing. Writes your profile's cordis.patch.yml for you and applies changes live through HMR.

README / ZH

插件文档

dsh-plugin-manager

在不改配置文件的前提下管理 DeepSeek Harness 的插件。

原本的流程是:把插件包放进 profile 目录、手改 cordis.patch.yml、重启、反复。 这个插件为 Web GUI 新增一个 插件管理 标签页 —— 就在 设置 → 插件 里,你可以:

  • 按 npm 包名安装插件(可附带 JSON 配置);
  • 一键启用 / 禁用任意 Loader 条目(即时生效,无需重启);
  • 再次卸载插件;
  • 查看完整的 Loader 组成树、profile 的依赖与 bundles,以及哪些行是管理器安装的。

它会替你写入 profile 的 cordis.patch.yml(一个带分隔符的自动管理块;你手写的补丁 会逐字节保留),运行中的服务通过用户补丁监听(HMR)立即应用改动。

同时还提供命令行(dsh-plugin-manager)和聊天命令(/plugin)。

组成

文件 作用
lib/index.js 宿主端:/plugin-manager/api JSON 接口 + /plugin 聊天命令
lib/client.js 浏览器端:设置 → 插件里的「插件管理」标签页
lib/core.mjs 共享逻辑:cordis.patch.yml 管理块读写、pnpm 执行、bundle 归并
bin/dsh-plugin-manager.mjs 独立 CLI(服务停止时也能用)

安装

npm 包名:@osskn4w7/dsh-plugin-manager

# 方式 A —— 标准 dsh bundle 安装:
dsh plugin --profile web add @osskn4w7/dsh-plugin-manager
# 然后重启 dsh web(bundle 补丁层在启动时加载)

# 方式 B —— 免重启的实时安装(在本目录执行):
dsh-plugin-manager bootstrap --profile web
# 或手动:在 profile 目录 pnpm add file:…,再启用该条目,然后刷新浏览器

两种方式二选一(都用会把条目插入两次)。bootstrap 通过 pnpm 把本包安装进 $DSH_HOME/profiles/web,并把它的 Loader 条目写入 cordis.patch.yml。因为 profile 补丁文件是实时监听的,宿主端会立即激活;刷新一次浏览器即可加载客户端包。

单独使用 CLI(不在插件源码目录时):

npm i -g @osskn4w7/dsh-plugin-manager
dsh-plugin-manager list --profile web

要求:PATH 里有 pnpm、使用 web profile(或任何带 web bundle 的 profile)、 服务默认绑定 loopback。

发布(维护者)

npm 包:@osskn4w7/dsh-plugin-manager;GitHub 仓库: OSSKn4w7/dsh-plugin-manager

npm version patch          # 或 minor / major —— 自增版本号并打 git tag
npm publish --registry=https://registry.npmjs.org/ --access public
git push && git push --tags

注意事项:

  • 本机默认 npm registry 是 npmmirror 镜像——必须显式 --registry=https://registry.npmjs.org/(镜像只读,不能发布)。
  • 账号已开启 2FA(auth-and-writes):发布时用 --otp <验证码>,或使用勾选了 bypass 2FA 的 granular access token(在 npmjs.com 设置页创建;该令牌的 直接发布能力预计 2027 年 1 月起改为 2FA 审批流程)。
  • bindsh-plugin-manager)通过 files 白名单包含在发布的 tarball 中。

启用/禁用原理

  • 普通插件(manifest 无 dsh.bundle):install 执行 pnpm add 并向管理块 插入一条实时 Loader 条目 —— 立即启用。
  • bundle 插件(声明了 dsh.bundle):install 执行 pnpm add 并把包名归并进 package.jsondsh.profile.bundles(与 dsh plugin --profile … add 相同规则)。 bundle 补丁层在启动时读取,因此会提示 needsRestart;重启后其条目出现,可再开关。
  • 启用/禁用:在管理块中增删一条按 id 的 disabled 补丁,监听器实时重组树。

CLI

dsh-plugin-manager list [--json] [--profile web]
dsh-plugin-manager enable <entry-id>   # 或 disable
dsh-plugin-manager install <pkg> [--config '{"a":1}']
dsh-plugin-manager remove <pkg>
dsh-plugin-manager bootstrap

聊天命令

在 Web 聊天里输入 /plugin list/plugin enable <id>/plugin disable <id>/plugin install <pkg>/plugin remove <pkg>

备注

  • cordis.patch.yml 中的管理块以 # >>> dsh-plugin-manager … >>># <<< dsh-plugin-manager <<< 为界;块内改动会被覆盖,块外内容原样保留。
  • HTTP 接口仅限 loopback(与默认绑定一致),无鉴权 —— 不要把你不可信网络上的 Web 服务暴露出去。
  • 若某条禁用的 id 在组成树中已不存在,Loader 只会记录一条无害警告;管理器在卸载 对应包时会清理这类补丁。

License

MIT