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

Function routeToDaemon

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

Source from the content-addressed store, hash-verified

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

Callers 1

runLocalHandshakeProxyFunction · 0.85

Calls 3

trackInflightFunction · 0.85
handleLocallyFunction · 0.85
writeMethod · 0.65

Tested by

no test coverage detected