1959377950-dotcom/dsh-workspace-archive-all

dsh-workspace-archive-all

DSH Web plugin: Archive-All action on every workspace folder menu in the sidebar (Ungrouped included). Running / open / blank / subagent sessions are skipped.

待分类

dsh-workspace-archive-all

English →

DeepSeek Harness Web 插件:给侧边栏每个工作区文件夹的 … 菜单加一个 全部归档 动作 (含"未分组"桶),一键归档该文件夹下全部未归档会话。

  • 弹窗确认 → 逐个归档 → 进度与结果反馈
  • 自动跳过:正在运行、当前正在查看、空白"新会话"、子代理会话、已归档会话
  • 中英文案齐全(跟随界面语言)

机制

浏览器里的工作区侧边栏来自官方包 @deepseek-ai/dsh-client-ui-workspace, 其客户端文件由 DSH 的客户端模块系统通过 prefix 路由 /plugins/<id>/client.js 提供。本插件的宿主半注册了一条精确路由 (dsh-host-webserver 的匹配规则:exact 表优先于 prefix 表):

GET /plugins/@deepseek-ai/dsh-client-ui-workspace/client.js
  → 本插件 lib/workspace-client.patched.js(打了"全部归档"补丁的官方文件)
  • 不做任何运行时拦截,不依赖脚本执行顺序
  • 卸载插件(从 bundles 移除)→ exact 路由消失 → 官方原版自动恢复, 磁盘上的官方文件从未被改动
  • 响应头与官方 serveBundle 一致(text/javascript; charset=utf-8、no-cache)

安装

官方 CLI 一条命令(自动装包 + 通过包自带的 cordis.patch.yml 挂载,无需手改文件):

dsh plugin --profile web add dsh-workspace-archive-all          # npm 发布后
dsh plugin --profile web add <tarball地址或本地路径>              # 如 GitHub Release 的 .tgz

或手动本地 bundle 方式:

  1. 把本目录放到任意位置(如 ~/dsh-workspace-archive-all)
  2. 链接进 profile:ln -s ~/dsh-workspace-archive-all ~/.dsh/profiles/web/node_modules/dsh-workspace-archive-all
  3. 在 ~/.dsh/profiles/web/package.json 的 dsh.profile.bundles 追加 "dsh-workspace-archive-all"
  4. 重启 dsh web(bundle 列表在启动时读取)后生效

包自带 cordis.patch.yml 带防双挂载守卫:profile 里已有手动 bundles 条目时, 包自己的 insert 行会自动退位,两条通道不会冲突——但请二选一。

上架 dshmarket 市场后,也可以在设置里一键安装。

卸载

dsh plugin --profile web remove dsh-workspace-archive-all

或手动本地 bundle 安装时:把 dsh.profile.bundles 里的条目移除并重启; dependencies 与 symlink 可一并清理,DSH 本体无需任何清理。

DSH 升级后同步补丁

官方包升级后,用构建脚本从新版官方文件重新生成补丁版:

node tools/build-patch.mjs
  • 官方文件路径自动探测(nvm / Homebrew / /usr/local / PNPM_HOME / PATH), 也可用 DSH_STOCK_CLIENT 环境变量或 node tools/build-patch.mjs <官方client.js> [输出文件] 指定
  • 11 个 find/replace 补丁逐个要求唯一命中,官方结构漂移时会明确报错 (此时 diff 新旧官方文件,重新推导补丁对)

文件

文件作用
lib/index.js宿主半:注册 exact 覆盖路由
lib/workspace-client.patched.js打好补丁的官方 workspace 客户端(构建产物)
cordis.patch.ymlbundle patch:挂载插件(含防双挂载守卫)
tools/build-patch.mjs从官方原版重新生成补丁版

许可

MIT