@colbymchenry/codegraph-darwin-arm64 0.9.4 → 0.9.6

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 (199) hide show
  1. package/lib/dist/bin/codegraph.js +12 -0
  2. package/lib/dist/bin/codegraph.js.map +1 -1
  3. package/lib/dist/db/queries.d.ts +1 -0
  4. package/lib/dist/db/queries.d.ts.map +1 -1
  5. package/lib/dist/db/queries.js +31 -3
  6. package/lib/dist/db/queries.js.map +1 -1
  7. package/lib/dist/extraction/grammars.d.ts +1 -1
  8. package/lib/dist/extraction/grammars.d.ts.map +1 -1
  9. package/lib/dist/extraction/grammars.js +29 -1
  10. package/lib/dist/extraction/grammars.js.map +1 -1
  11. package/lib/dist/extraction/index.d.ts +15 -2
  12. package/lib/dist/extraction/index.d.ts.map +1 -1
  13. package/lib/dist/extraction/index.js +170 -78
  14. package/lib/dist/extraction/index.js.map +1 -1
  15. package/lib/dist/extraction/languages/c-cpp.d.ts.map +1 -1
  16. package/lib/dist/extraction/languages/c-cpp.js +45 -0
  17. package/lib/dist/extraction/languages/c-cpp.js.map +1 -1
  18. package/lib/dist/extraction/languages/csharp.d.ts.map +1 -1
  19. package/lib/dist/extraction/languages/csharp.js +2 -1
  20. package/lib/dist/extraction/languages/csharp.js.map +1 -1
  21. package/lib/dist/extraction/languages/go.d.ts.map +1 -1
  22. package/lib/dist/extraction/languages/go.js +12 -0
  23. package/lib/dist/extraction/languages/go.js.map +1 -1
  24. package/lib/dist/extraction/languages/index.d.ts.map +1 -1
  25. package/lib/dist/extraction/languages/index.js +2 -0
  26. package/lib/dist/extraction/languages/index.js.map +1 -1
  27. package/lib/dist/extraction/languages/objc.d.ts +3 -0
  28. package/lib/dist/extraction/languages/objc.d.ts.map +1 -0
  29. package/lib/dist/extraction/languages/objc.js +133 -0
  30. package/lib/dist/extraction/languages/objc.js.map +1 -0
  31. package/lib/dist/extraction/mybatis-extractor.d.ts +48 -0
  32. package/lib/dist/extraction/mybatis-extractor.d.ts.map +1 -0
  33. package/lib/dist/extraction/mybatis-extractor.js +198 -0
  34. package/lib/dist/extraction/mybatis-extractor.js.map +1 -0
  35. package/lib/dist/extraction/tree-sitter-types.d.ts +4 -0
  36. package/lib/dist/extraction/tree-sitter-types.d.ts.map +1 -1
  37. package/lib/dist/extraction/tree-sitter.d.ts +33 -0
  38. package/lib/dist/extraction/tree-sitter.d.ts.map +1 -1
  39. package/lib/dist/extraction/tree-sitter.js +351 -14
  40. package/lib/dist/extraction/tree-sitter.js.map +1 -1
  41. package/lib/dist/index.d.ts +21 -2
  42. package/lib/dist/index.d.ts.map +1 -1
  43. package/lib/dist/index.js +53 -1
  44. package/lib/dist/index.js.map +1 -1
  45. package/lib/dist/installer/index.d.ts +1 -1
  46. package/lib/dist/installer/index.js +3 -3
  47. package/lib/dist/installer/index.js.map +1 -1
  48. package/lib/dist/installer/instructions-template.d.ts +2 -2
  49. package/lib/dist/installer/instructions-template.d.ts.map +1 -1
  50. package/lib/dist/installer/instructions-template.js +1 -1
  51. package/lib/dist/installer/targets/antigravity.d.ts +57 -0
  52. package/lib/dist/installer/targets/antigravity.d.ts.map +1 -0
  53. package/lib/dist/installer/targets/antigravity.js +307 -0
  54. package/lib/dist/installer/targets/antigravity.js.map +1 -0
  55. package/lib/dist/installer/targets/gemini.d.ts +26 -0
  56. package/lib/dist/installer/targets/gemini.d.ts.map +1 -0
  57. package/lib/dist/installer/targets/gemini.js +165 -0
  58. package/lib/dist/installer/targets/gemini.js.map +1 -0
  59. package/lib/dist/installer/targets/hermes.d.ts.map +1 -1
  60. package/lib/dist/installer/targets/hermes.js +57 -3
  61. package/lib/dist/installer/targets/hermes.js.map +1 -1
  62. package/lib/dist/installer/targets/kiro.d.ts +27 -0
  63. package/lib/dist/installer/targets/kiro.d.ts.map +1 -0
  64. package/lib/dist/installer/targets/kiro.js +196 -0
  65. package/lib/dist/installer/targets/kiro.js.map +1 -0
  66. package/lib/dist/installer/targets/registry.d.ts.map +1 -1
  67. package/lib/dist/installer/targets/registry.js +6 -0
  68. package/lib/dist/installer/targets/registry.js.map +1 -1
  69. package/lib/dist/installer/targets/types.d.ts +1 -1
  70. package/lib/dist/installer/targets/types.d.ts.map +1 -1
  71. package/lib/dist/mcp/daemon-paths.d.ts +46 -0
  72. package/lib/dist/mcp/daemon-paths.d.ts.map +1 -0
  73. package/lib/dist/mcp/daemon-paths.js +125 -0
  74. package/lib/dist/mcp/daemon-paths.js.map +1 -0
  75. package/lib/dist/mcp/daemon.d.ts +161 -0
  76. package/lib/dist/mcp/daemon.d.ts.map +1 -0
  77. package/lib/dist/mcp/daemon.js +403 -0
  78. package/lib/dist/mcp/daemon.js.map +1 -0
  79. package/lib/dist/mcp/engine.d.ts +100 -0
  80. package/lib/dist/mcp/engine.d.ts.map +1 -0
  81. package/lib/dist/mcp/engine.js +291 -0
  82. package/lib/dist/mcp/engine.js.map +1 -0
  83. package/lib/dist/mcp/index.d.ts +64 -53
  84. package/lib/dist/mcp/index.d.ts.map +1 -1
  85. package/lib/dist/mcp/index.js +307 -387
  86. package/lib/dist/mcp/index.js.map +1 -1
  87. package/lib/dist/mcp/proxy.d.ts +46 -0
  88. package/lib/dist/mcp/proxy.d.ts.map +1 -0
  89. package/lib/dist/mcp/proxy.js +276 -0
  90. package/lib/dist/mcp/proxy.js.map +1 -0
  91. package/lib/dist/mcp/server-instructions.d.ts +1 -1
  92. package/lib/dist/mcp/server-instructions.d.ts.map +1 -1
  93. package/lib/dist/mcp/server-instructions.js +1 -1
  94. package/lib/dist/mcp/session.d.ts +67 -0
  95. package/lib/dist/mcp/session.d.ts.map +1 -0
  96. package/lib/dist/mcp/session.js +276 -0
  97. package/lib/dist/mcp/session.js.map +1 -0
  98. package/lib/dist/mcp/tools.d.ts +49 -0
  99. package/lib/dist/mcp/tools.d.ts.map +1 -1
  100. package/lib/dist/mcp/tools.js +253 -17
  101. package/lib/dist/mcp/tools.js.map +1 -1
  102. package/lib/dist/mcp/transport.d.ts +111 -29
  103. package/lib/dist/mcp/transport.d.ts.map +1 -1
  104. package/lib/dist/mcp/transport.js +181 -71
  105. package/lib/dist/mcp/transport.js.map +1 -1
  106. package/lib/dist/mcp/version.d.ts +19 -0
  107. package/lib/dist/mcp/version.d.ts.map +1 -0
  108. package/lib/dist/mcp/version.js +71 -0
  109. package/lib/dist/mcp/version.js.map +1 -0
  110. package/lib/dist/resolution/callback-synthesizer.d.ts +3 -2
  111. package/lib/dist/resolution/callback-synthesizer.d.ts.map +1 -1
  112. package/lib/dist/resolution/callback-synthesizer.js +351 -3
  113. package/lib/dist/resolution/callback-synthesizer.js.map +1 -1
  114. package/lib/dist/resolution/frameworks/expo-modules.d.ts +3 -0
  115. package/lib/dist/resolution/frameworks/expo-modules.d.ts.map +1 -0
  116. package/lib/dist/resolution/frameworks/expo-modules.js +143 -0
  117. package/lib/dist/resolution/frameworks/expo-modules.js.map +1 -0
  118. package/lib/dist/resolution/frameworks/fabric.d.ts +3 -0
  119. package/lib/dist/resolution/frameworks/fabric.d.ts.map +1 -0
  120. package/lib/dist/resolution/frameworks/fabric.js +354 -0
  121. package/lib/dist/resolution/frameworks/fabric.js.map +1 -0
  122. package/lib/dist/resolution/frameworks/index.d.ts +4 -0
  123. package/lib/dist/resolution/frameworks/index.d.ts.map +1 -1
  124. package/lib/dist/resolution/frameworks/index.js +21 -1
  125. package/lib/dist/resolution/frameworks/index.js.map +1 -1
  126. package/lib/dist/resolution/frameworks/java.d.ts.map +1 -1
  127. package/lib/dist/resolution/frameworks/java.js +270 -1
  128. package/lib/dist/resolution/frameworks/java.js.map +1 -1
  129. package/lib/dist/resolution/frameworks/nestjs.d.ts.map +1 -1
  130. package/lib/dist/resolution/frameworks/nestjs.js +324 -0
  131. package/lib/dist/resolution/frameworks/nestjs.js.map +1 -1
  132. package/lib/dist/resolution/frameworks/react-native.d.ts +3 -0
  133. package/lib/dist/resolution/frameworks/react-native.d.ts.map +1 -0
  134. package/lib/dist/resolution/frameworks/react-native.js +360 -0
  135. package/lib/dist/resolution/frameworks/react-native.js.map +1 -0
  136. package/lib/dist/resolution/frameworks/swift-objc.d.ts +37 -0
  137. package/lib/dist/resolution/frameworks/swift-objc.d.ts.map +1 -0
  138. package/lib/dist/resolution/frameworks/swift-objc.js +252 -0
  139. package/lib/dist/resolution/frameworks/swift-objc.js.map +1 -0
  140. package/lib/dist/resolution/go-module.d.ts +26 -0
  141. package/lib/dist/resolution/go-module.d.ts.map +1 -0
  142. package/lib/dist/resolution/go-module.js +78 -0
  143. package/lib/dist/resolution/go-module.js.map +1 -0
  144. package/lib/dist/resolution/import-resolver.d.ts +18 -0
  145. package/lib/dist/resolution/import-resolver.d.ts.map +1 -1
  146. package/lib/dist/resolution/import-resolver.js +538 -4
  147. package/lib/dist/resolution/import-resolver.js.map +1 -1
  148. package/lib/dist/resolution/index.d.ts +10 -0
  149. package/lib/dist/resolution/index.d.ts.map +1 -1
  150. package/lib/dist/resolution/index.js +102 -0
  151. package/lib/dist/resolution/index.js.map +1 -1
  152. package/lib/dist/resolution/name-matcher.d.ts.map +1 -1
  153. package/lib/dist/resolution/name-matcher.js +212 -0
  154. package/lib/dist/resolution/name-matcher.js.map +1 -1
  155. package/lib/dist/resolution/swift-objc-bridge.d.ts +134 -0
  156. package/lib/dist/resolution/swift-objc-bridge.d.ts.map +1 -0
  157. package/lib/dist/resolution/swift-objc-bridge.js +256 -0
  158. package/lib/dist/resolution/swift-objc-bridge.js.map +1 -0
  159. package/lib/dist/resolution/types.d.ts +29 -0
  160. package/lib/dist/resolution/types.d.ts.map +1 -1
  161. package/lib/dist/sync/index.d.ts +3 -1
  162. package/lib/dist/sync/index.d.ts.map +1 -1
  163. package/lib/dist/sync/index.js +8 -1
  164. package/lib/dist/sync/index.js.map +1 -1
  165. package/lib/dist/sync/watcher.d.ts +119 -7
  166. package/lib/dist/sync/watcher.d.ts.map +1 -1
  167. package/lib/dist/sync/watcher.js +243 -37
  168. package/lib/dist/sync/watcher.js.map +1 -1
  169. package/lib/dist/sync/worktree.d.ts +54 -0
  170. package/lib/dist/sync/worktree.d.ts.map +1 -0
  171. package/lib/dist/sync/worktree.js +136 -0
  172. package/lib/dist/sync/worktree.js.map +1 -0
  173. package/lib/dist/types.d.ts +1 -1
  174. package/lib/dist/types.d.ts.map +1 -1
  175. package/lib/dist/types.js +3 -0
  176. package/lib/dist/types.js.map +1 -1
  177. package/lib/node_modules/.package-lock.json +29 -1
  178. package/lib/node_modules/chokidar/LICENSE +21 -0
  179. package/lib/node_modules/chokidar/README.md +305 -0
  180. package/lib/node_modules/chokidar/esm/handler.d.ts +90 -0
  181. package/lib/node_modules/chokidar/esm/handler.js +629 -0
  182. package/lib/node_modules/chokidar/esm/index.d.ts +215 -0
  183. package/lib/node_modules/chokidar/esm/index.js +798 -0
  184. package/lib/node_modules/chokidar/esm/package.json +1 -0
  185. package/lib/node_modules/chokidar/handler.d.ts +90 -0
  186. package/lib/node_modules/chokidar/handler.js +635 -0
  187. package/lib/node_modules/chokidar/index.d.ts +215 -0
  188. package/lib/node_modules/chokidar/index.js +804 -0
  189. package/lib/node_modules/chokidar/package.json +69 -0
  190. package/lib/node_modules/readdirp/LICENSE +21 -0
  191. package/lib/node_modules/readdirp/README.md +120 -0
  192. package/lib/node_modules/readdirp/esm/index.d.ts +108 -0
  193. package/lib/node_modules/readdirp/esm/index.js +257 -0
  194. package/lib/node_modules/readdirp/esm/package.json +1 -0
  195. package/lib/node_modules/readdirp/index.d.ts +108 -0
  196. package/lib/node_modules/readdirp/index.js +263 -0
  197. package/lib/node_modules/readdirp/package.json +70 -0
  198. package/lib/package.json +2 -1
  199. package/package.json +1 -1
