@graphpilot-oss/graphpilot 0.0.1 → 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/CHANGELOG.md +72 -126
- package/README.md +290 -102
- package/dist/cli.js +41 -1
- package/dist/cli.js.map +1 -1
- package/dist/edges.js +22 -11
- package/dist/edges.js.map +1 -1
- package/dist/indexer.js +3 -3
- package/dist/indexer.js.map +1 -1
- package/dist/init.d.ts +28 -0
- package/dist/init.js +112 -0
- package/dist/init.js.map +1 -0
- package/dist/interactions.d.ts +5 -4
- package/dist/interactions.js +0 -0
- package/dist/interactions.js.map +1 -1
- package/dist/mcp.js +119 -90
- package/dist/mcp.js.map +1 -1
- package/dist/repo-resolve.d.ts +47 -0
- package/dist/repo-resolve.js +195 -0
- package/dist/repo-resolve.js.map +1 -0
- package/dist/storage.js +10 -1
- package/dist/storage.js.map +1 -1
- package/dist/symbols.js +26 -2
- package/dist/symbols.js.map +1 -1
- package/dist/validation.js +30 -4
- package/dist/validation.js.map +1 -1
- package/dist/validators.d.ts +1 -5
- package/dist/validators.js +0 -11
- package/dist/validators.js.map +1 -1
- package/dist/watcher.d.ts +10 -0
- package/dist/watcher.js +70 -7
- package/dist/watcher.js.map +1 -1
- package/examples/README.md +105 -0
- package/examples/claude-code/README.md +125 -0
- package/examples/claude-code/claude-routing.md +102 -0
- package/examples/claude-code/claude_config.json +8 -0
- package/examples/cline/.clinerules +39 -0
- package/examples/cline/README.md +104 -0
- package/examples/cline/cline_mcp_settings.json +10 -0
- package/examples/continue/.continuerules +39 -0
- package/examples/continue/README.md +98 -0
- package/examples/continue/config.json +13 -0
- package/examples/cursor/.cursorrules +39 -0
- package/examples/cursor/README.md +98 -0
- package/examples/cursor/mcp.json +11 -0
- package/examples/windsurf/.windsurfrules +39 -0
- package/examples/windsurf/README.md +85 -0
- package/examples/windsurf/mcp_config.json +8 -0
- package/package.json +14 -4
- package/.editorconfig +0 -15
- package/.github/CODEOWNERS +0 -22
- package/.github/FUNDING.yml +0 -1
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -33
- package/.github/ISSUE_TEMPLATE/config.yml +0 -5
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -23
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -19
- package/.github/dependabot.yml +0 -15
- package/.github/workflows/ci.yml +0 -62
- package/.github/workflows/release.yml +0 -50
- package/.prettierignore +0 -19
- package/.prettierrc.json +0 -20
- package/CODE_OF_CONDUCT.md +0 -83
- package/CONTRIBUTING.md +0 -111
- package/bench/README.md +0 -544
- package/bench/results/agent-tier-2026-05-22.md +0 -28
- package/bench/results/agent-tier-summary.md +0 -44
- package/bench/results/baseline-tier-2026-05-22.md +0 -23
- package/bench/results/baseline.json +0 -810
- package/bench/results/baseline.md +0 -28
- package/bench/run-agent-tier-automated.ts +0 -234
- package/bench/run-agent-tier.md +0 -125
- package/bench/run-baseline-tier.ts +0 -200
- package/bench/run.ts +0 -210
- package/bench/runner-baseline.ts +0 -177
- package/bench/runner-graphpilot.ts +0 -131
- package/bench/score-agent-tier.ts +0 -191
- package/bench/score.ts +0 -59
- package/bench/tasks.ts +0 -236
- package/dist/provenance.d.ts +0 -74
- package/dist/provenance.js +0 -95
- package/dist/provenance.js.map +0 -1
- package/docs/architecture.md +0 -311
- package/docs/limitations.md +0 -156
- package/docs/mcp-setup.md +0 -231
- package/docs/quickstart.md +0 -202
- package/eslint.config.js +0 -148
- package/lefthook.yml +0 -81
- package/pnpm-workspace.yaml +0 -6
- package/scripts/smoke-stdio.mjs +0 -97
- package/src/cli.ts +0 -171
- package/src/edges.ts +0 -202
- package/src/git.ts +0 -255
- package/src/graph-schema.ts +0 -229
- package/src/impact.ts +0 -218
- package/src/indexer.ts +0 -152
- package/src/interactions.ts +0 -0
- package/src/mcp.ts +0 -652
- package/src/parser.ts +0 -138
- package/src/provenance.ts +0 -115
- package/src/query.ts +0 -148
- package/src/redact.ts +0 -122
- package/src/storage.ts +0 -115
- package/src/symbols.ts +0 -173
- package/src/validation.ts +0 -69
- package/src/validators.ts +0 -253
- package/src/watcher.ts +0 -383
- package/tests/edges.test.ts +0 -175
- package/tests/fixtures/sample.ts +0 -32
- package/tests/git.test.ts +0 -303
- package/tests/graph-schema.test.ts +0 -321
- package/tests/impact.test.ts +0 -454
- package/tests/interactions.test.ts +0 -180
- package/tests/lint-policy.test.ts +0 -106
- package/tests/mcp-stdio.test.ts +0 -171
- package/tests/mcp.test.ts +0 -335
- package/tests/parser.test.ts +0 -31
- package/tests/provenance.test.ts +0 -132
- package/tests/query.test.ts +0 -160
- package/tests/redact.test.ts +0 -167
- package/tests/security.test.ts +0 -144
- package/tests/symbols.test.ts +0 -78
- package/tests/validators.test.ts +0 -193
- package/tests/watcher.test.ts +0 -250
- package/tsconfig.json +0 -18
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# Cline (VS Code extension) + GraphPilot
|
|
2
|
+
|
|
3
|
+
Step-by-step install of GraphPilot as an MCP server inside Cline.
|
|
4
|
+
|
|
5
|
+
## 1. Build GraphPilot
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
git clone https://github.com/graphpilot-oss/graphpilot.git
|
|
9
|
+
cd graphpilot && pnpm install && pnpm build
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## 2. Open Cline's MCP settings
|
|
13
|
+
|
|
14
|
+
The easy way:
|
|
15
|
+
|
|
16
|
+
1. Open VS Code
|
|
17
|
+
2. Open the **Cline panel** (sidebar icon)
|
|
18
|
+
3. Click **MCP Servers**
|
|
19
|
+
4. Click the ⚙ gear icon → **Edit MCP Settings**
|
|
20
|
+
|
|
21
|
+
That opens `cline_mcp_settings.json`. Direct paths if you prefer to edit it manually:
|
|
22
|
+
|
|
23
|
+
| OS | Path |
|
|
24
|
+
| ------- | --------------------------------------------------------------------------------------------------------------- |
|
|
25
|
+
| macOS | `~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json` |
|
|
26
|
+
| Linux | `~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json` |
|
|
27
|
+
| Windows | `%APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json` |
|
|
28
|
+
|
|
29
|
+
## 3. Add the GraphPilot block
|
|
30
|
+
|
|
31
|
+
Paste the contents of [`cline_mcp_settings.json`](./cline_mcp_settings.json) and replace `/absolute/path/to/graphpilot/` with the real path:
|
|
32
|
+
|
|
33
|
+
```jsonc
|
|
34
|
+
{
|
|
35
|
+
"mcpServers": {
|
|
36
|
+
"graphpilot": {
|
|
37
|
+
"command": "node",
|
|
38
|
+
"args": ["/absolute/path/to/graphpilot/dist/cli.js", "mcp"],
|
|
39
|
+
"disabled": false,
|
|
40
|
+
"autoApprove": [],
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Post-npm:
|
|
47
|
+
|
|
48
|
+
```jsonc
|
|
49
|
+
{
|
|
50
|
+
"mcpServers": {
|
|
51
|
+
"graphpilot": {
|
|
52
|
+
"command": "npx",
|
|
53
|
+
"args": ["graphpilot", "mcp"],
|
|
54
|
+
"disabled": false,
|
|
55
|
+
"autoApprove": [],
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
> The `autoApprove` array lets you list tool names that Cline will call without per-call confirmation. Add e.g. `["gp_recall"]` once you're comfortable — leave it empty until then.
|
|
62
|
+
|
|
63
|
+
## 4. Verify
|
|
64
|
+
|
|
65
|
+
In the Cline panel → **MCP Servers** section, `graphpilot` should appear with a **green status dot** and 5 tools listed underneath. If it doesn't, restart VS Code.
|
|
66
|
+
|
|
67
|
+
## 5. Index a repo
|
|
68
|
+
|
|
69
|
+
From the integrated terminal:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
node /abs/path/to/graphpilot/dist/cli.js index .
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## 6. Try it
|
|
76
|
+
|
|
77
|
+
```text
|
|
78
|
+
Use graphpilot to find who calls authenticate.
|
|
79
|
+
|
|
80
|
+
Use gp_impact to show the blast radius of renaming parseFile.
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Cline will surface a tool-call card with the request → response → "Approve" button. Once approved, the result appears in the chat with `file:line @ sha` evidence anchors.
|
|
84
|
+
|
|
85
|
+
## 7. Keep the index fresh
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
node /abs/path/to/graphpilot/dist/cli.js watch .
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Troubleshooting
|
|
92
|
+
|
|
93
|
+
| Symptom | Fix |
|
|
94
|
+
| -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
|
|
95
|
+
| Server shows red / disconnected | Check `disabled: false`. Then try VS Code: Command Palette → "Developer: Reload Window". |
|
|
96
|
+
| Cline can't find tools after a restart | The settings file is JSON-strict — a trailing comma will silently disable the entire `mcpServers` block. Validate the JSON. |
|
|
97
|
+
| Tool calls return "no index" | Pass an explicit `path: "/abs/repo"`, or run `gp_index` first. |
|
|
98
|
+
|
|
99
|
+
## Files in this folder
|
|
100
|
+
|
|
101
|
+
| File | Purpose |
|
|
102
|
+
| ------------------------------------------------------ | ------------------------------------------------------ |
|
|
103
|
+
| [`README.md`](./README.md) | This walkthrough |
|
|
104
|
+
| [`cline_mcp_settings.json`](./cline_mcp_settings.json) | Sample config — copy the `mcpServers` block into yours |
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# GraphPilot routing rules for Continue
|
|
2
|
+
|
|
3
|
+
This repo has a GraphPilot structural code-graph available via MCP. Use it before grep on structural questions.
|
|
4
|
+
|
|
5
|
+
## When the user asks any of:
|
|
6
|
+
|
|
7
|
+
- "who calls X" / "what uses X" / "where is X called from"
|
|
8
|
+
- "what does X call" / "what does X depend on"
|
|
9
|
+
- "rename X — what breaks" / "impact of changing X" / "what depends on X"
|
|
10
|
+
- "find function X" / "where is X defined" / "list all interfaces"
|
|
11
|
+
|
|
12
|
+
→ **Use the graphpilot MCP tools BEFORE grep or reading files.**
|
|
13
|
+
|
|
14
|
+
| Question kind | Tool to call |
|
|
15
|
+
| ---------------------- | ------------------------------------------------------- |
|
|
16
|
+
| Define / locate symbol | `gp_recall({ query, substring?, path? })` |
|
|
17
|
+
| Callers / callees | `gp_callers({ symbol, direction, path? })` |
|
|
18
|
+
| Blast radius / rename | `gp_impact({ symbol, depth?, path? })` |
|
|
19
|
+
| PR-scoped blast radius | `gp_impact({ symbol, since: 'main', path? })` |
|
|
20
|
+
| Index health probe | `gp_stats({ path? })` |
|
|
21
|
+
| Refresh after edits | `gp_index({ path? })` |
|
|
22
|
+
|
|
23
|
+
## When NOT to use GraphPilot
|
|
24
|
+
|
|
25
|
+
Fall back to grep / read for:
|
|
26
|
+
|
|
27
|
+
- Comments, JSDoc, string literals, error messages
|
|
28
|
+
- Config files (package.json, tsconfig.json, .env)
|
|
29
|
+
- Markdown / docs
|
|
30
|
+
- Languages other than TypeScript / JavaScript
|
|
31
|
+
- Git history (blame, log)
|
|
32
|
+
|
|
33
|
+
## After heavy editing
|
|
34
|
+
|
|
35
|
+
After ~10+ file edits, call `gp_index` once before further structural questions, or run `graphpilot watch` in a side terminal for sub-10 ms incremental updates.
|
|
36
|
+
|
|
37
|
+
## Citing evidence
|
|
38
|
+
|
|
39
|
+
Every GraphPilot response carries `file:line @ sha` anchors. When citing results to the user, **include the anchor verbatim** — it's verifiable: the user can jump to that line and the code will match.
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Continue.dev + GraphPilot
|
|
2
|
+
|
|
3
|
+
Step-by-step install of GraphPilot as an MCP server inside Continue.
|
|
4
|
+
|
|
5
|
+
> Continue's MCP support is flagged **experimental** at the time of writing. If the config key below isn't recognized, check the [Continue docs](https://docs.continue.dev) for the current schema.
|
|
6
|
+
|
|
7
|
+
## 1. Build GraphPilot
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
git clone https://github.com/graphpilot-oss/graphpilot.git
|
|
11
|
+
cd graphpilot && pnpm install && pnpm build
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## 2. Edit Continue's config
|
|
15
|
+
|
|
16
|
+
Two scopes — pick one:
|
|
17
|
+
|
|
18
|
+
- **Global:** `~/.continue/config.json`
|
|
19
|
+
- **Per-project:** `<your-repo>/.continue/config.json`
|
|
20
|
+
|
|
21
|
+
Create the file if it doesn't exist. Paste the contents of [`config.json`](./config.json) and replace `/absolute/path/to/graphpilot/` with the real path:
|
|
22
|
+
|
|
23
|
+
```jsonc
|
|
24
|
+
{
|
|
25
|
+
"experimental": {
|
|
26
|
+
"modelContextProtocolServers": [
|
|
27
|
+
{
|
|
28
|
+
"transport": {
|
|
29
|
+
"type": "stdio",
|
|
30
|
+
"command": "node",
|
|
31
|
+
"args": ["/absolute/path/to/graphpilot/dist/cli.js", "mcp"],
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
},
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Post-npm:
|
|
40
|
+
|
|
41
|
+
```jsonc
|
|
42
|
+
{
|
|
43
|
+
"experimental": {
|
|
44
|
+
"modelContextProtocolServers": [
|
|
45
|
+
{
|
|
46
|
+
"transport": {
|
|
47
|
+
"type": "stdio",
|
|
48
|
+
"command": "npx",
|
|
49
|
+
"args": ["graphpilot", "mcp"],
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## 3. Restart Continue
|
|
58
|
+
|
|
59
|
+
Reload the VS Code / JetBrains window after editing the config.
|
|
60
|
+
|
|
61
|
+
## 4. Verify
|
|
62
|
+
|
|
63
|
+
Continue → Settings → **MCP Servers** panel. `graphpilot` should be listed with 5 tools.
|
|
64
|
+
|
|
65
|
+
## 5. Index a repo
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
node /abs/path/to/graphpilot/dist/cli.js index .
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## 6. Try it
|
|
72
|
+
|
|
73
|
+
```text
|
|
74
|
+
Use graphpilot's gp_recall to find parseToken.
|
|
75
|
+
|
|
76
|
+
Use gp_impact to compute the blast radius of renaming authenticate.
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## 7. Keep the index fresh
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
node /abs/path/to/graphpilot/dist/cli.js watch .
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Troubleshooting
|
|
86
|
+
|
|
87
|
+
| Symptom | Fix |
|
|
88
|
+
| ------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
|
|
89
|
+
| `modelContextProtocolServers` reported as "unknown key" | Your Continue version is on an older schema. Check the current docs for the new key name. |
|
|
90
|
+
| Server appears but tools aren't called | Continue's MCP autorouting is conservative. Be explicit: _"Use graphpilot's gp_callers…"_ |
|
|
91
|
+
| `pnpm install` native-module errors | `pnpm approve-builds --all && pnpm rebuild`. Drop to Node 22 LTS if on 23+. |
|
|
92
|
+
|
|
93
|
+
## Files in this folder
|
|
94
|
+
|
|
95
|
+
| File | Purpose |
|
|
96
|
+
| ------------------------------ | ------------------------------------------------------------ |
|
|
97
|
+
| [`README.md`](./README.md) | This walkthrough |
|
|
98
|
+
| [`config.json`](./config.json) | Sample `~/.continue/config.json` — copy the block into yours |
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# GraphPilot routing rules for Cursor
|
|
2
|
+
|
|
3
|
+
This repo has a GraphPilot structural code-graph available via MCP. Use it before grep on structural questions.
|
|
4
|
+
|
|
5
|
+
## When the user asks any of:
|
|
6
|
+
|
|
7
|
+
- "who calls X" / "what uses X" / "where is X called from"
|
|
8
|
+
- "what does X call" / "what does X depend on"
|
|
9
|
+
- "rename X — what breaks" / "impact of changing X" / "what depends on X"
|
|
10
|
+
- "find function X" / "where is X defined" / "list all interfaces"
|
|
11
|
+
|
|
12
|
+
→ **Use the graphpilot MCP tools BEFORE grep or reading files.**
|
|
13
|
+
|
|
14
|
+
| Question kind | Tool to call |
|
|
15
|
+
| ---------------------- | ------------------------------------------------------- |
|
|
16
|
+
| Define / locate symbol | `gp_recall({ query, substring?, path? })` |
|
|
17
|
+
| Callers / callees | `gp_callers({ symbol, direction, path? })` |
|
|
18
|
+
| Blast radius / rename | `gp_impact({ symbol, depth?, path? })` |
|
|
19
|
+
| PR-scoped blast radius | `gp_impact({ symbol, since: 'main', path? })` |
|
|
20
|
+
| Index health probe | `gp_stats({ path? })` |
|
|
21
|
+
| Refresh after edits | `gp_index({ path? })` |
|
|
22
|
+
|
|
23
|
+
## When NOT to use GraphPilot
|
|
24
|
+
|
|
25
|
+
Fall back to grep / read for:
|
|
26
|
+
|
|
27
|
+
- Comments, JSDoc, string literals, error messages
|
|
28
|
+
- Config files (package.json, tsconfig.json, .env)
|
|
29
|
+
- Markdown / docs
|
|
30
|
+
- Languages other than TypeScript / JavaScript
|
|
31
|
+
- Git history (blame, log)
|
|
32
|
+
|
|
33
|
+
## After heavy editing
|
|
34
|
+
|
|
35
|
+
After ~10+ file edits, call `gp_index` once before further structural questions, or run `graphpilot watch` in a side terminal for sub-10 ms incremental updates.
|
|
36
|
+
|
|
37
|
+
## Citing evidence
|
|
38
|
+
|
|
39
|
+
Every GraphPilot response carries `file:line @ sha` anchors. When citing results to the user, **include the anchor verbatim** — it's verifiable: the user can jump to that line and the code will match.
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Cursor + GraphPilot
|
|
2
|
+
|
|
3
|
+
Step-by-step install of GraphPilot as an MCP server inside Cursor.
|
|
4
|
+
|
|
5
|
+
## 1. Build GraphPilot
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
git clone https://github.com/graphpilot-oss/graphpilot.git
|
|
9
|
+
cd graphpilot && pnpm install && pnpm build
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## 2. Open Cursor's MCP config
|
|
13
|
+
|
|
14
|
+
Two ways:
|
|
15
|
+
|
|
16
|
+
- **UI:** Press `Cmd/Ctrl + ,` → search "MCP" → "Edit MCP config"
|
|
17
|
+
- **File:** open `~/.cursor/mcp.json` directly (create it if it doesn't exist)
|
|
18
|
+
|
|
19
|
+
Paste the contents of [`mcp.json`](./mcp.json) and replace `/absolute/path/to/graphpilot/` with the real path on your machine:
|
|
20
|
+
|
|
21
|
+
```jsonc
|
|
22
|
+
{
|
|
23
|
+
"mcpServers": {
|
|
24
|
+
"graphpilot": {
|
|
25
|
+
"command": "node",
|
|
26
|
+
"args": ["/absolute/path/to/graphpilot/dist/cli.js", "mcp"],
|
|
27
|
+
"env": {
|
|
28
|
+
"GRAPHPILOT_ROOT": "${workspaceFolder}",
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
`${workspaceFolder}` lets GraphPilot find the index when the agent omits `path` (MCP cwd is often your home directory, not the repo).
|
|
36
|
+
|
|
37
|
+
Post-npm:
|
|
38
|
+
|
|
39
|
+
```jsonc
|
|
40
|
+
{
|
|
41
|
+
"mcpServers": {
|
|
42
|
+
"graphpilot": {
|
|
43
|
+
"command": "npx",
|
|
44
|
+
"args": ["graphpilot", "mcp"],
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## 3. Verify
|
|
51
|
+
|
|
52
|
+
Settings → MCP. `graphpilot` should show as **Connected** with 5 tools listed.
|
|
53
|
+
|
|
54
|
+
If it shows red after the config change, click the refresh icon next to it — Cursor sometimes caches MCP server state.
|
|
55
|
+
|
|
56
|
+
## 4. Index a repo
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
node /abs/path/to/graphpilot/dist/cli.js index .
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## 5. Auto-routing via `.cursorrules`
|
|
63
|
+
|
|
64
|
+
Drop [`.cursorrules`](./.cursorrules) into the root of the repo you indexed. It tells Cursor's agent to reach for GraphPilot on structural questions automatically. Re-open the workspace to pick it up.
|
|
65
|
+
|
|
66
|
+
Try:
|
|
67
|
+
|
|
68
|
+
```text
|
|
69
|
+
Who calls authenticate in this repo?
|
|
70
|
+
|
|
71
|
+
What breaks if I rename parseFile?
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
You should see Cursor invoke `gp_callers` / `gp_impact` in its tool-use trace.
|
|
75
|
+
|
|
76
|
+
## 6. Keep the index fresh
|
|
77
|
+
|
|
78
|
+
In a side terminal:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
node /abs/path/to/graphpilot/dist/cli.js watch .
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Troubleshooting
|
|
85
|
+
|
|
86
|
+
| Symptom | Fix |
|
|
87
|
+
| ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
88
|
+
| Server shows red in Settings → MCP | Click the refresh icon. If still red, run `node dist/cli.js mcp` in a terminal — inspect stderr. |
|
|
89
|
+
| `.cursorrules` ignored | Cursor reads it on workspace open. Close and reopen the folder. |
|
|
90
|
+
| Tool calls return "no index" | Add `"env": { "GRAPHPILOT_ROOT": "${workspaceFolder}" }` to MCP config (see `mcp.json`), or copy project `.cursor/mcp.json`. Cursor also sends workspace roots automatically. |
|
|
91
|
+
|
|
92
|
+
## Files in this folder
|
|
93
|
+
|
|
94
|
+
| File | Purpose |
|
|
95
|
+
| -------------------------------- | -------------------------------------------------------------------- |
|
|
96
|
+
| [`README.md`](./README.md) | This walkthrough |
|
|
97
|
+
| [`mcp.json`](./mcp.json) | Sample `~/.cursor/mcp.json` — copy the `mcpServers` block into yours |
|
|
98
|
+
| [`.cursorrules`](./.cursorrules) | Routing template — copy to your indexed repo's root for auto-routing |
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# GraphPilot routing rules for Windsurf
|
|
2
|
+
|
|
3
|
+
This repo has a GraphPilot structural code-graph available via MCP. Use it before grep on structural questions.
|
|
4
|
+
|
|
5
|
+
## When the user asks any of:
|
|
6
|
+
|
|
7
|
+
- "who calls X" / "what uses X" / "where is X called from"
|
|
8
|
+
- "what does X call" / "what does X depend on"
|
|
9
|
+
- "rename X — what breaks" / "impact of changing X" / "what depends on X"
|
|
10
|
+
- "find function X" / "where is X defined" / "list all interfaces"
|
|
11
|
+
|
|
12
|
+
→ **Use the graphpilot MCP tools BEFORE grep or reading files.**
|
|
13
|
+
|
|
14
|
+
| Question kind | Tool to call |
|
|
15
|
+
| ---------------------- | ------------------------------------------------------- |
|
|
16
|
+
| Define / locate symbol | `gp_recall({ query, substring?, path? })` |
|
|
17
|
+
| Callers / callees | `gp_callers({ symbol, direction, path? })` |
|
|
18
|
+
| Blast radius / rename | `gp_impact({ symbol, depth?, path? })` |
|
|
19
|
+
| PR-scoped blast radius | `gp_impact({ symbol, since: 'main', path? })` |
|
|
20
|
+
| Index health probe | `gp_stats({ path? })` |
|
|
21
|
+
| Refresh after edits | `gp_index({ path? })` |
|
|
22
|
+
|
|
23
|
+
## When NOT to use GraphPilot
|
|
24
|
+
|
|
25
|
+
Fall back to grep / read for:
|
|
26
|
+
|
|
27
|
+
- Comments, JSDoc, string literals, error messages
|
|
28
|
+
- Config files (package.json, tsconfig.json, .env)
|
|
29
|
+
- Markdown / docs
|
|
30
|
+
- Languages other than TypeScript / JavaScript
|
|
31
|
+
- Git history (blame, log)
|
|
32
|
+
|
|
33
|
+
## After heavy editing
|
|
34
|
+
|
|
35
|
+
After ~10+ file edits, call `gp_index` once before further structural questions, or run `graphpilot watch` in a side terminal for sub-10 ms incremental updates.
|
|
36
|
+
|
|
37
|
+
## Citing evidence
|
|
38
|
+
|
|
39
|
+
Every GraphPilot response carries `file:line @ sha` anchors. When citing results to the user, **include the anchor verbatim** — it's verifiable: the user can jump to that line and the code will match.
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Windsurf (Codeium) + GraphPilot
|
|
2
|
+
|
|
3
|
+
Step-by-step install of GraphPilot as an MCP server inside Windsurf.
|
|
4
|
+
|
|
5
|
+
## 1. Build GraphPilot
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
git clone https://github.com/graphpilot-oss/graphpilot.git
|
|
9
|
+
cd graphpilot && pnpm install && pnpm build
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## 2. Edit Windsurf's MCP config
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
~/.codeium/windsurf/mcp_config.json
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Create it if it doesn't exist. Paste the contents of [`mcp_config.json`](./mcp_config.json) and replace `/absolute/path/to/graphpilot/` with the real path:
|
|
19
|
+
|
|
20
|
+
```jsonc
|
|
21
|
+
{
|
|
22
|
+
"mcpServers": {
|
|
23
|
+
"graphpilot": {
|
|
24
|
+
"command": "node",
|
|
25
|
+
"args": ["/absolute/path/to/graphpilot/dist/cli.js", "mcp"],
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Post-npm:
|
|
32
|
+
|
|
33
|
+
```jsonc
|
|
34
|
+
{
|
|
35
|
+
"mcpServers": {
|
|
36
|
+
"graphpilot": {
|
|
37
|
+
"command": "npx",
|
|
38
|
+
"args": ["graphpilot", "mcp"],
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## 3. Restart Windsurf
|
|
45
|
+
|
|
46
|
+
Fully quit and reopen. The Cascade panel reads MCP config on launch.
|
|
47
|
+
|
|
48
|
+
## 4. Verify
|
|
49
|
+
|
|
50
|
+
Open the **Cascade** panel — the MCP tools list should include the four `gp_*` tools (`gp_index`, `gp_recall`, `gp_callers`, `gp_impact`).
|
|
51
|
+
|
|
52
|
+
## 5. Index a repo
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
node /abs/path/to/graphpilot/dist/cli.js index .
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## 6. Try it
|
|
59
|
+
|
|
60
|
+
```text
|
|
61
|
+
Use graphpilot to find who calls authenticate.
|
|
62
|
+
|
|
63
|
+
What breaks if I rename parseFile? Use gp_impact.
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## 7. Keep the index fresh
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
node /abs/path/to/graphpilot/dist/cli.js watch .
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Troubleshooting
|
|
73
|
+
|
|
74
|
+
| Symptom | Fix |
|
|
75
|
+
| ------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
|
|
76
|
+
| MCP tools list is empty | Verify JSON syntax with `python -m json.tool ~/.codeium/windsurf/mcp_config.json`. Then restart Windsurf. |
|
|
77
|
+
| Server shows but tools fail with "no index" | Pass an explicit `path: "/abs/repo"` to the tool, or `gp_index` first. |
|
|
78
|
+
| Native module errors on launch | `pnpm approve-builds --all && pnpm rebuild` in the graphpilot dir. Use Node 22 LTS if on 23+. |
|
|
79
|
+
|
|
80
|
+
## Files in this folder
|
|
81
|
+
|
|
82
|
+
| File | Purpose |
|
|
83
|
+
| -------------------------------------- | ------------------------------------------------------------------------ |
|
|
84
|
+
| [`README.md`](./README.md) | This walkthrough |
|
|
85
|
+
| [`mcp_config.json`](./mcp_config.json) | Sample `~/.codeium/windsurf/mcp_config.json` — copy the block into yours |
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.0
|
|
6
|
+
"version": "1.0.0",
|
|
7
7
|
"description": "Structural memory for coding agents.",
|
|
8
8
|
"license": "Apache-2.0",
|
|
9
9
|
"repository": {
|
|
@@ -15,10 +15,18 @@
|
|
|
15
15
|
"url": "https://github.com/graphpilot-oss/graphpilot/issues"
|
|
16
16
|
},
|
|
17
17
|
"type": "module",
|
|
18
|
-
"main": "./dist/index.js",
|
|
19
18
|
"bin": {
|
|
20
19
|
"graphpilot": "./dist/cli.js"
|
|
21
20
|
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist/",
|
|
23
|
+
"assets/",
|
|
24
|
+
"examples/",
|
|
25
|
+
"README.md",
|
|
26
|
+
"LICENSE",
|
|
27
|
+
"CHANGELOG.md",
|
|
28
|
+
"SECURITY.md"
|
|
29
|
+
],
|
|
22
30
|
"engines": {
|
|
23
31
|
"node": ">=20"
|
|
24
32
|
},
|
|
@@ -39,7 +47,8 @@
|
|
|
39
47
|
"prettier": "^3.8.3",
|
|
40
48
|
"tsx": "^4.19.2",
|
|
41
49
|
"typescript": "^5.7.0",
|
|
42
|
-
"
|
|
50
|
+
"vite": "^6.4.3",
|
|
51
|
+
"vitest": "^4.1.8"
|
|
43
52
|
},
|
|
44
53
|
"scripts": {
|
|
45
54
|
"build": "tsc",
|
|
@@ -51,6 +60,7 @@
|
|
|
51
60
|
"format:check": "prettier --check \"**/*.{ts,tsx,js,jsx,mjs,cjs,json,yml,yaml,md}\"",
|
|
52
61
|
"typecheck": "tsc --noEmit",
|
|
53
62
|
"check": "pnpm typecheck && pnpm lint && pnpm format:check && pnpm test",
|
|
54
|
-
"bench": "tsx bench/run.ts"
|
|
63
|
+
"bench": "tsx bench/run.ts",
|
|
64
|
+
"bench:scale": "tsx bench/run-scale.ts"
|
|
55
65
|
}
|
|
56
66
|
}
|
package/.editorconfig
DELETED
package/.github/CODEOWNERS
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
# CODEOWNERS — auto-request review on every PR.
|
|
2
|
-
#
|
|
3
|
-
# Syntax: <path-glob> <reviewer> [<reviewer>...]
|
|
4
|
-
# Reviewers are GitHub handles (no @) or team slugs (@org/team).
|
|
5
|
-
#
|
|
6
|
-
# Order matters: the LAST matching rule wins. Default rule first, then
|
|
7
|
-
# overrides for paths that should pull in specific reviewers.
|
|
8
|
-
#
|
|
9
|
-
# Docs: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-security/customizing-your-repository/about-code-owners
|
|
10
|
-
|
|
11
|
-
# Default: solo maintainer reviews everything.
|
|
12
|
-
* @codeakki
|
|
13
|
-
|
|
14
|
-
# When co-maintainers join, add area-specific rules. For example:
|
|
15
|
-
#
|
|
16
|
-
# /src/mcp/ @codeakki @some-mcp-expert
|
|
17
|
-
# /src/parser/ @codeakki @some-tree-sitter-expert
|
|
18
|
-
# /docs/ @codeakki @docs-lead
|
|
19
|
-
# /bench/ @codeakki @benchmark-owner
|
|
20
|
-
# /.github/ @codeakki # workflow changes are sensitive
|
|
21
|
-
#
|
|
22
|
-
# Until then, the default rule is enough.
|
package/.github/FUNDING.yml
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
github: [codeakki]
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: Bug report
|
|
3
|
-
about: Something is broken or behaving unexpectedly
|
|
4
|
-
title: 'bug: '
|
|
5
|
-
labels: bug
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## Describe the bug
|
|
9
|
-
|
|
10
|
-
A clear description of what's wrong.
|
|
11
|
-
|
|
12
|
-
## Reproduction
|
|
13
|
-
|
|
14
|
-
Steps to reproduce:
|
|
15
|
-
|
|
16
|
-
1. Run `...`
|
|
17
|
-
2. ...
|
|
18
|
-
3. ...
|
|
19
|
-
|
|
20
|
-
## Expected behavior
|
|
21
|
-
|
|
22
|
-
What you expected to happen instead.
|
|
23
|
-
|
|
24
|
-
## Environment
|
|
25
|
-
|
|
26
|
-
- OS: [macOS / Linux / Windows + version]
|
|
27
|
-
- Node version: output of `node -v`
|
|
28
|
-
- GraphPilot version: output of `node dist/cli.js --version` (or commit SHA)
|
|
29
|
-
- MCP client (if relevant): [Claude Code / Cursor / Windsurf / ...]
|
|
30
|
-
|
|
31
|
-
## Additional context
|
|
32
|
-
|
|
33
|
-
Logs, screenshots, or a minimal repo that reproduces the issue.
|