MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / recordDaemonWarning

Function recordDaemonWarning

src/mcp/proxy.ts:305–325  ·  view source on GitHub ↗
(requestLine: string | undefined, response: JsonRpc)

Source from the content-addressed store, hash-verified

303 // local just as MCPSession does when the shared daemon is available.
304 const indexVersionWarnings = new IndexVersionWarningState();
305 const recordDaemonWarning = (requestLine: string | undefined, response: JsonRpc): void => {
306 if (!requestLine) return;
307 const result = response.result as { content?: Array<{ type?: unknown; text?: unknown }> } | undefined;
308 const first = result?.content?.[0];
309 if (first?.type !== 'text' || typeof first.text !== 'string') return;
310 if (!first.text.startsWith(INDEX_VERSION_WARNING_PREFIX)) return;
311
312 let request: JsonRpc;
313 try { request = JSON.parse(requestLine) as JsonRpc; } catch { return; }
314 const params = request.params as {
315 arguments?: { projectPath?: unknown };
316 } | undefined;
317 const requestedPath = params?.arguments?.projectPath;
318 let root = deps.root;
319 if (typeof requestedPath === 'string') {
320 const resolved = findNearestCodeGraphRoot(requestedPath);
321 if (!resolved) return;
322 root = resolved;
323 }
324 indexVersionWarnings.claim(root);
325 };
326 const trackInflight = (line: string): void => {
327 try {
328 const m = JSON.parse(line) as JsonRpc;

Callers 1

attachDaemonFunction · 0.85

Calls 3

findNearestCodeGraphRootFunction · 0.90
parseMethod · 0.80
claimMethod · 0.80

Tested by

no test coverage detected