/**
 * `agents reconnect [session-id]` — get me back into an agent terminal whose ssh
 * link dropped.
 *
 * The auto-reconnect in lib/hosts/reconnect.ts already re-attaches a live remote
 * pane over its own bounded backoff on a transient blink. This is the MANUAL
 * recovery for after it gave up — a sustained outage, or a VS Code terminal tab
 * that closed with the dead ssh client. One verb that always tries hardest to put
 * you back into that agent: attach the live pane if it still exists, else resume
 * the session; live pane > resumed copy > a clear message about what was lost.
 *
 * It delegates to `focus`, which already does exactly attach-else-resume for a
 * resolved id ({@link focusAction} → `focusResolvedSession`), so there is no second
 * recovery path to keep in sync. What `reconnect` adds is the recovery framing and,
 * with no id, targeting the MOST RECENT session in this shell's directory — the one
 * that most likely just dropped — instead of opening the full fleet picker.
 */
import type { Command } from 'commander';
import type { SessionMeta } from '../lib/session/types.js';
/**
 * The recency signal a no-id reconnect targets: last activity if the scan
 * computed one, else the creation time. A row with neither parseable sorts last.
 * Pure so target selection is unit-tested without the scanner.
 */
export declare function sessionRecency(s: Pick<SessionMeta, 'lastActivity' | 'timestamp'>): number;
/**
 * Pick the session to reconnect when the user gave no id: the most recently
 * active one in scope — the terminal that most likely just dropped. Pure; returns
 * undefined for an empty scope so the caller can print guidance.
 */
export declare function pickMostRecentSession(sessions: SessionMeta[]): SessionMeta | undefined;
/**
 * Resolve the no-id target: prefer the most recent session started from THIS
 * directory (the shell the user is reconnecting from), falling back to the most
 * recent session anywhere when the current directory has none. Best-effort — a
 * discovery failure yields undefined, never throws. Injectable `discover` keeps
 * the two-step scope preference testable without touching the real scanner.
 */
export declare function resolveRecentTarget(cwd: string, discover?: (opts: {
    cwd?: string;
    all?: boolean;
    since?: string;
    limit?: number;
}) => Promise<SessionMeta[]>): Promise<SessionMeta | undefined>;
export declare function reconnectAction(id: string | undefined): Promise<void>;
export declare function registerReconnectCommand(program: Command): void;
