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

Function replyFor

__tests__/mcp-initialize.test.ts:223–229  ·  view source on GitHub ↗
(id: number)

Source from the content-addressed store, hash-verified

221 child.stdin.write(JSON.stringify({ jsonrpc: '2.0', id: 2, method: 'prompts/list', params: {} }) + '\n');
222
223 const replyFor = async (id: number) => {
224 const ev = await waitFor(events, (e) => {
225 if (e.stream !== 'stdout') return false;
226 try { return JSON.parse(e.text).id === id; } catch { return false; }
227 }, 5000);
228 return JSON.parse(ev.text);
229 };
230
231 const resources = await replyFor(1);
232 expect(resources.error).toBeUndefined();

Callers 1

Calls 2

parseMethod · 0.80
waitForFunction · 0.70

Tested by

no test coverage detected