(line: string)
| 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 = ''; |
no test coverage detected