/** * The periodic refreshes a running gateway keeps doing after boot. * * Both read the live config at fire time rather than the boot snapshot, so a * reload between ticks is respected, and both are unref'd: a background refresh * must never be the reason the process stays up. */ import type { GatewayEmit } from "../shared/gateway-events.js"; import type { JinnConfig } from "../shared/types.js"; /** * How often to re-run dynamic engine model discovery while the gateway is up. * Discovery otherwise only runs on boot, on config reload, and as a post-failure * fallback — so a gateway with multi-day uptime keeps serving a stale catalog and * never sees a model published after it booted. Six hours is cheap (a handful of * short-lived CLI spawns plus one Anthropic catalog GET) and bounds that staleness. */ export declare const MODEL_REFRESH_INTERVAL_MS: number; /** * How often to re-read every engine's quota windows. Without it the health store * is written almost only by a turn that already failed, so each new session pays * one wasted turn to discover an engine is out of allowance. Fifteen minutes is * finer than any quota window resets and costs a few short-lived CLI spawns. */ export declare const ENGINE_HEALTH_REFRESH_INTERVAL_MS: number; export interface BackgroundRefreshes { /** Re-discover models now. The config-reload path asks for this directly, * because engine bins and auth may have changed under it. */ refreshModels: () => void; stop: () => void; } export declare function startBackgroundRefreshes(getConfig: () => JinnConfig, emit: GatewayEmit): BackgroundRefreshes; //# sourceMappingURL=background-refresh.d.ts.map