import type { ProxyServiceInstallSettings, ProxyPackageSelection, ProxyStagedInstallOptions, ProxyPackageUpgradeOptions, GlobalInstallerExecFile, GlobalInstallerKind, GlobalInstallerResolution, InstalledVersionValidation, ResolveGlobalInstallerOptions, ValidateInstalledVersionOptions } from "../types/index.js";
/** Resolve a package manager that can update the installation currently running. */
export declare function resolveGlobalInstaller(options?: ResolveGlobalInstallerOptions): GlobalInstallerResolution;
export declare function getGlobalInstallArgs(kind: GlobalInstallerKind, packageSpec: string): string[];
/**
 * Return whether a global package-manager failure is likely environmental and
 * worth retrying. Configuration and permission failures deliberately return
 * false so the updater does not repeatedly mutate a broken installation.
 *
 * @param error - The package-manager error, including any nested `cause` chain.
 */
export declare function isTransientInstallFailure(error: unknown): boolean;
/**
 * Validate a freshly installed CLI with retries. Global package replacement
 * can leave executable shims briefly unavailable while filesystem metadata and
 * cold module loading settle, so a single short probe is not authoritative.
 */
export declare function validateInstalledVersion(options: ValidateInstalledVersionOptions): Promise<InstalledVersionValidation>;
export declare function describeInstallFailure(error: unknown): string;
/** Read package metadata without importing the CLI/provider/telemetry graph. */
export declare function inspectProxyPackage(entryScript: string, nodePath?: string): ProxyPackageSelection;
export declare function readProxyPackageSelection(packagesDir: string, previous?: boolean): ProxyPackageSelection | null;
/** Resolve immutable selections before consulting an older mutable global entry. */
export declare function resolveProxyWorkerPackage(options: {
    packagesDir: string;
    entryScript: string;
    expectedVersion: string;
}): ProxyPackageSelection;
/** Persist only package selection; runtime env, config and launchd settings are untouched. */
export declare function selectProxyPackage(packagesDir: string, selection: ProxyPackageSelection, isCurrentOwner?: () => boolean): void;
/** No startup probes: IPC descriptors and OTel initialization belong to the real process. */
export declare function writeProxyPackageLauncher(path: string, selection: ProxyPackageSelection, isCurrentOwner?: () => boolean): void;
/** Install in a private tree, then publish the immutable directory after validation. */
export declare function installStagedProxyPackage(options: ProxyStagedInstallOptions): Promise<ProxyPackageSelection>;
/** Preserve local runtime diff hunks before any launcher or live selection changes. */
export declare function prepareProxyPackageUpgrade(options: ProxyPackageUpgradeOptions): Promise<ProxyPackageSelection>;
/** Only operator runtime settings survive reinstall, never worker IPC identity. */
export declare function isProxyServiceEnvironmentKey(name: string): boolean;
/** Parse plutil JSON without exposing credentials or invoking the saved launcher. */
export declare function parseProxyServiceInstallSettings(value: unknown): ProxyServiceInstallSettings;
/** Distinguish an absent launchd job from permission failures without logging plist/env data. */
export declare function probeProxyLaunchdPresence(options: {
    label: string;
    uid: number;
    execFileSync?: GlobalInstallerExecFile;
}): "loaded" | "not_loaded" | "unknown";
/** Read-only guard: callers must run this before every reinstall mutation. */
export declare function assertProxyServiceInstallIdle(options: {
    pids: number[];
    getProcessStatus: (pid: number) => "running" | "not_running" | "unknown";
    launchdPresence: "loaded" | "not_loaded" | "unknown";
}): void;
