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

Function routeToDaemon

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

Source from the content-addressed store, hash-verified

277 // initialize already answered locally; notifications (initialized) need no reply.
278 };
279 const routeToDaemon = (line: string): void => {
280 if (daemonStatus === 'ready' && daemonSocket) {
281 trackInflight(line);
282 if (process.env.CODEGRAPH_MCP_DEBUG) process.stderr.write(`[mcp-debug] proxy->daemon ${line.slice(0, 80)}\n`);
283 try { daemonSocket.write(line.endsWith('\n') ? line : line + '\n'); } catch { /* close path */ }
284 } else if (daemonStatus === 'failed') {
285 void handleLocally(line);
286 } else {
287 if (process.env.CODEGRAPH_MCP_DEBUG) process.stderr.write(`[mcp-debug] proxy-buffer(${daemonStatus}) ${line.slice(0, 80)}\n`);
288 pending.push(line);
289 }
290 };
291
292 // ---- client (stdin) ----
293 let stdinBuf = '';

Callers 1

runLocalHandshakeProxyFunction · 0.85

Calls 3

trackInflightFunction · 0.85
handleLocallyFunction · 0.85
writeMethod · 0.45

Tested by

no test coverage detected