Brainwires/jevwire on GitHub
- Stars
- 18
- Forks
- 4
- Language
- TypeScript
- License
- MIT
- Last push
- 21 Sep 2026
Read from GitHub on . Counts change daily.
How it uses Jev
const DEFAULT_BASE_URL = "https://api.typesafe.ai";
const DEFAULT_MODEL = "jev-latest";
const DEFAULT_TIMEOUT_MS = 30_000;
const DEFAULT_MAX_RETRIES = 3;
const BACKOFF_BASE_MS = 500;
const BACKOFF_CAP_MS = 10_000;
/** Full-jitter exponential backoff, capped. Exported for tests. */
export function computeBackoffMs(attempt: number, random: () => number = Math.random): number {
const ceiling = Math.min(BACKOFF_CAP_MS, BACKOFF_BASE_MS * 2 ** attempt);
return Math.round(ceiling * (0.5 + 0.5 * random()));
}
/**
* Parse a `retry-after` header: delay-seconds or an HTTP date.
