dsh 工作区视图插件集

August 17, 2026 · View on GitHub

面向 DeepSeek Harness 0.1.0-rc.5预构建插件产物。安装只使用本仓库 dist/ 下的 tarball,不依赖本机 harness 源码路径。

  • 工作区 Git 变更plugins/git):右对齐「Git 变更」抽屉。展示当前会话所属工作区的已暂存/未暂存/未跟踪文件,以及逐文件 diff(旧/新行号栏、复制差异、可拖动宽度)。
  • 工作区文件树plugins/files):右对齐「文件」抽屉。展示当前会话所属工作区的目录树,以及右侧预览栏(Markdown 渲染、PDF 原生查看器、docx/xlsx 文本提取、可拖动宽度)。
  • 持久记忆plugins/memory):memory_writememory_search 模型工具与自动召回;压缩成功或空闲 30 分钟后合并重复条目;/memory 快捷指令。较新的 harness 已在 dsh-base 内置记忆三行,本层先禁用内置行、再以新 id 插入同包名行——两种组合下都只激活一份。

目录结构

plugins/
├── git/
│   ├── bundle/             # dsh-plugin-workspace-git(组合包:声明 dsh.bundle)
│   ├── dsh-git/            # 主机服务包(预构建 lib/)
│   └── dsh-client-ui-git/  # 浏览器 UI 包(预构建 lib/,含 lib/client.js)
├── files/
│   ├── bundle/             # dsh-plugin-workspace-files
│   ├── dsh-files/
│   └── dsh-client-ui-files/
└── memory/
    ├── bundle/             # dsh-plugin-memory
    ├── dsh-memory/         # 服务定义(ctx.memory)
    ├── dsh-memory-storage/ # 本地提供方(存储域)
    ├── dsh-tool-memory/    # 模型工具 + 自动召回
    └── dsh-memory-consolidate/ # 自动整理 + /memory 指令
dist/                       # pnpm pack 产物(11 个 tarball,可直接分发)
scripts/repack.ps1          # 从 harness checkout 重建并重打包(路径由参数/环境变量传入)

前置条件

  1. 已安装 dsh CLI,且该安装包含以下内置包(dsh-base 组合包均提供): @deepseek-ai/dsh-api-remotes(已挂载 gitfiles Remote 客户端面)、 dsh-client-ui-primitivesdsh-client-ui-slotsdsh-client-runtimedsh-client-localedsh-typert-protocoldsh-subprocessdsh-workspacedsh-invariants; 记忆插件另需 dsh-storage-domaindsh-toolsdsh-llmdsh-agentdsh-commandsdsh-compaction@deepseek-ai/schemastery
  2. 网络可访问 npm registry(安装 zodfflatereactreact-dom)。

dsh plugin add 只接受本仓库 dist/*.tgz(或等价的已发布包),不要传入 harness 源码目录或 file: 路径。

安装

在本仓库根目录(dist/ 所在处)执行。demo 可换成任意已有或新建的 profile 名。

工作区视图插件一次装齐:

dsh plugin --profile demo add \
  ./dist/dsh-plugin-workspace-git-0.1.0.tgz \
  ./dist/deepseek-ai-dsh-git-0.1.0-rc.5.tgz \
  ./dist/deepseek-ai-dsh-client-ui-git-0.1.0-rc.5.tgz \
  ./dist/dsh-plugin-workspace-files-0.1.0.tgz \
  ./dist/deepseek-ai-dsh-files-0.1.0-rc.5.tgz \
  ./dist/deepseek-ai-dsh-client-ui-files-0.1.0-rc.5.tgz

记忆插件单独一条命令(dsh-base 已内置记忆三行时该层原地替换,见 plugins/memory/README.md):

dsh plugin --profile demo add \
  ./dist/dsh-plugin-memory-0.1.0.tgz \
  ./dist/deepseek-ai-dsh-memory-0.1.0-rc.5.tgz \
  ./dist/deepseek-ai-dsh-memory-storage-0.1.0-rc.5.tgz \
  ./dist/deepseek-ai-dsh-tool-memory-0.1.0-rc.5.tgz \
  ./dist/deepseek-ai-dsh-memory-consolidate-0.1.0-rc.5.tgz

首次使用会初始化该 profile(@deepseek-ai/dsh-base 为第一层),并把组合包追加进 dsh.profile.bundles@deepseek-ai/dsh-* 包作为普通依赖安装(declares no dsh.bundle 的 warning 属预期)。

验证层级:

dsh --profile demo --dump-config
# 输出中应包含 "# == dsh-plugin-workspace-git" 与 "# == dsh-plugin-workspace-files" 两层,
# 且行 id 为 git / files / ui-git / ui-files;
# 安装记忆插件后另有 "# == dsh-plugin-memory" 层:三条禁用内置行的定向补丁
# (memory-storage / tool-memory / memory-consolidate)+ 三条新 id 插入行
# (memory-storage-plugin / tool-memory-plugin / memory-consolidate-plugin)。

启动(默认 3080 被占用时换端口):

dsh --profile demo --port 3081

卸载:

dsh plugin --profile demo remove \
  dsh-plugin-workspace-git dsh-plugin-workspace-files dsh-plugin-memory \
  @deepseek-ai/dsh-git @deepseek-ai/dsh-files \
  @deepseek-ai/dsh-client-ui-git @deepseek-ai/dsh-client-ui-files \
  @deepseek-ai/dsh-memory @deepseek-ai/dsh-memory-storage \
  @deepseek-ai/dsh-tool-memory @deepseek-ai/dsh-memory-consolidate

为什么是「组合包 + 依赖包」的 tarball 结构

  • 行包必须按名字解析:组合包 patch 里的 name 由 profile 的 node_modules 解析。依赖包在同一条 dsh plugin add 命令里随 tarball 一起安装为 profile 直接依赖,行名即可解析;无需 registry 发布。
  • 组合包不声明这些依赖:pnpm 对未发布的 @deepseek-ai/* 名字会回 registry 拉取并 404,因此依赖关系由「同一条命令安装全部 tarball」承担,而不是写进组合包的 dependencies
  • 依赖包保持原包名@deepseek-ai/dsh-git@deepseek-ai/dsh-files/remote 导出被 dsh-api-remotes 的客户端面挂载,改名会断开类型图与运行时 schema;记忆包名与 ctx.memory 服务名绑定。
  • 去除 monorepo 约定workspace:^ peer 依赖已全部移除(内置包由 dsh 安装自身解析,声明反而会让 pnpm 自动安装失败);src/* 导出与构建脚本未随包分发。
  • 行 id 的处理git/files/ui-git/ui-files 复用 web-app 组合包(基础 profile 不含这些行,插入即生效)。记忆三行已被较新的 dsh-base 内置——Loader 对跨层重复 id 报错,因此记忆层改为「定向禁用内置行 + 以 -plugin 后缀的新 id 插入同包名行」:内置时只激活本层一份,未内置时禁用补丁以 warning 跳过、插入照常生效。

重新打包

harness 源码更新后,把 checkout 路径传给脚本(不要把本机盘符写进仓库):

pwsh -File scripts/repack.ps1 -Harness /path/to/deepseek-harness

也可先设置 DSH_HARNESS,再执行 pwsh -File scripts/repack.ps1。脚本会重建产物、拷贝 lib/、去掉产物里的绝对路径注释,并重打 tarball。