Airmetro/dsh-plugin-checker0

dsh-plugin-checker

Detect updates for installed third-party (non-builtin) DSH plugins, ask the user, and update them from the Web GUI.

AI 분석

自动扫描并对比已安装第三方插件的npm版本,在Web界面提供一键更新与反馈。适合安装了较多非内置插件、需要便捷维护插件版本的用户。

패키지
dsh-plugin-checker
버전
1.0.1
라이선스
MIT
최근 업데이트
2026. 8. 15.

설치

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Airmetro/dsh-plugin-checker

dsh-plugin-checker

检测已安装的第三方(非内置)DSH 插件是否有更新,在 Web GUI 询问用户是否更新,并反馈更新成功 / 更新失败

功能

  • 扫描:识别 $DSH_HOME/profiles/node_modules 里已安装的非内置插件(判定标准:package.json 含 dsh 字段,且不属于官方 @deepseek-ai/* 命名空间,排除自身)
  • 对比:逐个查询 npm registry 最新版,semver 语义比较(正确处理 rc/beta 预发布号),标记有更新的插件
  • 询问:Web GUI 顶部横幅列出可更新插件(名称 + installed → latest),可单个更新全部更新,操作前 confirm 确认
  • 反馈:更新成功(绿)显示"已更新到 X",更新失败(红)显示失败原因;支持重试
  • 每 6 小时自动复查;"重新检查"走 ?fresh=1 强制刷新

架构

  • Host 半身lib/index.js):
    • GET /dsh-plugin-checker/status.json — 扫描 + 版本对比(npm 查询带 5 分钟 TTL 缓存)
    • POST /dsh-plugin-checker/update — 更新指定插件(body { confirm: true, name },仅允许已安装的非内置插件)
  • Client 半身lib/client.js):shell.overlay 横幅,跟随 DSH 界面语言(zh / en,其余回退中文)

更新机制(布局无关)

你的机器可能用 junction 省 C 盘(@deepseek-ai/* 链接到部署目录),其它机器可能是真实拷贝。本插件不假设存储形态

  1. 临时目录执行 npm install @latest(干净环境,不触碰 profiles 其它包)
  2. 替换前用 lstat 检测目标是否为符号链接(junction):是则只删链接、拷贝真实副本,避免自拷贝陷阱
  3. 旧版本自动备份到 profiles/node_modules/.dsh-plugin-backups/ -/
  4. 新版本拷贝到 profiles/node_modules/ ,缺失的新增依赖一并合并

绝不直接对 profiles 执行 npm install --prefix(会清空整个 node_modules,详见项目经验记录)。

安装

包是 profile bundle(manifest 声明 dsh.bundle.patch):

# 1) 安装到 profile(真实拷贝或 npm 安装)
npm i dsh-plugin-checker

# 2) 在 $DSH_HOME/profiles/web/cordis.patch.yml 加一行
- insert:
    - id: dsh-plugin-checker
      name: 'dsh-plugin-checker'

然后应用 patch(或重启 dsh web)并刷新页面。

Notes

  • 非 npm 插件(未发布到 registry 的本地插件,如部分自研插件)会被标记 onNpm: false 并跳过更新检测
  • 更新后部分插件需要重启 dsh web 才生效(与 dsh-update-checker 的重启/看门狗机制配合使用)
  • 写操作均要求 { confirm: true },防误触发

License

MIT