/** Which cadence tier a poll is currently in. */ export type PollTier = "active" | "passive" | "halted"; /** The two facts that decide the tier. */ export interface PollSignals { /** The tab is backgrounded — `document.hidden`. */ hidden: boolean; /** * Work the user is waiting on is in flight right now (an engine is working, * a loop is iterating, a build is queued). NOT "a session exists" — an idle * session is precisely the case worth slowing down. */ busy: boolean; } /** Per-call-site cadence. `halted` is always 0 (suppressed) and is not configurable. */ export interface PollCadence { /** Interval while something is running. Usually the site's existing interval. */ activeMs: number; /** Interval while the tab is visible but nothing is running. `0` suppresses. */ passiveMs: number; } /** * Note `busy` wins over `hidden`: a backgrounded tab whose engine is mid-run * stays in `active`. That is the issue's own definition (Halted requires no * agent AND no conversation), and it is load-bearing here — the client-driven * Coder Loop and the post-delegation watcher advance off these polls, so * halting a busy tab would stall real work, not just a display. */ export declare function resolvePollTier(signals: PollSignals): PollTier; /** Interval for the current tier. `0` means "do not poll at all". */ export declare function resolvePollMs(cadence: PollCadence, signals: PollSignals): number; /** * Should the caller fetch ONCE immediately, on top of the interval, because the * tier just got faster? * * This is what makes the halted tier safe. Suppressing a poll in a hidden tab * leaves the displayed value stale by an unbounded amount; refreshing the * instant the tab comes back means the user never SEES the stale value, so the * suppression is invisible. `null` (first mount) is false — call sites already * do their own initial load. */ export declare function shouldRefreshOnResume(previous: PollTier | null, next: PollTier): boolean; //# sourceMappingURL=poll-cadence.d.ts.map