@magic5644/graph-it-live 1.0.0
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.
- package/LICENSE +21 -0
- package/README.md +712 -0
- package/bin/graph-it +2 -0
- package/dist/astWorker.js +42176 -0
- package/dist/graph-it.js +42584 -0
- package/dist/indexerWorker.js +42178 -0
- package/dist/mcpServer.mjs +435 -0
- package/dist/mcpWorker.js +42313 -0
- package/dist/queries/python.scm +65 -0
- package/dist/queries/rust.scm +82 -0
- package/dist/queries/typescript.scm +104 -0
- package/dist/wasm/sqljs.wasm +0 -0
- package/dist/wasm/tree-sitter-python.wasm +0 -0
- package/dist/wasm/tree-sitter-rust.wasm +0 -0
- package/dist/wasm/tree-sitter-typescript.wasm +0 -0
- package/dist/wasm/tree-sitter.wasm +0 -0
- package/package.json +1150 -0
package/README.md
ADDED
|
@@ -0,0 +1,712 @@
|
|
|
1
|
+
# Graph-It-Live
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
4
|
+
<img src="media/Graph-It-Live-Logo-256.png" alt="Graph-It-Live Logo" width="400"/>
|
|
5
|
+
|
|
6
|
+
**The AI-first dependency intelligence platform for VS Code.**
|
|
7
|
+
|
|
8
|
+
See your codebase the way your AI does β as a graph.
|
|
9
|
+
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
[](https://marketplace.visualstudio.com/items?itemName=magic5644.graph-it-live)
|
|
13
|
+
[](https://open-vsx.org/extension/magic5644/graph-it-live)
|
|
14
|
+
[](https://modelcontextprotocol.io)
|
|
15
|
+
[](https://github.com/magic5644/Graph-It-Live/blob/main/LICENSE)
|
|
16
|
+
[](https://github.com/magic5644/Graph-It-Live)
|
|
17
|
+
[](https://marketplace.visualstudio.com/items?itemName=magic5644.graph-it-live)
|
|
18
|
+
[](https://open-vsx.org/extension/magic5644/graph-it-live)
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
Graph-It-Live turns your codebase into a live, interactive dependency graph β one that both **you** and your **AI assistant** can query in real time.
|
|
23
|
+
|
|
24
|
+
Built for **architects** who need the big picture and **developers** who need to ship safely, it combines three analysis layers in one tool:
|
|
25
|
+
|
|
26
|
+
| Layer | What you see | Powered by |
|
|
27
|
+
|-------|-------------|------------|
|
|
28
|
+
| **File Graph** | File-to-file import relationships | Regex + AST parsing |
|
|
29
|
+
| **Symbol View** | Function/class call hierarchy inside a file | AST (ts-morph) |
|
|
30
|
+
| **Live Call Graph** | Cross-file symbol call relationships | Tree-sitter + SQLite |
|
|
31
|
+
|
|
32
|
+
All three layers are also exposed to AI via a **20-tool MCP server**, so your assistant can answer architecture questions with zero hallucination.
|
|
33
|
+
|
|
34
|
+
<div align="center">
|
|
35
|
+
<img src="media/demo-plugin-graph-it-live.gif" alt="Graph-It-Live Demo" width="800"/>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Why Graph-It-Live?
|
|
41
|
+
|
|
42
|
+
| Pain point | Without Graph-It-Live | With Graph-It-Live |
|
|
43
|
+
|---|---|---|
|
|
44
|
+
| "What breaks if I touch this file?" | Grep + hope | One-click reverse dependency lookup |
|
|
45
|
+
| "Explain this module's architecture" | Read 30 files | AI generates a codemap in seconds |
|
|
46
|
+
| "Are there circular deps?" | Manual tracing | Auto-detected, red-highlighted cycles |
|
|
47
|
+
| "What calls this function across the project?" | Global search + noise | Live Call Graph with depth control |
|
|
48
|
+
| "Onboard a new developer" | Hours of walkthroughs | Interactive graph + AI-generated overviews |
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Table of Contents
|
|
53
|
+
|
|
54
|
+
- [For AI β MCP Server](#-supercharge-your-ai-assistant)
|
|
55
|
+
- [Codemap Generation](#-codemap-generation-new)
|
|
56
|
+
- [All 21 MCP Tools](#available-tools)
|
|
57
|
+
- [TOON Format (Token Savings)](#toon-format-token-optimized-output)
|
|
58
|
+
- [For Humans β Visual Features](#-features-for-humans)
|
|
59
|
+
- [File Dependency Graph](#file-dependency-graph)
|
|
60
|
+
- [Symbol-Level Drill-Down](#symbol-level-drill-down)
|
|
61
|
+
- [Live Call Graph](#-live-call-graph-new)
|
|
62
|
+
- [Unused Dependency Filter](#unused-dependency-filter)
|
|
63
|
+
- [Installation & Usage](#installation)
|
|
64
|
+
- [Configuration](#configuration)
|
|
65
|
+
- [Development](#development)
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## π€ Supercharge Your AI Assistant
|
|
70
|
+
|
|
71
|
+
Stop pasting file paths and explaining your project structure. Graph-It-Live exposes **21 powerful dependency analysis tools** directly to your AI assistant via the [Model Context Protocol (MCP)](https://modelcontextprotocol.io), and **20 native LM Tools** directly in Copilot Agent mode (no MCP setup required).
|
|
72
|
+
|
|
73
|
+
**Works with:** GitHub Copilot, Claude (Desktop & Code), Cursor, Windsurf, Antigravity, and any MCP-compatible client.
|
|
74
|
+
|
|
75
|
+
### What your AI can do with Graph-It-Live
|
|
76
|
+
|
|
77
|
+
| You ask | AI uses | Result |
|
|
78
|
+
|---------|---------|--------|
|
|
79
|
+
| *"Map out the architecture of the auth module"* | `crawl_dependency_graph` | Full dependency tree as structured data |
|
|
80
|
+
| *"What breaks if I change User.ts?"* | `find_referencing_files` | All dependent files with O(1) lookup |
|
|
81
|
+
| *"Give me an overview of Spider.ts"* | `generate_codemap` | Exports, internals, deps, dependents, call flow β in one call |
|
|
82
|
+
| *"What calls formatDate() across the project?"* | `get_symbol_callers` | All callers with instant lookup |
|
|
83
|
+
| *"Show function-level flow in this file"* | `analyze_file_logic` | Intra-file call hierarchy |
|
|
84
|
+
| *"Analyze the impact of changing calculateTotal's signature"* | `get_impact_analysis` | Breaking change detection + all affected callers |
|
|
85
|
+
| *"Find unused exports in the codebase"* | `find_unused_symbols` | Dead code detection |
|
|
86
|
+
| *"Are there circular dependencies?"* | `crawl_dependency_graph` | Cycle detection built in |
|
|
87
|
+
|
|
88
|
+
<div align="center">
|
|
89
|
+
<img src="media/graph-it-live-tools-in-copilot.gif" alt="Using Graph-It-Live tools with GitHub Copilot" width="800"/>
|
|
90
|
+
<p><em>GitHub Copilot querying Graph-It-Live to analyze a project's dependency structure</em></p>
|
|
91
|
+
</div>
|
|
92
|
+
|
|
93
|
+
### πΊοΈ Codemap Generation *(New)*
|
|
94
|
+
|
|
95
|
+
The `graphitlive_generate_codemap` tool gives your AI a **complete structural overview of any file** in a single call β no more chaining 5 different tools.
|
|
96
|
+
|
|
97
|
+
**What it returns:**
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
βββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
101
|
+
β Spider.ts (247 lines, TypeScript) β
|
|
102
|
+
βββββββββββββββββββββββββββββββββββββββββββββββββββ€
|
|
103
|
+
β EXPORTS: Spider, SpiderOptions β
|
|
104
|
+
β INTERNALS: crawlFile, resolveImport, visitNode β
|
|
105
|
+
β DEPENDENCIES: Parser.ts, PathResolver.ts, ... β
|
|
106
|
+
β DEPENDENTS: SpiderBuilder.ts, extension.ts β
|
|
107
|
+
β CALL FLOW: crawl β crawlFile β resolveImport β
|
|
108
|
+
β CYCLES: none β
|
|
109
|
+
βββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
**Use cases:**
|
|
113
|
+
|
|
114
|
+
- **Onboarding:** *"Give me an overview of every file in src/analyzer/"* β AI maps the full module
|
|
115
|
+
- **Pre-refactor audit:** *"Generate codemaps for all files that import UserService"* β understand coupling before changing
|
|
116
|
+
- **Documentation:** *"Create architecture docs from codemaps"* β structured data β Markdown in seconds
|
|
117
|
+
- **Code review:** *"What does this new file export and who depends on it?"* β instant context
|
|
118
|
+
|
|
119
|
+
> **Token-efficient:** Output uses a compact format optimised for LLM consumption. Combine with `format: "toon"` for up to 60% token savings.
|
|
120
|
+
|
|
121
|
+
<!-- TODO: Add screenshot or video of AI generating a codemap -->
|
|
122
|
+
|
|
123
|
+
### π File Logic Analysis *(New)*
|
|
124
|
+
|
|
125
|
+
The `graphitlive_analyze_file_logic` tool reveals the **call hierarchy inside a single file** β which functions call which, in what order.
|
|
126
|
+
|
|
127
|
+
**Example prompt:** *"Show me how data flows through src/mcp/mcpServer.ts"*
|
|
128
|
+
|
|
129
|
+
**AI response (powered by the tool):**
|
|
130
|
+
```
|
|
131
|
+
Entry points: initializeServer(), main()
|
|
132
|
+
βββ initializeServer()
|
|
133
|
+
βββ registerAllTools() [call #1]
|
|
134
|
+
βββ setupFileWatcher() [call #2]
|
|
135
|
+
βββ startListening() [call #3]
|
|
136
|
+
βββ handleToolCall()
|
|
137
|
+
βββ validateWorkspace()
|
|
138
|
+
βββ invokeWorker()
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
**Use cases:**
|
|
142
|
+
|
|
143
|
+
- **Understand complex files** without reading every line
|
|
144
|
+
- **Find entry points** and trace execution paths
|
|
145
|
+
- **Detect internal cycles** (recursive calls between functions)
|
|
146
|
+
- **Refactoring confidence** β see what internal logic is affected
|
|
147
|
+
|
|
148
|
+
<!-- TODO: Add screenshot of AI analyzing file logic -->
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## ποΈ Features for Humans
|
|
153
|
+
|
|
154
|
+
### File Dependency Graph
|
|
155
|
+
|
|
156
|
+
The core of Graph-It-Live: a **real-time interactive graph** showing file-to-file import relationships across your project.
|
|
157
|
+
|
|
158
|
+
- **Multi-language:** TypeScript, JavaScript, Python, Rust, Vue, Svelte, GraphQL
|
|
159
|
+
- **Cycle detection:** Circular dependencies highlighted with red dashed lines and badges
|
|
160
|
+
- **Smart navigation:** Click any node to open the file; expand/collapse dependencies dynamically
|
|
161
|
+
- **Reverse lookup:** Right-click β "Find Referencing Files" for instant reverse dependency discovery
|
|
162
|
+
- **Background indexing:** Workspace indexed in a background thread for O(1) queries
|
|
163
|
+
|
|
164
|
+
<div align="center">
|
|
165
|
+
<img src="media/demo-plugin-graph-it-live.gif" alt="File dependency graph" width="800"/>
|
|
166
|
+
<p><em>Interactive file dependency graph with expand/collapse and cycle detection</em></p>
|
|
167
|
+
</div>
|
|
168
|
+
|
|
169
|
+
### Symbol-Level Drill-Down
|
|
170
|
+
|
|
171
|
+
Go beyond file dependencies β **drill into any file to visualize function-to-function and class-to-class call relationships** powered by AST analysis (ts-morph for TypeScript/JavaScript, tree-sitter for Python/Rust).
|
|
172
|
+
|
|
173
|
+
**How it works:**
|
|
174
|
+
|
|
175
|
+
1. **From the File Graph:** Double-click any file node (or right-click β "Drill Down")
|
|
176
|
+
2. **Instant symbol graph:** See an interactive tree showing:
|
|
177
|
+
- **Functions** in vibrant blue
|
|
178
|
+
- **Classes** in deep purple
|
|
179
|
+
- **Variables/Constants** in amber
|
|
180
|
+
- **β calls** β outgoing calls from each symbol
|
|
181
|
+
- **β called by** β incoming callers (including from other files)
|
|
182
|
+
- **Recursive calls** with cycle badges
|
|
183
|
+
3. **Click-to-navigate:** Click any symbol to jump to its definition
|
|
184
|
+
4. **Breadcrumb nav:** `Project > folder > file.ts` β one click to return to file view
|
|
185
|
+
|
|
186
|
+
**Multi-language support:**
|
|
187
|
+
- TypeScript / JavaScript (ts-morph AST)
|
|
188
|
+
- Python (tree-sitter WASM)
|
|
189
|
+
- Rust (tree-sitter WASM)
|
|
190
|
+
|
|
191
|
+
**Benefits:**
|
|
192
|
+
- **Understand code flow** without reading every line
|
|
193
|
+
- **See who calls your exports** β incoming dependencies from other files
|
|
194
|
+
- **Detect recursive calls** β cycle detection with visual indicators
|
|
195
|
+
- **Refactoring confidence** β visualize all internal dependencies
|
|
196
|
+
|
|
197
|
+
<div align="center">
|
|
198
|
+
<img src="media/drill-down-symbol-view.png" alt="Symbol-level drill-down view" width="600"/>
|
|
199
|
+
<p><em>Symbol drill-down: purple classes, blue functions, amber variables with call relationships</em></p>
|
|
200
|
+
</div>
|
|
201
|
+
|
|
202
|
+
### π· Live Call Graph *(New)*
|
|
203
|
+
|
|
204
|
+
The **Live Call Graph** visualises **cross-file symbol call relationships** across your entire project in a Cytoscape.js panel backed by an in-memory SQLite database.
|
|
205
|
+
|
|
206
|
+
Unlike the Symbol View (which shows relationships *within* a single file via AST), the Call Graph shows how symbols call each other *across files* using Tree-sitter AST extraction.
|
|
207
|
+
|
|
208
|
+
**Key capabilities:**
|
|
209
|
+
|
|
210
|
+
| Feature | Description |
|
|
211
|
+
|---------|-------------|
|
|
212
|
+
| **Cross-file analysis** | See function calls that span multiple files |
|
|
213
|
+
| **Neighbourhood queries** | BFS expansion from any symbol, configurable depth (1β5) |
|
|
214
|
+
| **Cycle detection** | Mutual-recursion and self-recursion highlighted in red |
|
|
215
|
+
| **Compound node layout** | Symbols grouped by folder for visual clarity |
|
|
216
|
+
| **Call order numbering** | CALLS edges numbered to show invocation order |
|
|
217
|
+
| **Theme-aware** | Adapts to dark, light, and high-contrast VS Code themes |
|
|
218
|
+
| **Live refresh** | On file save, the graph updates automatically (500ms debounce) |
|
|
219
|
+
| **Filter legend** | Toggle visibility by symbol type (function, class, variable) and by folder |
|
|
220
|
+
|
|
221
|
+
**How to use:**
|
|
222
|
+
|
|
223
|
+
1. Open a source file and place the cursor on a symbol (function, class, methodβ¦). Then open the command palette β `Graph-It-Live: Show Call Graph` or click the "Call Graph" button in the sidebar toolbar
|
|
224
|
+
2. The extension indexes your workspace (Tree-sitter AST extraction)
|
|
225
|
+
3. Click any symbol to re-center the neighbourhood
|
|
226
|
+
4. **Drag any node** (symbol or entire file/folder group) to rearrange the layout freely
|
|
227
|
+
5. Use the depth slider to expand or narrow the view
|
|
228
|
+
6. Filter by symbol type or folder using the legend overlay
|
|
229
|
+
|
|
230
|
+
<div align="center">
|
|
231
|
+
<img src="media/call-graph-view-example.png" alt="Live call graph with cycle detection" width="800"/>
|
|
232
|
+
<p><em>Live Call Graph β cross-file symbol relationships with cycle detection and folder grouping</em></p>
|
|
233
|
+
</div>
|
|
234
|
+
|
|
235
|
+
<!-- TODO: Add a short video/gif showing the call graph in action (indexing β symbol click β depth change β live refresh on save) -->
|
|
236
|
+
|
|
237
|
+
### Unused Dependency Filter
|
|
238
|
+
|
|
239
|
+
Smart filter to show only dependencies that are actually used in your code. Toggle between showing all imports or filtering unused ones with a single click.
|
|
240
|
+
|
|
241
|
+
- **Hide mode:** Unused dependencies completely removed from the graph
|
|
242
|
+
- **Dim mode:** Unused dependencies shown with reduced opacity and dashed lines
|
|
243
|
+
|
|
244
|
+
<div align="center">
|
|
245
|
+
<img src="media/demo-filter-hide-mode.gif" alt="Hide mode - removes unused dependencies" width="600"/>
|
|
246
|
+
<p><em>Hide mode: Unused dependencies completely removed</em></p>
|
|
247
|
+
</div>
|
|
248
|
+
|
|
249
|
+
<div align="center">
|
|
250
|
+
<img src="media/demo-filter-dim-mode.gif" alt="Dim mode - shows unused dependencies with reduced opacity" width="600"/>
|
|
251
|
+
<p><em>Dim mode: Unused dependencies shown with reduced opacity</em></p>
|
|
252
|
+
</div>
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
## Prerequisites
|
|
257
|
+
|
|
258
|
+
- **Node.js**: v20 or higher
|
|
259
|
+
- **VS Code**: v1.96.0 or higher
|
|
260
|
+
|
|
261
|
+
**No build tools required** β the extension uses WebAssembly (WASM) parsers. No Python, C++ compiler, or native compilation needed.
|
|
262
|
+
|
|
263
|
+
## Installation
|
|
264
|
+
|
|
265
|
+
### From Marketplace
|
|
266
|
+
|
|
267
|
+
Search for **"Graph-It-Live"** in the Extensions view (`Ctrl+Shift+X` / `Cmd+Shift+X`), or install from the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=magic5644.graph-it-live).
|
|
268
|
+
|
|
269
|
+
### From Open VSX Registry
|
|
270
|
+
|
|
271
|
+
Also available on the [Open VSX Registry](https://open-vsx.org/extension/magic5644/graph-it-live) for VSCodium and other compatible editors.
|
|
272
|
+
|
|
273
|
+
## Usage
|
|
274
|
+
|
|
275
|
+
1. **Open a Project** β TypeScript, JavaScript, Python, Rust, Vue, Svelte, or GraphQL
|
|
276
|
+
2. **Open the Graph** β Click the Graph-It-Live icon in the Activity Bar, or run `Graph-It-Live: Show Dependency Graph`
|
|
277
|
+
3. **Interact:**
|
|
278
|
+
- **Click** a node β open the file
|
|
279
|
+
- **Double-click** a node β drill down to symbol view
|
|
280
|
+
- **Right-click** a node β expand, collapse, find referencing files
|
|
281
|
+
- **Command palette** β `Show Call Graph` for cross-file symbol analysis
|
|
282
|
+
|
|
283
|
+
---
|
|
284
|
+
|
|
285
|
+
## Configuration
|
|
286
|
+
|
|
287
|
+
### Performance Profiles
|
|
288
|
+
|
|
289
|
+
Choose a performance profile based on your machine:
|
|
290
|
+
|
|
291
|
+
| Profile | RAM | Concurrency | Max Edges | Cache |
|
|
292
|
+
|---------|-----|-------------|-----------|-------|
|
|
293
|
+
| **`default`** *(recommended)* | 4-8 GB | 4 | 2000 | 500/200 |
|
|
294
|
+
| **`low-memory`** | < 4 GB | 2 | 1000 | 200/100 |
|
|
295
|
+
| **`high-performance`** | 16 GB+ | 12 | 5000 | 1500/800 |
|
|
296
|
+
| **`custom`** | Any | Manual | Manual | Manual |
|
|
297
|
+
|
|
298
|
+
Set via `graph-it-live.performanceProfile` in VS Code settings.
|
|
299
|
+
|
|
300
|
+
With **`custom`** profile, you can fine-tune:
|
|
301
|
+
- `unusedAnalysisConcurrency` (1-16)
|
|
302
|
+
- `unusedAnalysisMaxEdges` (0 = unlimited)
|
|
303
|
+
- `maxCacheSize` (50-2000)
|
|
304
|
+
- `maxSymbolCacheSize` (50-1000)
|
|
305
|
+
- `indexingConcurrency` (1-16)
|
|
306
|
+
|
|
307
|
+
### All Settings
|
|
308
|
+
|
|
309
|
+
<div align="center">
|
|
310
|
+
<img src="media/unused-dependency-mode-option.png" alt="Unused Dependency Mode configuration" width="700"/>
|
|
311
|
+
<p><em>Configure how unused dependencies are displayed: hide (remove completely) or dim (show with reduced opacity)</em></p>
|
|
312
|
+
</div>
|
|
313
|
+
|
|
314
|
+
| Setting | Default | Description |
|
|
315
|
+
| :----------------------------------------- | :-------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
316
|
+
| `graph-it-live.performanceProfile` | `default` | Performance preset: `default`, `low-memory`, `high-performance`, or `custom` for manual control. |
|
|
317
|
+
| `graph-it-live.enableMcpServer` | `false` | Enable the MCP server for AI/LLM integration. |
|
|
318
|
+
| `graph-it-live.enableMcpDebugLogging` | `false` | Privacy-sensitive debug logging for MCP (creates `~/mcp-debug.log`). Enable only for troubleshooting. |
|
|
319
|
+
| `graph-it-live.maxDepth` | `50` | Maximum dependency depth to analyze. |
|
|
320
|
+
| `graph-it-live.excludeNodeModules` | `true` | Exclude `node_modules` imports from the graph. |
|
|
321
|
+
| `graph-it-live.enableBackgroundIndexing` | `true` | Enable background indexing for O(1) reverse dependency lookups. |
|
|
322
|
+
| `graph-it-live.persistIndex` | `false` | Persist reverse index to disk for faster startup. |
|
|
323
|
+
| `graph-it-live.indexingConcurrency` | `4` | Parallel file processing during indexing (1-16). |
|
|
324
|
+
| `graph-it-live.indexingStartDelay` | `1000` | Delay (ms) before starting background indexing after activation. |
|
|
325
|
+
| `graph-it-live.logLevel` | `info` | Logging verbosity: `debug`, `info`, `warn`, `error`, or `none`. |
|
|
326
|
+
| `graph-it-live.unusedDependencyMode` | `hide` | How to display unused dependencies: `hide` or `dim`. |
|
|
327
|
+
| `graph-it-live.unusedAnalysisConcurrency` | `4` | Parallel file analysis for unused detection (1-16). |
|
|
328
|
+
| `graph-it-live.unusedAnalysisMaxEdges` | `2000` | Skip auto unused analysis above this edge count (0 = no limit). |
|
|
329
|
+
| `graph-it-live.persistUnusedAnalysisCache` | `false` | Cache unused analysis results to disk. |
|
|
330
|
+
| `graph-it-live.maxUnusedAnalysisCacheSize` | `200` | Max cached unused analysis results (LRU eviction). |
|
|
331
|
+
| `graph-it-live.maxCacheSize` | `500` | Max cached file dependency analyses. |
|
|
332
|
+
| `graph-it-live.maxSymbolCacheSize` | `200` | Max cached symbol analysis results. |
|
|
333
|
+
| `graph-it-live.preIndexCallGraph` | `true` | Pre-index the call graph database at startup for near-instant first query. |
|
|
334
|
+
| `graph-it-live.symbolViewLayout` | `hierarchical` | Layout for symbol drill-down: `hierarchical`, `force-directed`, or `radial`. |
|
|
335
|
+
|
|
336
|
+
---
|
|
337
|
+
|
|
338
|
+
## Standalone CLI
|
|
339
|
+
|
|
340
|
+
Graph-It-Live is also available as a standalone npm package β no VS Code required.
|
|
341
|
+
|
|
342
|
+
```bash
|
|
343
|
+
npm install -g @magic5644/graph-it-live
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
After install, `graph-it` is available on your PATH:
|
|
347
|
+
|
|
348
|
+
```bash
|
|
349
|
+
graph-it --version # Show installed version
|
|
350
|
+
graph-it --help # Full help with MCP config snippets
|
|
351
|
+
graph-it scan # Index/re-index the workspace
|
|
352
|
+
graph-it summary # Workspace overview
|
|
353
|
+
graph-it summary src/api.ts # Per-file codemap
|
|
354
|
+
graph-it trace src/index.ts#main # Trace execution flow
|
|
355
|
+
graph-it explain src/utils.ts # File logic analysis
|
|
356
|
+
graph-it path src/index.ts # Dependency graph from file
|
|
357
|
+
graph-it check src/api.ts # Unused exported symbols
|
|
358
|
+
graph-it serve # Launch MCP stdio server
|
|
359
|
+
graph-it tool --list # List all 20 MCP tools
|
|
360
|
+
graph-it tool analyze_dependencies --filePath=/abs/path/file.ts
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
**Without installing globally:**
|
|
364
|
+
|
|
365
|
+
```bash
|
|
366
|
+
npx @magic5644/graph-it-live scan
|
|
367
|
+
npx @magic5644/graph-it-live serve
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
---
|
|
371
|
+
|
|
372
|
+
## MCP Server (AI/LLM Integration)
|
|
373
|
+
|
|
374
|
+
Graph-It-Live includes an optional **MCP server** that exposes its full analysis engine to AI assistants and LLMs.
|
|
375
|
+
|
|
376
|
+
### Setup
|
|
377
|
+
|
|
378
|
+
1. Set `graph-it-live.enableMcpServer` to `true` in VS Code settings
|
|
379
|
+
2. The server starts automatically when the extension activates
|
|
380
|
+
3. Your AI assistant detects the tools via MCP auto-discovery
|
|
381
|
+
|
|
382
|
+
<div align="center">
|
|
383
|
+
<img src="media/enable-mcp-server-tools.gif" alt="Enable MCP Server in VS Code Settings" width="800"/>
|
|
384
|
+
</div>
|
|
385
|
+
|
|
386
|
+
### Available Tools
|
|
387
|
+
|
|
388
|
+
The MCP server exposes **21 tools** for AI/LLM consumption. All tools except `set_workspace` are also available as **native LM Tools** (`#graphResolve`, `#graphBreaking`, `#graphCallGraph`, etc.) directly in Copilot Agent mode β no MCP server required for those.
|
|
389
|
+
|
|
390
|
+
| Tool | Description |
|
|
391
|
+
| :--- | :---------- |
|
|
392
|
+
| `graphitlive_set_workspace` | Set the project directory to analyze |
|
|
393
|
+
| `graphitlive_analyze_dependencies` | Analyze a single file's direct imports and exports |
|
|
394
|
+
| `graphitlive_crawl_dependency_graph` | Crawl the full dependency tree from an entry file |
|
|
395
|
+
| `graphitlive_find_referencing_files` | Find all files that import a given file (reverse lookup) |
|
|
396
|
+
| `graphitlive_expand_node` | Expand a node to discover dependencies beyond known paths |
|
|
397
|
+
| `graphitlive_parse_imports` | Parse raw import statements without path resolution |
|
|
398
|
+
| `graphitlive_verify_dependency_usage` | Verify whether a specific dependency is actually used in a file |
|
|
399
|
+
| `graphitlive_resolve_module_path` | Resolve a module specifier to an absolute file path |
|
|
400
|
+
| `graphitlive_get_symbol_graph` | Get symbol-level dependencies (functions, classes) within a file |
|
|
401
|
+
| `graphitlive_find_unused_symbols` | Find potentially unused exported symbols (dead code detection) |
|
|
402
|
+
| `graphitlive_get_symbol_dependents` | Find all symbols that depend on a specific symbol |
|
|
403
|
+
| `graphitlive_trace_function_execution` | Trace the complete execution path through function calls |
|
|
404
|
+
| `graphitlive_get_symbol_callers` | Find all callers of a symbol with O(1) instant lookup |
|
|
405
|
+
| `graphitlive_analyze_breaking_changes` | Detect breaking changes when modifying function signatures |
|
|
406
|
+
| `graphitlive_get_impact_analysis` | Full impact analysis combining callers and breaking changes |
|
|
407
|
+
| `graphitlive_get_index_status` | Get the current state of the dependency index |
|
|
408
|
+
| `graphitlive_invalidate_files` | Invalidate specific files from the cache after modifications |
|
|
409
|
+
| `graphitlive_rebuild_index` | Rebuild the entire dependency index from scratch |
|
|
410
|
+
| `graphitlive_analyze_file_logic` | Analyze symbol-level call hierarchy and code flow within a file |
|
|
411
|
+
| `graphitlive_generate_codemap` | Generate a comprehensive structured overview of any source file |
|
|
412
|
+
| `graphitlive_query_call_graph` | Query cross-file callers/callees via BFS on the call graph SQLite database |
|
|
413
|
+
|
|
414
|
+
### TOON Format (Token-Optimized Output)
|
|
415
|
+
|
|
416
|
+
All tools support an optional `format` parameter to reduce token consumption:
|
|
417
|
+
|
|
418
|
+
```json
|
|
419
|
+
{
|
|
420
|
+
"tool": "graphitlive_crawl_dependency_graph",
|
|
421
|
+
"params": {
|
|
422
|
+
"entryFile": "/path/to/main.ts",
|
|
423
|
+
"format": "toon"
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
| Format | Description | Token Savings |
|
|
429
|
+
|--------|-------------|---------------|
|
|
430
|
+
| `json` *(default)* | Standard JSON output | β |
|
|
431
|
+
| `toon` | Compact Token-Oriented Object Notation | 30-60% |
|
|
432
|
+
| `markdown` | JSON wrapped in markdown code blocks | β |
|
|
433
|
+
|
|
434
|
+
See [TOON Format Documentation](./docs/TOON_FORMAT.md) for full specifications.
|
|
435
|
+
|
|
436
|
+
### Native LM Tools (Copilot Agent Mode)
|
|
437
|
+
|
|
438
|
+
All 20 analysis tools are also available **natively in GitHub Copilot** β no MCP server required. Reference them with `#` in Agent mode:
|
|
439
|
+
|
|
440
|
+
| Reference | Tool | Description |
|
|
441
|
+
|---|---|---|
|
|
442
|
+
| `#graphFindRefs` | `find_referencing_files` | All files that import a given file |
|
|
443
|
+
| `#graphDeps` | `analyze_dependencies` | Direct imports and exports of a file |
|
|
444
|
+
| `#graphCrawl` | `crawl_dependency_graph` | Full dependency tree from an entry file |
|
|
445
|
+
| `#graphSymbols` | `get_symbol_graph` | Symbol-level dependencies within a file |
|
|
446
|
+
| `#graphUnused` | `find_unused_symbols` | Dead code detection |
|
|
447
|
+
| `#graphCallers` | `get_symbol_callers` | All callers of a symbol |
|
|
448
|
+
| `#graphImpact` | `get_impact_analysis` | Full impact analysis |
|
|
449
|
+
| `#graphIndexStatus` | `get_index_status` | Current state of the dependency index |
|
|
450
|
+
| `#graphImports` | `parse_imports` | Raw import statements |
|
|
451
|
+
| `#graphCodemap` | `generate_codemap` | Comprehensive file structural overview |
|
|
452
|
+
| `#graphExpand` | `expand_node` | Incremental dependency exploration |
|
|
453
|
+
| `#graphVerifyUsage` | `verify_dependency_usage` | Is an import actually used? |
|
|
454
|
+
| `#graphInvalidate` | `invalidate_files` | Flush cache for specific files |
|
|
455
|
+
| `#graphRebuildIndex` | `rebuild_index` | Full index rebuild |
|
|
456
|
+
| `#graphDependents` | `get_symbol_dependents` | All symbols depending on a given symbol |
|
|
457
|
+
| `#graphTrace` | `trace_function_execution` | Full recursive call chain |
|
|
458
|
+
| `#graphFileLogic` | `analyze_file_logic` | Intra-file call hierarchy |
|
|
459
|
+
| `#graphResolve` | `resolve_module_path` | Resolve a module specifier to its absolute path |
|
|
460
|
+
| `#graphBreaking` | `analyze_breaking_changes` | Detect breaking changes between two file versions |
|
|
461
|
+
| `#graphCallGraph` | `query_call_graph` | BFS callers/callees via the SQLite call graph index |
|
|
462
|
+
|
|
463
|
+
> **Note:** `#graphCallGraph` requires the Call Graph panel (`graph-it-live.showCallGraph`) to be opened at least once to build the index.
|
|
464
|
+
|
|
465
|
+
### Manual MCP Server Configuration
|
|
466
|
+
|
|
467
|
+
If automatic MCP registration doesn't work in your editor, you can configure the server manually.
|
|
468
|
+
|
|
469
|
+
<details>
|
|
470
|
+
<summary><strong>Click to expand configuration instructions for VS Code, Cursor, Claude Desktop, Windsurf, etc.</strong></summary>
|
|
471
|
+
|
|
472
|
+
#### VS Code / VS Code Insiders
|
|
473
|
+
|
|
474
|
+
Create or edit `.vscode/mcp.json` in your workspace:
|
|
475
|
+
|
|
476
|
+
```json
|
|
477
|
+
{
|
|
478
|
+
"servers": {
|
|
479
|
+
"graph-it-live": {
|
|
480
|
+
"type": "stdio",
|
|
481
|
+
"command": "graph-it",
|
|
482
|
+
"args": ["serve"],
|
|
483
|
+
"env": {
|
|
484
|
+
"WORKSPACE_ROOT": "${workspaceFolder}",
|
|
485
|
+
"EXCLUDE_NODE_MODULES": "true",
|
|
486
|
+
"MAX_DEPTH": "50"
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
```
|
|
492
|
+
|
|
493
|
+
> **Fallback (if CLI not installed):** replace `"command": "graph-it"` with `"command": "node"` and add `"args": ["${extensionPath:magic5644.graph-it-live}/dist/mcpServer.mjs"]`.
|
|
494
|
+
|
|
495
|
+
#### Cursor
|
|
496
|
+
|
|
497
|
+
Create or edit `.cursor/mcp.json` in your workspace or `~/.cursor/mcp.json` for global configuration:
|
|
498
|
+
|
|
499
|
+
```json
|
|
500
|
+
{
|
|
501
|
+
"mcpServers": {
|
|
502
|
+
"graph-it-live": {
|
|
503
|
+
"command": "graph-it",
|
|
504
|
+
"args": ["serve"],
|
|
505
|
+
"env": {
|
|
506
|
+
"WORKSPACE_ROOT": "${workspaceFolder}",
|
|
507
|
+
"EXCLUDE_NODE_MODULES": "true",
|
|
508
|
+
"MAX_DEPTH": "50"
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
```
|
|
514
|
+
|
|
515
|
+
> **Fallback (if CLI not installed):** `"command": "bash", "args": ["-c", "node ~/.cursor/extensions/magic5644.graph-it-live-*/dist/mcpServer.mjs"]`
|
|
516
|
+
|
|
517
|
+
#### Claude Desktop
|
|
518
|
+
|
|
519
|
+
Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS):
|
|
520
|
+
|
|
521
|
+
```json
|
|
522
|
+
{
|
|
523
|
+
"mcpServers": {
|
|
524
|
+
"graph-it-live": {
|
|
525
|
+
"command": "graph-it",
|
|
526
|
+
"args": ["serve"],
|
|
527
|
+
"env": {
|
|
528
|
+
"WORKSPACE_ROOT": "/path/to/your/project",
|
|
529
|
+
"EXCLUDE_NODE_MODULES": "true",
|
|
530
|
+
"MAX_DEPTH": "50"
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
```
|
|
536
|
+
|
|
537
|
+
> **Fallback (if CLI not installed):** `"command": "bash", "args": ["-c", "node ~/.vscode/extensions/magic5644.graph-it-live-*/dist/mcpServer.mjs"]`
|
|
538
|
+
|
|
539
|
+
#### Development / Local Testing
|
|
540
|
+
|
|
541
|
+
```json
|
|
542
|
+
{
|
|
543
|
+
"mcpServers": {
|
|
544
|
+
"graph-it-live": {
|
|
545
|
+
"command": "node",
|
|
546
|
+
"args": ["/path/to/Graph-It-Live/dist/mcpServer.mjs"],
|
|
547
|
+
"env": {
|
|
548
|
+
"WORKSPACE_ROOT": "/absolute/path/to/your/project",
|
|
549
|
+
"TSCONFIG_PATH": "/absolute/path/to/your/project/tsconfig.json",
|
|
550
|
+
"EXCLUDE_NODE_MODULES": "true",
|
|
551
|
+
"MAX_DEPTH": "50"
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
```
|
|
557
|
+
|
|
558
|
+
#### Windsurf
|
|
559
|
+
|
|
560
|
+
Create or edit `~/.codeium/windsurf/mcp_config.json`:
|
|
561
|
+
|
|
562
|
+
```json
|
|
563
|
+
{
|
|
564
|
+
"mcpServers": {
|
|
565
|
+
"graph-it-live": {
|
|
566
|
+
"command": "graph-it",
|
|
567
|
+
"args": ["serve"],
|
|
568
|
+
"env": {
|
|
569
|
+
"WORKSPACE_ROOT": "${workspaceFolder}",
|
|
570
|
+
"EXCLUDE_NODE_MODULES": "true",
|
|
571
|
+
"MAX_DEPTH": "50"
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
```
|
|
577
|
+
|
|
578
|
+
> **Fallback (if CLI not installed):** `"command": "bash", "args": ["-c", "node ~/.windsurf/extensions/magic5644.graph-it-live-*/dist/mcpServer.mjs"]`
|
|
579
|
+
|
|
580
|
+
#### Antigravity
|
|
581
|
+
|
|
582
|
+
Create or edit `.antigravity/mcp.json` in your workspace or configure globally:
|
|
583
|
+
|
|
584
|
+
```json
|
|
585
|
+
{
|
|
586
|
+
"mcpServers": {
|
|
587
|
+
"graph-it-live": {
|
|
588
|
+
"command": "graph-it",
|
|
589
|
+
"args": ["serve"],
|
|
590
|
+
"env": {
|
|
591
|
+
"WORKSPACE_ROOT": "${workspaceFolder}",
|
|
592
|
+
"EXCLUDE_NODE_MODULES": "true",
|
|
593
|
+
"MAX_DEPTH": "50"
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
```
|
|
599
|
+
|
|
600
|
+
> **Fallback (if CLI not installed):** `"command": "bash", "args": ["-c", "node ~/.vscode/extensions/magic5644.graph-it-live-*/dist/mcpServer.mjs"]`
|
|
601
|
+
|
|
602
|
+
</details>
|
|
603
|
+
|
|
604
|
+
---
|
|
605
|
+
|
|
606
|
+
## Development
|
|
607
|
+
|
|
608
|
+
For comprehensive development instructions, see:
|
|
609
|
+
|
|
610
|
+
- **[DEVELOPMENT.md](DEVELOPMENT.md)** β Setup, build, testing, WASM architecture
|
|
611
|
+
- **[CONTRIBUTING.md](CONTRIBUTING.md)** β Contribution guidelines and workflow
|
|
612
|
+
|
|
613
|
+
### Quick Start
|
|
614
|
+
|
|
615
|
+
```bash
|
|
616
|
+
git clone https://github.com/magic5644/Graph-It-Live.git
|
|
617
|
+
cd Graph-It-Live
|
|
618
|
+
npm install
|
|
619
|
+
npm run build
|
|
620
|
+
# Press F5 in VS Code to launch the Extension Development Host
|
|
621
|
+
```
|
|
622
|
+
|
|
623
|
+
### Project Structure
|
|
624
|
+
|
|
625
|
+
```
|
|
626
|
+
Graph-It-Live/
|
|
627
|
+
βββ src/
|
|
628
|
+
β βββ analyzer/ # Dependency analysis (AST, Tree-sitter, SQLite)
|
|
629
|
+
β β βββ callgraph/ # Live Call Graph engine
|
|
630
|
+
β βββ extension/ # VS Code extension host
|
|
631
|
+
β β βββ services/ # Service layer (graph, symbol, call graph, indexing)
|
|
632
|
+
β βββ mcp/ # MCP server (20 AI tools)
|
|
633
|
+
β βββ shared/ # Types, protocols, utilities
|
|
634
|
+
β βββ webview/ # React UI (ReactFlow + Cytoscape.js)
|
|
635
|
+
β βββ callgraph/ # Call graph panel entry point
|
|
636
|
+
β βββ components/
|
|
637
|
+
β βββ reactflow/ # File graph + symbol view
|
|
638
|
+
β βββ cytoscape/ # Live call graph rendering
|
|
639
|
+
βββ tests/ # 1494+ tests (Vitest + VS Code E2E)
|
|
640
|
+
βββ resources/queries/ # Tree-sitter .scm queries (TS, Python, Rust)
|
|
641
|
+
βββ docs/ # Technical documentation
|
|
642
|
+
```
|
|
643
|
+
|
|
644
|
+
### Build & Test Commands
|
|
645
|
+
|
|
646
|
+
| Command | Description |
|
|
647
|
+
|---------|-------------|
|
|
648
|
+
| `npm run build` | Bundle via esbuild + copy WASM files |
|
|
649
|
+
| `npm run watch` | Rebuild on change |
|
|
650
|
+
| `npm test` | Run unit tests (Vitest, mocked parsers) |
|
|
651
|
+
| `npm run test:vscode` | E2E tests from source with real WASM |
|
|
652
|
+
| `npm run test:vscode:vsix` | E2E tests from .vsix (pre-release) |
|
|
653
|
+
| `npm run lint` | Lint TypeScript (ESLint) |
|
|
654
|
+
| `npm run check:types` | Strict type checking |
|
|
655
|
+
| `npm run package` | Build .vsix package |
|
|
656
|
+
| `npm run package:verify` | Verify no .map files in package |
|
|
657
|
+
|
|
658
|
+
---
|
|
659
|
+
|
|
660
|
+
## WASM Architecture
|
|
661
|
+
|
|
662
|
+
Graph-It-Live uses **WebAssembly** tree-sitter parsers for cross-platform compatibility and security:
|
|
663
|
+
|
|
664
|
+
- No native compilation needed β no Python, C++ compiler, or build tools
|
|
665
|
+
- Pure JavaScript + WASM (~2-3 MB total)
|
|
666
|
+
- Works identically on Windows, Linux, and macOS
|
|
667
|
+
- Parsers: `tree-sitter.wasm`, `tree-sitter-python.wasm`, `tree-sitter-rust.wasm`
|
|
668
|
+
|
|
669
|
+
<details>
|
|
670
|
+
<summary><strong>Click to expand WASM technical details</strong></summary>
|
|
671
|
+
|
|
672
|
+
### Architecture
|
|
673
|
+
|
|
674
|
+
```
|
|
675
|
+
VS Code Extension Host (Electron)
|
|
676
|
+
βββ WasmParserFactory (Singleton)
|
|
677
|
+
β βββ tree-sitter.wasm (Core runtime)
|
|
678
|
+
β βββ tree-sitter-python.wasm (Python grammar)
|
|
679
|
+
β βββ tree-sitter-rust.wasm (Rust grammar)
|
|
680
|
+
βββ PythonParser, RustParser (use WASM)
|
|
681
|
+
βββ GraphExtractor (tree-sitter queries for call graph)
|
|
682
|
+
```
|
|
683
|
+
|
|
684
|
+
### Testing
|
|
685
|
+
|
|
686
|
+
- **Unit tests:** Mocked parsers (WASM doesn't run in Node.js)
|
|
687
|
+
- **E2E tests:** Real WASM parsers in VS Code's Electron environment
|
|
688
|
+
- **90+ E2E tests** validate all functionality with real parsers
|
|
689
|
+
|
|
690
|
+
### Troubleshooting
|
|
691
|
+
|
|
692
|
+
| Error | Cause | Solution |
|
|
693
|
+
|-------|-------|---------|
|
|
694
|
+
| "Extension path required" | Internal error | Report as bug |
|
|
695
|
+
| "LinkError: WebAssembly.instantiate()" | Node.js limitation | Expected in unit tests; works in VS Code |
|
|
696
|
+
| "WASM file not found" | Missing from dist/wasm/ | Run `npm run build` or reinstall |
|
|
697
|
+
|
|
698
|
+
</details>
|
|
699
|
+
|
|
700
|
+
---
|
|
701
|
+
|
|
702
|
+
## License
|
|
703
|
+
|
|
704
|
+
MIT License β see [LICENSE](LICENSE) file for details.
|
|
705
|
+
|
|
706
|
+
## Acknowledgements
|
|
707
|
+
|
|
708
|
+
Language icons provided by [SuperTinyIcons](https://github.com/edent/SuperTinyIcons) β CC0-1.0 license.
|
|
709
|
+
|
|
710
|
+
## Author
|
|
711
|
+
|
|
712
|
+
**magic56** (magic5644)
|