/** * The device code timed out — the person did not finish in the browser inside the window. * * Named, because a BARE Error is PLATFORM under `failureFrom` ("Clustly's server, the network, or * something we did not classify failed; your input was fine") and this is nobody's failure but the * clock's. Production 2026-09-20 filed it as a red ours-to-fix issue on a builder who simply took * too long. `platformOutage()` below is the case that genuinely IS ours, and stays a bare Error. */ export declare class DeviceCodeExpiredError extends Error { constructor(); } /** * CLI half of the RFC 8628 device flow (design: docs/designs/clustly-cli.md §4; build-plan * 3.3) — the cross-machine path: works from any browser on any device, which is exactly what * a pasted loopback URL cannot do. Polls with the server-given interval and switches on the * §3.5 error codes. */ export interface DeviceStart { deviceCode: string; userCode: string; verificationUri: string; expiresInS: number; intervalS: number; } export interface IssuedKey { apiKey: string; keyPrefix: string; } type Fetch = typeof fetch; type Sleep = (ms: number) => Promise; /** Consecutive polls that got no usable answer before the outage is named as Clustly's (2 min at 5 s). */ export declare const MAX_CONSECUTIVE_POLL_FAILURES = 24; export declare function startDevice(apiBase: string, fetchFn?: Fetch): Promise; /** Poll until approved/denied/expired. Resolves with the freshly minted key. */ export declare function pollDevice(apiBase: string, start: DeviceStart, fetchFn?: Fetch, sleep?: Sleep): Promise; export {};