/** One hour, the window Linear's request quota is measured over. */
export declare const LINEAR_RATE_WINDOW_MS: number;
/**
 * The shared proactive budget, one key's requests per rolling hour. Deliberately
 * under Linear's hard 2500/hr so it leaves headroom for a human using the key and
 * absorbs the concurrent check-then-create overshoot (at most N-1 for N racing
 * agents) without ever reaching a real 429.
 */
export declare const LINEAR_HOURLY_REQUEST_BUDGET = 2400;
export declare function setLinearRateLimitDirForTest(dir: string | null): string | null;
/**
 * Count this key's requests inside the rolling window, sweeping elapsed stamp
 * files as it goes (they can only accumulate at the rate requests are issued, and
 * this is the one place that already lists them). Pure read otherwise.
 */
export declare function linearRequestsInWindow(apiKey: string, nowMs?: number): number;
/**
 * Try to reserve one Linear request against the shared hourly budget.
 *
 * Returns `true` and records the reservation when there is room, `false` when the
 * budget is exhausted — the caller then serves the cache instead of spending a
 * request that would 429. The write is a single empty file whose NAME carries the
 * whole record, so a concurrent reserver can neither clobber it nor be clobbered
 * by it.
 */
export declare function reserveLinearRequest(apiKey: string, nowMs?: number): boolean;
