/**
 * Inject-target resolution — the safety choke point (RUSH-1415).
 *
 * The watchdog knows a session has stalled and wants to nudge it with "continue".
 * `injectIntoTerminal` (inject.ts) can DELIVER into a target; this module decides
 * the RIGHT target for a given sessionId — the exact split the agent lives in —
 * and NEVER guesses. If it can't name a precise rail it returns `addressable:
 * false` with a reason, and the watchdog skips rather than typing into the
 * frontmost / wrong split.
 *
 * Resolution reads the agent's INHERITED ENV (via session provenance) plus the
 * IDE's live-terminals registry (off disk) — no cooperation from the agent:
 *
 *   tmux  > iterm > vscodium > pty
 *
 * tmux wins whenever present: a `tmux send-keys -t <pane>` reaches the pane no
 * matter which host app (iTerm / Ghostty / VS Code) is above it, so it's correct
 * inside ANY of them. Absent tmux, the host-app rail: iTerm2's exact split by
 * session UUID (env), or a VSCodium/Cursor/VS Code integrated terminal addressed
 * by its live-terminals id. Ghostty has no per-split addressing (no scripting
 * dictionary), so a Ghostty-hosted session with no tmux is honestly reported
 * un-addressable — the coarse focus-stealing window path stays behind an explicit
 * opt-in and is never chosen by default.
 */
import type { ActiveSession } from '../session/active.js';
import type { InjectTarget } from './inject.js';
/** A resolved rail, or an honest refusal. The watchdog acts only on `addressable: true`. */
export type InjectRail = 'tmux' | 'iterm' | 'vscodium' | 'ghostty' | 'pty';
export type InjectResolution = {
    addressable: true;
    rail: InjectRail;
    target: InjectTarget;
    note?: string;
} | {
    addressable: false;
    reason: string;
    hint?: string;
};
export interface ResolveOptions {
    /**
     * Allow the COARSE Ghostty path (raise the frontmost/opt-in window and type via
     * System Events keystrokes — steals focus, not split-precise). Off by default:
     * a Ghostty session with no tmux resolves to un-addressable instead.
     */
    allowGhosttyFocus?: boolean;
    /**
     * A known `agents pty` sidecar id for this session, if the caller has one. No
     * automatic sessionId -> pty mapping exists yet, so pty is only emitted when
     * supplied here (the lowest-precedence rail).
     */
    ptyId?: string;
}
/**
 * Human-facing recovery hint for a session the resolver judged un-addressable.
 * Tells the user both how to continue THIS session and how to make FUTURE runs
 * addressable, so the failure is not silent and the fix is actionable.
 */
export declare function addressabilityRecoveryHint(session: ActiveSession, fallbackId?: string): string;
/**
 * Resolve a target from an already-fetched ActiveSession. Pure — no I/O — so the
 * precedence logic is unit-testable without the process table. This is where the
 * tmux > iterm > vscodium > pty precedence and the Ghostty refusal live.
 */
export declare function resolveInjectTargetForSession(session: ActiveSession, opts?: ResolveOptions): InjectResolution;
/**
 * The single resolver the watchdog calls: sessionId -> a precise InjectTarget or
 * an honest refusal. Fetches the active session (which carries provenance, host,
 * and pid), then applies the pure precedence above. Returns `addressable: false`
 * when the session isn't live / can't be found — never a guess.
 */
export declare function resolveInjectTarget(sessionId: string, opts?: ResolveOptions): Promise<InjectResolution>;
