/**
 * `agents sessions go [id]` — DEPRECATED alias for `agents sessions focus --attach-only`.
 *
 * `go` was "attach or refuse" (never fork/resume). `focus --attach-only` is exactly
 * that behavior, so `go` now prints a deprecation notice and delegates to `focusAction`.
 *
 * This file still owns the shared reach engine that `focus` imports:
 *   - `gatherLiveTargets` / `pickLiveTarget` / `buildLivePool` — live-session discovery + picker
 *   - `jumpTo` — the side-effecting jump: attach the already-running terminal
 *       local tmux    -> attach (switch-client when already inside tmux)
 *       local Ghostty -> focus its tab (Cmd+<n> via System Events; tab # from ghostty-tabs)
 *       remote tmux   -> ssh -tt + tmux attach (pane->session resolved on the remote)
 *       otherwise     -> hand off to the `UnreachableFallback` (attach-only refuses; focus resumes)
 *   - `refuseFallback` — the attach-only fallback (remote -> login shell; local -> refuse)
 */
import type { Command } from 'commander';
import { type ActiveSession } from '../lib/session/active.js';
import type { SessionMeta } from '../lib/session/types.js';
import { type LiveStatusFilter } from './sessions.js';
export declare function registerGoCommand(program: Command): void;
/**
 * Scope a live-session pool by device and live status. Pure so the `focus`
 * device/status filters are unit-testable without touching the sweep. `hosts`
 * keeps only sessions whose `machine` is in the set (local rows carry `self`,
 * remote rows carry their peer tag); `statuses` reuses `--active`'s exact
 * `matchesLiveStatus` derivation rather than a parallel status table.
 */
export declare function filterLivePool(sessions: ActiveSession[], opts?: {
    hosts?: string[];
    statuses?: LiveStatusFilter[];
}): ActiveSession[];
/**
 * Live rows whose session id starts with `selector` (case-insensitive prefix).
 * Same match `resolveOne` uses, so skip-fleet and resolve stay aligned.
 */
export declare function localLiveSelectorMatches(sessions: ActiveSession[], selector: string): ActiveSession[];
/**
 * Skip `gatherRemoteActive` when local already answered the selector:
 * two local matches fail closed without waiting for a sleeping peer that
 * might collide; a single local hit skips only when the selector is a full
 * UUID or unique-enough 8-hex (`isUniqueEnoughSelector`). A shorter unique
 * local prefix still races the fleet so a remote collision can fail closed.
 * Zero matches still race the fleet.
 */
export declare function shouldSkipRemoteSweep(localMatches: ActiveSession[], selector: string): boolean;
/**
 * First-hit abort predicate for a live-id fleet race. A full UUID is globally
 * unique so the first exact hit is the only hit. A unique-enough live prefix
 * (8+ chars, the tmux `ag-<agent>-<8hex>` short id) aborts remaining SSH once
 * a reachable peer answers — unanswered boxes must not delay (PHNX-3298).
 * Shorter prefixes stay all-settle.
 */
export declare function isDefinitiveLiveMatch(session: ActiveSession, selector: string): boolean;
/**
 * Live jump targets (local + remote), keyed by session id. Cloud is excluded by
 * default (it has no local pid to attach), but `detach` opts in with
 * `includeCloud` so it can resolve a cloud id and refuse it with a clear message
 * instead of a bare "no live session".
 *
 * `hosts` scopes the sweep to named devices — the fan-out only dials them, and the
 * pool is then filtered to `s.machine ∈ hosts` so a stray local row can't leak in.
 * `statuses` narrows to the live-state words `--active` uses (orphan/crashed/…).
 * `selector` (detach/stop) skips fleet SSH when local already has a unique live
 * id or a local collision; omit it for browse (`focus` with no id) so the picker
 * still all-settles.
 */
export declare function gatherLiveTargets(local: boolean, opts?: {
    includeCloud?: boolean;
    hosts?: string[];
    statuses?: LiveStatusFilter[];
    selector?: string;
}): Promise<{
    self: string;
    activeById: Map<string, ActiveSession>;
}>;
/** Interactive pick over the live sessions' rich SessionMeta; returns the chosen live session. */
export declare function pickLiveTarget(activeById: Map<string, ActiveSession>, self: string, message: string, enterHint: string): Promise<ActiveSession | null>;
/**
 * Multi-select over the live sessions' rich SessionMeta (same rows as
 * `pickLiveTarget`, but a checkbox picker) — the plural sibling that lets `focus`
 * open several sessions at once. Mirrors `sessions resume`'s `multiItemPicker`
 * wiring; returns the chosen live sessions in pick order, or `[]` on cancel.
 */
export declare function pickLiveTargets(activeById: Map<string, ActiveSession>, self: string, message: string): Promise<ActiveSession[]>;
/**
 * Map each live session to its rich SessionMeta (worktree/PR/changes/tools/tests
 * via the shared picker), reusing `discoverSessions`. Remote or unindexed live
 * sessions get a minimal synthesized meta so they still appear and jump.
 */
export declare function buildLivePool(activeById: Map<string, ActiveSession>, self: string): Promise<SessionMeta[]>;
export interface Where {
    label: string;
    action: string;
}
/** What `jumpTo` writes after a remote tmux attach's SSH stream returns. Pure so
 *  the ControlMaster close path is unit-tested without SSH (RUSH-3227). */
export declare function remoteAttachEndedNotice(sessionId: string | undefined, host: string, code: number): string | undefined;
/**
 * Pure, testable mirror of `jumpTo`'s path selection (jumpTo itself has side
 * effects — process.exit / ssh / osascript). Keep the branch ORDER in sync with
 * `jumpTo` below: remote-tmux, then local-tmux, then ghostty, then refuse.
 */
export declare function describeWhere(s: ActiveSession, self: string): Where;
/**
 * What to do when a session can't be *attached* (no tmux/Ghostty rail). `go`
 * refuses; `focus` opens a new tab and resumes. `remote` is the peer name when
 * the session lives on another machine, else undefined. `fallbackId` is the
 * indexed session id when the live row has not registered one yet (PHNX-3356).
 */
export type UnreachableFallback = (s: ActiveSession, remote: string | undefined, fallbackId?: string) => void | Promise<void>;
export type AttachRailLiveness = {
    state: 'alive';
} | {
    state: 'dead';
    exitStatus?: number;
} | {
    state: 'missing';
};
/** Probe the tmux process, not just retained provenance. This is deliberately
 * called immediately before an attach so remain-on-exit panes cannot masquerade
 * as living agent sessions. */
export declare function probeAttachRail(s: ActiveSession, self: string): Promise<AttachRailLiveness>;
/** Strict attach-only fallback: no pane means no attach. Never open a shell or
 * start recovery, because both would violate the caller's no-fork intent. */
export declare function refuseFallback(s: ActiveSession, remote: string | undefined, fallbackId?: string): Promise<void>;
export declare function jumpTo(s: ActiveSession, self: string, fallback?: UnreachableFallback, fallbackId?: string): Promise<void>;
