前言¶
在 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 倉庫。