DeepSHPlugins
dsh-plugin-knowledge-graph 项目预览
GITHUB / COMMUNITY PROJECT

dsh-plugin-knowledge-graph

工具与集成TypeScriptMIT

基于代码库知识图谱的 read_graph 工具(CONTAINS / EXPORTS / IMPORTS / IMPORTS_SYMBOL 关系)。

5 StarsLuke-Yong 更新时间 2026-08-17
访问 GitHub 仓库
dsh-plugin-knowledge-graph 项目预览

项目介绍

中文

基于代码库知识图谱的 read_graph 工具(CONTAINS / EXPORTS / IMPORTS / IMPORTS_SYMBOL 关系)。

English

A read_graph tool backed by a codebase knowledge graph (CONTAINS / EXPORTS / IMPORTS / IMPORTS_SYMBOL relations).

项目信息与收录信号

快照 2026-09-11
作者 / 组织
Luke-Yong
仓库
Luke-Yong/dsh-plugin-knowledge-graph
GitHub Stars
5
Forks
0
开发语言
TypeScript
许可证
MIT
最近推送
2026-08-17
Manifest
数据中检测到声明

公开仓库不自动等于可商用;许可证与当前兼容性以原项目文档为准。Manifest 和数据评分不构成安装安全认证。

数据评分

67/ 100
维护活跃
83
文档与实用信息
100
生态关注度
22
安装便捷信号
75
项目声明信号
100

README 含完整安装与使用说明;关注度尚低(5)。

评分来自已有数据快照的五维模型,仅作浏览参考,不是实际使用评测或安全检测结论。

安装与使用

所有项目资料与许可均以对应 GitHub 仓库为准。

dsh plugin --profile web add github:Luke-Yong/dsh-plugin-knowledge-graph

复制命令不会自动执行。请先阅读仓库文档,确认环境要求与许可证。

项目截图

仓库 README

GitHub 原文

已保存的仓库文档快照;文档抓取时间未记录,可能与上方目录介绍处于不同版本。安装前请核对当前仓库说明。

dsh-plugin-knowledge-graph

A DeepSeek Harness (DSH) plugin that exposes a read_graph tool backed by a codebase knowledge graph. The graph tracks every file, directory, exported symbol, and their relationships so an agent can answer structural and dependency questions faster than grepping or reading files.

Status: infancy. This project is in its infancy stage. Execution behavior, the query surface, and compatibility may change while the project is iterated on and tested by the open source community.
Derived work. This project is derived from the knowledge graph tool in Luke-Yong/H, adapted to DeepSeek Harness's "everything is a plugin" model.

What it does

Given a workspace root, the plugin builds an in-memory graph and answers queries such as:

  • structure — print the full directory tree
  • exports <file> — list every symbol exported by a file
  • imports_of <file> — list symbols a file imports (with their source files; stdlib/third-party imports are tagged)
  • exporters_of <symbol> — find which files export a symbol
  • dependents <file> — find which files import from a file
  • unused_imports <file> — list imports never referenced in the file

Symbols are parsed from TypeScript/JavaScript (via the TypeScript compiler API) and Python (module-level def, class, and name = value bindings).

Graph model

The graph uses three node types and four edge types:

NodesMeaning
dirA directory
fileA source file
symbolAn exported symbol (function, class, const, type, interface, enum, default)
EdgesMeaning
CONTAINSStructural parent → child (dir → dir/file, file → symbol)
EXPORTSFile → symbol it exports
IMPORTSFile-level dependency (file → file)
IMPORTS_SYMBOLPrecise symbol-level dependency (file → symbol)

Installation

Install with the DSH CLI into a profile:

dsh plugin --profile web add github:Luke-Yong/dsh-plugin-knowledge-graph

Pin to a specific commit for reproducibility:

dsh plugin --profile web add github:Luke-Yong/dsh-plugin-knowledge-graph#<commit-sha>

Usage

The plugin registers a single tool, read_graph, on ctx.tools. Its parameters:

ParameterTypeRequiredDescription
querystringyesQuery string in <query_type> <target> form
rootstringnoAbsolute workspace root to graph. Defaults to process.cwd()
Root hygiene: the root default (process.cwd()) may be a parent directory containing several independent projects. Always pass an explicit root pointing at the single workspace you are working in, so structure doesn't descend into sibling trees.

Example queries:

exports src/index.ts
exporters_of buildKnowledgeGraph
imports_of src/query.ts
dependents src/knowledgeGraph.ts
unused_imports app.py
structure

Project structure

src/
  index.ts         Plugin entry — registers the read_graph tool
  knowledgeGraph.ts  Graph builder (filesystem walk, import/export parsing, serialization)
  query.ts         Query engine (runGraphQuery)

Building

npm run build   # tsc -p tsconfig.json

Output is emitted to dist/ (dist/index.js is the package entry point).

License

MIT

使用前核对

安装步骤、兼容版本与授权范围以原项目当前文档为准。Stars 和评分是快照中的导航信号。

安装与排错 · 项目问题反馈

同类项目