/** * Auto-Updater for AgentFactory CLI. * * When enabled, checks for new versions and can automatically update * the CLI package. For long-running processes (fleet, governor), it * waits until there are no active workers before restarting. * * Configuration (in order of precedence): * 1. CLI flag: --auto-update / --no-auto-update * 2. .env.local: AF_AUTO_UPDATE=true * 3. .agentfactory/config.yaml: autoUpdate: true */ import type { UpdateCheckResult } from './version.js'; export interface AutoUpdateConfig { /** CLI flag override (highest precedence) */ cliFlag?: boolean; /** Whether there are active workers/agents to wait for */ hasActiveWorkers?: () => boolean | Promise; /** Callback invoked right before the process exits for restart */ onBeforeRestart?: () => void | Promise; } /** * Resolve whether auto-update is enabled from all config sources. */ export declare function isAutoUpdateEnabled(cliFlag?: boolean): boolean; /** * Perform auto-update if enabled and an update is available. * * For long-running processes (fleet, governor), this should be called * periodically. It will: * 1. Check if auto-update is enabled * 2. Verify an update is available * 3. Wait for active workers to finish (if hasActiveWorkers provided) * 4. Install the update * 5. Exit the process so the service manager can restart with the new version * * Returns true if an update was applied (process will exit shortly after). */ export declare function maybeAutoUpdate(updateCheck: UpdateCheckResult | null, config: AutoUpdateConfig): Promise; //# sourceMappingURL=auto-updater.d.ts.map