J
dsh-plugin-offline-sync
jeremyly/dsh-plugin-offline-sync
Package local DSH plugins into a portable ZIP, and install them offline on other machines with version detection and incremental packing. Its HTTP routes have no DSH access check, so a web page open in your browser could call them.
설치
dsh plugin --profile web add github:jeremyly/dsh-plugin-offline-syncREADME
dsh-plugin-offline-sync
将本地 DSH 插件打包为便携 ZIP,并在其他机器上离线安装。即使目标机器没装过本插件也能用。
功能
- 选择打包哪些插件 — 设置页里勾选。
- 增量打包检测 — 自动对比上次打包的指纹(文件路径+大小+mtime),有更新的标记为「有更新」。
- 目标机器版本检测 — 安装器逐个展示打包版本 vs 目标机器已安装版本,由用户决定是否更新。
- 目标机器无本插件也能装 — 安装器是独立的
install.cjs,只依赖 Node 内置模块,不需要 DSH 运行时。 - DSH 桌面端安装包自动下载 — 在插件列表中以一张卡片形式呈现,可勾选 Windows / macOS 平台,从下载站(
download.deepseek.com)拉取最新安装程序。版本号通过对安装链接发HEAD请求、解析Content-Disposition文件名获得,无需下载整个安装包;与上次下载记录对比,有新版本时标记「有更新」并自动预选。安装包是独立作业:不打包进 ZIP,单独存放在输出目录的dsh-installer/下;但「复制最近结果」会一并复制安装包,「清除历史」也会一并删除安装包。
安装
dsh plugin add Jeremyly/dsh-plugin-offline-sync
打包流程
设置 → Plugins → 离线打包同步 → 勾选插件 → 打包选中 → 输出目录生成 dsh-plugins-<时间戳>.zip。
安装流程(目标机器)
unzip dsh-plugins-*.zip
cd <解压目录>
node install.cjs
安装器会:
- 定位 DSH profile(默认
desktop,可用--profile <name>或DSH_PROFILE_DIR覆盖) - 逐个显示打包版本 vs 已安装版本
- 默认自动安装版本更高的(或目标机未安装的)插件,跳过相同或更旧的版本
- 加
--confirm可逐个询问是否安装/覆盖 - 拷贝文件、更新
package.json、合并cordis.patch.yml
常用参数:
node install.cjs:默认,自动安装更新的/新增的插件node install.cjs --confirm:逐个询问确认node install.cjs --yes:全部安装,不询问node install.cjs --list:仅列出打包内容与目标机已装版本对比
重启 DSH 生效。
环境要求
- DeepSeek Harness:已在
0.2.2-rc.3上测试。插件依赖webServer与clientModulesAPI,低版本 DSH 若提供这些 API 也可正常工作。 - Node.js:>= 18(插件本身与随包附带的
install.cjs均仅使用 Node 内置模块) - 平台:Windows / macOS / Linux
- Windows:使用系统自带的 PowerShell
Compress-Archive打包 - macOS / Linux:需系统提供
zip命令
- Windows:使用系统自带的 PowerShell
配置
在 cordis.patch.yml 里:
- insert:
- id: dsh-plugin-offline-sync
name: 'dsh-plugin-offline-sync'
config:
profile: desktop
outputDir: 'C:\\path\\to\\output' # 可选,默认 <profile>/dsh-plugin-offline-sync-output
License
MIT