import { ApiClient } from './api-client'; import type { AutoUpdateConfig } from './types'; export interface AutoUpdaterHandle { stop: () => void; } /** * Start the auto-updater that periodically checks for new versions. * * @param clients - ApiClient instances (any one is used for version check) * @param config - Auto-update configuration * @param stopAllAgents - Function to gracefully stop all running agents * @param sendUpdateError - Function to report update errors via heartbeat * @param isAnyAgentBusy - Optional callback to check if any agent is processing a command * @param isUpdateAllowed - Optional gate evaluated on every check. Returning false skips the * check entirely. Used to honour the server-side (admin UI) auto-update setting without * requiring an agent restart. Omitted = always allowed (previous behaviour). * * NOTE: `config.enabled` is deliberately NOT consulted here. Whether an update may run is * decided per check by `isUpdateAllowed` (the server-side setting can flip between checks), * and `config.enabled` only records the startup baseline from CLI flags / local config. * Adding an early return on `!config.enabled` would pin the decision to startup and make the * admin UI toggle require an agent restart. Callers that must never update — a CLI * `--no-auto-update`, or a runtime where self-update cannot work — simply never call this. */ export declare function startAutoUpdater(clients: ApiClient[], config: AutoUpdateConfig, stopAllAgents: () => void | Promise, sendUpdateError?: (error: string) => void, isAnyAgentBusy?: () => Promise, isUpdateAllowed?: () => Promise): AutoUpdaterHandle; //# sourceMappingURL=auto-updater.d.ts.map