/**
 * tmux binary discovery + spawn helpers.
 *
 * Every shell-out goes through `runTmux()` so:
 *  - args are passed as an array, never interpolated into a shell string (no
 *    quoting bugs like swarmify's `command.replace(/'/g, "'\\''")` hack);
 *  - the socket arg is positioned correctly (`-S <sock>` MUST come before the
 *    subcommand);
 *  - stdout/stderr capture is consistent for the session module to parse.
 */
/** Oldest tmux release with `run-shell -C`, required by the managed pane-died hook. */
export declare const MIN_TMUX_VERSION = "3.2";
/**
 * Locate the tmux binary on PATH. Cached after first call — tmux either is or
 * isn't installed for the duration of the process.
 *
 * Returns null when tmux is not installed.
 */
export declare function findTmuxBinary(): string | null;
/** True when tmux is installed somewhere on PATH. */
export declare function isTmuxInstalled(): boolean;
/** Best-effort tmux version string (e.g. "tmux 3.6a"). Returns null when not installed or version probe fails. */
export declare function getTmuxVersion(): string | null;
/** True for a `tmux -V` string at or above the supported 3.2 floor. */
export declare function isTmuxVersionSupported(version: string | null): boolean;
/**
 * Throw a user-friendly error when tmux isn't installed. Command handlers call
 * this first thing so the error message is the same shape every time.
 */
export declare function assertTmuxAvailable(): string;
export declare class TmuxUnavailableError extends Error {
    constructor(message: string);
}
export declare class TmuxCommandError extends Error {
    readonly stderr: string;
    readonly stdout: string;
    readonly code: number | null;
    constructor(message: string, stderr: string, stdout: string, code: number | null);
}
export interface RunTmuxOptions {
    /** Socket path (default: shared server socket). */
    socket?: string;
    /** Args after `tmux -S <socket>` — e.g. `['has-session', '-t', 'foo']`. */
    args: string[];
    /** Throw on nonzero exit. Defaults true. */
    throwOnError?: boolean;
    /** Child process env. */
    env?: NodeJS.ProcessEnv;
    /**
     * Kill the child and reject after this many ms. Unset = wait forever (the
     * historical behavior). A wedged tmux server would otherwise hang the caller
     * indefinitely — the active-session scan passes a bound so a bad server can't
     * freeze `agents sessions --active`.
     */
    timeoutMs?: number;
}
/**
 * Run a tmux command and capture stdout/stderr. The socket arg is hoisted in
 * front of `args` so callers never have to remember the `-S` position.
 *
 * For interactive `attach`, use `attachTmux()` instead — this helper is for
 * scripted commands where you want output back as strings.
 */
export declare function runTmux(opts: RunTmuxOptions): Promise<{
    stdout: string;
    stderr: string;
    code: number;
}>;
/**
 * Foreground attach. Replaces this process's stdio with tmux's so the user is
 * fully inside tmux. Returns the tmux exit code (which the caller should mirror
 * via process.exit so detach/Ctrl-D propagates cleanly).
 */
export declare function attachTmux(opts: {
    socket: string;
    args: string[];
    env?: NodeJS.ProcessEnv;
}): Promise<number>;
