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

Function routeToDaemon

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

Source from the content-addressed store, hash-verified

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