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

Function routeToDaemon

src/mcp/proxy.ts:417–428  ·  view source on GitHub ↗
(line: string)

Source from the content-addressed store, hash-verified

415 // initialize already answered locally; notifications (initialized) need no reply.
416 };
417 const routeToDaemon = (line: string): void => {
418 if (daemonStatus === 'ready' && daemonSocket) {
419 trackInflight(line);
420 if (process.env.CODEGRAPH_MCP_DEBUG) process.stderr.write(`[mcp-debug] proxy->daemon ${line.slice(0, 80)}\n`);
421 try { daemonSocket.write(line.endsWith('\n') ? line : line + '\n'); } catch { /* close path */ }
422 } else if (daemonStatus === 'failed') {
423 void handleLocally(line);
424 } else {
425 if (process.env.CODEGRAPH_MCP_DEBUG) process.stderr.write(`[mcp-debug] proxy-buffer(${daemonStatus}) ${line.slice(0, 80)}\n`);
426 pending.push(line);
427 }
428 };
429
430 // ---- client (stdin) ----
431 let stdinBuf = '';

Callers 1

runLocalHandshakeProxyFunction · 0.85

Calls 4

trackInflightFunction · 0.85
handleLocallyFunction · 0.85
pushMethod · 0.80
writeMethod · 0.65

Tested by

no test coverage detected