@colbymchenry/codegraph-darwin-x64 1.0.0 → 1.1.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 (175) hide show
  1. package/lib/dist/bin/codegraph.js +258 -17
  2. package/lib/dist/bin/codegraph.js.map +1 -1
  3. package/lib/dist/bin/fatal-handler.d.ts +20 -0
  4. package/lib/dist/bin/fatal-handler.d.ts.map +1 -0
  5. package/lib/dist/bin/fatal-handler.js +118 -0
  6. package/lib/dist/bin/fatal-handler.js.map +1 -0
  7. package/lib/dist/db/index.d.ts +22 -1
  8. package/lib/dist/db/index.d.ts.map +1 -1
  9. package/lib/dist/db/index.js +46 -1
  10. package/lib/dist/db/index.js.map +1 -1
  11. package/lib/dist/db/queries.d.ts +14 -0
  12. package/lib/dist/db/queries.d.ts.map +1 -1
  13. package/lib/dist/db/queries.js +25 -0
  14. package/lib/dist/db/queries.js.map +1 -1
  15. package/lib/dist/directory.d.ts +58 -0
  16. package/lib/dist/directory.d.ts.map +1 -1
  17. package/lib/dist/directory.js +165 -0
  18. package/lib/dist/directory.js.map +1 -1
  19. package/lib/dist/extraction/grammars.d.ts +11 -3
  20. package/lib/dist/extraction/grammars.d.ts.map +1 -1
  21. package/lib/dist/extraction/grammars.js +14 -5
  22. package/lib/dist/extraction/grammars.js.map +1 -1
  23. package/lib/dist/extraction/index.d.ts.map +1 -1
  24. package/lib/dist/extraction/index.js +202 -32
  25. package/lib/dist/extraction/index.js.map +1 -1
  26. package/lib/dist/extraction/languages/c-cpp.d.ts.map +1 -1
  27. package/lib/dist/extraction/languages/c-cpp.js +47 -2
  28. package/lib/dist/extraction/languages/c-cpp.js.map +1 -1
  29. package/lib/dist/extraction/languages/csharp.d.ts.map +1 -1
  30. package/lib/dist/extraction/languages/csharp.js +20 -0
  31. package/lib/dist/extraction/languages/csharp.js.map +1 -1
  32. package/lib/dist/extraction/languages/dart.d.ts.map +1 -1
  33. package/lib/dist/extraction/languages/dart.js +22 -0
  34. package/lib/dist/extraction/languages/dart.js.map +1 -1
  35. package/lib/dist/extraction/languages/java.d.ts.map +1 -1
  36. package/lib/dist/extraction/languages/java.js +213 -9
  37. package/lib/dist/extraction/languages/java.js.map +1 -1
  38. package/lib/dist/extraction/languages/kotlin.d.ts.map +1 -1
  39. package/lib/dist/extraction/languages/kotlin.js +51 -0
  40. package/lib/dist/extraction/languages/kotlin.js.map +1 -1
  41. package/lib/dist/extraction/languages/scala.d.ts.map +1 -1
  42. package/lib/dist/extraction/languages/scala.js +19 -9
  43. package/lib/dist/extraction/languages/scala.js.map +1 -1
  44. package/lib/dist/extraction/parse-worker.js +4 -1
  45. package/lib/dist/extraction/parse-worker.js.map +1 -1
  46. package/lib/dist/extraction/tree-sitter-types.d.ts +13 -0
  47. package/lib/dist/extraction/tree-sitter-types.d.ts.map +1 -1
  48. package/lib/dist/extraction/tree-sitter.d.ts +119 -0
  49. package/lib/dist/extraction/tree-sitter.d.ts.map +1 -1
  50. package/lib/dist/extraction/tree-sitter.js +890 -11
  51. package/lib/dist/extraction/tree-sitter.js.map +1 -1
  52. package/lib/dist/index.d.ts +33 -0
  53. package/lib/dist/index.d.ts.map +1 -1
  54. package/lib/dist/index.js +68 -7
  55. package/lib/dist/index.js.map +1 -1
  56. package/lib/dist/installer/index.d.ts.map +1 -1
  57. package/lib/dist/installer/index.js +33 -56
  58. package/lib/dist/installer/index.js.map +1 -1
  59. package/lib/dist/installer/instructions-template.d.ts +3 -3
  60. package/lib/dist/installer/instructions-template.d.ts.map +1 -1
  61. package/lib/dist/installer/instructions-template.js +4 -4
  62. package/lib/dist/installer/targets/claude.d.ts +18 -12
  63. package/lib/dist/installer/targets/claude.d.ts.map +1 -1
  64. package/lib/dist/installer/targets/claude.js +78 -6
  65. package/lib/dist/installer/targets/claude.js.map +1 -1
  66. package/lib/dist/installer/targets/shared.d.ts +12 -2
  67. package/lib/dist/installer/targets/shared.d.ts.map +1 -1
  68. package/lib/dist/installer/targets/shared.js +13 -12
  69. package/lib/dist/installer/targets/shared.js.map +1 -1
  70. package/lib/dist/installer/targets/types.d.ts +7 -0
  71. package/lib/dist/installer/targets/types.d.ts.map +1 -1
  72. package/lib/dist/mcp/daemon-manager.d.ts +42 -0
  73. package/lib/dist/mcp/daemon-manager.d.ts.map +1 -0
  74. package/lib/dist/mcp/daemon-manager.js +129 -0
  75. package/lib/dist/mcp/daemon-manager.js.map +1 -0
  76. package/lib/dist/mcp/daemon-registry.d.ts +47 -0
  77. package/lib/dist/mcp/daemon-registry.d.ts.map +1 -0
  78. package/lib/dist/mcp/daemon-registry.js +229 -0
  79. package/lib/dist/mcp/daemon-registry.js.map +1 -0
  80. package/lib/dist/mcp/daemon.d.ts.map +1 -1
  81. package/lib/dist/mcp/daemon.js +5 -0
  82. package/lib/dist/mcp/daemon.js.map +1 -1
  83. package/lib/dist/mcp/engine.d.ts.map +1 -1
  84. package/lib/dist/mcp/engine.js +8 -0
  85. package/lib/dist/mcp/engine.js.map +1 -1
  86. package/lib/dist/mcp/index.d.ts +1 -0
  87. package/lib/dist/mcp/index.d.ts.map +1 -1
  88. package/lib/dist/mcp/index.js +13 -0
  89. package/lib/dist/mcp/index.js.map +1 -1
  90. package/lib/dist/mcp/liveness-watchdog.d.ts +18 -0
  91. package/lib/dist/mcp/liveness-watchdog.d.ts.map +1 -0
  92. package/lib/dist/mcp/liveness-watchdog.js +207 -0
  93. package/lib/dist/mcp/liveness-watchdog.js.map +1 -0
  94. package/lib/dist/mcp/server-instructions.d.ts +18 -14
  95. package/lib/dist/mcp/server-instructions.d.ts.map +1 -1
  96. package/lib/dist/mcp/server-instructions.js +57 -52
  97. package/lib/dist/mcp/server-instructions.js.map +1 -1
  98. package/lib/dist/mcp/session.d.ts.map +1 -1
  99. package/lib/dist/mcp/session.js +23 -18
  100. package/lib/dist/mcp/session.js.map +1 -1
  101. package/lib/dist/mcp/tools.d.ts +51 -1
  102. package/lib/dist/mcp/tools.d.ts.map +1 -1
  103. package/lib/dist/mcp/tools.js +585 -151
  104. package/lib/dist/mcp/tools.js.map +1 -1
  105. package/lib/dist/project-config.d.ts +19 -0
  106. package/lib/dist/project-config.d.ts.map +1 -0
  107. package/lib/dist/project-config.js +180 -0
  108. package/lib/dist/project-config.js.map +1 -0
  109. package/lib/dist/reasoning/config.d.ts +45 -0
  110. package/lib/dist/reasoning/config.d.ts.map +1 -0
  111. package/lib/dist/reasoning/config.js +171 -0
  112. package/lib/dist/reasoning/config.js.map +1 -0
  113. package/lib/dist/reasoning/credentials.d.ts +5 -0
  114. package/lib/dist/reasoning/credentials.d.ts.map +1 -0
  115. package/lib/dist/reasoning/credentials.js +83 -0
  116. package/lib/dist/reasoning/credentials.js.map +1 -0
  117. package/lib/dist/reasoning/login.d.ts +21 -0
  118. package/lib/dist/reasoning/login.d.ts.map +1 -0
  119. package/lib/dist/reasoning/login.js +85 -0
  120. package/lib/dist/reasoning/login.js.map +1 -0
  121. package/lib/dist/reasoning/reasoner.d.ts +43 -0
  122. package/lib/dist/reasoning/reasoner.d.ts.map +1 -0
  123. package/lib/dist/reasoning/reasoner.js +308 -0
  124. package/lib/dist/reasoning/reasoner.js.map +1 -0
  125. package/lib/dist/resolution/c-fnptr-synthesizer.d.ts +33 -0
  126. package/lib/dist/resolution/c-fnptr-synthesizer.d.ts.map +1 -0
  127. package/lib/dist/resolution/c-fnptr-synthesizer.js +352 -0
  128. package/lib/dist/resolution/c-fnptr-synthesizer.js.map +1 -0
  129. package/lib/dist/resolution/callback-synthesizer.d.ts +6 -1
  130. package/lib/dist/resolution/callback-synthesizer.d.ts.map +1 -1
  131. package/lib/dist/resolution/callback-synthesizer.js +1109 -1
  132. package/lib/dist/resolution/callback-synthesizer.js.map +1 -1
  133. package/lib/dist/resolution/frameworks/goframe.d.ts +41 -0
  134. package/lib/dist/resolution/frameworks/goframe.d.ts.map +1 -0
  135. package/lib/dist/resolution/frameworks/goframe.js +112 -0
  136. package/lib/dist/resolution/frameworks/goframe.js.map +1 -0
  137. package/lib/dist/resolution/frameworks/index.d.ts +1 -0
  138. package/lib/dist/resolution/frameworks/index.d.ts.map +1 -1
  139. package/lib/dist/resolution/frameworks/index.js +5 -1
  140. package/lib/dist/resolution/frameworks/index.js.map +1 -1
  141. package/lib/dist/resolution/frameworks/react.d.ts.map +1 -1
  142. package/lib/dist/resolution/frameworks/react.js +17 -60
  143. package/lib/dist/resolution/frameworks/react.js.map +1 -1
  144. package/lib/dist/resolution/goframe-synthesizer.d.ts +28 -0
  145. package/lib/dist/resolution/goframe-synthesizer.d.ts.map +1 -0
  146. package/lib/dist/resolution/goframe-synthesizer.js +158 -0
  147. package/lib/dist/resolution/goframe-synthesizer.js.map +1 -0
  148. package/lib/dist/resolution/import-resolver.d.ts.map +1 -1
  149. package/lib/dist/resolution/import-resolver.js +56 -0
  150. package/lib/dist/resolution/import-resolver.js.map +1 -1
  151. package/lib/dist/resolution/name-matcher.d.ts.map +1 -1
  152. package/lib/dist/resolution/name-matcher.js +48 -8
  153. package/lib/dist/resolution/name-matcher.js.map +1 -1
  154. package/lib/dist/resolution/strip-comments.d.ts +1 -1
  155. package/lib/dist/resolution/strip-comments.d.ts.map +1 -1
  156. package/lib/dist/resolution/strip-comments.js +2 -0
  157. package/lib/dist/resolution/strip-comments.js.map +1 -1
  158. package/lib/dist/sync/watcher.d.ts +68 -1
  159. package/lib/dist/sync/watcher.d.ts.map +1 -1
  160. package/lib/dist/sync/watcher.js +212 -14
  161. package/lib/dist/sync/watcher.js.map +1 -1
  162. package/lib/dist/telemetry/index.d.ts +0 -3
  163. package/lib/dist/telemetry/index.d.ts.map +1 -1
  164. package/lib/dist/telemetry/index.js +4 -7
  165. package/lib/dist/telemetry/index.js.map +1 -1
  166. package/lib/dist/upgrade/index.d.ts.map +1 -1
  167. package/lib/dist/upgrade/index.js +40 -4
  168. package/lib/dist/upgrade/index.js.map +1 -1
  169. package/lib/dist/utils.d.ts +14 -1
  170. package/lib/dist/utils.d.ts.map +1 -1
  171. package/lib/dist/utils.js +20 -2
  172. package/lib/dist/utils.js.map +1 -1
  173. package/lib/node_modules/.package-lock.json +1 -1
  174. package/lib/package.json +2 -2
  175. package/package.json +1 -1
