@sdsrs/code-graph 0.5.13 → 0.5.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: code-explorer
|
|
3
3
|
description: Deep code understanding expert using AST knowledge graph. Use when exploring unfamiliar code, tracing complex relationships, or understanding module architecture.
|
|
4
|
-
tools: ["Read", "Grep", "Glob", "Bash", "mcp__code-graph__semantic_code_search", "mcp__code-graph__get_call_graph", "mcp__code-graph__get_ast_node", "mcp__code-
|
|
4
|
+
tools: ["Read", "Grep", "Glob", "Bash", "mcp__code-graph__semantic_code_search", "mcp__code-graph__get_call_graph", "mcp__code-graph__get_ast_node", "mcp__code-graph__trace_http_chain"]
|
|
5
5
|
model: sonnet
|
|
6
6
|
---
|
|
7
7
|
|
|
@@ -11,10 +11,9 @@ You are a code exploration specialist with access to an AST knowledge graph.
|
|
|
11
11
|
|
|
12
12
|
1. **Start with semantic_code_search** to locate relevant code by meaning
|
|
13
13
|
2. **Use get_call_graph** to understand function relationships and call chains
|
|
14
|
-
3. **Use get_ast_node** to get symbol metadata
|
|
15
|
-
4. **Use
|
|
16
|
-
5. **
|
|
17
|
-
6. **Fall back to Grep/Read** only when code-graph tools lack coverage (e.g., config files, non-code assets)
|
|
14
|
+
3. **Use get_ast_node** to get symbol metadata, code, and callers/callees (use `context_lines` for surrounding source)
|
|
15
|
+
4. **Use trace_http_chain** for HTTP request flow analysis
|
|
16
|
+
5. **Fall back to Grep/Read** only when code-graph tools lack coverage (e.g., config files, non-code assets)
|
|
18
17
|
|
|
19
18
|
## Rules
|
|
20
19
|
|
|
@@ -10,6 +10,6 @@ Trace the complete execution path of an HTTP request.
|
|
|
10
10
|
## Steps
|
|
11
11
|
|
|
12
12
|
1. Call `trace_http_chain(route, depth=5)` to get the full chain
|
|
13
|
-
2. For each key node in the chain, call `
|
|
13
|
+
2. For each key node in the chain, call `get_ast_node` (by node_id, with `context_lines`) to show the implementation
|
|
14
14
|
3. Map the flow: route → middleware → validation → business logic → data access → response
|
|
15
15
|
4. Highlight any error handling, authentication checks, or database operations
|
|
@@ -9,9 +9,9 @@ Understand what a module does, its public API, and how it connects to the rest o
|
|
|
9
9
|
|
|
10
10
|
## Steps
|
|
11
11
|
|
|
12
|
-
1. Call `
|
|
13
|
-
2. Call `
|
|
14
|
-
3. For
|
|
12
|
+
1. Call `module_overview(path)` to get exports, hot paths, and file structure in one call
|
|
13
|
+
2. Call `dependency_graph(file_path)` for the main file to map imports and dependents
|
|
14
|
+
3. For key functions that need deeper understanding, call `get_call_graph` to trace call chains
|
|
15
15
|
4. Summarize:
|
|
16
16
|
- **Purpose**: what this module does
|
|
17
17
|
- **Public API**: exported functions/classes with signatures
|
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
3
|
const { execFileSync } = require('child_process');
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
const path = require('path');
|
|
4
6
|
const { findBinary } = require('./find-binary');
|
|
5
7
|
|
|
8
|
+
// Only show status in projects that have a code-graph index.
|
|
9
|
+
// The statusLine config is global, so we must exit silently for
|
|
10
|
+
// directories that aren't code-graph projects.
|
|
11
|
+
const cwd = process.cwd();
|
|
12
|
+
if (!fs.existsSync(path.join(cwd, '.code-graph', 'index.db'))) {
|
|
13
|
+
process.exit(0);
|
|
14
|
+
}
|
|
15
|
+
|
|
6
16
|
const bin = findBinary();
|
|
7
17
|
if (!bin) {
|
|
8
18
|
process.stdout.write('code-graph: offline');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sdsrs/code-graph",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.15",
|
|
4
4
|
"description": "MCP server that indexes codebases into an AST knowledge graph with semantic search, call graph traversal, and HTTP route tracing",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"node": ">=16"
|
|
34
34
|
},
|
|
35
35
|
"optionalDependencies": {
|
|
36
|
-
"@sdsrs/code-graph-linux-x64": "0.5.
|
|
37
|
-
"@sdsrs/code-graph-linux-arm64": "0.5.
|
|
38
|
-
"@sdsrs/code-graph-darwin-x64": "0.5.
|
|
39
|
-
"@sdsrs/code-graph-darwin-arm64": "0.5.
|
|
40
|
-
"@sdsrs/code-graph-win32-x64": "0.5.
|
|
36
|
+
"@sdsrs/code-graph-linux-x64": "0.5.15",
|
|
37
|
+
"@sdsrs/code-graph-linux-arm64": "0.5.15",
|
|
38
|
+
"@sdsrs/code-graph-darwin-x64": "0.5.15",
|
|
39
|
+
"@sdsrs/code-graph-darwin-arm64": "0.5.15",
|
|
40
|
+
"@sdsrs/code-graph-win32-x64": "0.5.15"
|
|
41
41
|
}
|
|
42
42
|
}
|