dshbase

插件目录 / Developer / dsh-code-index

dsh-code-index

未验证 lemonxiny55

✓ 持续维护 基于 2 个官方 DSH 包

查看 GitHub ↗ ← 返回插件目录

2Stars
0Forks
0未关闭 issue
语言
2026-08-22最近推送
跨平台平台

功能简介

Developer 类别的 DeepSeek Harness 插件。

我们的评价
未验证 — 尚未实测

Developer 类别的 DeepSeek Harness 插件。 尚未验证——请自行安装测试。

「未验证」表示我们的自动化 CI 尚未安装过该插件。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。

你是插件作者? 想拿到「已验证」标签——提交你自己的验证证据(截图、日志或短视频),我们审核通过后即改为「已验证」。

提交验证证据 ↗

README

dsh-code-index

npm version
CI

English | 中文

Semantic repo index — a DeepSeek Harness (dsh) plugin that gives the agent a codebase map: a tree-sitter symbol index, ranked symbol search, and a bounded auto-updating repo map in the system prompt.

Fills a real ecosystem gap: search of the dsh-plugin topic (2026-08) shows git/voice/browser/memory plugins galore, but no native, model-usable code index / repo-map capability — the kind of thing aider's repo-map and Cursor's @Codebase do for their agents.

What the model gets

Tool Purpose
code_index Status / (re)build the index for the current workspace
code_symbols List symbols (functions, classes, interfaces, types, methods…) with file:line — filtered by name, path, kind, exported
code_search Ranked lookup: exact > prefix > substring, exports first, relevance score + file:line
code_map Bounded ranked repo map (top files by symbol density, key symbols + lines)

Plus an optional auto-injected system prompt section (code-index:repo-map, order 60): a compact ranked map of the default workspace, refreshed with a 60s TTL. Set autoInject: false to disable and rely on the code_map tool only.

Install

Requires dsh (any install path — npx, npm, or source) and Node ≥ 22.

# from npm (prebuilt)
npx @deepseek-ai/dsh plugin --profile web add dsh-code-index

# or from a directory containing this checkout
npx @deepseek-ai/dsh plugin --profile web add ./dsh-code-index

Restart the Web UI (npx @deepseek-ai/dsh web) — startup logs confirm each tool:

[dsh-code-index] plugin loaded
[dsh-code-index] registered tool: code_index
...

Verify the composed config without booting: dsh --profile web --dump-config.

Using it

In a workspace session, ask the agent:

  • "Which repo are we in — run code_map first."
  • "Find every function whose name contains parse and where it lives."
  • "List the exported symbols in src/core."
  • "Rebuild the code index."

No API key is needed to index; the model must of course be configured to call the tools.

Example (input → output)

User prompt:

Which repo are we in? Run code_map first, then find where extractSymbols is defined.

The agent calls the tools in turn:

code_map
# repo map
## src/extract.ts (14)
  function extractSymbols(code, id) :121
  function languageForFile(filePath) :37
  ...

code_search { query: "extractSymbols" }
export function extractSymbols(code, id) — src/extract.ts:121

The index builds lazily on first use; later calls are served from the on-disk cache with mtime-incremental refresh.

Configuration

Options are passed as the plugin row's config in the profile patch (or defaults are used if absent):

# $DSH_HOME/profiles/<name>/cordis.patch.yml — a bare row overrides by id.
- id: code-index
  config:
    excludeDirs: [generated, playground]
    mapTopFiles: 30
    mapMaxChars: 4000
    autoInject: true
Key Default Meaning
excludeDirs [] Extra dirs appended to the built-in excludes (node_modules, .git, dist, build, out, coverage, .next, .nuxt, .cache, target, vendor, …)
mapTopFiles 24 Max files in a ranked map
mapMaxChars 3200 Hard cap on rendered map characters
autoInject true Register the system prompt section

Supported languages

TypeScript + JavaScript + Python (.ts .tsx .mts .cts .js .jsx .mjs .cjs .py .pyi) via tree-sitter WASM — pure parsing, no native build. The symbol provider seam (src/extract.ts + grammars) is where other languages/embeddings plug in later.

How it works

  • Index build (src/buildIndex.ts): recursive scan (excludes applied), per-file tree-sitter extraction (src/extract.ts), JSON cache under <repo>/.dsh-code-index/, incremental refresh by mtime (only touched files re-parse).
  • Search (src/search.ts): pure scoring — exact 1 / prefix 0.8 / substring 0.5, export boost, name order tiebreak.
  • Repo map (src/repomap.ts): density-aware file score (class/interface/function weighted, mild anti-bloat), top-N files, per-file symbol cap, hard char truncation.
  • Workspace resolution: each tool resolves the session cwd (agent.session.header.cwd) and walks up to the nearest .git (bounded — a directory without a repo marker is never indexed).

Known limitations

  • web-tree-sitter pinned to ^0.20.8 — newer releases expect dylinked grammar wasm while tree-sitter-wasms ships static builds; this pair is verified working under Node ≥ 22/24.
  • Auto-injected section targets the default workspace (launch directory, matching headless/CLI mode). Multi-workspace Web UI sessions should use code_map/code_symbols (they resolve per-session cwd).
  • Local variables are indexed too — recall over precision; code_search ranking keeps them low.
  • Developer-preview harness: expect breaking harness/plugin API changes upstream.

Development

pnpm install
pnpm test        # vitest — extractor, scan, cache, search, repo map (35 tests)
pnpm typecheck
pnpm build       # tsup → dist/index.js (ESM, external deps)

License

MIT. Not affiliated with DeepSeek; built on the public dsh plugin surface.

安装

🧩 让 Agent 自动装(推荐)

装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:

dsh plugin add dshbase-catalog

然后对 agent 说「帮我装 dsh-code-index」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包

该插件是 GitHub 源码(未发 npm)——直接从仓库装:

Web profile:

dsh plugin --profile web add github:lemonxiny55/dsh-code-index

Headless(CLI)profile:

dsh plugin --profile headless add github:lemonxiny55/dsh-code-index

实测报告

尚未 L3 验证——若已跑过,见下方失败备注。

状态:pending · 最近测试 2026-08-26
备注:验证: install-fail 浏览全部待验证失败 →
安全:尚未扫描——我们的每日静态扫描将很快覆盖它。

分享徽章

Developer 里更多

浏览全部 7789 个插件 →