import { type BootDecisionKind, type UpdatePinRecord } from './self-update-rollback.js'; export declare const SELF_UPDATE_DRAIN_MAX_WAIT_MS: number; export declare const UPDATE_CHANNEL_ENV = "AWB_AGENT_MANAGER_UPDATE_CHANNEL"; export declare const UPDATE_CHANNEL_OFF = "off"; export type InstallMode = 'npm-global' | 'unknown'; export declare function resolveUpdateChannel(raw?: string | null): string; export declare function isAutoUpdateDisabled(channel: string): boolean; export declare function resolveEffectiveUpdateChannel(channel: string, pin: UpdatePinRecord | null): string; export declare const UPDATE_POLICY_ENV = "AWB_AGENT_MANAGER_UPDATE_POLICY"; export type UpdatePolicy = 'manual' | 'scheduled' | 'auto'; export declare function resolveUpdatePolicy(raw?: string | null): UpdatePolicy; export type UpdatePolicyAction = 'none' | 'request_approval' | 'start'; export type UpdatePolicyReason = 'channel_off' | 'policy_manual' | 'up_to_date' | 'no_window' | 'outside_window' | 'auto_in_window' | 'approved' | 'awaiting_approval'; export interface UpdatePolicyGateResult { action: UpdatePolicyAction; reason: UpdatePolicyReason; approvalVersion: string | null; logLine: string; } export declare function evaluateUpdatePolicyGate(input: { policy: UpdatePolicy; channel: string; windowRaw: string | null | undefined; now: Date; updateAvailable: boolean; latestVersion: string | null; approvedVersion: string | null; }): UpdatePolicyGateResult; export interface UpdateStatus { current_version: string; latest_version: string | null; update_available: boolean; install_mode: InstallMode; update_channel: string; last_checked_at: string | null; last_error: string | null; update_approval_pending_version: string | null; } export interface SelfUpdateResult { changed: boolean; summary: string; willReExec?: boolean; deferred?: boolean; } export interface SelfUpdateOpts { log?: (msg: string) => void; noReExec?: boolean; countInFlightSessions?: () => number; drainMaxWaitMs?: number; stateDir?: string; withinWindow?: boolean; approvalSource?: string; pinnedTargetVersion?: string; ports?: SelfUpdatePorts; } export interface EntrypointProbeResult { ok: boolean; reportedVersion: string | null; detail: string; } export interface SelfUpdatePorts { install?: (spec: string) => Promise<{ ok: boolean; detail: string; }>; verifyProvenance?: (channel: string) => Promise; restart?: () => void; probe?: (input: { expectVersion: string; }) => Promise; } export declare function classifyInstallMode(npmGlobalRoot: string | null): InstallMode; export declare function detectInstallMode(): InstallMode; export declare function readBundledVersion(): string; export declare function compareSemver(a: string, b: string): number; export declare class UpdateChecker { #private; constructor(opts?: { intervalMs?: number; log?: (msg: string) => void; installMode?: InstallMode; updateChannel?: string; currentVersion?: string; countInFlightSessions?: () => number; stateDir?: string; updatePolicy?: string; updateWindow?: string; now?: () => Date; runUpdate?: (opts: SelfUpdateOpts) => Promise; npmView?: (channelSpec: string) => Promise<{ ok: boolean; stdout: string; stderr: string; }>; verifyProvenance?: (channel: string) => Promise; }); status(): UpdateStatus; setCountInFlightSessions(fn: () => number): void; start(): void; stop(): void; checkNow(): Promise; } export declare function _resetSelfUpdateInFlightForTests(): void; export declare function runSelfUpdate(opts?: SelfUpdateOpts): Promise; export declare function isSystemdReExecPending(): boolean; export declare function pendingRestartReason(): 'self_update_restart' | null; export declare function _setPendingRestartReasonForTests(reason: 'self_update_restart' | null): void; export declare function hasPendingSelfUpdate(opts?: { stateDir?: string; }): boolean; export interface NpmUpdateGateResult { proceed: boolean; deferred: boolean; nextDeferredSinceMs: number | null; summary: string | null; } export declare function evaluateNpmUpdateGate(input: { countInFlightSessions: number | null; deferredSinceMs: number | null; nowMs: number; capMs: number; }): NpmUpdateGateResult; export declare function _npmGlobalUpdaterSourceForTests(): string; export interface ProvenanceVerdict { ok: boolean; version: string | null; reason: string; } export declare function parseProvenanceView(stdout: string): ProvenanceVerdict; export declare function probeInstalledEntrypoint(input: { expectVersion: string; entrypoint?: string | null; timeoutMs?: number; }): Promise; export declare function resolveVerifiedRollbackSpec(input: { previousVersion: string; verifyProvenance: (channel: string) => Promise; out: (msg: string) => void; bypassed?: boolean; }): Promise; export interface BootVerificationOutcome { kind: BootDecisionKind; armed: boolean; willReExec: boolean; summary: string | null; } export declare function runBootVerification(opts?: SelfUpdateOpts): Promise; export declare function _scheduleRollbackRestartForTests(restart: () => void): void; export declare function markBootVerified(opts?: SelfUpdateOpts): boolean; export declare function runBootVerificationTimeout(opts?: SelfUpdateOpts & { elapsedMs?: number; timeoutMs?: number; heartbeatEnabled?: boolean; }): Promise; export declare function restartManager(opts?: SelfUpdateOpts): Promise;