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

Function reply

__tests__/security.test.ts:907–915  ·  view source on GitHub ↗
(id: number)

Source from the content-addressed store, hash-verified

905 child.stderr.on('data', (chunk) => { err += chunk.toString('utf8'); });
906 const send = (message: object): void => { child.stdin.write(JSON.stringify(message) + '\n'); };
907 const reply = async (id: number): Promise<Reply> => {
908 const deadline = Date.now() + 30_000;
909 for (;;) {
910 const hit = messages.find((m) => m.id === id && m.result);
911 if (hit) return hit.result!;
912 if (Date.now() > deadline) throw new Error(`${source}: no reply ${id}; stderr: ${err}`);
913 await new Promise((resolve) => setTimeout(resolve, 25));
914 }
915 };
916
917 send({
918 jsonrpc: '2.0', id: 0, method: 'initialize',

Callers 1

security.test.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected