@colbymchenry/codegraph 0.7.10 → 0.9.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/README.md +70 -54
- package/npm-shim.js +43 -0
- package/package.json +13 -51
- package/LICENSE +0 -21
- package/dist/bin/codegraph.d.ts +0 -21
- package/dist/bin/codegraph.d.ts.map +0 -1
- package/dist/bin/codegraph.js +0 -1232
- package/dist/bin/codegraph.js.map +0 -1
- package/dist/bin/node-version-check.d.ts +0 -20
- package/dist/bin/node-version-check.d.ts.map +0 -1
- package/dist/bin/node-version-check.js +0 -42
- package/dist/bin/node-version-check.js.map +0 -1
- package/dist/bin/uninstall.d.ts +0 -14
- package/dist/bin/uninstall.d.ts.map +0 -1
- package/dist/bin/uninstall.js +0 -36
- package/dist/bin/uninstall.js.map +0 -1
- package/dist/config.d.ts +0 -51
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js +0 -321
- package/dist/config.js.map +0 -1
- package/dist/context/formatter.d.ts +0 -30
- package/dist/context/formatter.d.ts.map +0 -1
- package/dist/context/formatter.js +0 -244
- package/dist/context/formatter.js.map +0 -1
- package/dist/context/index.d.ts +0 -97
- package/dist/context/index.d.ts.map +0 -1
- package/dist/context/index.js +0 -1048
- package/dist/context/index.js.map +0 -1
- package/dist/db/index.d.ts +0 -72
- package/dist/db/index.d.ts.map +0 -1
- package/dist/db/index.js +0 -200
- package/dist/db/index.js.map +0 -1
- package/dist/db/migrations.d.ts +0 -44
- package/dist/db/migrations.d.ts.map +0 -1
- package/dist/db/migrations.js +0 -131
- package/dist/db/migrations.js.map +0 -1
- package/dist/db/queries.d.ts +0 -253
- package/dist/db/queries.d.ts.map +0 -1
- package/dist/db/queries.js +0 -1207
- package/dist/db/queries.js.map +0 -1
- package/dist/db/schema.sql +0 -151
- package/dist/db/sqlite-adapter.d.ts +0 -52
- package/dist/db/sqlite-adapter.d.ts.map +0 -1
- package/dist/db/sqlite-adapter.js +0 -237
- package/dist/db/sqlite-adapter.js.map +0 -1
- package/dist/directory.d.ts +0 -57
- package/dist/directory.d.ts.map +0 -1
- package/dist/directory.js +0 -264
- package/dist/directory.js.map +0 -1
- package/dist/errors.d.ts +0 -136
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js +0 -219
- package/dist/errors.js.map +0 -1
- package/dist/extraction/dfm-extractor.d.ts +0 -31
- package/dist/extraction/dfm-extractor.d.ts.map +0 -1
- package/dist/extraction/dfm-extractor.js +0 -151
- package/dist/extraction/dfm-extractor.js.map +0 -1
- package/dist/extraction/grammars.d.ts +0 -78
- package/dist/extraction/grammars.d.ts.map +0 -1
- package/dist/extraction/grammars.js +0 -322
- package/dist/extraction/grammars.js.map +0 -1
- package/dist/extraction/index.d.ts +0 -130
- package/dist/extraction/index.d.ts.map +0 -1
- package/dist/extraction/index.js +0 -1279
- package/dist/extraction/index.js.map +0 -1
- package/dist/extraction/languages/c-cpp.d.ts +0 -4
- package/dist/extraction/languages/c-cpp.d.ts.map +0 -1
- package/dist/extraction/languages/c-cpp.js +0 -126
- package/dist/extraction/languages/c-cpp.js.map +0 -1
- package/dist/extraction/languages/csharp.d.ts +0 -3
- package/dist/extraction/languages/csharp.d.ts.map +0 -1
- package/dist/extraction/languages/csharp.js +0 -72
- package/dist/extraction/languages/csharp.js.map +0 -1
- package/dist/extraction/languages/dart.d.ts +0 -3
- package/dist/extraction/languages/dart.d.ts.map +0 -1
- package/dist/extraction/languages/dart.js +0 -192
- package/dist/extraction/languages/dart.js.map +0 -1
- package/dist/extraction/languages/go.d.ts +0 -3
- package/dist/extraction/languages/go.d.ts.map +0 -1
- package/dist/extraction/languages/go.js +0 -58
- package/dist/extraction/languages/go.js.map +0 -1
- package/dist/extraction/languages/index.d.ts +0 -10
- package/dist/extraction/languages/index.d.ts.map +0 -1
- package/dist/extraction/languages/index.js +0 -45
- package/dist/extraction/languages/index.js.map +0 -1
- package/dist/extraction/languages/java.d.ts +0 -3
- package/dist/extraction/languages/java.d.ts.map +0 -1
- package/dist/extraction/languages/java.js +0 -64
- package/dist/extraction/languages/java.js.map +0 -1
- package/dist/extraction/languages/javascript.d.ts +0 -3
- package/dist/extraction/languages/javascript.d.ts.map +0 -1
- package/dist/extraction/languages/javascript.js +0 -90
- package/dist/extraction/languages/javascript.js.map +0 -1
- package/dist/extraction/languages/kotlin.d.ts +0 -3
- package/dist/extraction/languages/kotlin.d.ts.map +0 -1
- package/dist/extraction/languages/kotlin.js +0 -253
- package/dist/extraction/languages/kotlin.js.map +0 -1
- package/dist/extraction/languages/pascal.d.ts +0 -3
- package/dist/extraction/languages/pascal.d.ts.map +0 -1
- package/dist/extraction/languages/pascal.js +0 -66
- package/dist/extraction/languages/pascal.js.map +0 -1
- package/dist/extraction/languages/php.d.ts +0 -3
- package/dist/extraction/languages/php.d.ts.map +0 -1
- package/dist/extraction/languages/php.js +0 -107
- package/dist/extraction/languages/php.js.map +0 -1
- package/dist/extraction/languages/python.d.ts +0 -3
- package/dist/extraction/languages/python.d.ts.map +0 -1
- package/dist/extraction/languages/python.js +0 -56
- package/dist/extraction/languages/python.js.map +0 -1
- package/dist/extraction/languages/ruby.d.ts +0 -3
- package/dist/extraction/languages/ruby.d.ts.map +0 -1
- package/dist/extraction/languages/ruby.js +0 -114
- package/dist/extraction/languages/ruby.js.map +0 -1
- package/dist/extraction/languages/rust.d.ts +0 -3
- package/dist/extraction/languages/rust.d.ts.map +0 -1
- package/dist/extraction/languages/rust.js +0 -109
- package/dist/extraction/languages/rust.js.map +0 -1
- package/dist/extraction/languages/scala.d.ts +0 -3
- package/dist/extraction/languages/scala.d.ts.map +0 -1
- package/dist/extraction/languages/scala.js +0 -139
- package/dist/extraction/languages/scala.js.map +0 -1
- package/dist/extraction/languages/swift.d.ts +0 -3
- package/dist/extraction/languages/swift.d.ts.map +0 -1
- package/dist/extraction/languages/swift.js +0 -91
- package/dist/extraction/languages/swift.js.map +0 -1
- package/dist/extraction/languages/typescript.d.ts +0 -3
- package/dist/extraction/languages/typescript.d.ts.map +0 -1
- package/dist/extraction/languages/typescript.js +0 -129
- package/dist/extraction/languages/typescript.js.map +0 -1
- package/dist/extraction/liquid-extractor.d.ts +0 -52
- package/dist/extraction/liquid-extractor.d.ts.map +0 -1
- package/dist/extraction/liquid-extractor.js +0 -313
- package/dist/extraction/liquid-extractor.js.map +0 -1
- package/dist/extraction/parse-worker.d.ts +0 -8
- package/dist/extraction/parse-worker.d.ts.map +0 -1
- package/dist/extraction/parse-worker.js +0 -94
- package/dist/extraction/parse-worker.js.map +0 -1
- package/dist/extraction/svelte-extractor.d.ts +0 -56
- package/dist/extraction/svelte-extractor.d.ts.map +0 -1
- package/dist/extraction/svelte-extractor.js +0 -272
- package/dist/extraction/svelte-extractor.js.map +0 -1
- package/dist/extraction/tree-sitter-helpers.d.ts +0 -28
- package/dist/extraction/tree-sitter-helpers.d.ts.map +0 -1
- package/dist/extraction/tree-sitter-helpers.js +0 -103
- package/dist/extraction/tree-sitter-helpers.js.map +0 -1
- package/dist/extraction/tree-sitter-types.d.ts +0 -179
- package/dist/extraction/tree-sitter-types.d.ts.map +0 -1
- package/dist/extraction/tree-sitter-types.js +0 -10
- package/dist/extraction/tree-sitter-types.js.map +0 -1
- package/dist/extraction/tree-sitter.d.ts +0 -233
- package/dist/extraction/tree-sitter.d.ts.map +0 -1
- package/dist/extraction/tree-sitter.js +0 -2393
- package/dist/extraction/tree-sitter.js.map +0 -1
- package/dist/extraction/vue-extractor.d.ts +0 -36
- package/dist/extraction/vue-extractor.d.ts.map +0 -1
- package/dist/extraction/vue-extractor.js +0 -163
- package/dist/extraction/vue-extractor.js.map +0 -1
- package/dist/extraction/wasm/tree-sitter-pascal.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-scala.wasm +0 -0
- package/dist/graph/index.d.ts +0 -8
- package/dist/graph/index.d.ts.map +0 -1
- package/dist/graph/index.js +0 -13
- package/dist/graph/index.js.map +0 -1
- package/dist/graph/queries.d.ts +0 -106
- package/dist/graph/queries.d.ts.map +0 -1
- package/dist/graph/queries.js +0 -366
- package/dist/graph/queries.js.map +0 -1
- package/dist/graph/traversal.d.ts +0 -127
- package/dist/graph/traversal.d.ts.map +0 -1
- package/dist/graph/traversal.js +0 -493
- package/dist/graph/traversal.js.map +0 -1
- package/dist/index.d.ts +0 -447
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -825
- package/dist/index.js.map +0 -1
- package/dist/installer/claude-md-template.d.ts +0 -14
- package/dist/installer/claude-md-template.d.ts.map +0 -1
- package/dist/installer/claude-md-template.js +0 -21
- package/dist/installer/claude-md-template.js.map +0 -1
- package/dist/installer/config-writer.d.ts +0 -29
- package/dist/installer/config-writer.d.ts.map +0 -1
- package/dist/installer/config-writer.js +0 -109
- package/dist/installer/config-writer.js.map +0 -1
- package/dist/installer/index.d.ts +0 -53
- package/dist/installer/index.d.ts.map +0 -1
- package/dist/installer/index.js +0 -338
- package/dist/installer/index.js.map +0 -1
- package/dist/installer/instructions-template.d.ts +0 -28
- package/dist/installer/instructions-template.d.ts.map +0 -1
- package/dist/installer/instructions-template.js +0 -63
- package/dist/installer/instructions-template.js.map +0 -1
- package/dist/installer/targets/claude.d.ts +0 -27
- package/dist/installer/targets/claude.d.ts.map +0 -1
- package/dist/installer/targets/claude.js +0 -246
- package/dist/installer/targets/claude.js.map +0 -1
- package/dist/installer/targets/codex.d.ts +0 -18
- package/dist/installer/targets/codex.d.ts.map +0 -1
- package/dist/installer/targets/codex.js +0 -185
- package/dist/installer/targets/codex.js.map +0 -1
- package/dist/installer/targets/cursor.d.ts +0 -35
- package/dist/installer/targets/cursor.d.ts.map +0 -1
- package/dist/installer/targets/cursor.js +0 -229
- package/dist/installer/targets/cursor.js.map +0 -1
- package/dist/installer/targets/opencode.d.ts +0 -30
- package/dist/installer/targets/opencode.d.ts.map +0 -1
- package/dist/installer/targets/opencode.js +0 -235
- package/dist/installer/targets/opencode.js.map +0 -1
- package/dist/installer/targets/registry.d.ts +0 -35
- package/dist/installer/targets/registry.d.ts.map +0 -1
- package/dist/installer/targets/registry.js +0 -83
- package/dist/installer/targets/registry.js.map +0 -1
- package/dist/installer/targets/shared.d.ts +0 -77
- package/dist/installer/targets/shared.d.ts.map +0 -1
- package/dist/installer/targets/shared.js +0 -246
- package/dist/installer/targets/shared.js.map +0 -1
- package/dist/installer/targets/toml.d.ts +0 -52
- package/dist/installer/targets/toml.d.ts.map +0 -1
- package/dist/installer/targets/toml.js +0 -147
- package/dist/installer/targets/toml.js.map +0 -1
- package/dist/installer/targets/types.d.ts +0 -116
- package/dist/installer/targets/types.d.ts.map +0 -1
- package/dist/installer/targets/types.js +0 -16
- package/dist/installer/targets/types.js.map +0 -1
- package/dist/mcp/index.d.ts +0 -86
- package/dist/mcp/index.d.ts.map +0 -1
- package/dist/mcp/index.js +0 -355
- package/dist/mcp/index.js.map +0 -1
- package/dist/mcp/server-instructions.d.ts +0 -19
- package/dist/mcp/server-instructions.d.ts.map +0 -1
- package/dist/mcp/server-instructions.js +0 -59
- package/dist/mcp/server-instructions.js.map +0 -1
- package/dist/mcp/tools.d.ts +0 -200
- package/dist/mcp/tools.d.ts.map +0 -1
- package/dist/mcp/tools.js +0 -1319
- package/dist/mcp/tools.js.map +0 -1
- package/dist/mcp/transport.d.ts +0 -89
- package/dist/mcp/transport.d.ts.map +0 -1
- package/dist/mcp/transport.js +0 -170
- package/dist/mcp/transport.js.map +0 -1
- package/dist/resolution/frameworks/cargo-workspace.d.ts +0 -18
- package/dist/resolution/frameworks/cargo-workspace.d.ts.map +0 -1
- package/dist/resolution/frameworks/cargo-workspace.js +0 -225
- package/dist/resolution/frameworks/cargo-workspace.js.map +0 -1
- package/dist/resolution/frameworks/csharp.d.ts +0 -8
- package/dist/resolution/frameworks/csharp.d.ts.map +0 -1
- package/dist/resolution/frameworks/csharp.js +0 -213
- package/dist/resolution/frameworks/csharp.js.map +0 -1
- package/dist/resolution/frameworks/express.d.ts +0 -8
- package/dist/resolution/frameworks/express.d.ts.map +0 -1
- package/dist/resolution/frameworks/express.js +0 -225
- package/dist/resolution/frameworks/express.js.map +0 -1
- package/dist/resolution/frameworks/go.d.ts +0 -8
- package/dist/resolution/frameworks/go.d.ts.map +0 -1
- package/dist/resolution/frameworks/go.js +0 -158
- package/dist/resolution/frameworks/go.js.map +0 -1
- package/dist/resolution/frameworks/index.d.ts +0 -41
- package/dist/resolution/frameworks/index.d.ts.map +0 -1
- package/dist/resolution/frameworks/index.js +0 -129
- package/dist/resolution/frameworks/index.js.map +0 -1
- package/dist/resolution/frameworks/java.d.ts +0 -8
- package/dist/resolution/frameworks/java.d.ts.map +0 -1
- package/dist/resolution/frameworks/java.js +0 -177
- package/dist/resolution/frameworks/java.js.map +0 -1
- package/dist/resolution/frameworks/laravel.d.ts +0 -13
- package/dist/resolution/frameworks/laravel.d.ts.map +0 -1
- package/dist/resolution/frameworks/laravel.js +0 -248
- package/dist/resolution/frameworks/laravel.js.map +0 -1
- package/dist/resolution/frameworks/python.d.ts +0 -10
- package/dist/resolution/frameworks/python.d.ts.map +0 -1
- package/dist/resolution/frameworks/python.js +0 -278
- package/dist/resolution/frameworks/python.js.map +0 -1
- package/dist/resolution/frameworks/react.d.ts +0 -8
- package/dist/resolution/frameworks/react.d.ts.map +0 -1
- package/dist/resolution/frameworks/react.js +0 -272
- package/dist/resolution/frameworks/react.js.map +0 -1
- package/dist/resolution/frameworks/ruby.d.ts +0 -8
- package/dist/resolution/frameworks/ruby.d.ts.map +0 -1
- package/dist/resolution/frameworks/ruby.js +0 -198
- package/dist/resolution/frameworks/ruby.js.map +0 -1
- package/dist/resolution/frameworks/rust.d.ts +0 -8
- package/dist/resolution/frameworks/rust.d.ts.map +0 -1
- package/dist/resolution/frameworks/rust.js +0 -207
- package/dist/resolution/frameworks/rust.js.map +0 -1
- package/dist/resolution/frameworks/svelte.d.ts +0 -9
- package/dist/resolution/frameworks/svelte.d.ts.map +0 -1
- package/dist/resolution/frameworks/svelte.js +0 -249
- package/dist/resolution/frameworks/svelte.js.map +0 -1
- package/dist/resolution/frameworks/swift.d.ts +0 -10
- package/dist/resolution/frameworks/swift.d.ts.map +0 -1
- package/dist/resolution/frameworks/swift.js +0 -376
- package/dist/resolution/frameworks/swift.js.map +0 -1
- package/dist/resolution/frameworks/vue.d.ts +0 -9
- package/dist/resolution/frameworks/vue.d.ts.map +0 -1
- package/dist/resolution/frameworks/vue.js +0 -306
- package/dist/resolution/frameworks/vue.js.map +0 -1
- package/dist/resolution/import-resolver.d.ts +0 -40
- package/dist/resolution/import-resolver.d.ts.map +0 -1
- package/dist/resolution/import-resolver.js +0 -663
- package/dist/resolution/import-resolver.js.map +0 -1
- package/dist/resolution/index.d.ts +0 -106
- package/dist/resolution/index.d.ts.map +0 -1
- package/dist/resolution/index.js +0 -709
- package/dist/resolution/index.js.map +0 -1
- package/dist/resolution/name-matcher.d.ts +0 -32
- package/dist/resolution/name-matcher.d.ts.map +0 -1
- package/dist/resolution/name-matcher.js +0 -384
- package/dist/resolution/name-matcher.js.map +0 -1
- package/dist/resolution/path-aliases.d.ts +0 -68
- package/dist/resolution/path-aliases.d.ts.map +0 -1
- package/dist/resolution/path-aliases.js +0 -238
- package/dist/resolution/path-aliases.js.map +0 -1
- package/dist/resolution/strip-comments.d.ts +0 -27
- package/dist/resolution/strip-comments.d.ts.map +0 -1
- package/dist/resolution/strip-comments.js +0 -441
- package/dist/resolution/strip-comments.js.map +0 -1
- package/dist/resolution/types.d.ts +0 -172
- package/dist/resolution/types.d.ts.map +0 -1
- package/dist/resolution/types.js +0 -8
- package/dist/resolution/types.js.map +0 -1
- package/dist/search/query-parser.d.ts +0 -57
- package/dist/search/query-parser.d.ts.map +0 -1
- package/dist/search/query-parser.js +0 -177
- package/dist/search/query-parser.js.map +0 -1
- package/dist/search/query-utils.d.ts +0 -53
- package/dist/search/query-utils.d.ts.map +0 -1
- package/dist/search/query-utils.js +0 -347
- package/dist/search/query-utils.js.map +0 -1
- package/dist/sync/index.d.ts +0 -13
- package/dist/sync/index.d.ts.map +0 -1
- package/dist/sync/index.js +0 -17
- package/dist/sync/index.js.map +0 -1
- package/dist/sync/watcher.d.ts +0 -81
- package/dist/sync/watcher.d.ts.map +0 -1
- package/dist/sync/watcher.js +0 -184
- package/dist/sync/watcher.js.map +0 -1
- package/dist/types.d.ts +0 -423
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -256
- package/dist/types.js.map +0 -1
- package/dist/ui/glyphs.d.ts +0 -42
- package/dist/ui/glyphs.d.ts.map +0 -1
- package/dist/ui/glyphs.js +0 -78
- package/dist/ui/glyphs.js.map +0 -1
- package/dist/ui/shimmer-progress.d.ts +0 -11
- package/dist/ui/shimmer-progress.d.ts.map +0 -1
- package/dist/ui/shimmer-progress.js +0 -90
- package/dist/ui/shimmer-progress.js.map +0 -1
- package/dist/ui/shimmer-worker.d.ts +0 -2
- package/dist/ui/shimmer-worker.d.ts.map +0 -1
- package/dist/ui/shimmer-worker.js +0 -118
- package/dist/ui/shimmer-worker.js.map +0 -1
- package/dist/ui/types.d.ts +0 -17
- package/dist/ui/types.d.ts.map +0 -1
- package/dist/ui/types.js +0 -3
- package/dist/ui/types.js.map +0 -1
- package/dist/utils.d.ts +0 -205
- package/dist/utils.d.ts.map +0 -1
- package/dist/utils.js +0 -549
- package/dist/utils.js.map +0 -1
- package/scripts/local-install.sh +0 -41
- package/scripts/patch-tree-sitter-dart.js +0 -112
- package/scripts/release.sh +0 -70
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/installer/targets/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE1C;;;;GAIG;AACH,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,CAAC;AAElE;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,OAAO,CAAC;IAC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|
|
4
|
-
*
|
|
5
|
-
* Each MCP-capable agent (Claude Code, Cursor, Codex CLI, opencode, ...)
|
|
6
|
-
* implements this interface so the installer orchestrator can write the
|
|
7
|
-
* right MCP-server config + instructions file + permissions for that
|
|
8
|
-
* agent without baking client-specific paths into core code. Adding a
|
|
9
|
-
* new agent = one new file in `targets/` + one entry in `registry.ts`.
|
|
10
|
-
*
|
|
11
|
-
* Closes the Claude-locked installer issue (upstream #137). The
|
|
12
|
-
* runtime MCP server is already agent-agnostic; this brings the
|
|
13
|
-
* installer to the same surface.
|
|
14
|
-
*/
|
|
15
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
//# sourceMappingURL=types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/installer/targets/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG"}
|
package/dist/mcp/index.d.ts
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CodeGraph MCP Server
|
|
3
|
-
*
|
|
4
|
-
* Model Context Protocol server that exposes CodeGraph functionality
|
|
5
|
-
* as tools for AI assistants like Claude.
|
|
6
|
-
*
|
|
7
|
-
* @module mcp
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```typescript
|
|
11
|
-
* import { MCPServer } from 'codegraph';
|
|
12
|
-
*
|
|
13
|
-
* const server = new MCPServer('/path/to/project');
|
|
14
|
-
* await server.start();
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
/**
|
|
18
|
-
* MCP Server for CodeGraph
|
|
19
|
-
*
|
|
20
|
-
* Implements the Model Context Protocol to expose CodeGraph
|
|
21
|
-
* functionality as tools that can be called by AI assistants.
|
|
22
|
-
*/
|
|
23
|
-
export declare class MCPServer {
|
|
24
|
-
private transport;
|
|
25
|
-
private cg;
|
|
26
|
-
private toolHandler;
|
|
27
|
-
private projectPath;
|
|
28
|
-
private initPromise;
|
|
29
|
-
constructor(projectPath?: string);
|
|
30
|
-
/**
|
|
31
|
-
* Start the MCP server
|
|
32
|
-
*
|
|
33
|
-
* Note: CodeGraph initialization is deferred until the initialize request
|
|
34
|
-
* is received, which includes the rootUri from the client.
|
|
35
|
-
*/
|
|
36
|
-
start(): Promise<void>;
|
|
37
|
-
/**
|
|
38
|
-
* Try to initialize CodeGraph for the default project.
|
|
39
|
-
*
|
|
40
|
-
* Walks up parent directories to find the nearest .codegraph/ folder,
|
|
41
|
-
* similar to how git finds .git/ directories.
|
|
42
|
-
*
|
|
43
|
-
* If initialization fails, the error is recorded but the server continues
|
|
44
|
-
* to work — cross-project queries and retries on subsequent tool calls
|
|
45
|
-
* are still possible.
|
|
46
|
-
*/
|
|
47
|
-
private tryInitializeDefault;
|
|
48
|
-
/**
|
|
49
|
-
* Retry initialization of the default project if it previously failed.
|
|
50
|
-
* Called lazily on tool calls that need the default project.
|
|
51
|
-
* Re-walks parent directories each time so it picks up projects
|
|
52
|
-
* initialized after the MCP server started.
|
|
53
|
-
*
|
|
54
|
-
* Awaits any in-flight background init (kicked off by handleInitialize) so
|
|
55
|
-
* we never open the SQLite file twice concurrently.
|
|
56
|
-
*/
|
|
57
|
-
private retryInitIfNeeded;
|
|
58
|
-
/**
|
|
59
|
-
* Start file watching on the active CodeGraph instance.
|
|
60
|
-
* Logs sync activity to stderr for diagnostics.
|
|
61
|
-
*/
|
|
62
|
-
private startWatching;
|
|
63
|
-
/**
|
|
64
|
-
* Stop the server
|
|
65
|
-
*/
|
|
66
|
-
stop(): void;
|
|
67
|
-
/**
|
|
68
|
-
* Handle incoming JSON-RPC messages
|
|
69
|
-
*/
|
|
70
|
-
private handleMessage;
|
|
71
|
-
/**
|
|
72
|
-
* Handle initialize request
|
|
73
|
-
*/
|
|
74
|
-
private handleInitialize;
|
|
75
|
-
/**
|
|
76
|
-
* Handle tools/list request
|
|
77
|
-
*/
|
|
78
|
-
private handleToolsList;
|
|
79
|
-
/**
|
|
80
|
-
* Handle tools/call request
|
|
81
|
-
*/
|
|
82
|
-
private handleToolsCall;
|
|
83
|
-
}
|
|
84
|
-
export { StdioTransport } from './transport';
|
|
85
|
-
export { tools, ToolHandler } from './tools';
|
|
86
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/mcp/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAwCH;;;;;GAKG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,SAAS,CAAiB;IAClC,OAAO,CAAC,EAAE,CAA0B;IACpC,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,WAAW,CAAgB;IAGnC,OAAO,CAAC,WAAW,CAA8B;gBAErC,WAAW,CAAC,EAAE,MAAM;IAOhC;;;;;OAKG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAe5B;;;;;;;;;OASG;YACW,oBAAoB;IAsBlC;;;;;;;;OAQG;YACW,iBAAiB;IA6B/B;;;OAGG;IACH,OAAO,CAAC,aAAa;IAqBrB;;OAEG;IACH,IAAI,IAAI,IAAI;IAYZ;;OAEG;YACW,aAAa;IA6C3B;;OAEG;YACW,gBAAgB;IAiD9B;;OAEG;YACW,eAAe;IAO7B;;OAEG;YACW,eAAe;CAqC9B;AAGD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC"}
|
package/dist/mcp/index.js
DELETED
|
@@ -1,355 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* CodeGraph MCP Server
|
|
4
|
-
*
|
|
5
|
-
* Model Context Protocol server that exposes CodeGraph functionality
|
|
6
|
-
* as tools for AI assistants like Claude.
|
|
7
|
-
*
|
|
8
|
-
* @module mcp
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```typescript
|
|
12
|
-
* import { MCPServer } from 'codegraph';
|
|
13
|
-
*
|
|
14
|
-
* const server = new MCPServer('/path/to/project');
|
|
15
|
-
* await server.start();
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
19
|
-
if (k2 === undefined) k2 = k;
|
|
20
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
21
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
22
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
23
|
-
}
|
|
24
|
-
Object.defineProperty(o, k2, desc);
|
|
25
|
-
}) : (function(o, m, k, k2) {
|
|
26
|
-
if (k2 === undefined) k2 = k;
|
|
27
|
-
o[k2] = m[k];
|
|
28
|
-
}));
|
|
29
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
30
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
31
|
-
}) : function(o, v) {
|
|
32
|
-
o["default"] = v;
|
|
33
|
-
});
|
|
34
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
35
|
-
var ownKeys = function(o) {
|
|
36
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
37
|
-
var ar = [];
|
|
38
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
39
|
-
return ar;
|
|
40
|
-
};
|
|
41
|
-
return ownKeys(o);
|
|
42
|
-
};
|
|
43
|
-
return function (mod) {
|
|
44
|
-
if (mod && mod.__esModule) return mod;
|
|
45
|
-
var result = {};
|
|
46
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
47
|
-
__setModuleDefault(result, mod);
|
|
48
|
-
return result;
|
|
49
|
-
};
|
|
50
|
-
})();
|
|
51
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
52
|
-
exports.ToolHandler = exports.tools = exports.StdioTransport = exports.MCPServer = void 0;
|
|
53
|
-
const path = __importStar(require("path"));
|
|
54
|
-
const index_1 = __importStar(require("../index"));
|
|
55
|
-
const transport_1 = require("./transport");
|
|
56
|
-
const tools_1 = require("./tools");
|
|
57
|
-
const server_instructions_1 = require("./server-instructions");
|
|
58
|
-
/**
|
|
59
|
-
* Convert a file:// URI to a filesystem path.
|
|
60
|
-
* Handles URL encoding and Windows drive letter paths.
|
|
61
|
-
*/
|
|
62
|
-
function fileUriToPath(uri) {
|
|
63
|
-
try {
|
|
64
|
-
const url = new URL(uri);
|
|
65
|
-
let filePath = decodeURIComponent(url.pathname);
|
|
66
|
-
// On Windows, file:///C:/path produces pathname /C:/path — strip leading /
|
|
67
|
-
if (process.platform === 'win32' && /^\/[a-zA-Z]:/.test(filePath)) {
|
|
68
|
-
filePath = filePath.slice(1);
|
|
69
|
-
}
|
|
70
|
-
return path.resolve(filePath);
|
|
71
|
-
}
|
|
72
|
-
catch {
|
|
73
|
-
// Fallback for non-standard URIs
|
|
74
|
-
return uri.replace(/^file:\/\/\/?/, '');
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* MCP Server Info
|
|
79
|
-
*/
|
|
80
|
-
const SERVER_INFO = {
|
|
81
|
-
name: 'codegraph',
|
|
82
|
-
version: '0.1.0',
|
|
83
|
-
};
|
|
84
|
-
/**
|
|
85
|
-
* MCP Protocol Version
|
|
86
|
-
*/
|
|
87
|
-
const PROTOCOL_VERSION = '2024-11-05';
|
|
88
|
-
/**
|
|
89
|
-
* MCP Server for CodeGraph
|
|
90
|
-
*
|
|
91
|
-
* Implements the Model Context Protocol to expose CodeGraph
|
|
92
|
-
* functionality as tools that can be called by AI assistants.
|
|
93
|
-
*/
|
|
94
|
-
class MCPServer {
|
|
95
|
-
transport;
|
|
96
|
-
cg = null;
|
|
97
|
-
toolHandler;
|
|
98
|
-
projectPath;
|
|
99
|
-
// In-flight background init kicked off from handleInitialize. Tracked so the
|
|
100
|
-
// sync retry path doesn't race against it (double-opening the SQLite file).
|
|
101
|
-
initPromise = null;
|
|
102
|
-
constructor(projectPath) {
|
|
103
|
-
this.projectPath = projectPath || null;
|
|
104
|
-
this.transport = new transport_1.StdioTransport();
|
|
105
|
-
// Create ToolHandler eagerly — cross-project queries work even without a default project
|
|
106
|
-
this.toolHandler = new tools_1.ToolHandler(null);
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Start the MCP server
|
|
110
|
-
*
|
|
111
|
-
* Note: CodeGraph initialization is deferred until the initialize request
|
|
112
|
-
* is received, which includes the rootUri from the client.
|
|
113
|
-
*/
|
|
114
|
-
async start() {
|
|
115
|
-
// Start listening for messages immediately - don't check initialization yet
|
|
116
|
-
// We'll get the project path from the initialize request's rootUri
|
|
117
|
-
this.transport.start(this.handleMessage.bind(this));
|
|
118
|
-
// Keep the process running
|
|
119
|
-
process.on('SIGINT', () => this.stop());
|
|
120
|
-
process.on('SIGTERM', () => this.stop());
|
|
121
|
-
// When the parent process (Claude Code) exits, stdin closes.
|
|
122
|
-
// Detect this and shut down gracefully to prevent orphaned processes.
|
|
123
|
-
process.stdin.on('end', () => this.stop());
|
|
124
|
-
process.stdin.on('close', () => this.stop());
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Try to initialize CodeGraph for the default project.
|
|
128
|
-
*
|
|
129
|
-
* Walks up parent directories to find the nearest .codegraph/ folder,
|
|
130
|
-
* similar to how git finds .git/ directories.
|
|
131
|
-
*
|
|
132
|
-
* If initialization fails, the error is recorded but the server continues
|
|
133
|
-
* to work — cross-project queries and retries on subsequent tool calls
|
|
134
|
-
* are still possible.
|
|
135
|
-
*/
|
|
136
|
-
async tryInitializeDefault(projectPath) {
|
|
137
|
-
// Walk up parent directories to find nearest .codegraph/
|
|
138
|
-
const resolvedRoot = (0, index_1.findNearestCodeGraphRoot)(projectPath);
|
|
139
|
-
if (!resolvedRoot) {
|
|
140
|
-
this.projectPath = projectPath;
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
this.projectPath = resolvedRoot;
|
|
144
|
-
try {
|
|
145
|
-
this.cg = await index_1.default.open(resolvedRoot);
|
|
146
|
-
this.toolHandler.setDefaultCodeGraph(this.cg);
|
|
147
|
-
this.startWatching();
|
|
148
|
-
}
|
|
149
|
-
catch (err) {
|
|
150
|
-
// Log the error so transient failures are diagnosable (see issue #47)
|
|
151
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
152
|
-
process.stderr.write(`[CodeGraph MCP] Failed to open project at ${resolvedRoot}: ${msg}\n`);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
/**
|
|
156
|
-
* Retry initialization of the default project if it previously failed.
|
|
157
|
-
* Called lazily on tool calls that need the default project.
|
|
158
|
-
* Re-walks parent directories each time so it picks up projects
|
|
159
|
-
* initialized after the MCP server started.
|
|
160
|
-
*
|
|
161
|
-
* Awaits any in-flight background init (kicked off by handleInitialize) so
|
|
162
|
-
* we never open the SQLite file twice concurrently.
|
|
163
|
-
*/
|
|
164
|
-
async retryInitIfNeeded() {
|
|
165
|
-
// Wait for the background init started during handleInitialize, if any.
|
|
166
|
-
if (this.initPromise) {
|
|
167
|
-
try {
|
|
168
|
-
await this.initPromise;
|
|
169
|
-
}
|
|
170
|
-
catch { /* errored init falls through to retry */ }
|
|
171
|
-
}
|
|
172
|
-
// Already initialized successfully
|
|
173
|
-
if (this.toolHandler.hasDefaultCodeGraph())
|
|
174
|
-
return;
|
|
175
|
-
// No project path to retry with
|
|
176
|
-
if (!this.projectPath)
|
|
177
|
-
return;
|
|
178
|
-
const resolvedRoot = (0, index_1.findNearestCodeGraphRoot)(this.projectPath);
|
|
179
|
-
if (!resolvedRoot)
|
|
180
|
-
return;
|
|
181
|
-
try {
|
|
182
|
-
// Close any previously failed instance to avoid leaking resources
|
|
183
|
-
if (this.cg) {
|
|
184
|
-
try {
|
|
185
|
-
this.cg.close();
|
|
186
|
-
}
|
|
187
|
-
catch { /* ignore */ }
|
|
188
|
-
this.cg = null;
|
|
189
|
-
}
|
|
190
|
-
this.cg = index_1.default.openSync(resolvedRoot);
|
|
191
|
-
this.projectPath = resolvedRoot;
|
|
192
|
-
this.toolHandler.setDefaultCodeGraph(this.cg);
|
|
193
|
-
this.startWatching();
|
|
194
|
-
}
|
|
195
|
-
catch {
|
|
196
|
-
// Still failing — will retry on next tool call
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
/**
|
|
200
|
-
* Start file watching on the active CodeGraph instance.
|
|
201
|
-
* Logs sync activity to stderr for diagnostics.
|
|
202
|
-
*/
|
|
203
|
-
startWatching() {
|
|
204
|
-
if (!this.cg)
|
|
205
|
-
return;
|
|
206
|
-
const started = this.cg.watch({
|
|
207
|
-
onSyncComplete: (result) => {
|
|
208
|
-
if (result.filesChanged > 0) {
|
|
209
|
-
process.stderr.write(`[CodeGraph MCP] Auto-synced ${result.filesChanged} file(s) in ${result.durationMs}ms\n`);
|
|
210
|
-
}
|
|
211
|
-
},
|
|
212
|
-
onSyncError: (err) => {
|
|
213
|
-
process.stderr.write(`[CodeGraph MCP] Auto-sync error: ${err.message}\n`);
|
|
214
|
-
},
|
|
215
|
-
});
|
|
216
|
-
if (started) {
|
|
217
|
-
process.stderr.write('[CodeGraph MCP] File watcher active — graph will auto-sync on changes\n');
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
/**
|
|
221
|
-
* Stop the server
|
|
222
|
-
*/
|
|
223
|
-
stop() {
|
|
224
|
-
// Close all cached cross-project connections first
|
|
225
|
-
this.toolHandler.closeAll();
|
|
226
|
-
// Close the main CodeGraph instance
|
|
227
|
-
if (this.cg) {
|
|
228
|
-
this.cg.close();
|
|
229
|
-
this.cg = null;
|
|
230
|
-
}
|
|
231
|
-
this.transport.stop();
|
|
232
|
-
process.exit(0);
|
|
233
|
-
}
|
|
234
|
-
/**
|
|
235
|
-
* Handle incoming JSON-RPC messages
|
|
236
|
-
*/
|
|
237
|
-
async handleMessage(message) {
|
|
238
|
-
// Check if it's a request (has id) or notification (no id)
|
|
239
|
-
const isRequest = 'id' in message;
|
|
240
|
-
switch (message.method) {
|
|
241
|
-
case 'initialize':
|
|
242
|
-
if (isRequest) {
|
|
243
|
-
await this.handleInitialize(message);
|
|
244
|
-
}
|
|
245
|
-
break;
|
|
246
|
-
case 'initialized':
|
|
247
|
-
// Notification that client has finished initialization
|
|
248
|
-
// No action needed - the client is ready
|
|
249
|
-
break;
|
|
250
|
-
case 'tools/list':
|
|
251
|
-
if (isRequest) {
|
|
252
|
-
await this.handleToolsList(message);
|
|
253
|
-
}
|
|
254
|
-
break;
|
|
255
|
-
case 'tools/call':
|
|
256
|
-
if (isRequest) {
|
|
257
|
-
await this.handleToolsCall(message);
|
|
258
|
-
}
|
|
259
|
-
break;
|
|
260
|
-
case 'ping':
|
|
261
|
-
if (isRequest) {
|
|
262
|
-
this.transport.sendResult(message.id, {});
|
|
263
|
-
}
|
|
264
|
-
break;
|
|
265
|
-
default:
|
|
266
|
-
if (isRequest) {
|
|
267
|
-
this.transport.sendError(message.id, transport_1.ErrorCodes.MethodNotFound, `Method not found: ${message.method}`);
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
/**
|
|
272
|
-
* Handle initialize request
|
|
273
|
-
*/
|
|
274
|
-
async handleInitialize(request) {
|
|
275
|
-
const params = request.params;
|
|
276
|
-
// Extract project path from rootUri or workspaceFolders
|
|
277
|
-
let projectPath = this.projectPath;
|
|
278
|
-
if (params?.rootUri) {
|
|
279
|
-
projectPath = fileUriToPath(params.rootUri);
|
|
280
|
-
}
|
|
281
|
-
else if (params?.workspaceFolders?.[0]?.uri) {
|
|
282
|
-
projectPath = fileUriToPath(params.workspaceFolders[0].uri);
|
|
283
|
-
}
|
|
284
|
-
// Fall back to current working directory if no path provided
|
|
285
|
-
if (!projectPath) {
|
|
286
|
-
projectPath = process.cwd();
|
|
287
|
-
}
|
|
288
|
-
// Respond to the handshake BEFORE doing any heavy initialization. Loading
|
|
289
|
-
// the SQLite DB and the tree-sitter WASM runtime can take many seconds on
|
|
290
|
-
// slow filesystems (Docker Desktop VirtioFS on macOS, WSL2). Clients like
|
|
291
|
-
// Claude Code time out the handshake at ~30s, which manifested as
|
|
292
|
-
// "MCP tools never appear" — the child was alive and had received the
|
|
293
|
-
// initialize but was still awaiting initGrammars(). See issue #172.
|
|
294
|
-
//
|
|
295
|
-
// We accept the client's protocol version but respond with our supported
|
|
296
|
-
// version. The `instructions` field is surfaced by MCP clients in the
|
|
297
|
-
// agent's system prompt automatically — it's the right place for the
|
|
298
|
-
// universal tool-selection playbook, ahead of individual tool descriptions.
|
|
299
|
-
this.transport.sendResult(request.id, {
|
|
300
|
-
protocolVersion: PROTOCOL_VERSION,
|
|
301
|
-
capabilities: {
|
|
302
|
-
tools: {},
|
|
303
|
-
},
|
|
304
|
-
serverInfo: SERVER_INFO,
|
|
305
|
-
instructions: server_instructions_1.SERVER_INSTRUCTIONS,
|
|
306
|
-
});
|
|
307
|
-
// Kick off the default-project init in the background. Tool calls that
|
|
308
|
-
// arrive before it finishes will see the "not initialized yet" path and
|
|
309
|
-
// fall through to `retryInitIfNeeded`, which now waits for this promise
|
|
310
|
-
// rather than racing against it with a second open.
|
|
311
|
-
this.initPromise = this.tryInitializeDefault(projectPath).finally(() => {
|
|
312
|
-
this.initPromise = null;
|
|
313
|
-
});
|
|
314
|
-
}
|
|
315
|
-
/**
|
|
316
|
-
* Handle tools/list request
|
|
317
|
-
*/
|
|
318
|
-
async handleToolsList(request) {
|
|
319
|
-
await this.retryInitIfNeeded();
|
|
320
|
-
this.transport.sendResult(request.id, {
|
|
321
|
-
tools: this.toolHandler.getTools(),
|
|
322
|
-
});
|
|
323
|
-
}
|
|
324
|
-
/**
|
|
325
|
-
* Handle tools/call request
|
|
326
|
-
*/
|
|
327
|
-
async handleToolsCall(request) {
|
|
328
|
-
const params = request.params;
|
|
329
|
-
if (!params || !params.name) {
|
|
330
|
-
this.transport.sendError(request.id, transport_1.ErrorCodes.InvalidParams, 'Missing tool name');
|
|
331
|
-
return;
|
|
332
|
-
}
|
|
333
|
-
const toolName = params.name;
|
|
334
|
-
const toolArgs = params.arguments || {};
|
|
335
|
-
// Validate tool exists
|
|
336
|
-
const tool = tools_1.tools.find(t => t.name === toolName);
|
|
337
|
-
if (!tool) {
|
|
338
|
-
this.transport.sendError(request.id, transport_1.ErrorCodes.InvalidParams, `Unknown tool: ${toolName}`);
|
|
339
|
-
return;
|
|
340
|
-
}
|
|
341
|
-
// If the default project isn't initialized yet, retry in case it was
|
|
342
|
-
// initialized after the MCP server started (e.g. user ran codegraph init)
|
|
343
|
-
await this.retryInitIfNeeded();
|
|
344
|
-
const result = await this.toolHandler.execute(toolName, toolArgs);
|
|
345
|
-
this.transport.sendResult(request.id, result);
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
exports.MCPServer = MCPServer;
|
|
349
|
-
// Export for use in CLI
|
|
350
|
-
var transport_2 = require("./transport");
|
|
351
|
-
Object.defineProperty(exports, "StdioTransport", { enumerable: true, get: function () { return transport_2.StdioTransport; } });
|
|
352
|
-
var tools_2 = require("./tools");
|
|
353
|
-
Object.defineProperty(exports, "tools", { enumerable: true, get: function () { return tools_2.tools; } });
|
|
354
|
-
Object.defineProperty(exports, "ToolHandler", { enumerable: true, get: function () { return tools_2.ToolHandler; } });
|
|
355
|
-
//# sourceMappingURL=index.js.map
|
package/dist/mcp/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,2CAA6B;AAC7B,kDAA+D;AAC/D,2CAA8F;AAC9F,mCAA6C;AAC7C,+DAA4D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vB,MAAM,IAAI,GAAG,aAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC;QAClD,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,IAAI,CAAC,SAAS,CAAC,SAAS,CACtB,OAAO,CAAC,EAAE,EACV,sBAAU,CAAC,aAAa,EACxB,iBAAiB,QAAQ,EAAE,CAC5B,CAAC;YACF,OAAO;QACT,CAAC;QAED,qEAAqE;QACrE,0EAA0E;QAC1E,MAAM,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAE/B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAElE,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;IAChD,CAAC;CACF;AAzSD,8BAySC;AAED,wBAAwB;AACxB,yCAA6C;AAApC,2GAAA,cAAc,OAAA;AACvB,iCAA6C;AAApC,8FAAA,KAAK,OAAA;AAAE,oGAAA,WAAW,OAAA"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Server-level instructions emitted in the MCP `initialize` response.
|
|
3
|
-
*
|
|
4
|
-
* MCP clients (Claude Code, Cursor, opencode, LangChain, OpenAI Agent
|
|
5
|
-
* SDK, …) surface this text in the agent's system prompt automatically,
|
|
6
|
-
* giving the agent a high-level playbook for the codegraph toolset
|
|
7
|
-
* before it sees individual tool descriptions.
|
|
8
|
-
*
|
|
9
|
-
* Goals when editing this:
|
|
10
|
-
* - Tool selection by intent (which tool for which question)
|
|
11
|
-
* - Common chains (refactor planning = X then Y)
|
|
12
|
-
* - Anti-patterns (don't grep when codegraph_search is faster)
|
|
13
|
-
*
|
|
14
|
-
* Keep it tight. The agent reads this every session — long instructions
|
|
15
|
-
* burn tokens. Reference only tools that exist on `main`; gate any
|
|
16
|
-
* conditional tools behind feature checks if/when they ship.
|
|
17
|
-
*/
|
|
18
|
-
export declare const SERVER_INSTRUCTIONS = "# Codegraph \u2014 code intelligence over an indexed knowledge graph\n\nCodegraph is a SQLite knowledge graph of every symbol, edge, and file\nin the workspace. Reads are sub-millisecond; the index lags writes by\nabout a second through the file watcher. Consult it BEFORE writing or\nediting code, not during.\n\n## Tool selection by intent\n\n- **\"What is the symbol named X?\"** \u2192 `codegraph_search`\n- **\"What's the deal with this task / feature / area?\"** \u2192 `codegraph_context` (PRIMARY \u2014 composes search + node + callers + callees in one call)\n- **\"What calls this?\"** \u2192 `codegraph_callers`\n- **\"What does this call?\"** \u2192 `codegraph_callees`\n- **\"What would changing this break?\"** \u2192 `codegraph_impact`\n- **\"Show me this symbol's source / signature / docstring.\"** \u2192 `codegraph_node`\n- **\"Survey an unfamiliar topic / pattern / module.\"** \u2192 `codegraph_explore` (heavier; deep dive)\n- **\"What's in directory X?\"** \u2192 `codegraph_files`\n- **\"Is the index ready / what's its size?\"** \u2192 `codegraph_status`\n\n## Common chains\n\n- **Onboarding**: `codegraph_context` first. If still unclear, `codegraph_explore` for breadth, then `codegraph_node` on specific symbols.\n- **Refactor planning**: `codegraph_search` \u2192 `codegraph_callers` \u2192 `codegraph_impact`. The blast-radius answer comes from impact, not from walking callers manually.\n- **Debugging a regression**: `codegraph_callers` of the suspected symbol; widen with `codegraph_impact` if an unexpected call appears.\n\n## Anti-patterns\n\n- **Don't grep first** when looking up a symbol by name \u2014 `codegraph_search` is faster and returns kind + location + signature.\n- **Don't chain `codegraph_search` + `codegraph_node`** when you just want context \u2014 `codegraph_context` is one round-trip.\n- **Don't use `codegraph_explore` for narrow questions** \u2014 it's a multi-call deep dive, expensive in tokens. Save it for genuine \"I'm new here\" surveys.\n- **Don't query the index immediately after editing a file** \u2014 the watcher needs ~500ms to debounce + sync. Wait for the next turn.\n\n## Limitations\n\n- Index lags file writes by ~1 second.\n- Cross-file resolution is best-effort name matching; ambiguous calls may return multiple candidates.\n- No live correctness validation \u2014 that's still the TypeScript compiler / test suite / linter's job. Codegraph supplements those with structural context they don't have.\n";
|
|
19
|
-
//# sourceMappingURL=server-instructions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server-instructions.d.ts","sourceRoot":"","sources":["../../src/mcp/server-instructions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,mBAAmB,s7EAqC/B,CAAC"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SERVER_INSTRUCTIONS = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Server-level instructions emitted in the MCP `initialize` response.
|
|
6
|
-
*
|
|
7
|
-
* MCP clients (Claude Code, Cursor, opencode, LangChain, OpenAI Agent
|
|
8
|
-
* SDK, …) surface this text in the agent's system prompt automatically,
|
|
9
|
-
* giving the agent a high-level playbook for the codegraph toolset
|
|
10
|
-
* before it sees individual tool descriptions.
|
|
11
|
-
*
|
|
12
|
-
* Goals when editing this:
|
|
13
|
-
* - Tool selection by intent (which tool for which question)
|
|
14
|
-
* - Common chains (refactor planning = X then Y)
|
|
15
|
-
* - Anti-patterns (don't grep when codegraph_search is faster)
|
|
16
|
-
*
|
|
17
|
-
* Keep it tight. The agent reads this every session — long instructions
|
|
18
|
-
* burn tokens. Reference only tools that exist on `main`; gate any
|
|
19
|
-
* conditional tools behind feature checks if/when they ship.
|
|
20
|
-
*/
|
|
21
|
-
exports.SERVER_INSTRUCTIONS = `# Codegraph — code intelligence over an indexed knowledge graph
|
|
22
|
-
|
|
23
|
-
Codegraph is a SQLite knowledge graph of every symbol, edge, and file
|
|
24
|
-
in the workspace. Reads are sub-millisecond; the index lags writes by
|
|
25
|
-
about a second through the file watcher. Consult it BEFORE writing or
|
|
26
|
-
editing code, not during.
|
|
27
|
-
|
|
28
|
-
## Tool selection by intent
|
|
29
|
-
|
|
30
|
-
- **"What is the symbol named X?"** → \`codegraph_search\`
|
|
31
|
-
- **"What's the deal with this task / feature / area?"** → \`codegraph_context\` (PRIMARY — composes search + node + callers + callees in one call)
|
|
32
|
-
- **"What calls this?"** → \`codegraph_callers\`
|
|
33
|
-
- **"What does this call?"** → \`codegraph_callees\`
|
|
34
|
-
- **"What would changing this break?"** → \`codegraph_impact\`
|
|
35
|
-
- **"Show me this symbol's source / signature / docstring."** → \`codegraph_node\`
|
|
36
|
-
- **"Survey an unfamiliar topic / pattern / module."** → \`codegraph_explore\` (heavier; deep dive)
|
|
37
|
-
- **"What's in directory X?"** → \`codegraph_files\`
|
|
38
|
-
- **"Is the index ready / what's its size?"** → \`codegraph_status\`
|
|
39
|
-
|
|
40
|
-
## Common chains
|
|
41
|
-
|
|
42
|
-
- **Onboarding**: \`codegraph_context\` first. If still unclear, \`codegraph_explore\` for breadth, then \`codegraph_node\` on specific symbols.
|
|
43
|
-
- **Refactor planning**: \`codegraph_search\` → \`codegraph_callers\` → \`codegraph_impact\`. The blast-radius answer comes from impact, not from walking callers manually.
|
|
44
|
-
- **Debugging a regression**: \`codegraph_callers\` of the suspected symbol; widen with \`codegraph_impact\` if an unexpected call appears.
|
|
45
|
-
|
|
46
|
-
## Anti-patterns
|
|
47
|
-
|
|
48
|
-
- **Don't grep first** when looking up a symbol by name — \`codegraph_search\` is faster and returns kind + location + signature.
|
|
49
|
-
- **Don't chain \`codegraph_search\` + \`codegraph_node\`** when you just want context — \`codegraph_context\` is one round-trip.
|
|
50
|
-
- **Don't use \`codegraph_explore\` for narrow questions** — it's a multi-call deep dive, expensive in tokens. Save it for genuine "I'm new here" surveys.
|
|
51
|
-
- **Don't query the index immediately after editing a file** — the watcher needs ~500ms to debounce + sync. Wait for the next turn.
|
|
52
|
-
|
|
53
|
-
## Limitations
|
|
54
|
-
|
|
55
|
-
- Index lags file writes by ~1 second.
|
|
56
|
-
- Cross-file resolution is best-effort name matching; ambiguous calls may return multiple candidates.
|
|
57
|
-
- No live correctness validation — that's still the TypeScript compiler / test suite / linter's job. Codegraph supplements those with structural context they don't have.
|
|
58
|
-
`;
|
|
59
|
-
//# sourceMappingURL=server-instructions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server-instructions.js","sourceRoot":"","sources":["../../src/mcp/server-instructions.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;GAgBG;AACU,QAAA,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqClC,CAAC"}
|