@@ -0,0 +1,207 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.DEFAULT_WATCHDOG_TIMEOUT_MS = void 0;
37
+ exports.parseWatchdogTimeoutMs = parseWatchdogTimeoutMs;
38
+ exports.deriveCheckIntervalMs = deriveCheckIntervalMs;
39
+ exports.installMainThreadWatchdog = installMainThreadWatchdog;
40
+ /**
41
+ * Main-thread liveness watchdog — belt-and-suspenders for #850.
42
+ *
43
+ * The #850 fix removes the one *known* trigger (the uncaught-exception handler
44
+ * no longer formats a raw Error's `.stack`). But ANY synchronous, non-yielding
45
+ * loop on the main thread — a future V8 stack-format pathology, a runaway
46
+ * regex, an accidental `while (true)` — wedges the event loop, and from JS you
47
+ * cannot interrupt it: timers, signal handlers, and the PPID watchdog all run
48
+ * *on* that blocked loop, so the process pins a core forever with no
49
+ * self-recovery (the exact unrecoverable state #850 reported).
50
+ *
51
+ * **Why a separate PROCESS, not a worker thread.** A worker thread was the
52
+ * obvious first choice and it works in a toy process — but it was validated to
53
+ * FAIL in the real daemon (#850 live test). V8 isolates in one process
54
+ * coordinate on global safepoints, so when one thread requests a GC every other
55
+ * thread must reach a safepoint before it can proceed. A main thread wedged in
56
+ * a tight, non-allocating loop never reaches one, which strands the watchdog
57
+ * worker on its very next allocation/safepoint check — and the #850 hot loop
58
+ * (`SourcePositionTableIterator::Advance`, a non-allocating C++ table walk) is
59
+ * exactly that shape. A child process shares no isolate and no heap with the
60
+ * parent, so the wedge cannot touch it; it kills via the kernel, which honours
61
+ * SIGKILL regardless of what the parent's threads are doing.
62
+ *
63
+ * **How.** The parent writes a heartbeat byte to the child's stdin every
64
+ * `checkMs` from a timer — firing at all means the event loop is turning. The
65
+ * child resets a kill-timer on each byte; if none arrives for `timeoutMs` it
66
+ * `SIGKILL`s the parent so a fresh daemon starts on the next connection. When
67
+ * the parent exits normally the pipe closes and the child exits too (no
68
+ * orphan).
69
+ *
70
+ * **Won't fire on real work.** Heavy parsing runs in the parse worker
71
+ * (off-thread) and indexing shells out to a child process, so the daemon's main
72
+ * thread only ever does fast, bounded work. The default timeout is ~300× the
73
+ * 5h #850 wedge shorter, yet far longer than any legitimate main-thread block.
74
+ * Opt out with `CODEGRAPH_NO_WATCHDOG=1`; tune with `CODEGRAPH_WATCHDOG_TIMEOUT_MS`.
75
+ */
76
+ const fs = __importStar(require("fs"));
77
+ const os = __importStar(require("os"));
78
+ const child_process_1 = require("child_process");
79
+ /** Default: 60s — ~300× shorter than the 5h #850 wedge, far longer than any real main-thread block. */
80
+ exports.DEFAULT_WATCHDOG_TIMEOUT_MS = 60_000;
81
+ /** `true` for `1/true/yes/on` (case-insensitive); `false` otherwise. */
82
+ function isEnvTruthy(raw) {
83
+ if (!raw)
84
+ return false;
85
+ return ['1', 'true', 'yes', 'on'].includes(raw.trim().toLowerCase());
86
+ }
87
+ /** Parse the timeout env, falling back to the default for missing/invalid values. */
88
+ function parseWatchdogTimeoutMs(raw, fallback = exports.DEFAULT_WATCHDOG_TIMEOUT_MS) {
89
+ if (raw === undefined)
90
+ return fallback;
91
+ const n = Number(raw);
92
+ return Number.isFinite(n) && n > 0 ? n : fallback;
93
+ }
94
+ /** Derive a heartbeat cadence that emits several beats inside the timeout window. */
95
+ function deriveCheckIntervalMs(timeoutMs) {
96
+ return Math.min(2000, Math.max(50, Math.round(timeoutMs / 5)));
97
+ }
98
+ /** Arming/teardown diagnostics, gated on the existing MCP debug switch. */
99
+ function debug(msg) {
100
+ if (process.env.CODEGRAPH_MCP_DEBUG) {
101
+ try {
102
+ fs.writeSync(2, `[CodeGraph watchdog] ${msg}\n`);
103
+ }
104
+ catch { /* ignore */ }
105
+ }
106
+ }
107
+ /**
108
+ * The watchdog child body, run via `node -e`. Inlined as a string (not a
109
+ * shipped `.js`) so there is no dist-vs-src path to resolve — it runs
110
+ * identically under `tsx` in tests and under the bundle in production. Reads its
111
+ * target pid + timeout from argv; an MSG built once at startup (the child is
112
+ * never wedged, so allocation here is fine).
113
+ */
114
+ const CHILD_SOURCE = `
115
+ const fs = require('fs');
116
+ const parentPid = Number(process.argv[1]);
117
+ const timeoutMs = Number(process.argv[2]);
118
+ const secs = Math.round(timeoutMs / 1000);
119
+ const MSG = Buffer.from('[CodeGraph] Main thread unresponsive for ~' + secs + 's — killing the wedged process so a fresh one can start (#850). Disable with CODEGRAPH_NO_WATCHDOG=1.\\n');
120
+ function kill() {
121
+ try { fs.writeSync(2, MSG); } catch (e) {}
122
+ try { process.kill(parentPid, 'SIGKILL'); } catch (e) {}
123
+ process.exit(0);
124
+ }
125
+ let timer = setTimeout(kill, timeoutMs);
126
+ process.stdin.on('data', () => { clearTimeout(timer); timer = setTimeout(kill, timeoutMs); });
127
+ process.stdin.on('end', () => process.exit(0)); // parent closed the pipe (exited) -> no orphan
128
+ process.stdin.on('error', () => process.exit(0)); // pipe broke -> parent gone
129
+ process.stdin.resume();
130
+ `;
131
+ /**
132
+ * Install the main-thread liveness watchdog for a long-lived process. Returns a
133
+ * handle to stop it, or `null` when disabled or when the child can't be spawned
134
+ * (degraded, never throws — a missing watchdog must never keep a process from
135
+ * starting).
136
+ */
137
+ function installMainThreadWatchdog() {
138
+ if (isEnvTruthy(process.env.CODEGRAPH_NO_WATCHDOG))
139
+ return null;
140
+ const timeoutMs = parseWatchdogTimeoutMs(process.env.CODEGRAPH_WATCHDOG_TIMEOUT_MS);
141
+ const checkMs = deriveCheckIntervalMs(timeoutMs);
142
+ let child;
143
+ try {
144
+ // No execArgv inheritance (unlike Worker), so the child carries none of our
145
+ // V8 flags — it runs no WASM and needs none. stderr inherits the parent's
146
+ // fd 2 so the kill notice lands wherever the parent logs (daemon.log).
147
+ child = (0, child_process_1.spawn)(process.execPath, ['-e', CHILD_SOURCE, String(process.pid), String(timeoutMs)], {
148
+ stdio: ['pipe', 'ignore', 'inherit'],
149
+ windowsHide: true,
150
+ // The watchdog touches no files; keep its cwd off the project/temp dir
151
+ // so it can't hold one open (Windows EPERM-on-cleanup, mirrors the
152
+ // parse-worker quirk).
153
+ cwd: os.tmpdir(),
154
+ });
155
+ }
156
+ catch (err) {
157
+ debug(`spawn failed: ${err instanceof Error ? err.message : String(err)}`);
158
+ return null;
159
+ }
160
+ const stdin = child.stdin;
161
+ if (!stdin) {
162
+ debug('child has no stdin pipe; not arming');
163
+ try {
164
+ child.kill();
165
+ }
166
+ catch { /* ignore */ }
167
+ return null;
168
+ }
169
+ // Writing after the child exits surfaces EPIPE on the stream — swallow it so
170
+ // it can't escalate to the global handler (which now exits, #850).
171
+ stdin.on('error', () => { });
172
+ child.on('error', (err) => debug(`child error: ${err.message}`));
173
+ // Heartbeat: a byte per tick. When the main thread wedges, these stop and the
174
+ // child's timeout fires. unref'd so it never keeps the process alive itself.
175
+ const heartbeat = setInterval(() => {
176
+ try {
177
+ stdin.write('\n');
178
+ }
179
+ catch { /* child gone */ }
180
+ }, checkMs);
181
+ heartbeat.unref();
182
+ // Neither the child nor its pipe should keep the parent alive past its work.
183
+ child.unref();
184
+ try {
185
+ stdin.unref?.();
186
+ }
187
+ catch { /* ignore */ }
188
+ debug(`armed (child pid ${child.pid ?? '?'}): timeoutMs=${timeoutMs} checkMs=${checkMs}`);
189
+ let stopped = false;
190
+ return {
191
+ stop() {
192
+ if (stopped)
193
+ return;
194
+ stopped = true;
195
+ clearInterval(heartbeat);
196
+ try {
197
+ stdin.end();
198
+ }
199
+ catch { /* ignore */ } // EOF -> child exits cleanly
200
+ try {
201
+ child.kill();
202
+ }
203
+ catch { /* ignore */ } // belt-and-suspenders
204
+ },
205
+ };
206
+ }
207
+ //# sourceMappingURL=liveness-watchdog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"liveness-watchdog.js","sourceRoot":"","sources":["../../src/mcp/liveness-watchdog.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDA,wDAOC;AAGD,sDAEC;AA6CD,8DA8DC;AAzKD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,uCAAyB;AACzB,uCAAyB;AACzB,iDAAoD;AAEpD,uGAAuG;AAC1F,QAAA,2BAA2B,GAAG,MAAM,CAAC;AAElD,wEAAwE;AACxE,SAAS,WAAW,CAAC,GAAuB;IAC1C,IAAI,CAAC,GAAG;QAAE,OAAO,KAAK,CAAC;IACvB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,CA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,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAAC,CAAC;QAAC,MAAM,CAAC,CAAC,gBAAgB,CAAC,CAAC;IACvD,CAAC,EAAE,OAAO,CAAC,CAAC;IACZ,SAAS,CAAC,KAAK,EAAE,CAAC;IAElB,6EAA6E;IAC7E,KAAK,CAAC,KAAK,EAAE,CAAC;IACd,IAAI,CAAC;QAAE,KAA2C,CAAC,KAAK,EAAE,EAAE,CAAC;IAAC,CAAC;IAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC;IAEtF,KAAK,CAAC,oBAAoB,KAAK,CAAC,GAAG,IAAI,GAAG,gBAAgB,SAAS,YAAY,OAAO,EAAE,CAAC,CAAC;IAE1F,IAAI,OAAO,GAAG,KAAK,CAAC;IACpB,OAAO;QACL,IAAI;YACF,IAAI,OAAO;gBAAE,OAAO;YACpB,OAAO,GAAG,IAAI,CAAC;YACf,aAAa,CAAC,SAAS,CAAC,CAAC;YACzB,IAAI,CAAC;gBAAC,KAAK,CAAC,GAAG,EAAE,CAAC;YAAC,CAAC;YAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,6BAA6B;YACzE,IAAI,CAAC;gBAAC,KAAK,CAAC,IAAI,EAAE,CAAC;YAAC,CAAC;YAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,sBAAsB;QACrE,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -7,24 +7,28 @@
7
7
  * before it sees individual tool descriptions.
