/**
 * Update Check Module
 *
 * Handles background version checking with caching, package manager detection,
 * and dismissed version tracking. Never blocks startup with network calls —
 * uses cached values for display and checks in the background.
 *
 * Cache file: ~/.proletariat/version-check.json
 * Schema:
 * {
 *   "latest_version": "0.3.53",
 *   "last_checked_at": "2024-01-01T00:00:00.000Z",
 *   "dismissed_version": "0.3.53" | null
 * }
 */
export interface VersionCheckCache {
    latest_version: string | null;
    last_checked_at: string | null;
    dismissed_version: string | null;
}
export type PackageManager = 'brew' | 'npm' | 'standalone';
export declare function readCache(): VersionCheckCache;
export declare function writeCache(cache: VersionCheckCache): void;
/**
 * Returns true if enough time has elapsed since the last check.
 */
export declare function shouldCheck(cache: VersionCheckCache): boolean;
/**
 * Detect how prlt was installed.
 *
 * Priority:
 * 1. PRLT_MANAGED_BY env var (explicit override)
 * 2. Standalone install metadata file (~/.local/lib/proletariat/.install-metadata.json)
 * 3. Binary path heuristic (Homebrew prefixes → brew, ~/.local/bin → standalone, otherwise npm)
 */
export declare function detectPackageManager(): PackageManager;
/**
 * Get the update command string for the detected package manager.
 */
export declare function getUpdateCommand(pm: PackageManager): string;
/**
 * Get the standalone install directory from metadata or default.
 * Returns null if not a standalone install.
 */
export declare function getStandaloneInstallDir(): string | null;
/**
 * Resolve the local filesystem path for the Homebrew tap.
 * Returns null if the tap directory doesn't exist.
 */
export declare function getBrewTapPath(): string | null;
export interface StaleTapResult {
    /** Whether the tap is stale (local HEAD behind origin/main) */
    isStale: boolean;
    /** Local HEAD commit hash (short) */
    localHead?: string;
    /** Remote HEAD commit hash (short) */
    remoteHead?: string;
}
/**
 * Check whether the local Homebrew tap checkout is behind origin/main.
 *
 * Runs a quick `git fetch --dry-run` to update remote refs, then compares
 * local HEAD against origin/main. Returns { isStale: false } for any error
 * or when the tap is not installed (non-brew installs).
 */
export declare function checkStaleTap(tapPath?: string | null): StaleTapResult;
/**
 * Get the remediation commands for a stale Homebrew tap.
 */
export declare function getStaleTapCommands(): string[];
/**
 * Fetch the latest version using the appropriate source for the package manager.
 * For brew installs, uses the Homebrew API (avoids false positives from npm).
 * Falls back to npm registry if brew API fails.
 */
export declare function fetchLatestVersion(pm: PackageManager): Promise<string | null>;
/**
 * Compare two semver-like version strings.
 * Returns true if `latest` is newer than `current`.
 */
export declare function isNewerVersion(current: string, latest: string): boolean;
export interface UpdateInfo {
    /** Whether an update is available (and not dismissed) */
    updateAvailable: boolean;
    /** The current CLI version */
    currentVersion: string;
    /** The latest available version (from cache) */
    latestVersion: string | null;
    /** Detected package manager */
    packageManager: PackageManager;
    /** The command to run the update */
    updateCommand: string;
    /** Whether the Homebrew tap is stale (only set for brew installs) */
    staleTap?: StaleTapResult;
}
/**
 * Check if an update is available using cached data only (synchronous, never blocks).
 * Returns update info if an update is available and not dismissed.
 */
export declare function getCachedUpdateInfo(currentVersion: string): UpdateInfo;
/**
 * Perform a background version check and update the cache.
 * The fetch runs without blocking startup, but the promise is tracked
 * internally so it can be flushed before process exit via
 * {@link flushPendingVersionCheck}.
 */
export declare function triggerBackgroundCheck(pm: PackageManager): void;
/**
 * Await the in-flight background version check (if any) so the result
 * is written to disk before the process exits.  Called from the postrun
 * hook — mirrors the flush pattern used by analytics and Sentry.
 *
 * No-op when no check is pending (the common case).
 */
export declare function flushPendingVersionCheck(): Promise<void>;
/**
 * Dismiss updates for a specific version. The prompt won't show again
 * until a newer version is available.
 */
export declare function dismissVersion(version: string): void;
/**
 * Dismiss updates for the current session only (no persistence).
 * This is the default "Skip" behavior — just don't persist anything.
 */
export declare function dismissSession(): void;
