dsh-code-intel:DeepSeek Harness 的符号感知代码索引与混合搜索

前言

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 进行交互。

  1. 首次调用 code_search 或 directory code_outline 时,工具会返回索引结果和一个 job id。
  2. 使用内置的 jobs 工具检查或等待该任务完成。
  3. 任务完成后,再次调用代码工具即可获得搜索或大纲结果。

配置说明

插件默认为词法模式,不需要网络请求。开启混合搜索模式需要配置 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
羽毛球分组比赛记分
小程序二维码

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

小夜