8
8
  *
9
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)
10
+ * - Lead the agent to codegraph_explore for any structural/flow question
11
+ * - Reinforce "explore instead of Read/Grep" for indexed code
12
+ * - Anti-patterns (don't re-verify with grep; don't hand-reconstruct flows)
13
13
  *
14
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.
15
+ * burn tokens. The DEFAULT MCP surface is `codegraph_explore` ALONE (see
16
+ * DEFAULT_MCP_TOOLS in tools.ts) reference only that tool here. The other
17
+ * tools (node/search/callers/…) stay defined and are re-enablable via
18
+ * CODEGRAPH_MCP_TOOLS, but they are NOT listed to agents, so don't name them.
17
19
  */
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 in\nthe workspace \u2014 pre-computed structure you would otherwise re-derive by\nreading files (cached intelligence: thousands of parse/trace decisions you\ndon't pay to re-reason each run). Reads are sub-millisecond; the index lags\nwrites by ~1s through the file watcher. Reach for it BEFORE *and* while\nwriting or editing code \u2014 not just for questions: one call returns the\nverbatim source PLUS who calls it and what it affects, so you edit with the\nblast radius in view. More accurate context, in far fewer tokens and\nround-trips than reading files yourself.\n\n## Use codegraph instead of reading files \u2014 for questions AND edits\n\nWhether you're answering \"how does X work\" or implementing a change (fixing\na bug, adding a feature), reach for codegraph before you Read. For\nunderstanding, answer DIRECTLY \u2014 usually with ONE `codegraph_explore` call.\n`codegraph_explore` takes either a natural-language question or a bag of\nsymbol/file names and returns the verbatim source of the relevant symbols\ngrouped by file, so it is Read-equivalent and most often the ONLY\ncodegraph call you need. Codegraph IS the pre-built search index \u2014 so\ndelegating the lookup to a separate file-reading sub-task/agent, or\nrunning your own grep + read loop, repeats work codegraph already did and\ncosts more for the same answer. Reach for raw Read/Grep only to confirm a\nspecific detail codegraph didn't cover. A direct codegraph answer is\ntypically one to a few calls; a grep/read exploration is dozens.\n\n## Tool selection by intent\n\n- **Almost any question \u2014 \"how does X work\", architecture, a bug, \"what/where is X\", or surveying an area** \u2192 `codegraph_explore` (PRIMARY \u2014 call FIRST; ONE capped call returns the verbatim source of the relevant symbols grouped by file; most often the ONLY call you need)\n- **\"How does X reach/become Y? / the flow / the path from X to Y\"** \u2192 `codegraph_explore`, naming the symbols that span the flow (e.g. `mutateElement renderScene`) \u2014 it surfaces the call path among them, including dynamic-dispatch hops (callbacks, React re-render, JSX children) grep can't follow\n- **\"What is the symbol named X?\" (just its location)** \u2192 `codegraph_search`\n- **\"What calls this?\" / \"What would changing this break?\"** \u2192 `codegraph_callers` \u2014 EVERY call site with file:line, including where a function is **registered as a callback** (passed as an argument, assigned to a function pointer/field, listed in a handler table) \u2014 labeled \"via callback registration\" \u2014 so a function with no direct calls is NOT dead if it's wired up somewhere. When several UNRELATED symbols share a name (one `UserService` per monorepo app), it reports **one section per definition** (never a merged list) \u2014 pass `file` to focus the definition you mean. The wider blast radius arrives automatically on `codegraph_explore` (its \"Blast radius\" section) and `codegraph_node` (the dependents note)\n- **\"What does this call?\"** \u2192 `codegraph_node` with that symbol and `includeCode: true` \u2014 the body IS the callee list, and the caller/callee trail comes with it\n- **Reading a source FILE (any time you'd use the `Read` tool)** \u2192 `codegraph_node` with a `file` path and no `symbol`. It returns the file's **current source with line numbers \u2014 the same `<n>\\t<line>` shape `Read` gives you, safe to `Edit` from** \u2014 narrowable with `offset`/`limit` exactly like `Read`, PLUS a one-line note of which files depend on it. Same bytes as `Read`, faster (served from the index), with the blast radius attached. Use it **instead of `Read`** for indexed source files; fall back to `Read` only for what codegraph doesn't index (configs, docs). Pass `symbolsOnly: true` for just the file's structure.\n- **About to read or edit a symbol you can name** \u2192 `codegraph_node` with that `symbol` (SECONDARY \u2014 the after-explore depth tool): the verbatim source (`includeCode: true`) PLUS its caller/callee trail, so before changing it you see what calls it and what your edit would break. For an OVERLOADED name it returns EVERY matching definition's body in one call, so you never Read a file to find the right overload\n\n## Common chains\n\n- **Flow / \"how does X reach Y\"**: ONE `codegraph_explore` with the symbol names spanning the flow \u2014 it surfaces the call path among them (riding dynamic-dispatch hops) AND returns their source. No need to reconstruct the path with `codegraph_search` + `codegraph_callers`.\n- **Onboarding / understanding any area**: ONE `codegraph_explore` is usually the whole answer. Only follow up \u2014 `codegraph_node` for a specific symbol \u2014 if something is still unclear.\n- **Refactor planning**: `codegraph_callers` for the complete call-site list to update; the wider blast radius is already attached to `codegraph_explore` / `codegraph_node` output.\n- **Debugging a regression**: `codegraph_callers` of the suspected symbol; `codegraph_node` on anything unexpected that appears.\n\n## Anti-patterns\n\n- **Trust codegraph's results \u2014 don't re-verify them with grep.** They come from a full AST parse; re-checking with grep is slower, less accurate, and wastes context.\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`** to understand an area \u2014 ONE `codegraph_explore` returns the relevant symbols' source together in a single round-trip.\n- **Don't loop `codegraph_node` over many symbols** \u2014 one `codegraph_explore` call returns them all grouped by file, while each separate call re-reads the whole context and costs far more. Use `codegraph_node` for a single symbol.\n- **Don't reach for the `Read` tool on an indexed source file** \u2014 `codegraph_node` with a `file` reads it for you (same `<n>\\t<line>` source, `offset`/`limit` like Read, faster, with its blast radius), and with a `symbol` it returns the source plus the caller/callee trail. Reach for raw `Read` only for what codegraph doesn't index (configs, docs) or when the staleness banner flags a file as pending re-index.\n- **After editing, check the staleness banner.** When a tool response starts with \"\u26A0\uFE0F Some files referenced below were edited since the last index sync\u2026\", the listed files are pending re-index \u2014 Read those specific files for accurate content. Every file NOT in that banner is fresh, so still trust codegraph.\n\n## Limitations\n\n- If a tool reports a project isn't indexed (no `.codegraph/`), stop calling codegraph tools for that project for the rest of the session and use your built-in tools there instead. Indexing is the user's decision \u2014 mention they can run `codegraph init` if it comes up, but don't run it yourself.\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";
20
+ 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 in\nthe workspace \u2014 pre-computed structure you would otherwise re-derive by\nreading files (cached intelligence: thousands of parse/trace decisions you\ndon't pay to re-reason each run). Reads are sub-millisecond; the index lags\nwrites by ~1s through the file watcher. Reach for it BEFORE *and* while\nwriting or editing code \u2014 not just for questions: one call returns the\nverbatim source PLUS who calls it and what it affects, so you edit with the\nblast radius in view. More accurate context, in far fewer tokens and\nround-trips than reading files yourself.\n\n## One tool: codegraph_explore \u2014 use it instead of reading files\n\nThere is a single tool, `codegraph_explore`, and it is Read-equivalent. It\ntakes either a natural-language question or a bag of symbol/file names and\nreturns the **verbatim, line-numbered source** of the relevant symbols\ngrouped by file \u2014 the same `<n>\\t<line>` shape `Read` gives you, safe to\n`Edit` from \u2014 PLUS the call path among them (including dynamic-dispatch hops\nlike callbacks, React re-render, and JSX children that grep can't follow) and\na blast-radius summary of what depends on them.\n\nWhether you're answering \"how does X work\" or implementing a change (fixing a\nbug, adding a feature), call `codegraph_explore` before you Read. ONE call\nusually answers the whole question. Codegraph IS the pre-built search index \u2014\nso running your own grep + read loop, or delegating the lookup to a separate\nfile-reading sub-task/agent, repeats work codegraph already did and costs more\nfor the same answer. A direct codegraph answer is typically one to a few\ncalls; a grep/read exploration is dozens.\n\n## How to query\n\n- **Almost any question \u2014 \"how does X work\", architecture, a bug, \"what/where is X\", or surveying an area** \u2192 `codegraph_explore` with a natural-language question or the relevant names. ONE capped call returns the verbatim source grouped by file; most often the ONLY call you need.\n- **\"How does X reach/become Y? / the flow / the path from X to Y\"** \u2192 `codegraph_explore`, naming the symbols that span the flow (e.g. `mutateElement renderScene`) \u2014 it surfaces the call path among them, riding dynamic-dispatch hops, and returns their source.\n- **Reading or editing a file/symbol you can name** \u2192 put its name or file path in the `codegraph_explore` query \u2014 it returns that current line-numbered source (safe to `Edit` from) with the call path and blast radius attached, so you don't Read it separately. For an overloaded name it returns every matching definition's body in one call.\n- **Need more?** Call `codegraph_explore` again with more specific names \u2014 treat the source it returns as already Read.\n\n## Anti-patterns\n\n- **Trust codegraph's results \u2014 don't re-verify them with grep.** They come from a full AST parse; re-checking with grep is slower, less accurate, and wastes context.\n- **Don't grep or Read first** to find or understand indexed code \u2014 ONE `codegraph_explore` returns the relevant symbols' source together in a single round-trip. Reach for raw `Read`/`Grep` only to confirm a specific detail codegraph didn't cover, or for what codegraph doesn't index (configs, docs).\n- **Don't reconstruct a flow by hand** \u2014 name the endpoints in one `codegraph_explore` and it surfaces the path between them, dynamic-dispatch hops included.\n- **After editing, check the staleness banner.** When a tool response starts with \"\u26A0\uFE0F Some files referenced below were edited since the last index sync\u2026\", the listed files are pending re-index \u2014 Read those specific files for accurate content. Every file NOT in that banner is fresh, so still trust codegraph. A different, rarer banner \u2014 \"\u26A0\uFE0F CodeGraph auto-sync is DISABLED\u2026\" \u2014 means live watching stopped entirely (the whole index is frozen, not just a few files); until it's resolved, Read files directly to confirm anything that may have changed.\n\n## Limitations\n\n- If a tool reports a project isn't indexed (no `.codegraph/`), stop calling codegraph tools for that project for the rest of the session and use your built-in tools there instead. Indexing is the user's decision \u2014 mention they can run `codegraph init` if it comes up, but don't run it yourself.\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
21
  /**
20
- * Instructions variant sent when the workspace has NO codegraph index.
22
+ * Instructions variant sent when the server's own root has NO codegraph index.
21
23
  *
22
- * Sending the full playbook ("lean on codegraph for everything") into a
23
- * session where every call would fail wastes the agent's calls and worse —
24
- * the failures teach it codegraph is broken. The unindexed variant is a
25
- * short, unambiguous "inactive this session" note; `tools/list` is gated to
26
- * empty in the same state, so the agent has nothing to mis-call. Indexing is
27
- * deliberately left to the user: the agent is told NOT to run init itself.
24
+ * The tools are still exposed (gating tool availability on whether `./` has an
25
+ * index is the bug behind #964: it breaks monorepos where only sub-projects are
26
+ * indexed, and a server that started before `codegraph init` never surfaces the
27
+ * tools afterward). Instead of an "inactive" note, this variant tells the agent
28
+ * codegraph works **per project**: there's no default project to query, so pass
29
+ * a `projectPath` to any project that HAS a `.codegraph/`. The full single-
30
+ * project playbook ({@link SERVER_INSTRUCTIONS}) is sent instead when the root
31
+ * IS indexed, so the common case stays tight.
28
32
  */
29
- export declare const SERVER_INSTRUCTIONS_UNINDEXED = "# Codegraph \u2014 inactive (workspace not indexed)\n\nThis workspace has no codegraph index (no `.codegraph/` directory), so no\ncodegraph tools are available this session. Work with your built-in tools as\nusual.\n\nIndexing is the user's decision \u2014 do not run it yourself. If the user asks\nabout codegraph, they can enable it by running `codegraph init` in the\nproject root and starting a new session.\n";
33
+ export declare const SERVER_INSTRUCTIONS_NO_ROOT_INDEX = "# Codegraph \u2014 available (per-project; pass projectPath)\n\nCodegraph is a SQLite knowledge graph of a codebase's symbols, edges, and\nfiles: one `codegraph_explore` call returns the verbatim, line-numbered source\nof the relevant symbols PLUS the call paths between them and a blast-radius\nsummary \u2014 replacing a grep + Read loop with one round-trip.\n\nThis server started somewhere with no `.codegraph/` of its own, so there is no\ndefault project \u2014 but the tools are available and work **per project**:\n\n- To query a project that HAS a `.codegraph/` index (e.g. a service inside a\n monorepo, or a second repo), pass its path as `projectPath` to\n `codegraph_explore` (and any other codegraph tool). Codegraph resolves the\n nearest `.codegraph/` at or above that path and answers from it \u2014 for as many\n projects as you like in one session.\n- For a project with no `.codegraph/`, use your built-in tools (Read/Grep/Glob)\n for that project. Indexing is the user's decision \u2014 don't run it yourself, but\n if it comes up they can run `codegraph init` in a project to enable codegraph\n there (a new index is picked up live, no restart).\n";
30
34
  //# sourceMappingURL=server-instructions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"server-instructions.d.ts","sourceRoot":"","sources":["../../src/mcp/server-instructions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,mBAAmB,wqOA2D/B,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,6BAA6B,kaASzC,CAAC"}
1
+ {"version":3,"file":"server-instructions.d.ts","sourceRoot":"","sources":["../../src/mcp/server-instructions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,mBAAmB,qsJAkD/B,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iCAAiC,4pCAmB7C,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SERVER_INSTRUCTIONS_UNINDEXED = exports.SERVER_INSTRUCTIONS = void 0;
3
+ exports.SERVER_INSTRUCTIONS_NO_ROOT_INDEX = exports.SERVER_INSTRUCTIONS = void 0;
4
4
  /**
5
5
  * Server-level instructions emitted in the MCP `initialize` response.
6
6
  *
@@ -10,13 +10,15 @@ exports.SERVER_INSTRUCTIONS_UNINDEXED = exports.SERVER_INSTRUCTIONS = void 0;
10
10
  * before it sees individual tool descriptions.
11
11
  *
12
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)
13
+ * - Lead the agent to codegraph_explore for any structural/flow question
14
+ * - Reinforce "explore instead of Read/Grep" for indexed code
15
+ * - Anti-patterns (don't re-verify with grep; don't hand-reconstruct flows)
16
16
  *
17
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.
18
+ * burn tokens. The DEFAULT MCP surface is `codegraph_explore` ALONE (see
19
+ * DEFAULT_MCP_TOOLS in tools.ts) reference only that tool here. The other
20
+ * tools (node/search/callers/…) stay defined and are re-enablable via
21
+ * CODEGRAPH_MCP_TOOLS, but they are NOT listed to agents, so don't name them.
20
22
  */
21
23
  exports.SERVER_INSTRUCTIONS = `# Codegraph — code intelligence over an indexed knowledge graph
22
24
 
@@ -30,46 +32,37 @@ verbatim source PLUS who calls it and what it affects, so you edit with the
30
32
  blast radius in view. More accurate context, in far fewer tokens and
31
33
  round-trips than reading files yourself.
32
34
 
33
- ## Use codegraph instead of reading files — for questions AND edits
35
+ ## One tool: codegraph_explore — use it instead of reading files
34
36
 
35
- Whether you're answering "how does X work" or implementing a change (fixing
36
- a bug, adding a feature), reach for codegraph before you Read. For
37
- understanding, answer DIRECTLY usually with ONE \`codegraph_explore\` call.
38
- \`codegraph_explore\` takes either a natural-language question or a bag of
39
- symbol/file names and returns the verbatim source of the relevant symbols
40
- grouped by file, so it is Read-equivalent and most often the ONLY
41
- codegraph call you need. Codegraph IS the pre-built search index — so
42
- delegating the lookup to a separate file-reading sub-task/agent, or
43
- running your own grep + read loop, repeats work codegraph already did and
44
- costs more for the same answer. Reach for raw Read/Grep only to confirm a
45
- specific detail codegraph didn't cover. A direct codegraph answer is
46
- typically one to a few calls; a grep/read exploration is dozens.
37
+ There is a single tool, \`codegraph_explore\`, and it is Read-equivalent. It
38
+ takes either a natural-language question or a bag of symbol/file names and
39
+ returns the **verbatim, line-numbered source** of the relevant symbols
40
+ grouped by file the same \`<n>\\t<line>\` shape \`Read\` gives you, safe to
41
+ \`Edit\` from PLUS the call path among them (including dynamic-dispatch hops
42
+ like callbacks, React re-render, and JSX children that grep can't follow) and
43
+ a blast-radius summary of what depends on them.
47
44
 
48
- ## Tool selection by intent
45
+ Whether you're answering "how does X work" or implementing a change (fixing a
46
+ bug, adding a feature), call \`codegraph_explore\` before you Read. ONE call
47
+ usually answers the whole question. Codegraph IS the pre-built search index —
48
+ so running your own grep + read loop, or delegating the lookup to a separate
49
+ file-reading sub-task/agent, repeats work codegraph already did and costs more
50
+ for the same answer. A direct codegraph answer is typically one to a few
51
+ calls; a grep/read exploration is dozens.
49
52
 
50
- - **Almost any question — "how does X work", architecture, a bug, "what/where is X", or surveying an area** → \`codegraph_explore\` (PRIMARY — call FIRST; ONE capped call returns the verbatim source of the relevant symbols grouped by file; most often the ONLY call you need)
51
- - **"How does X reach/become Y? / the flow / the path from X to Y"** → \`codegraph_explore\`, naming the symbols that span the flow (e.g. \`mutateElement renderScene\`) — it surfaces the call path among them, including dynamic-dispatch hops (callbacks, React re-render, JSX children) grep can't follow
52
- - **"What is the symbol named X?" (just its location)** → \`codegraph_search\`
53
- - **"What calls this?" / "What would changing this break?"** → \`codegraph_callers\` — EVERY call site with file:line, including where a function is **registered as a callback** (passed as an argument, assigned to a function pointer/field, listed in a handler table) — labeled "via callback registration" — so a function with no direct calls is NOT dead if it's wired up somewhere. When several UNRELATED symbols share a name (one \`UserService\` per monorepo app), it reports **one section per definition** (never a merged list) — pass \`file\` to focus the definition you mean. The wider blast radius arrives automatically on \`codegraph_explore\` (its "Blast radius" section) and \`codegraph_node\` (the dependents note)
54
- - **"What does this call?"** → \`codegraph_node\` with that symbol and \`includeCode: true\` — the body IS the callee list, and the caller/callee trail comes with it
55
- - **Reading a source FILE (any time you'd use the \`Read\` tool)** → \`codegraph_node\` with a \`file\` path and no \`symbol\`. It returns the file's **current source with line numbers — the same \`<n>\\t<line>\` shape \`Read\` gives you, safe to \`Edit\` from** — narrowable with \`offset\`/\`limit\` exactly like \`Read\`, PLUS a one-line note of which files depend on it. Same bytes as \`Read\`, faster (served from the index), with the blast radius attached. Use it **instead of \`Read\`** for indexed source files; fall back to \`Read\` only for what codegraph doesn't index (configs, docs). Pass \`symbolsOnly: true\` for just the file's structure.
56
- - **About to read or edit a symbol you can name** → \`codegraph_node\` with that \`symbol\` (SECONDARY — the after-explore depth tool): the verbatim source (\`includeCode: true\`) PLUS its caller/callee trail, so before changing it you see what calls it and what your edit would break. For an OVERLOADED name it returns EVERY matching definition's body in one call, so you never Read a file to find the right overload
53
+ ## How to query
57
54
 
58
- ## Common chains
59
-
60
- - **Flow / "how does X reach Y"**: ONE \`codegraph_explore\` with the symbol names spanning the flow it surfaces the call path among them (riding dynamic-dispatch hops) AND returns their source. No need to reconstruct the path with \`codegraph_search\` + \`codegraph_callers\`.
61
- - **Onboarding / understanding any area**: ONE \`codegraph_explore\` is usually the whole answer. Only follow up \`codegraph_node\` for a specific symbol if something is still unclear.
62
- - **Refactor planning**: \`codegraph_callers\` for the complete call-site list to update; the wider blast radius is already attached to \`codegraph_explore\` / \`codegraph_node\` output.
63
- - **Debugging a regression**: \`codegraph_callers\` of the suspected symbol; \`codegraph_node\` on anything unexpected that appears.
55
+ - **Almost any question — "how does X work", architecture, a bug, "what/where is X", or surveying an area** → \`codegraph_explore\` with a natural-language question or the relevant names. ONE capped call returns the verbatim source grouped by file; most often the ONLY call you need.
56
+ - **"How does X reach/become Y? / the flow / the path from X to Y"** → \`codegraph_explore\`, naming the symbols that span the flow (e.g. \`mutateElement renderScene\`) — it surfaces the call path among them, riding dynamic-dispatch hops, and returns their source.
57
+ - **Reading or editing a file/symbol you can name** put its name or file path in the \`codegraph_explore\` query it returns that current line-numbered source (safe to \`Edit\` from) with the call path and blast radius attached, so you don't Read it separately. For an overloaded name it returns every matching definition's body in one call.
58
+ - **Need more?** Call \`codegraph_explore\` again with more specific namestreat the source it returns as already Read.
64
59
 
65
60
  ## Anti-patterns
66
61
 
67
62
  - **Trust codegraph's results — don't re-verify them with grep.** They come from a full AST parse; re-checking with grep is slower, less accurate, and wastes context.
68
- - **Don't grep first** when looking up a symbol by name \`codegraph_search\` is faster and returns kind + location + signature.
69
- - **Don't chain \`codegraph_search\` + \`codegraph_node\`** to understand an area ONE \`codegraph_explore\` returns the relevant symbols' source together in a single round-trip.
70
- - **Don't loop \`codegraph_node\` over many symbols**one \`codegraph_explore\` call returns them all grouped by file, while each separate call re-reads the whole context and costs far more. Use \`codegraph_node\` for a single symbol.
71
- - **Don't reach for the \`Read\` tool on an indexed source file** — \`codegraph_node\` with a \`file\` reads it for you (same \`<n>\\t<line>\` source, \`offset\`/\`limit\` like Read, faster, with its blast radius), and with a \`symbol\` it returns the source plus the caller/callee trail. Reach for raw \`Read\` only for what codegraph doesn't index (configs, docs) or when the staleness banner flags a file as pending re-index.
72
- - **After editing, check the staleness banner.** When a tool response starts with "⚠️ Some files referenced below were edited since the last index sync…", the listed files are pending re-index — Read those specific files for accurate content. Every file NOT in that banner is fresh, so still trust codegraph.
63
+ - **Don't grep or Read first** to find or understand indexed code — ONE \`codegraph_explore\` returns the relevant symbols' source together in a single round-trip. Reach for raw \`Read\`/\`Grep\` only to confirm a specific detail codegraph didn't cover, or for what codegraph doesn't index (configs, docs).
64
+ - **Don't reconstruct a flow by hand** name the endpoints in one \`codegraph_explore\` and it surfaces the path between them, dynamic-dispatch hops included.
65
+ - **After editing, check the staleness banner.** When a tool response starts with "⚠️ Some files referenced below were edited since the last index sync…", the listed files are pending re-index Read those specific files for accurate content. Every file NOT in that banner is fresh, so still trust codegraph. A different, rarer banner — "⚠️ CodeGraph auto-sync is DISABLED…" — means live watching stopped entirely (the whole index is frozen, not just a few files); until it's resolved, Read files directly to confirm anything that may have changed.
73
66
 
74
67
  ## Limitations
75
68
 
@@ -79,23 +72,35 @@ typically one to a few calls; a grep/read exploration is dozens.
79
72
  - 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.
80
73
  `;
81
74
  /**
82
- * Instructions variant sent when the workspace has NO codegraph index.
75
+ * Instructions variant sent when the server's own root has NO codegraph index.
83
76
  *
84
- * Sending the full playbook ("lean on codegraph for everything") into a
85
- * session where every call would fail wastes the agent's calls and worse —
86
- * the failures teach it codegraph is broken. The unindexed variant is a
87
- * short, unambiguous "inactive this session" note; `tools/list` is gated to
88
- * empty in the same state, so the agent has nothing to mis-call. Indexing is
89
- * deliberately left to the user: the agent is told NOT to run init itself.
77
+ * The tools are still exposed (gating tool availability on whether `./` has an
78
+ * index is the bug behind #964: it breaks monorepos where only sub-projects are
79
+ * indexed, and a server that started before `codegraph init` never surfaces the
80
+ * tools afterward). Instead of an "inactive" note, this variant tells the agent
81
+ * codegraph works **per project**: there's no default project to query, so pass
82
+ * a `projectPath` to any project that HAS a `.codegraph/`. The full single-
83
+ * project playbook ({@link SERVER_INSTRUCTIONS}) is sent instead when the root
84
+ * IS indexed, so the common case stays tight.
90
85
  */
91
- exports.SERVER_INSTRUCTIONS_UNINDEXED = `# Codegraph — inactive (workspace not indexed)
86
+ exports.SERVER_INSTRUCTIONS_NO_ROOT_INDEX = `# Codegraph — available (per-project; pass projectPath)
87
+
88
+ Codegraph is a SQLite knowledge graph of a codebase's symbols, edges, and
89
+ files: one \`codegraph_explore\` call returns the verbatim, line-numbered source
90
+ of the relevant symbols PLUS the call paths between them and a blast-radius
91
+ summary — replacing a grep + Read loop with one round-trip.
92
92
 
93
- This workspace has no codegraph index (no \`.codegraph/\` directory), so no
94
- codegraph tools are available this session. Work with your built-in tools as
95
- usual.
93
+ This server started somewhere with no \`.codegraph/\` of its own, so there is no
94
+ default project but the tools are available and work **per project**:
96
95
 
97
- Indexing is the user's decision do not run it yourself. If the user asks
98
- about codegraph, they can enable it by running \`codegraph init\` in the
99
- project root and starting a new session.
96
+ - To query a project that HAS a \`.codegraph/\` index (e.g. a service inside a
97
+ monorepo, or a second repo), pass its path as \`projectPath\` to
98
+ \`codegraph_explore\` (and any other codegraph tool). Codegraph resolves the
99
+ nearest \`.codegraph/\` at or above that path and answers from it — for as many
100
+ projects as you like in one session.
101
+ - For a project with no \`.codegraph/\`, use your built-in tools (Read/Grep/Glob)
102
+ for that project. Indexing is the user's decision — don't run it yourself, but
103
+ if it comes up they can run \`codegraph init\` in a project to enable codegraph
104
+ there (a new index is picked up live, no restart).
100
105
  `;
101
106
  //# sourceMappingURL=server-instructions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"server-instructions.js","sourceRoot":"","sources":["../../src/mcp/server-instructions.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;GAgBG;AACU,QAAA,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2DlC,CAAC;AAEF;;;;;;;;;GASG;AACU,QAAA,6BAA6B,GAAG;;;;;;;;;CAS5C,CAAC"}
1
+ {"version":3,"file":"server-instructions.js","sourceRoot":"","sources":["../../src/mcp/server-instructions.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACU,QAAA,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkDlC,CAAC;AAEF;;;;;;;;;;;GAWG;AACU,QAAA,iCAAiC,GAAG;;;;;;;;;;;;;;;;;;;CAmBhD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/mcp/session.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EAAuC,gBAAgB,EAAc,MAAM,aAAa,CAAC;AAChG,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAOrC;;;GAGG;AAGH,eAAO,MAAM,WAAW;;;CAGvB,CAAC;AAEF,uDAAuD;AACvD,eAAO,MAAM,gBAAgB,eAAe,CAAC;AAmC7C,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC;AAED;;;GAGG;AACH,qBAAa,UAAU;IASnB,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,MAAM;IAThB,OAAO,CAAC,mBAAmB,CAAS;IACpC,kFAAkF;IAClF,OAAO,CAAC,UAAU,CAAyB;IAC3C,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,cAAc,CAA8B;IACpD,OAAO,CAAC,mBAAmB,CAAgB;gBAGjC,SAAS,EAAE,gBAAgB,EAC3B,MAAM,EAAE,SAAS,EACzB,IAAI,GAAE,iBAAsB;IAK9B;;;OAGG;IACH,KAAK,IAAI,IAAI;IAIb;;;OAGG;IACH,IAAI,IAAI,IAAI;IAIZ,kEAAkE;IAClE,YAAY,IAAI,gBAAgB;YAIlB,aAAa;YA0Cb,gBAAgB;YAyDhB,eAAe;YAcf,eAAe;IAiC7B;;;;;;;OAOG;YACW,iBAAiB;IAyB/B;;;OAGG;YACW,aAAa;CAgB5B"}
1
+ {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/mcp/session.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EAAuC,gBAAgB,EAAc,MAAM,aAAa,CAAC;AAChG,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAOrC;;;GAGG;AAGH,eAAO,MAAM,WAAW;;;CAGvB,CAAC;AAEF,uDAAuD;AACvD,eAAO,MAAM,gBAAgB,eAAe,CAAC;AAmC7C,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC;AAED;;;GAGG;AACH,qBAAa,UAAU;IASnB,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,MAAM;IAThB,OAAO,CAAC,mBAAmB,CAAS;IACpC,kFAAkF;IAClF,OAAO,CAAC,UAAU,CAAyB;IAC3C,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,cAAc,CAA8B;IACpD,OAAO,CAAC,mBAAmB,CAAgB;gBAGjC,SAAS,EAAE,gBAAgB,EAC3B,MAAM,EAAE,SAAS,EACzB,IAAI,GAAE,iBAAsB;IAK9B;;;OAGG;IACH,KAAK,IAAI,IAAI;IAIb;;;OAGG;IACH,IAAI,IAAI,IAAI;IAIZ,kEAAkE;IAClE,YAAY,IAAI,gBAAgB;YAIlB,aAAa;YA0Cb,gBAAgB;YA0DhB,eAAe;YAkBf,eAAe;IAiC7B;;;;;;;OAOG;YACW,iBAAiB;IAyB/B;;;OAGG;YACW,aAAa;CAgB5B"}
@@ -203,23 +203,24 @@ class MCPSession {
203
203
  else if (this.explicitProjectPath) {
204
204
  explicitPath = this.explicitProjectPath;
205
205
  }
206
- // Pick the instructions variant by the workspace's index state — a cheap
206
+ // Pick the instructions variant by the root's index state — a cheap
207
207
  // synchronous walk-up (existsSync loop only, no DB open, so the #172
208
- // respond-fast contract holds). An unindexed workspace gets the short
209
- // "inactive this session" note instead of the full playbook: the playbook
210
- // tells the agent to lean on tools that would all fail, and early failures
211
- // teach the agent to abandon codegraph entirely. `tools/list` is gated the
212
- // same way (empty list when unindexed). When no explicit path is known yet
213
- // (roots/list dance pending), cwd is the best predictor of where the
214
- // default project will resolve — and on a mismatch the worst case is the
215
- // optimistic full playbook backstopped by the empty tool list.
208
+ // respond-fast contract holds). When the root IS indexed, send the full
209
+ // single-project playbook. When it ISN'T, send the per-project variant
210
+ // (tools are still exposed see handleToolsList): it tells the agent there
211
+ // is no default project and to pass `projectPath` to any project that has a
212
+ // `.codegraph/`. Gating tool AVAILABILITY on whether `./` is indexed was the
213
+ // #964 bug it broke monorepos (only sub-projects indexed) and never
214
+ // surfaced the tools after a mid-session `codegraph init`. When no explicit
215
+ // path is known yet (roots/list dance pending), cwd is the best predictor of
216
+ // where the default project will resolve.
216
217
  const indexed = (0, directory_1.findNearestCodeGraphRoot)(explicitPath ?? process.cwd()) !== null;
217
218
  // Respond to the handshake BEFORE doing any heavy init — see issue #172.
218
219
  this.transport.sendResult(request.id, {
219
220
  protocolVersion: exports.PROTOCOL_VERSION,
220
221
  capabilities: { tools: {} },
221
222
  serverInfo: exports.SERVER_INFO,
222
- instructions: indexed ? server_instructions_1.SERVER_INSTRUCTIONS : server_instructions_1.SERVER_INSTRUCTIONS_UNINDEXED,
223
+ instructions: indexed ? server_instructions_1.SERVER_INSTRUCTIONS : server_instructions_1.SERVER_INSTRUCTIONS_NO_ROOT_INDEX,
223
224
  });
224
225
  if (explicitPath) {
225
226
  // Kick off engine init in the background. If another session in the
@@ -230,15 +231,19 @@ class MCPSession {
230
231
  }
231
232
  async handleToolsList(request) {
232
233
  await this.retryInitIfNeeded();
233
- // An unindexed workspace serves an EMPTY tool list: absence is the one
234
- // signal an agent can't misread. Listing 8 tools that all fail wastes the
235
- // agent's calls and teaches it codegraph is broken (observed: one or two
236
- // early isError responses and the agent stops calling codegraph for the
237
- // whole session). A `codegraph init` run after the server started is
238
- // picked up on the next tools/list retryInitIfNeeded re-walks though
239
- // most hosts only request the list once per connection.
234
+ // Always expose the tools even when the server root has no index. Gating
235
+ // availability on whether `./` is indexed (the old behavior) breaks the
236
+ // monorepo case where only sub-projects carry a `.codegraph/` (the agent
237
+ // saw zero tools and couldn't even reach an indexed sub-project by
238
+ // `projectPath`), and it hides the tools from a session that started before
239
+ // the user ran `codegraph init` (most hosts request the list once, so the
240
+ // freshly-built index never surfaces). #964. The not-indexed case is still
241
+ // safe: a call against an un-indexed path returns SUCCESS-shaped guidance
242
+ // ("pass projectPath / run codegraph init"), never `isError`, so it can't
243
+ // teach the agent to abandon codegraph. `getTools()` returns the default
244
+ // surface even before a project is open.
240
245
  this.transport.sendResult(request.id, {
241
- tools: this.engine.hasDefaultCodeGraph() ? this.engine.getToolHandler().getTools() : [],
246
+ tools: this.engine.getToolHandler().getTools(),
242
247
  });
243
248
  }
244
249
  async handleToolsCall(request) {
@@ -1 +1 @@
1
- {"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/mcp/session.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,2CAA6B;AAC7B,2CAAgG;AAEhG,mCAAgC;AAChC,+DAA2F;AAC3F,uCAAoD;AACpD,4CAAwD;AACxD,4CAAwD;AAExD;;;GAGG;AACH,2EAA2E;AAC3E,4EAA4E;AAC/D,QAAA,WAAW,GAAG;IACzB,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,iCAAuB;CACjC,CAAC;AAEF,uDAAuD;AAC1C,QAAA,gBAAgB,GAAG,YAAY,CAAC;AAE7C;;;GAGG;AACH,MAAM,qBAAqB,GAAG,IAAI,CAAC;AAEnC;;;GAGG;AACH,SAAS,aAAa,CAAC,GAAW;IAChC,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;QACzB,IAAI,QAAQ,GAAG,kBAAkB,CAA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