@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.
Files changed (123) hide show
  1. package/CHANGELOG.md +72 -126
  2. package/README.md +290 -102
  3. package/dist/cli.js +41 -1
  4. package/dist/cli.js.map +1 -1
  5. package/dist/edges.js +22 -11
  6. package/dist/edges.js.map +1 -1
  7. package/dist/indexer.js +3 -3
  8. package/dist/indexer.js.map +1 -1
  9. package/dist/init.d.ts +28 -0
  10. package/dist/init.js +112 -0
  11. package/dist/init.js.map +1 -0
  12. package/dist/interactions.d.ts +5 -4
  13. package/dist/interactions.js +0 -0
  14. package/dist/interactions.js.map +1 -1
  15. package/dist/mcp.js +119 -90
  16. package/dist/mcp.js.map +1 -1
  17. package/dist/repo-resolve.d.ts +47 -0
  18. package/dist/repo-resolve.js +195 -0
  19. package/dist/repo-resolve.js.map +1 -0
  20. package/dist/storage.js +10 -1
  21. package/dist/storage.js.map +1 -1
  22. package/dist/symbols.js +26 -2
  23. package/dist/symbols.js.map +1 -1
  24. package/dist/validation.js +30 -4
  25. package/dist/validation.js.map +1 -1
  26. package/dist/validators.d.ts +1 -5
  27. package/dist/validators.js +0 -11
  28. package/dist/validators.js.map +1 -1
  29. package/dist/watcher.d.ts +10 -0
  30. package/dist/watcher.js +70 -7
  31. package/dist/watcher.js.map +1 -1
  32. package/examples/README.md +105 -0
  33. package/examples/claude-code/README.md +125 -0
  34. package/examples/claude-code/claude-routing.md +102 -0
  35. package/examples/claude-code/claude_config.json +8 -0
  36. package/examples/cline/.clinerules +39 -0
  37. package/examples/cline/README.md +104 -0
  38. package/examples/cline/cline_mcp_settings.json +10 -0
  39. package/examples/continue/.continuerules +39 -0
  40. package/examples/continue/README.md +98 -0
  41. package/examples/continue/config.json +13 -0
  42. package/examples/cursor/.cursorrules +39 -0
  43. package/examples/cursor/README.md +98 -0
  44. package/examples/cursor/mcp.json +11 -0
  45. package/examples/windsurf/.windsurfrules +39 -0
  46. package/examples/windsurf/README.md +85 -0
  47. package/examples/windsurf/mcp_config.json +8 -0
  48. package/package.json +14 -4
  49. package/.editorconfig +0 -15
  50. package/.github/CODEOWNERS +0 -22
  51. package/.github/FUNDING.yml +0 -1
  52. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -33
  53. package/.github/ISSUE_TEMPLATE/config.yml +0 -5
  54. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -23
  55. package/.github/PULL_REQUEST_TEMPLATE.md +0 -19
  56. package/.github/dependabot.yml +0 -15
  57. package/.github/workflows/ci.yml +0 -62
  58. package/.github/workflows/release.yml +0 -50
  59. package/.prettierignore +0 -19
  60. package/.prettierrc.json +0 -20
  61. package/CODE_OF_CONDUCT.md +0 -83
  62. package/CONTRIBUTING.md +0 -111
  63. package/bench/README.md +0 -544
  64. package/bench/results/agent-tier-2026-05-22.md +0 -28
  65. package/bench/results/agent-tier-summary.md +0 -44
  66. package/bench/results/baseline-tier-2026-05-22.md +0 -23
  67. package/bench/results/baseline.json +0 -810
  68. package/bench/results/baseline.md +0 -28
  69. package/bench/run-agent-tier-automated.ts +0 -234
  70. package/bench/run-agent-tier.md +0 -125
  71. package/bench/run-baseline-tier.ts +0 -200
  72. package/bench/run.ts +0 -210
  73. package/bench/runner-baseline.ts +0 -177
  74. package/bench/runner-graphpilot.ts +0 -131
  75. package/bench/score-agent-tier.ts +0 -191
  76. package/bench/score.ts +0 -59
  77. package/bench/tasks.ts +0 -236
  78. package/dist/provenance.d.ts +0 -74
  79. package/dist/provenance.js +0 -95
  80. package/dist/provenance.js.map +0 -1
  81. package/docs/architecture.md +0 -311
  82. package/docs/limitations.md +0 -156
  83. package/docs/mcp-setup.md +0 -231
  84. package/docs/quickstart.md +0 -202
  85. package/eslint.config.js +0 -148
  86. package/lefthook.yml +0 -81
  87. package/pnpm-workspace.yaml +0 -6
  88. package/scripts/smoke-stdio.mjs +0 -97
  89. package/src/cli.ts +0 -171
  90. package/src/edges.ts +0 -202
  91. package/src/git.ts +0 -255
  92. package/src/graph-schema.ts +0 -229
  93. package/src/impact.ts +0 -218
  94. package/src/indexer.ts +0 -152
  95. package/src/interactions.ts +0 -0
  96. package/src/mcp.ts +0 -652
  97. package/src/parser.ts +0 -138
  98. package/src/provenance.ts +0 -115
  99. package/src/query.ts +0 -148
  100. package/src/redact.ts +0 -122
  101. package/src/storage.ts +0 -115
  102. package/src/symbols.ts +0 -173
  103. package/src/validation.ts +0 -69
  104. package/src/validators.ts +0 -253
  105. package/src/watcher.ts +0 -383
  106. package/tests/edges.test.ts +0 -175
  107. package/tests/fixtures/sample.ts +0 -32
  108. package/tests/git.test.ts +0 -303
  109. package/tests/graph-schema.test.ts +0 -321
  110. package/tests/impact.test.ts +0 -454
  111. package/tests/interactions.test.ts +0 -180
  112. package/tests/lint-policy.test.ts +0 -106
  113. package/tests/mcp-stdio.test.ts +0 -171
  114. package/tests/mcp.test.ts +0 -335
  115. package/tests/parser.test.ts +0 -31
  116. package/tests/provenance.test.ts +0 -132
  117. package/tests/query.test.ts +0 -160
  118. package/tests/redact.test.ts +0 -167
  119. package/tests/security.test.ts +0 -144
  120. package/tests/symbols.test.ts +0 -78
  121. package/tests/validators.test.ts +0 -193
  122. package/tests/watcher.test.ts +0 -250
  123. 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,10 @@
