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

Function until

__tests__/mcp-opencode-tool-names.test.ts:226–232  ·  view source on GitHub ↗
(check: () => boolean)

Source from the content-addressed store, hash-verified

224 const reply = (id: number) =>
225 out.split('\n').filter((l) => l.startsWith('{')).map((l) => JSON.parse(l)).find((m) => m.id === id);
226 const until = async (check: () => boolean) => {
227 const deadline = Date.now() + 15_000;
228 while (!check()) {
229 if (Date.now() > deadline) throw new Error(`no reply: ${out}\n${err}`);
230 await new Promise((r) => setTimeout(r, 25));
231 }
232 };
233 try {
234 send({ id: 1, method: 'initialize', params: initializeParams(clientInfo, indexedDir) });
235 send({ id: 2, method: 'tools/list', params: {} });

Callers 1

proxyHandshakeFunction · 0.70

Calls 1

checkFunction · 0.70

Tested by

no test coverage detected