DeepSeek Harness Windows 平台的 @file 补全:dsh-at-file-everything

前言

在 Windows 平台用 DeepSeek Harness(DSH)开发智能体时,一个常见痛点是 @file 补全的速度和覆盖范围。上游自带的 file-reference-local provider 会遍历整个工作区树,受 maxEntries 限制,在大工程里既慢又可能漏掉文件。dsh-at-file-everything 这个插件利用 Everything 的全局索引来回答 @file,绕过本地遍历,只做查询和重排。

插件定位

这是一个为 DeepSeek Harness 在 Windows 上提供 instant @file 补全的插件,由 backkom 维护。它通过 Everything 的命令行客户端 es.exe 访问全局搜索索引,把工作区作为排名根,在 Composer 里补全文件路径。

核心功能

  • 使用 Everything 的索引进行文件搜索,不遍历本地文件树。
  • 支持精确匹配、前缀匹配、子串匹配、目录段匹配、子序列匹配等排序规则。
  • 通过 excludedDirectories 过滤掉不需要的目录(如 .git、node_modules、Library、Temp、Output 等)。
  • 查询默认限定在工作区根目录下,防止跨工作区泄漏文件。
  • 通过 fuzzyFallback 开启子序列回退(如 pbin → PlayButton)。

安装与启用

先安装 Everything 服务与 CLI:

winget install voidtools.Everything
winget install voidtools.Everything.Cli

再在 DSH profile 中添加插件:

dsh plugin --profile <profile> add dsh-at-file-everything

插件会生成 cordis.patch.yml,插入 file-reference-everything 行并禁用 file-reference-local,保证只有一个 provider 提供 ctx.fileReferences。安装后重启 Harness profile 即可。

配置项

插件通过 dsh.plugin.json 提供默认配置:

- id: file-reference-everything
  name: dsh-at-file-everything
  config:
    esCommand: es.exe
    maxResults: 20
    maxCandidates: 300
    timeoutMs: 3000
    fuzzyFallback: true
    excludedDirectories: [.git, node_modules, Library, Temp, Output]
    extraPathDirectories: []
    installPrompt: true

常用字段说明:

字段 默认值 说明
esCommand es.exe 客户端可执行文件名或绝对路径,未指定路径时通过 PATH 解析
maxResults 20 单次查询返回的候选数
maxCandidates 300 向 Everything 请求的行数,用于排序,增加会线性增加开销
timeoutMs 3000 每个 es.exe 查询的超时时间(毫秒)
fuzzyFallback true 连续匹配无结果时,尝试子序列匹配
excludedDirectories .git, node_modules, Library, Temp, Output 目录名过滤,不区分大小写,仅过滤目录名
extraPathDirectories [] 额外添加到 PATH 的目录,用于便携式 Everything 安装
installPrompt true 安装时提示 @path 路径指引

典型用法

在 DSH 工作区输入 @ 触发补全,继续输入文件名或路径进行过滤,选择后会插入 @path。目录候选会保留尾部斜杠,方便继续向下补全。

  • 空查询 @Archive:搜索工作区根目录下所有文件。
  • 目录查询 @Assets/Scripts/:仅列出该目录下的文件。
  • 排序规则:精确 basename > 前缀 > 子串 > 目录段 > 子序列,同分时目录优先于文件,短路径优先。

适用场景与注意

  • 适合在 Windows 上使用 DSH 开发、调试智能体,且工作区规模较大(数万至数十万文件)。
  • 需要预先安装并运行 Everything 1.4+,并让其对相关盘符建立索引。
  • 插件在 Windows 上声明 os: win32,其他平台不可用。
  • 插件通过 dsh.plugin.json 插件清单声明依赖与入口,使用 MIT 许可证,可自行审查源码。
  • 插件以当前 DSH 进程权限运行,请检查权限与安全边界。

结尾

dsh-at-file-everything 把 Everything 的全局索引带到 DSH 的 @file 场景里,绕过本地遍历,在大工程中提供接近毫秒级的响应与更高的覆盖。更多细节可访问插件目录页与 GitHub 仓库。

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

小夜