import { type PackageManager, type PlatformInfo } from './detect-platform.js';
export interface TmuxResult {
    installed: boolean;
    version?: string;
    /** True iff we ran an installer (vs. tmux was already present). */
    freshInstall: boolean;
    /** Which strategy actually ran the install. */
    strategy?: PackageManager;
    /** When installed=false: human-readable reason for the caller's warning. */
    reason?: string;
    /** When installed=false: the manual command we'd have run, for the warning. */
    manualCommand?: string;
}
export declare function tmuxEnv(env?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
/**
 * Functional tmux probe — actually starts a tmux server and tears it down.
 *
 * `tmux -V` only checks the binary, not whether tmux can create a socket and
 * fork a session. Real-world failures we've seen: (1) /tmp owned by another
 * user, (2) broken ~/.tmux.conf, (3) the binary is a libc-mismatched dynamic
 * link, (4) tmux 1.x on minimal images missing libevent. All of those make
 * `tmux -V` succeed but every `new-session` / `attach-session` fail, which
 * floods daemon-error.log and leaves the worker with no working backend.
 *
 * Uses a unique `-L <socket-name>` so the probe never clobbers an existing
 * user tmux server. Stderr is captured (not inherited) so the failure
 * reason can surface in the bootstrap warning without spilling onto the
 * user's terminal.
 */
export declare function probeTmuxFunctional(): {
    ok: true;
    version: string;
} | {
    ok: false;
    reason: string;
};
/** Build the install argv for a given package manager. Pure: returns argv[]
 *  ready for spawnSync, no side effects. Returns undefined if escalation
 *  isn't possible. */
export declare function buildInstallArgv(pm: PackageManager, pkg: string, info: PlatformInfo): string[] | undefined;
/** apt-get specifically needs an updated package list on minimal images
 *  before the install will find tmux. This is NOT part of buildInstallArgv
 *  (which is pure) — it runs once just before the apt install attempt.
 *  Failure here is non-fatal; the actual install will fail loudly if it
 *  can't find the package. */
export declare function aptUpdateBeforeInstall(info: PlatformInfo): void;
/** Suggest the manual command we'd have run, for the failure message. */
export declare function suggestManualCommand(pm: PackageManager, pkg: string): string;
export declare function runInstall(argv: string[]): boolean;
export declare function ensureTmux(info?: PlatformInfo): Promise<TmuxResult>;
//# sourceMappingURL=ensure-tmux.d.ts.map