hyls9527
dsh-bundle-updater
DSH 整合包插件管理器:检查更新 / 搜索 / 安装 / 卸载 / 安全审计(npm / GitHub / 本地链接)|Full-lifecycle plugin manager for DSH profile bundles
- Stars
- 1
- Language
- TypeScript
- Created
- Aug 14, 2026
- Updated
- Aug 14, 2026
Introduction
dsh-bundle-updater
DSH profile 整合包 · 插件全生命周期管理器(v0.2.1)
English: A full-lifecycle plugin manager for DSH profile bundles — update check, search, install, uninstall and security audit for npm / GitHub / local-link plugins. Every write operation is auto-backed up first.
五个工具覆盖插件从发现到维护的完整生命周期:检查更新 / 搜索 / 安装 / 卸载 / 安全审计。 吸收社区 dsh-update-radar(link-git 上游检查)与 marketplace(安装管道)的设计思路; 所有写操作(安装 / 卸载 / 更新)前自动备份,可随时回退。
工具一览
1. bundle_update — 检查/更新插件
检查三类依赖:
- npm 包:registry 最新版 vs 当前版本
- GitHub 直链:上游 HEAD commit vs 固定 commit
- link-git 插件(link: 且含 .git):本地 HEAD vs 上游 HEAD
| 参数 | 说明 |
|---|---|
mode | check(默认)只报告;update 执行更新(前自动备份) |
packages | 包名子集;缺省全部 |
2. bundle_search — 搜索社区插件
| 参数 | 说明 |
|---|---|
query | 关键词 |
source | github(默认,dsh-plugin topic)或 npm(registry) |
limit | 条数上限,默认 10 |
返回名称/描述/star/安装 spec,可直接喂给 bundle_install。
3. bundle_install — 安装插件
spec 支持:npm 包名@版本 / github:owner/repo#ref / link:绝对路径。
自动加入 dependencies + dsh.profile.bundles,安装前备份。
4. bundle_uninstall — 卸载插件
按包名从 dependencies + bundles 移除,卸载前备份。
5. bundle_security — 安全审计
三道防线扫描当前整合包:
- 已知漏洞:
pnpm audit(官方 registry) - 生命周期脚本:检查所有已装插件的
preinstall/install/postinstall/prepare等脚本(供应链攻击最常见入口) - 外发端点:提取插件代码中的外发网络端点并与白名单比对
| 参数 | 说明 |
|---|---|
deep | true 时同时扫描传递依赖(较慢);缺省只扫直接依赖 |
每周提醒(可选)
本插件零被动 token 开销(不在启动时注入内容)。每周提醒用官方
schedule_create:
schedule_create(every_seconds=604800, prompt="检查 DSH 插件更新:bundle_update(mode=check) 后报告")
插件配置
# ~/.dsh/profiles/web/cordis.patch.yml
- id: bundle-updater
name: dsh-bundle-updater
config:
profile: web
# skip: ["dsh-token-budget"]
开发
npm run typecheck # tsc --noEmit
npm run build # esbuild → lib/index.js