@@ -0,0 +1,291 @@
1
+ "use strict";
2
+ /**
3
+ * MCP shared engine — the heavyweight, *shared* state for an MCP server:
4
+ * the project's {@link CodeGraph} instance, file watcher, and the
5
+ * {@link ToolHandler} cache for cross-project queries.
6
+ *
7
+ * One engine, many sessions:
8
+ * - direct mode (single stdio session) instantiates one engine + one session;
9
+ * - daemon mode instantiates one engine and a new session per socket
10
+ * connection. Every session reads from the same SQLite WAL and the same
11
+ * inotify watch set — that's the entire point of issue #411.
12
+ */
13
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ var desc = Object.getOwnPropertyDescriptor(m, k);
16
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
+ desc = { enumerable: true, get: function() { return m[k]; } };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || (function () {
30
+ var ownKeys = function(o) {
31
+ ownKeys = Object.getOwnPropertyNames || function (o) {
32
+ var ar = [];
33
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
34
+ return ar;
35
+ };
36
+ return ownKeys(o);
37
+ };
38
+ return function (mod) {
39
+ if (mod && mod.__esModule) return mod;
40
+ var result = {};
41
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
42
+ __setModuleDefault(result, mod);
43
+ return result;
44
+ };
45
+ })();
46
+ Object.defineProperty(exports, "__esModule", { value: true });
47
+ exports.MCPEngine = void 0;
48
+ exports.parseDebounceEnv = parseDebounceEnv;
49
+ const index_1 = __importStar(require("../index"));
50
+ const sync_1 = require("../sync");
51
+ const tools_1 = require("./tools");
52
+ /**
53
+ * Shared MCP engine. Thread-safe in the sense that multiple sessions can
54
+ * call its methods concurrently — internally it serializes initialization
55
+ * through a single promise so multiple sessions racing each other on first
56
+ * connect never double-open the SQLite file.
57
+ */
58
+ class MCPEngine {
59
+ cg = null;
60
+ toolHandler;
61
+ // Project root we resolved to. Null until `ensureInitialized` succeeds
62
+ // (or null forever if no .codegraph/ ever turned up — that's a valid
63
+ // state for the engine, since cross-project queries still work).
64
+ projectPath = null;
65
+ // Set on first `ensureInitialized` so subsequent sessions don't redo work.
66
+ initPromise = null;
67
+ watcherStarted = false;
68
+ opts;
69
+ closed = false;
70
+ constructor(opts = {}) {
71
+ this.opts = { watch: opts.watch ?? true };
72
+ this.toolHandler = new tools_1.ToolHandler(null);
73
+ }
74
+ /**
75
+ * Convenience for {@link MCPServer} compatibility: pre-seed an explicit
76
+ * project path (from the `--path` CLI flag) without yet opening it. This
77
+ * keeps the synchronous constructor cheap; the actual open happens on the
78
+ * first `ensureInitialized` call.
79
+ */
80
+ setProjectPathHint(projectPath) {
81
+ this.projectPath = projectPath;
82
+ this.toolHandler.setDefaultProjectHint(projectPath);
83
+ }
84
+ /** Project root that the engine resolved on first init (null if none). */
85
+ getProjectPath() {
86
+ return this.projectPath;
87
+ }
88
+ /** Shared ToolHandler — sessions delegate tool dispatch through this. */
89
+ getToolHandler() {
90
+ return this.toolHandler;
91
+ }
92
+ /** Whether the default project's CodeGraph is open. */
93
+ hasDefaultCodeGraph() {
94
+ return this.toolHandler.hasDefaultCodeGraph();
95
+ }
96
+ /**
97
+ * Walk up from `searchFrom` to find the nearest `.codegraph/` and open it.
98
+ * Idempotent: concurrent callers share one in-flight init; subsequent
99
+ * callers after success are no-ops.
100
+ *
101
+ * The original `MCPServer.tryInitializeDefault` carried the same retry-on-
102
+ * subsequent-tool-call semantics; we preserve them by NOT throwing when the
103
+ * search misses (just leaves `cg` null so the next call can retry).
104
+ */
105
+ async ensureInitialized(searchFrom) {
106
+ if (this.closed)
107
+ return;
108
+ if (this.toolHandler.hasDefaultCodeGraph())
109
+ return;
110
+ if (this.initPromise) {
111
+ try {
112
+ await this.initPromise;
113
+ }
114
+ catch { /* let caller retry */ }
115
+ return;
116
+ }
117
+ this.initPromise = this.doInitialize(searchFrom).finally(() => {
118
+ this.initPromise = null;
119
+ });
120
+ try {
121
+ await this.initPromise;
122
+ }
123
+ catch {
124
+ // Init errors are logged inside `doInitialize`; falling through here
125
+ // matches MCPServer's previous "retry on next tool call" behavior.
126
+ }
127
+ }
128
+ /**
129
+ * Synchronous last-resort init used by the per-session retry loop when the
130
+ * background `ensureInitialized` already finished (or failed) and we need
131
+ * to pick up a project that appeared *after* the engine started.
132
+ */
133
+ retryInitializeSync(searchFrom) {
134
+ if (this.closed)
135
+ return;
136
+ if (this.toolHandler.hasDefaultCodeGraph())
137
+ return;
138
+ this.toolHandler.setDefaultProjectHint(searchFrom);
139
+ const resolvedRoot = (0, index_1.findNearestCodeGraphRoot)(searchFrom);
140
+ if (!resolvedRoot)
141
+ return;
142
+ try {
143
+ // Close any previously failed instance to avoid leaking resources.
144
+ if (this.cg) {
145
+ try {
146
+ this.cg.close();
147
+ }
148
+ catch { /* ignore */ }
149
+ this.cg = null;
150
+ }
151
+ this.cg = index_1.default.openSync(resolvedRoot);
152
+ this.projectPath = resolvedRoot;
153
+ this.toolHandler.setDefaultCodeGraph(this.cg);
154
+ this.startWatching();
155
+ this.catchUpSync();
156
+ }
157
+ catch {
158
+ // Still failing — caller will try again on the next tool call.
159
+ }
160
+ }
161
+ /**
162
+ * Close everything. Used on graceful daemon shutdown (SIGTERM/idle timeout)
163
+ * and on direct-mode stop. Idempotent.
164
+ */
165
+ stop() {
166
+ if (this.closed)
167
+ return;
168
+ this.closed = true;
169
+ this.toolHandler.closeAll();
170
+ if (this.cg) {
171
+ try {
172
+ this.cg.close();
173
+ }
174
+ catch { /* ignore */ }
175
+ this.cg = null;
176
+ }
177
+ }
178
+ async doInitialize(searchFrom) {
179
+ this.toolHandler.setDefaultProjectHint(searchFrom);
180
+ const resolvedRoot = (0, index_1.findNearestCodeGraphRoot)(searchFrom);
181
+ if (!resolvedRoot) {
182
+ // No .codegraph/ above searchFrom — that's not an error, sessions may
183
+ // still discover one later via roots/list.
184
+ this.projectPath = searchFrom;
185
+ return;
186
+ }
187
+ this.projectPath = resolvedRoot;
188
+ try {
189
+ this.cg = await index_1.default.open(resolvedRoot);
190
+ this.toolHandler.setDefaultCodeGraph(this.cg);
191
+ this.startWatching();
192
+ this.catchUpSync();
193
+ }
194
+ catch (err) {
195
+ const msg = err instanceof Error ? err.message : String(err);
196
+ process.stderr.write(`[CodeGraph MCP] Failed to open project at ${resolvedRoot}: ${msg}\n`);
197
+ }
198
+ }
199
+ /**
200
+ * Start file watching on the active CodeGraph instance. Idempotent — the
201
+ * watcher is per-engine, not per-session, which is why the daemon path
202
+ * collapses N inotify sets to one. The wording of the disabled-reason log
203
+ * exactly matches the prior in-tree implementation so log-driven dashboards
204
+ * keep working.
205
+ */
206
+ startWatching() {
207
+ if (!this.cg || this.watcherStarted || !this.opts.watch)
208
+ return;
209
+ const disabledReason = (0, sync_1.watchDisabledReason)(this.projectPath ?? process.cwd());
210
+ if (disabledReason) {
211
+ process.stderr.write(`[CodeGraph MCP] File watcher disabled — ${disabledReason}. ` +
212
+ `The graph will not auto-update; run \`codegraph sync\` (or install the git sync hooks via \`codegraph init\`) to refresh.\n`);
213
+ this.watcherStarted = true;
214
+ return;
215
+ }
216
+ // Optional override for the debounce window via env var (issue #403).
217
+ // Useful for workspaces with bursty writes (formatter-on-save chains,
218
+ // large generated outputs) where the 2s default fires too often. Clamped
219
+ // to [100ms, 60s]; out-of-range / non-numeric values fall back to the
220
+ // FileWatcher default. We log the active value so it's discoverable.
221
+ const debounceMs = parseDebounceEnv(process.env.CODEGRAPH_WATCH_DEBOUNCE_MS);
222
+ if (debounceMs !== undefined) {
223
+ process.stderr.write(`[CodeGraph MCP] File watcher debounce: ${debounceMs}ms (CODEGRAPH_WATCH_DEBOUNCE_MS)\n`);
224
+ }
225
+ const started = this.cg.watch({
226
+ debounceMs,
227
+ onSyncComplete: (result) => {
228
+ if (result.filesChanged > 0) {
229
+ process.stderr.write(`[CodeGraph MCP] Auto-synced ${result.filesChanged} file(s) in ${result.durationMs}ms\n`);
230
+ }
231
+ },
232
+ onSyncError: (err) => {
233
+ process.stderr.write(`[CodeGraph MCP] Auto-sync error: ${err.message}\n`);
234
+ },
235
+ });
236
+ this.watcherStarted = true;
237
+ if (started) {
238
+ process.stderr.write('[CodeGraph MCP] File watcher active — graph will auto-sync on changes\n');
239
+ }
240
+ else {
241
+ process.stderr.write('[CodeGraph MCP] File watcher unavailable on this platform — run `codegraph sync` to refresh the graph after changes.\n');
242
+ }
243
+ }
244
+ /**
245
+ * Reconcile the index with the current filesystem once, right after open —
246
+ * catches edits, adds, deletes, and `git pull`/`checkout` changes made while
247
+ * no watcher was running. Background, never awaited.
248
+ */
249
+ catchUpSync() {
250
+ const cg = this.cg;
251
+ if (!cg)
252
+ return;
253
+ void cg
254
+ .sync()
255
+ .then((result) => {
256
+ const changed = result.filesAdded + result.filesModified + result.filesRemoved;
257
+ if (changed > 0) {
258
+ process.stderr.write(`[CodeGraph MCP] Caught up ${changed} file(s) changed since last run\n`);
259
+ }
260
+ })
261
+ .catch((err) => {
262
+ const msg = err instanceof Error ? err.message : String(err);
263
+ process.stderr.write(`[CodeGraph MCP] Catch-up sync failed: ${msg}\n`);
264
+ });
265
+ }
266
+ }
267
+ exports.MCPEngine = MCPEngine;
268
+ /**
269
+ * Parse and clamp the CODEGRAPH_WATCH_DEBOUNCE_MS env override.
270
+ *
271
+ * Issue #403: workspaces with bursty writes (formatter-on-save, multi-file
272
+ * refactors) sometimes want a longer quiet window before sync. Returns
273
+ * `undefined` for unset / empty / non-numeric / out-of-range values so the
274
+ * FileWatcher default (2000ms) takes over — never throws.
275
+ *
276
+ * Clamp range: 100ms (faster would mean a sync per keystroke) to 60s (longer
277
+ * and the watcher feels broken). Out-of-range values are treated as "ignore
278
+ * this misconfiguration" rather than capped, since silently capping a 0 or
279
+ * a typoed value would mask a real config bug.
280
+ */
281
+ function parseDebounceEnv(raw) {
282
+ if (!raw || !raw.trim())
283
+ return undefined;
284
+ const n = Number(raw);
285
+ if (!Number.isFinite(n) || !Number.isInteger(n))
286
+ return undefined;
287
+ if (n < 100 || n > 60000)
288
+ return undefined;
289
+ return n;
290
+ }
291
+ //# sourceMappingURL=engine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine.js","sourceRoot":"","sources":["../../src/mcp/engine.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuPH,4CAMC;AA3PD,kDAA+D;AAC/D,kCAA8C;AAC9C,mCAAsC;AAWtC;;;;;GAKG;AACH,MAAa,SAAS;IACZ,EAAE,GAAqB,IAAI,CAAC;IAC5B,WAAW,CAAc;IACjC,uEAAuE;IACvE,qEAAqE;IACrE,iEAAiE;IACzD,WAAW,GAAkB,IAAI,CAAC;IAC1C,2EAA2E;IACnE,WAAW,GAAyB,IAAI,CAAC;IACzC,cAAc,GAAG,KAAK,CAAC;IACvB,IAAI,CAA6B;IACjC,MAAM,GAAG,KAAK,CAAC;IAEvB,YAAY,OAAyB,EAAE;QACrC,IAAI,CAAC,IAAI,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,IAAI,EAAE,CAAC;QAC1C,IAAI,CAAC,WAAW,GAAG,IAAI,mBAAW,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAED;;;;;OAKG;IACH,kBAAkB,CAAC,WAAmB;QACpC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,WAAW,CAAC,qBAAqB,CAAC,WAAW,CAAC,CAAC;IACtD,CAAC;IAED,0EAA0E;IAC1E,cAAc;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,yEAAyE;IACzE,cAAc;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,uDAAuD;IACvD,mBAAmB;QACjB,OAAO,IAAI,CAAC,WAAW,CAAC,mBAAmB,EAAE,CAAC;IAChD,CAAC;IA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,8BAmNC;AAED;;;;;;;;;;;;GAYG;AACH,SAAgB,gBAAgB,CAAC,GAAuB;IACtD,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE;QAAE,OAAO,SAAS,CAAC;IAC1C,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IACtB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;QAAE,OAAO,SAAS,CAAC;IAClE,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,KAAK;QAAE,OAAO,SAAS,CAAC;IAC3C,OAAO,CAAC,CAAC;AACX,CAAC"}
@@ -13,86 +13,97 @@
13
13
  * const server = new MCPServer('/path/to/project');
