(cwd: string)
| 36 | } |
| 37 | |
| 38 | function spawnServer(cwd: string): ChildProcessWithoutNullStreams { |
| 39 | return spawn(process.execPath, [...WASM_RUNTIME_FLAGS, BIN, 'serve', '--mcp'], { |
| 40 | cwd, |
| 41 | stdio: ['pipe', 'pipe', 'pipe'], |
| 42 | // Pin to direct (in-process) mode. #172 is a contract about the in-process |
| 43 | // server's init ordering — the "File watcher active" log this test observes |
| 44 | // is emitted in-process. In daemon mode the watcher runs in the detached |
| 45 | // daemon (logging to .codegraph/daemon.log, not the child's stderr); the |
| 46 | // same response-before-init guarantee lives in the shared session code and |
| 47 | // is covered by mcp-daemon.test.ts. Direct mode also avoids leaking a |
| 48 | // detached daemon from this suite. |
| 49 | env: { ...process.env, CODEGRAPH_NO_DAEMON: '1' }, |
| 50 | }) as ChildProcessWithoutNullStreams; |
| 51 | } |
| 52 | |
| 53 | function sendInitialize(child: ChildProcessWithoutNullStreams, projectPath: string) { |
| 54 | const msg = JSON.stringify({ |
no test coverage detected