1
+ {
2
+ "mcpServers": {
3
+ "graphpilot": {
4
+ "command": "node",
5
+ "args": ["/absolute/path/to/graphpilot/dist/cli.js", "mcp"],
6
+ "disabled": false,
7
+ "autoApprove": []
8
+ }
9
+ }
10
+ }
@@ -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,13 @@
1
+ {
2
+ "experimental": {
3
+ "modelContextProtocolServers": [
4
+ {
5
+ "transport": {
6
+ "type": "stdio",
7
+ "command": "node",
8
+ "args": ["/absolute/path/to/graphpilot/dist/cli.js", "mcp"]
9
+ }
10
+ }
11
+ ]
12
+ }
13
+ }
@@ -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,11 @@
1
+ {
2
+ "mcpServers": {
3
+ "graphpilot": {
4
+ "command": "node",
5
+ "args": ["/absolute/path/to/graphpilot/dist/cli.js", "mcp"],
6
+ "env": {
7
+ "GRAPHPILOT_ROOT": "${workspaceFolder}"
8
+ }
9
+ }
10
+ }
11
+ }
@@ -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 |
@@ -0,0 +1,8 @@
1
+ {
2
+ "mcpServers": {
3
+ "graphpilot": {
4
+ "command": "node",
5
+ "args": ["/absolute/path/to/graphpilot/dist/cli.js", "mcp"]
6
+ }
7
+ }
8
+ }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.0.1",
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
- "vitest": "^2.1.0"
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
@@ -1,15 +0,0 @@
1
- root = true
2
-
3
- [*]
4
- indent_style = space
5
- indent_size = 2
6
- end_of_line = lf
7
- charset = utf-8
8
- trim_trailing_whitespace = true
9
- insert_final_newline = true
10
-
11
- [*.md]
12
- trim_trailing_whitespace = false
13
-
14
- [Makefile]
15
- indent_style = tab
@@ -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.
@@ -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.