import { type InstallMethod } from './cli-install-method.js'; import { runWithSudo, type SudoFailure } from './sudo-runner.js'; export declare const CLI_UPDATE_TIMEOUT_MS: number; export interface CliUpdateAttempt { method: string; command: string; ok: boolean; output: string; } export interface CliUpdateOutcome { supported: boolean; ok: boolean; before: string | null; after: string | null; detail: string; hostLabel: string; resolvedPath: string | null; installMethod: string | null; needsSudo: boolean; sudoFailure: SudoFailure | null; attempts: CliUpdateAttempt[]; otherInstalls: Array<{ path: string; version: string | null; }>; } export interface CliUpdateDeps { run?: (cmd: string, args: string[], timeoutMs: number) => Promise<{ ok: boolean; output: string; }>; probeVersion?: (bin: string) => Promise; listCandidates?: (cli: string) => string[]; detectMethod?: (bin: string, pkg: string | null) => InstallMethod; resolveBin?: (cli: string) => string; invalidateResolved?: (cli: string) => void; runSudo?: typeof runWithSudo; hostLabel?: string; log?: (msg: string) => void; } export interface CliUpdateOptions { bin?: string | null; latest?: string | null; getSudoPassword?: (() => Promise) | null; } export declare function extractSemver(version: string | null | undefined): string | null; export declare function compareCliVersions(a: string | null, b: string | null): number | null; export declare function candidateKeyFor(cli: string, resolvedPath: string): string; export declare function npmLatestApplies(method: InstallMethod): boolean; export declare function listCliInstalls(cli: string, deps?: Pick): Promise>; export declare function runCliUpdate(cli: string, deps?: CliUpdateDeps, options?: CliUpdateOptions): Promise;