dsh-file-mount¶
| 类型 | 插件 | 分类 | 记忆与上下文 |
| 星数 | ⭐3 | 状态 | ✅ 活跃 |
| 能力 | context, files | 更新时间 | 2026-08-14 |
📖 项目简介¶
DeepSeek Harness 插件:文件增量挂载 + 重复读取去重。记录每个文件哪些行范围已经进入模型上下文,重复读取只补缺失部分,文件在磁盘上变化时自动失效重挂,并提供一个「挂载文件」标签页实时展示账本。 移植自 piwpi 的 context-mount 机制。
✨ 核心特性¶
- 模型侧:读过的行范围不重复进上下文(去重 marker),新内容只注入缺失区间(增量挂载),磁盘变化即失效重挂(版本感知);渲染格式确定,prompt 前缀缓存稳定。
- 界面侧:对话区出现「上下文注入 · file-mount」折叠行(摘要显示本次节省,如「saved ≈ 300 tokens」);轨迹页出现对应 context 记录;对话区标签栏新增「挂载文件」标签页,实时列出路径、指纹、已挂载行范围与状态,顶部显示本次会话累计节省 t
- 节省统计:按「字符数 ÷ 4」粗略估算(去重 = 整个被去重窗口,增量 = 已覆盖区间);累计值跨文件变化与会话恢复保持一致。
📦 安装¶
# 从 GitHub(需在 profile 的 pnpm-workspace.yaml 里授权该包的 prepare 构建)
npx @deepseek-ai/dsh plugin --profile web add github:acefun29/dsh-file-mount
# 或本地目录 / tarball
npx @deepseek-ai/dsh plugin --profile web add file:../dsh-file-mount
npx @deepseek-ai/dsh --profile web
🚀 快速开始¶
- id: file-mount
name: dsh-file-mount
config:
enabled: true # 总开关;关闭后所有读取原生透传
capacity: 32 # 文件身份缓存容量(挂载中文件不受淘汰影响)
ttlMs: 300000 # 缓存安全阀:同 stat 内容被改的兜底重读间隔