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

Function replyFor

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

Source from the content-addressed store, hash-verified

165 child.stdin.write(JSON.stringify({ jsonrpc: '2.0', id: 2, method: 'prompts/list', params: {} }) + '\n');
166
167 const replyFor = async (id: number) => {
168 const ev = await waitFor(events, (e) => {
169 if (e.stream !== 'stdout') return false;
170 try { return JSON.parse(e.text).id === id; } catch { return false; }
171 }, 5000);
172 return JSON.parse(ev.text);
173 };
174
175 const resources = await replyFor(1);
176 expect(resources.error).toBeUndefined();

Callers 1

Calls 1

waitForFunction · 0.70

Tested by

no test coverage detected