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