14
14
  * await server.start();
15
15
  * ```
16
+ *
17
+ * Runtime modes (decided in {@link MCPServer.start}):
18
+ *
19
+ * - **Direct** — one process serves one MCP client over stdio. The pre-#411
20
+ * behavior; used when the user opts out (`CODEGRAPH_NO_DAEMON=1`), no
21
+ * `.codegraph/` is reachable, or the daemon machinery fails for any reason.
22
+ * - **Proxy** — what an MCP host actually talks to when sharing is on: a thin
23
+ * stdio↔socket pipe to the shared daemon. The proxy carries the #277 PPID
24
+ * watchdog, so a SIGKILL'd host reaps its proxy promptly. See {@link ./proxy.ts}.
25
+ * - **Daemon** — a *detached* background process (its own session/process
26
+ * group) that serves N proxies over a Unix-domain socket / named pipe,
27
+ * sharing one CodeGraph + watcher + SQLite handle. Spawned on demand; never a
28
+ * child of any host, so it survives individual sessions and is reaped by
29
+ * client-refcount + idle timeout. See {@link ./daemon.ts} and issue #411.
30
+ *
31
+ * The detached-daemon + always-proxy split is the fix for the review finding
32
+ * that the original in-process daemon (a) was the first host's child, so closing
33
+ * that terminal severed every other client, and (b) disabled the PPID watchdog,
34
+ * regressing #277 (orphaned daemons on host SIGKILL).
16
35
  */
17
36
  /**
18
37
  * MCP Server for CodeGraph
19
38
  *
20
39
  * Implements the Model Context Protocol to expose CodeGraph
21
40
  * functionality as tools that can be called by AI assistants.
41
+ *
42
+ * Backwards-compatible constructor and `start()` signature with the
43
+ * pre-issue-#411 implementation: callers continue to do
44
+ * `new MCPServer(path).start()`. Internally we now pick from direct / proxy /
45
+ * daemon at start time.
22
46
  */
23
47
  export declare class MCPServer {
24
- private transport;
25
- private cg;
26
- private toolHandler;
27
48
  private projectPath;
28
- private initPromise;
29
- private clientSupportsRoots;
30
- private rootsAttempted;
49
+ private session;
50
+ private engine;
51
+ private daemon;
52
+ private ppidWatchdog;
31
53
  private originalPpid;
32
54
  private hostPpid;
33
- private ppidWatchdog;
34
55
  private stopped;
56
+ private mode;
35
57
  constructor(projectPath?: string);
36
58
  /**
37
- * Start the MCP server
59
+ * Start the MCP server.
38
60
  *
39
- * Note: CodeGraph initialization is deferred until the initialize request
40
- * is received, which includes the rootUri from the client.
41
- */
42
- start(): Promise<void>;
43
- /**
44
- * Try to initialize CodeGraph for the default project.
61
+ * Decision order:
62
+ * 1. `CODEGRAPH_NO_DAEMON=1` direct mode (unchanged pre-#411 behavior).
63
+ * 2. `CODEGRAPH_DAEMON_INTERNAL=1` → we ARE the detached daemon; listen.
64
+ * 3. No `.codegraph/` reachable → direct mode (the daemon's lockfile and
65
+ * socket both live under `.codegraph/`).
66
+ * 4. Otherwise connect to (or spawn) the shared daemon and proxy to it.
45
67
  *
46
- * Walks up parent directories to find the nearest .codegraph/ folder,
47
- * similar to how git finds .git/ directories.
48
- *
49
- * If initialization fails, the error is recorded but the server continues
50
- * to work — cross-project queries and retries on subsequent tool calls
51
- * are still possible.
68
+ * On any unexpected failure in step 4 we transparently fall back to direct
69
+ * mode a misbehaving daemon must never block a session from starting.
52
70
  */
53
- private tryInitializeDefault;
54
- /**
55
- * Retry initialization of the default project if it previously failed.
56
- * Called lazily on tool calls that need the default project.
57
- * Re-walks parent directories each time so it picks up projects
58
- * initialized after the MCP server started.
59
- *
60
- * Awaits any in-flight background init (kicked off by handleInitialize) so
61
- * we never open the SQLite file twice concurrently.
62
- */
63
- private retryInitIfNeeded;
64
- /**
65
- * Resolve the project root via the MCP `roots/list` request and initialize
66
- * from the first root the client reports. Falls back to the process cwd if
67
- * the client returns no usable root or doesn't answer in time. See issue #196.
68
- */
69
- private initFromRoots;
70
- /**
71
- * Start file watching on the active CodeGraph instance.
72
- * Logs sync activity to stderr for diagnostics.
73
- */
74
- private startWatching;
71
+ start(): Promise<void>;
75
72
  /**
76
- * Stop the server
73
+ * Stop the server. In daemon mode this triggers graceful shutdown of every
74
+ * connected session; in direct mode it mirrors the pre-#411 behavior (close
75
+ * cg, exit). Proxy mode never routes through here — the proxy exits itself.
77
76
  */
78
77
  stop(): void;
78
+ /** Single-process stdio MCP session — the pre-issue-#411 code path. */
79
+ private startDirect;
79
80
  /**
80
- * Handle incoming JSON-RPC messages
81
- */
82
- private handleMessage;
83
- /**
84
- * Handle initialize request
81
+ * Run as the detached shared daemon (process spawned with
82
+ * `CODEGRAPH_DAEMON_INTERNAL=1`). Arbitrate the O_EXCL lock, then either
83
+ * become the daemon (bind the socket, serve forever) or — if a live daemon
84
+ * already holds the lock — exit so we don't leak a redundant process.
85
+ *
86
+ * No PPID watchdog and no stdin handlers: the daemon is detached on purpose
87
+ * and reaps itself via client-refcount + idle timeout (see {@link Daemon}).
85
88
  */
86
- private handleInitialize;
89
+ private startDaemonProcess;
87
90
  /**
88
- * Handle tools/list request
91
+ * Become a proxy to the shared daemon, spawning the daemon first if none is
92
+ * reachable. Returns 'proxy' once the proxied session has run to completion
93
+ * (the host disconnected), or 'fallback' if the caller should run in-process.
89
94
  */
90
- private handleToolsList;
95
+ private connectOrSpawnDaemon;
96
+ /** Standard SIGINT/SIGTERM handlers that route to our `stop()` (direct mode). */
97
+ private installSignalHandlers;
91
98
  /**
92
- * Handle tools/call request
99
+ * PPID watchdog (#277) — direct mode only. Daemon mode is detached on purpose
100
+ * and reaps via idle timeout; proxy mode installs its own watchdog inside
101
+ * {@link runProxy}. So this only ever runs for an in-process direct session.
93
102
  */
94
- private handleToolsCall;
103
+ private installPpidWatchdog;
95
104
  }
96
105
  export { StdioTransport } from './transport';
97
106
  export { tools, ToolHandler } from './tools';
107
+ export { Daemon } from './daemon';
108
+ export { CodeGraphPackageVersion } from './version';
98
109
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AA2GH;;;;;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;IAIjD,OAAO,CAAC,mBAAmB,CAAS;IAGpC,OAAO,CAAC,cAAc,CAAS;IAG/B,OAAO,CAAC,YAAY,CAAwB;IAK5C,OAAO,CAAC,QAAQ,CAA4D;IAC5E,OAAO,CAAC,YAAY,CAA+C;IAInE,OAAO,CAAC,OAAO,CAAS;gBAEZ,WAAW,CAAC,EAAE,MAAM;IAOhC;;;;;OAKG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IA+C5B;;;;;;;;;OASG;YACW,oBAAoB;IAyBlC;;;;;;;;OAQG;YACW,iBAAiB;IA+C/B;;;;OAIG;YACW,aAAa;IAiB3B;;;OAGG;IACH,OAAO,CAAC,aAAa;IAsCrB;;OAEG;IACH,IAAI,IAAI,IAAI;IAkBZ;;OAEG;YACW,aAAa;IA6C3B;;OAEG;YACW,gBAAgB;IA6D9B;;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"}
1
+ {"version":3,"file":"index.d.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