(cwd: string)
| 20 | const BIN = path.resolve(__dirname, '../dist/bin/codegraph.js'); |
| 21 | |
| 22 | function spawnServer(cwd: string): ChildProcessWithoutNullStreams { |
| 23 | return spawn(process.execPath, [BIN, 'serve', '--mcp'], { |
| 24 | cwd, |
| 25 | stdio: ['pipe', 'pipe', 'pipe'], |
| 26 | // Pin to direct (in-process) mode. #172 is a contract about the in-process |
| 27 | // server's init ordering — the "File watcher active" log this test observes |
| 28 | // is emitted in-process. In daemon mode the watcher runs in the detached |
| 29 | // daemon (logging to .codegraph/daemon.log, not the child's stderr); the |
| 30 | // same response-before-init guarantee lives in the shared session code and |
| 31 | // is covered by mcp-daemon.test.ts. Direct mode also avoids leaking a |
| 32 | // detached daemon from this suite. |
| 33 | env: { ...process.env, CODEGRAPH_NO_DAEMON: '1' }, |
| 34 | }) as ChildProcessWithoutNullStreams; |
| 35 | } |
| 36 | |
| 37 | function sendInitialize(child: ChildProcessWithoutNullStreams, projectPath: string) { |
| 38 | const msg = JSON.stringify({ |
no outgoing calls
no test coverage detected