前言¶
DeepSeek Harness (DSH) 的設計理念是“一切皆插件”。在本地開發場景下,智能體往往缺乏對代碼庫結構的理解能力,且無法在本地進行高效的代碼檢索。dsh-code-intel 插件通過符號感知索引和混合搜索機制,解決了這一問題。
插件定位¶
- 名稱:dsh-code-intel
- 作者:lonelymoon87
- 分類:記憶
- 核心功能:符號感知代碼搜索、代碼大綱解析、後臺索引、SQLite 持久化、文件系統監視、混合搜索(詞法和語義)、多語言支持(TS、JS、Python、Go、Rust、Java)
安裝¶
安裝前請確保 DSH 版本爲 >=0.1.0-rc.6 <0.2.0 且 Node.js 版本爲 ^22.19 || >=24。
dsh plugin --profile web add https://github.com/lonelymoon87/dsh-code-intel/releases/download/v0.1.3/dsh-code-intel-0.1.3.tgz
使用流程¶
該工具採用異步索引機制,首次使用時需要通過 Job ID 進行交互。
- 首次調用
code_search或directory code_outline時,工具會返回索引結果和一個job id。 - 使用內置的
jobs工具檢查或等待該任務完成。 - 任務完成後,再次調用代碼工具即可獲得搜索或大綱結果。
配置說明¶
插件默認爲詞法模式,不需要網絡請求。開啓混合搜索模式需要配置 OpenAI 兼容的嵌入端點。
詞法模式配置(默認):
- id: code-intel
name: dsh-code-intel
config:
indexDir: .dsh/code-index
include: [.ts, .tsx, .js, .jsx, .py, .go, .rs, .java]
exclude: [.dsh, .git, node_modules, dist, build, coverage, vendor]
maxFileSize: 1000000
maxChunkChars: 12000
maxResults: 20
watch: true
embedding: false
混合模式配置:
embedding:
provider: openai-compatible
endpoint: https://embedding.example/v1/embeddings
model: your-embedding-model
credentialRef: EMBEDDING_API_KEY
batchSize: 32
注意:indexDir 和排除項必須相對於工作區。只有列出的解析器支持的擴展名才被接受。
技術細節與限制¶
- 緩存位置:
~/.dsh/code-index/(工作區相對路徑)。 - Node 版本:需要 Node 22+,因爲內置 SQLite 模塊是實驗性的。
- 憑證處理:配置中的憑證是引用,不是 YAML 中的實際密鑰。插件在運行時通過
ctx.credentials解析引用。 - 數據隱私:無遙測,不註冊自定義持久化會話事件。
- API 限制:DeepSeek 的官方 API 不暴露公共嵌入端點,因此插件不會僞造端點或靜默將詞法結果標記爲語義結果。
生態信息¶
- 目錄頁:https://www.skillhub.cn/plugins/lonelymoon87/dsh-code-intel
- 源碼:https://github.com/lonelymoon87/dsh-code-intel
- 許可證:MIT