import type { ProxyRuntimeActivity, ProxyServingWorkerIdentity, ProxyUpdateWindowOptions, ProxyUpdateWindowResult } from "../types/index.js";
/**
 * Parse serving identity conservatively from `/status`. A rolling status is
 * trusted only when the worker-local fields agree with the supervisor snapshot.
 */
export declare function parseProxyServingWorkerIdentity(payload: unknown, rollingSupervisor: boolean): ProxyServingWorkerIdentity | null;
/** A long-running update may mutate live selection only for its original worker. */
export declare function isSameProxyServingWorker(expected: ProxyServingWorkerIdentity, current: ProxyServingWorkerIdentity | null | undefined): boolean;
/**
 * A replacement updater starts from the newly installed package. The registry
 * then reports no newer version even when its launchd parent still runs the
 * old package, so parent reconciliation must be decided from both live
 * generations instead of `updateAvailable` alone.
 */
export declare function shouldRefreshStaleSupervisor(options: {
    updateAvailable: boolean;
    rollingSupervisor: boolean;
    runningVersion: string;
    workerVersion?: string;
    supervisorVersion?: string;
}): boolean;
/** An idle active worker alone does not make its supervisor safe to stop. */
export declare function isProxyRuntimeSettled(activity: ProxyRuntimeActivity): boolean;
/** Parse untrusted status conservatively; incomplete rolling evidence is busy. */
export declare function parseProxyRuntimeActivity(payload: unknown): ProxyRuntimeActivity | null;
/**
 * Prefer a naturally quiet window, then briefly drain new inference traffic.
 * Automatic supervisor refresh uses allowBusyDrain=false: it fences admission
 * only after a quiet observation and never waits for busy workers behind it.
 * Existing requests are never interrupted; a bounded drain failure is returned
 * to the caller so admission can be reopened and retried later.
 */
export declare function waitForProxyUpdateWindow(options: ProxyUpdateWindowOptions): Promise<ProxyUpdateWindowResult>;
/** An asynchronous staging job must not publish after its service owner changes. */
export declare function isProxyUpdateOwnerCurrent(options: {
    stopping: boolean;
    parentPid: number;
    updaterPid: number;
    parentStatus: "running" | "not_running" | "unknown";
    runtimePid?: number;
    runtimeUpdaterPid?: number;
}): boolean;
