dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
⚡ Unified code graph & knowledge base for DeepSeek Harness — AST symbols, refactor blast radius, clone detection and spec-to-code traceability on embedded FalkorDB.
The most powerful codebase navigation, refactoring, and knowledge intelligence plugin for DeepSeek Harness agents.
Combines the best of Tree-sitter WebAssembly AST symbol graphs and Markdown knowledge bases into an embedded FalkorDB Cypher graph database with a tgrep-style client-server daemon and incremental file watcher.
Traditional AI agent search tools rely on naive lexical search (grep) or flat SQLite FTS tables that lack semantic graph awareness. When working with large codebases (>100k LOC, monorepos, multi-package architectures), agents often:
DSH-KnowCode solves this by unifying:
(:DocSection)-[:DOCUMENTS]->(:Symbol) and (:Rule)-[:GOVERNS]->(:File)).tgrep-style Architecture: One-shot indexer (knowcode index .) and a persistent daemon (knowcode serve) with a debounced incremental file watcher.| Feature | dsh-tool-codegraph | dsh-knowledge-base | dsh-knowcode |
|---|---|---|---|
| Database | External C binary | SQLite FTS5 | Embedded FalkorDB (Cypher Graph) |
| Code AST Graph | ✅ Yes | ❌ No | ✅ Yes (Multi-language Tree-sitter WASM) |
| Knowledge / Docs | ❌ No | ✅ Documents | ✅ Unified (ADRs + Docs + Rules) |
| Cross-Linking | ❌ No | ❌ No | ✅ Docs link to Code Symbols |
| Refactoring Blast Radius | Basic depth | ❌ None | ✅ Transitive risk scoring + test mapping |
| Circular Dependency Check | ❌ No | ❌ No | ✅ Graph cycle detection (DAG audit) |
| Language Porting Contract | ❌ No | ❌ No | ✅ API contract & dependency blueprint |
| Client-Server Architecture | CLI subprocess per call | Headless / In-process | ✅ Microsoft tgrep-style daemon + watcher |
| Incremental Re-indexing | Stale sync required | Upsert on import | ✅ Live debounced file watcher + SHA hashes |
The code graph is built on a real Tree-sitter WebAssembly (WASM) parser, not regex heuristics. There is no fixed language whitelist: the engine ships prebuilt grammars for the most common languages, loads the rest on demand, and accepts any custom Tree-sitter grammar you provide.
Why it matters:
| Dimension | Regex / heuristic parsers | DSH-KnowCode (Tree-sitter WASM) |
|---|---|---|
| Accuracy | Breaks on nesting, generics, macros, multiline signatures | True AST — exact nodes, scopes, and ranges |
| False positives | Symbols "found" inside strings, comments, template literals | Impossible — strings/comments are leaves, never declarations |
| Language coverage | Hardcoded per-language regex | Any grammar — 30+ bundled, unlimited via .wasm drop-in |
| Native toolchain | Often needs node-gyp, Python, a C++ compiler | None — WASM runs identically on macOS, Linux, Windows |
| Onboarding a new language | New regex parser + new tests | Drop in one .wasm file |
| Area | Languages | Extensions |
|---|---|---|
| Web & Enterprise | TypeScript, TSX, JavaScript, JSX | .ts .tsx .mts .cts .js .jsx .mjs .cjs |
| Systems & Backend | Go, Rust, C, C++, Java, C# | .go .rs .c .h .cpp .hpp .cc .cxx .java .cs |
| Scripting & Dynamic | Python, Ruby, PHP, Lua, Bash / Shell | .py .rb .php .lua .sh .bash .zsh |
| Modern & Functional | Kotlin, Scala, Swift, Zig, Elixir, OCaml, ReScript | .kt .scala .swift .zig .ex .exs .ml .res |
| Smart Contracts | Solidity | .sol |
| Anything else | Every other Tree-sitter grammar | any extension you register |
Each language yields the same graph shape — classes, interfaces, structs, traits, enums, modules, functions, methods, qualified names (Namespace.Class.method), inherited signatures, complete startLine/endLine bodies, import edges, and call edges.
Nothing to compile. Drop a .wasm grammar into any of these locations, and it is picked up automatically:
| Source | Path | Notes |
|---|---|---|
| Project-local | <workspace>/.knowcode/grammars/tree-sitter-<lang>.wasm | Travels with the repo — best for teams |
| User-global | ~/.knowcode/grammars/tree-sitter-<lang>.wasm | Available to every workspace on the machine |
| Environment | KNOWCODE_GRAMMARS_DIR=/path/to/grammars | Point at a shared grammars cache |
You can also register one programmatically:
import { TreeSitterEngine } from 'dsh-knowcode/lib/parser/tree-sitter.js';
// Load a grammar by file path or Buffer, and claim extensions for it
await TreeSitterEngine.registerGrammar('haskell', '/grammars/tree-sitter-haskell.wasm', ['.hs', '.lhs']);
TreeSitterEngine.registerExtension('.hbs', 'handlebars');
// Force-load ahead of time (optional — parsing also loads on demand)
await TreeSitterEngine.ensureLanguage('haskell');
A grammar that fails to load (version mismatch, corrupt file) is reported as a warning and skipped — it never aborts an indexing run. Files for that language fall back to the built-in generic declaration scan instead of the AST walker.
| Requirement | Notes |
|---|---|
Node.js ^22.19.0 || >=24.0.0 | Same range the DeepSeek Harness requires. |
| pnpm | Only for the development workflow (pnpm run build, pnpm run test). |
| Git LFS | Only when installing from a clone — the repository stores the embedded FalkorDB binaries through LFS. Packages installed from npm already contain the real binaries and need nothing extra. See Platform Support & Execution Guide below. |
knowcode command come from?There is no separate binary to download. knowcode is the CLI entry point shipped inside this package and declared in its package.json:
"bin": { "knowcode": "./bin/knowcode.js" }
Whenever the package is installed or linked, npm/pnpm expose that file as a knowcode symlink inside node_modules/.bin/. The file itself is a plain Node.js script (#!/usr/bin/env node), so it runs anywhere the runtime dependencies are installed.
Pick whichever option below fits your situation.
git clone git@github.com:huuthuan-nguyen/dsh-knowcode.git
cd dsh-knowcode
pnpm install # runtime deps: commander, falkordb, chokidar, fast-glob, ignore, web-tree-sitter, tree-sitter-wasms
./bin/knowcode.js index .
node bin/knowcode.js index . behaves identically if you prefer to be explicit. The compiled lib/ directory is committed, so no build is required.
After editing anything under
src/, rebuild before using the CLI —bin/knowcode.jsand the whole CLI import from../lib/:pnpm run build
npm link for a global knowcode commandBest for local development, so knowcode works from any directory:
cd dsh-knowcode
pnpm install && pnpm run build
npm link
knowcode index .
npm link reads the bin field and symlinks knowcode into the global bin directory (shown by npm prefix -g). To undo it:
npm unlink -g dsh-knowcode
Installs the published package into ~/.dsh/profiles/<profile>/node_modules/ and registers it with the harness in one step:
dsh plugin add --profile web dsh-knowcode
The CLI becomes available inside that profile as well:
~/.dsh/profiles/web/node_modules/.bin/knowcode index .
Working on the plugin itself? Point the profile at your checkout instead, so the harness loads your build:
dsh plugin add --profile web link:/absolute/path/to/dsh-knowcode
Prefer configuring the profile by hand? Use the bundle patch shown under DeepSeek Harness Plugin Setup below, then restart the harness.
Published on the public registry as dsh-knowcode, so no clone is needed:
# Try it without installing anything
npx dsh-knowcode index .
npx dsh-knowcode serve .
# …or install the CLI globally
npm install -g dsh-knowcode
knowcode index .
# …or add it to a project
pnpm add dsh-knowcode
pnpm exec knowcode index .
The package bundles the embedded FalkorDB engine for macOS (Apple Silicon) and Linux x64 — ~35 MB compressed, 92.8 MB installed. On a platform without bundled binaries, point
FALKORDB_URLat an external instance; see Platform Support & Execution Guide below.
knowcode --version # prints the package version
knowcode --help # lists: index, serve, status, query, stop
Then build a graph for your repository and start the daemon:
knowcode index . # one-shot index of code + docs
knowcode serve . # background daemon + live file watcher
knowcode serve . --trace # …with tgrep-style [trace] diagnostics
knowcode status . # health, file counts and daemon state
See the CLI Usage section below for the full command reference, and Platform Support & Execution Guide for per-operating-system notes (including Windows/WSL2 and Linux ARM64).
Every tool is engineered for LLM Function Calling and Semantic Intent Matching on large codebases:
code_get_architecture_overview (alias: code_explore)
code_get_symbol_definition_and_signature (alias: code_symbol_definition)
code_analyze_refactor_blast_radius (alias: code_blast_radius)
code_find_function_callers (alias: code_callers, code_function_callers)
code_find_function_callees (alias: code_callees, code_function_callees)
code_detect_circular_dependencies (alias: code_detect_cycles)
code_find_affected_test_files (alias: code_affected_tests)
code_find_similar_duplicate_functions (alias: code_find_duplicates, code_code_clones)
code_extract_symbol_porting_contract (alias: code_porting_contract)
code_generate_cross_paradigm_porting_blueprint (alias: code_oop_to_rust, code_port_to_rust)
throws Exception) into idiomatic algebraic Result<T, ErrorEnum> types, and provides explicit borrow checker ownership guidelines (avoiding circular Rc/RefCell pitfalls).code_extract_third_party_usage_slice (alias: code_library_slice, code_slim_polyfill)
spec_find_code_flow_for_feature (alias: spec_to_code_flow, feature_code_flow, code_feature_flow)
*.md documentation, PRD, or architecture specs. Traverses execution flow from entry points to leaf services and generates an ASCII / Mermaid execution diagram.*.md has been fully implemented in code, or locating the entire execution path of a user story.code_find_spec_features_for_symbol (alias: code_to_spec_features, symbol_feature_specs, feature_for_symbol)
*.md, PRD sections, and architectural rules that a specific function, method, or class belongs to or serves. Traces both direct documentation links and upstream caller execution paths.knowledge_search_documentation_and_rules (alias: knowledge_search)
knowledge_get_document_content_and_rules (alias: knowledge_doc)
schema_map_contract_to_storage (alias: schema_map_contract, contract_to_db, map_contract_to_storage)
schema_analyze_storage_migration_impact (alias: schema_migration_impact, db_migration_blast_radius)
code_find_call_path_between_symbols (alias: code_call_path, code_trace_call_path)
chargePayment or deleteUser) and observing all intermediate transit points.code_find_implementations_and_subtypes (alias: code_subtypes, code_implementations)
code_search_symbols_by_pattern (alias: code_search_symbols)
code_find_unused_dead_symbols (alias: code_dead_code, code_unused_symbols)
code_analyze_git_diff_semantic_impact (alias: code_git_diff_impact, code_audit_git_diff)
knowcode_check_index_health_and_stats (alias: knowcode_status)
knowcode_trigger_incremental_reindex (alias: knowcode_sync)
knowcode_execute_custom_cypher_query (alias: knowcode_cypher)
tgrep-style)dsh-knowcode ships with the knowcode executable CLI for terminal usage and CI/CD pipelines.
Not sure you have the
knowcodecommand yet? It is not a separate download — see Installation & Quickstart above for the four ways to obtain it. Quick check:knowcode --version.Throughout this section,
knowcode …can always be replaced by./bin/knowcode.js …when running from a clone.
serve indexes the workspace by itself — index is optional. There is no need to index before serving.
On startup, and before it announces readiness, serve reconciles the graph with the filesystem: