Introduction¶
DSH (DeepSeek Harness) adopts an “everything is a plugin” architecture. As the plugin ecosystem grows, managing dependencies between plugins and resolving conflicts becomes a key maintenance challenge. Without executing plugin code, it is difficult to intuitively determine whether a plugin has missing dependencies, circular references, or conflicts with other plugins. dsh-plugin-graph aims to address this pain point. As an ecosystem-level infrastructure plugin, it provides dependency graph construction and conflict detection capabilities.
Core Capabilities¶
This plugin performs static analysis of plugin source code and package.json without executing plugin code, ensuring a safe and general-purpose analysis process.
Conflict Detection¶
The system supports four types of conflict detection, covering tools, services, pipeline interception, and event listening:
* Tool conflicts
* Service conflicts
* Pipeline interception overlaps
* Event listener overlaps
Dependency Graph and Compatibility¶
- Dependency graph: Automatically detects missing dependencies and circular dependencies (using the DFS three-color marking algorithm).
- Version compatibility: Checks the DSH version requirements declared by plugins against the current runtime version (supports simplified semver:
*/x.y.z/^/~/>=). - Installation preflight: Simulates the incremental risk of installing a new plugin and automatically blocks it when conflicts are detected.
Runtime and Deployment¶
- Runtime: All business logic consists of pure functions; the runtime (
index.js) provides only a thin wrapper. - CLI / CI ready: Supports
--jsonoutput; exit codes 0/1 can be integrated directly into CI gates.
Installation and Activation¶
Install it using the following commands:
# 作为 DSH 插件安装
dsh plugin add dsh-plugin-graph
# 或作为 CLI 全局安装
npm install -g dsh-plugin-graph
Typical Usage¶
After installation, you can use the following commands in the command line:
# 扫描插件目录,构建依赖图并检测冲突
dsh-plugin-graph scan <dir> [--]
# 冲突检查(无 error 级冲突即健康)
dsh-plugin-graph check <dir> [--]
# 安装预检:模拟安装新插件后的增量风险
dsh-plugin-graph preflight <existingDir> <incomingDir> [--]
# DSH 版本兼容性检查
dsh-plugin-graph compat <dir> <dshVersion> [--]
Use Cases and Notes¶
This tool is suitable for the DSH plugin development and maintenance stages. Because plugins run with the privileges of the current DSH process, it is recommended to inspect the source code and license before installation. The project is released under the MIT license, and Node.js version >= 18 is required.
Conclusion¶
dsh-plugin-graph provides a complete workflow from dependency resolution to conflict interception, helping developers avoid risks before installing plugins.