前言¶
用 DeepSeek Harness(dsh)做 profile 开发时,第三方插件往往通过 dsh plugin --profile <p> add <pkg> 装进 ~/.dsh/profiles/<p>/。装多了容易忘记装了谁、版本是否落后;依赖写在 package.json 的 dependencies 里,却未必出现在 dsh.profile.bundles,等于没真正进插件层;想对照 registry 更新,还得自己进 profile 目录跑 pnpm outdated 和升级命令。官方「设置 → 插件」页主要回答「哪些插件被 Loader 加载、启用状态如何」,和「外部 npm/git 包装了没、能不能升」是两条线。下面介绍社区插件 dsh-plugin-management(维护者 YUYUY9527):在设置里加「外部插件」视图,并给 agent 暴露查询与更新工具。
这是什么¶
dsh-plugin-management 是面向 dsh 的外部插件管理器:对当前 profile 里非 @deepseek-ai/* 的第三方依赖做 inventory(已装版本、版本范围、是否生效为插件层、能否更新),并支持一键更新、卸载,以及复制各包的安装命令。
- 仓库:YUYUY9527/dsh-plugin-management
- 目录页:SkillHub 插件页
- 分类:客户端(Settings → Plugins UI + agent 工具
external_plugins) - 许可证:MIT(见仓库
package.json) - 当前包版本(资料):1.2.1
核心功能¶
| 能力 | 说明 |
|---|---|
| 外部插件清单 | 列出 profile dependencies 中外部包:已装版本、范围、是否在 dsh.profile.bundles 中生效、registry 或 link: 等本地 spec |
| 版本检查 | 使用 pnpm outdated --format json,区分范围内可更新与需 --latest 的跨大版本升级 |
| 一键更新 | 单包、全部可更新、跨大版本(latest)三种粒度 |
| 卸载 | 面板两行确认后执行 dsh plugin --profile <p> remove <包名>,并从 dsh.profile.bundles 移除 |
| 安装命令展示 | 每行给出可复制的 dsh plugin --profile <p> add …(registry 可钉最新;本地/git/tarball 原样复用 spec) |
| 结果回显 | 展示实际命令、退出码、stdout/stderr 尾部,并提示需重启 dsh 后新版本加载或卸载生效 |
| Profile 切换 | 自动识别当前运行 profile,也可手动切换 |
| Agent 工具 | external_plugins:list / update / uninstall |
| 双语 | 界面跟随 locale(zh / en) |
判断逻辑简要对应 profile 目录结构:dependencies 表示「装着谁」;dsh.profile.bundles 表示「谁作为插件层被装配」;node_modules/<pkg>/package.json 的 version 与 dsh.bundle.patch 用于实际版本与是否为 bundle。
安装与启用¶
装完后重启 dsh 才会完成 bundle 装配。add 的 spec 原样交给 pnpm,因此 pnpm 支持的写法均可使用。--profile 必须是你在跑的那个 profile(例如 dsh web 对应 web)。
公网安装示例(来自 README,可按需选用其一):
# 锁定版本(推荐:git tag)
dsh plugin --profile web add github:YUYUY9527/dsh-plugin-management#v1.0.0
# 跟随仓库最新代码
dsh plugin --profile web add github:YUYUY9527/dsh-plugin-management
# Release 包 URL(本机无需 git)
dsh plugin --profile web add https://github.com/YUYUY9527/dsh-plugin-management/releases/download/v1.0.0/dsh-plugin-management-1.0.0.tgz
# npm registry(README 注明尚未发布,发布后可用)
dsh plugin --profile web add dsh-plugin-management
加完后可检查是否装配进配置:
dsh --profile web --dump-config | grep dsh-plugin-management
运行环境:package.json 要求 Node >=22.0.0。维护者说明本包分发以 GitHub Release + git 安装 为主,npm 路径尚未启用。
可选配置(cordis.patch.yml 中本插件条目下的 config):
- id: dsh-plugin-management
config:
apiPath: /dsh-plugin-management/api # 路由冲突时修改
sandboxMode: danger-full-access # 执行 pnpm/dsh 时的沙箱模式
默认 sandboxMode 为 danger-full-access,是因为一键更新需要写 pnpm store(不在 profile 目录内);若改为更严模式,更新可能被同一沙箱规则拒绝——属文档中的有意取舍。
典型用法¶
设置界面¶
重启 dsh 后打开 设置 → 插件,在官方 tab 之后会出现 「外部插件」:
- 顶部选择 profile(「自动」= 当前运行实例)、点「刷新」或「一键更新 (N)」。
- 每行查看包名、版本、状态徽标(可更新 / 可升级 / 最新 / 本地链接 / 非插件层 / 已废弃等)。
- 按需点「更新」「升级到最新」或「卸载」(卸载需 4 秒内二次确认)。
- 底部查看命令输出;有变更时按提示重启 dsh。
页面会先展示本地清单,再自动联网做版本检查;失败会显示原因而非静默「未检查」。
模型工具¶
Agent 可调用 external_plugins:
external_plugins action=list
external_plugins action=list check=false
external_plugins action=update profile=web
external_plugins action=update names=["dsh-tinyfish-search"]
external_plugins action=update latest=true
external_plugins action=uninstall names=["dsh-tinyfish-search"]
卸载必须显式 names,没有「卸全部」。
HTTP API(同源)¶
默认前缀 /dsh-plugin-management/api,例如 GET /inventory?profile=&check=1&refresh=1、POST /update、POST /uninstall(body 中 names 必填)。跨站请求会被拒绝。
适用场景与注意¶
适合谁:长期在固定 profile 上堆多个社区 dsh 插件、需要一眼看清「装了什么、生没生效、要不要升」的开发者;也希望 agent 能代查清单、批量更新或按名卸载的场景。
范围与限制(README 明确说明):
- 只管理当前 profile 的第三方依赖,不涵盖
@deepseek-ai/*与模板自带 in-box bundle。 - 不提供「安装新插件」的 UI——新装仍用
dsh plugin add;本插件专注看见、更新、卸载与命令复制。 - 跨大版本升级不校验与当前 dsh 的兼容性,升级前需自行看目标包说明。
- 插件在 当前 dsh 进程权限与沙箱 下执行 shell/pnpm;安装前应阅读源码与 MIT 许可证,并理解
sandboxMode含义。
临时禁用本插件而不卸载:在 profile 的 cordis.patch.yml 对应条目加 disabled: true。命令行移除本插件:
dsh plugin --profile web remove dsh-plugin-management
结尾¶
dsh-plugin-management 把「profile 里第三方包装了什么、是否在 bundles 里生效、registry 上有没有新版本」收敛到设置页的一 tab,并把同一套能力交给 external_plugins 与 HTTP API。与官方插件加载视图互补,减少靠记忆维护 package.json 和手工进目录升级的成本。
- 目录页:https://www.skillhub.cn/plugins/YUYUY9527/dsh-plugin-management
- GitHub:https://github.com/YUYUY9527/dsh-plugin-management
社区插件目录(SkillHub)独立于 DeepSeek / 幻方,并非官方应用商店;使用前请自行核对仓库与 Release 来源。