Something went wrong. Try again.
fork of prime agent with changes i want but are not upstreamable probqbly (and some fixes)
Something went wrong. Try again.
402 B · 18 lines
TypeScript
at main
12345678910111213141516171819/** * Sleep helper that respects abort signal. */export function sleep(ms: number, signal?: AbortSignal): Promise<void> { return new Promise((resolve, reject) => { if (signal?.aborted) { reject(new Error("Aborted")); return; }
const timeout = setTimeout(resolve, ms);
signal?.addEventListener("abort", () => { clearTimeout(timeout); reject(new Error("Aborted")); }); });}