/**
 * Pure core of `agents sessions detach` — the nudge, the resumed-run argv, and the id
 * resolver. Kept import-light (only a type import) so it is unit-tested without
 * loading the live-session discovery graph.
 */
import { type ActiveSession } from '../lib/session/active.js';
/**
 * The prompt the backgrounded run resumes with. Its whole job is to stop a
 * now-unwatched agent from stalling on a confirmation nobody will answer: it
 * tells the agent it is headless and to drive to done, or to stop and state a
 * blocker (which surfaces as a waiting session the user can `attach`).
 */
export declare const BACKGROUND_NUDGE: string;
/**
 * Build the argv for the headless continuation `detach` spawns. Agent-agnostic
 * and version-pinned by construction — it goes through the same `agents run
 * --resume` path `attach` reverses.
 */
export declare function buildBackgroundArgv(agent: string, sessionId: string, cwd?: string): string[];
/** What to do with a resolved session, given which machine we're on. */
export type DetachTarget = {
    kind: 'local';
    sessionId: string;
} | {
    kind: 'remote';
    machine: string;
    sessionId: string;
} | {
    kind: 'refuse';
    reason: string;
};
/**
 * Decide how to detach a resolved session. Cloud and team sessions are refused
 * (they have their own lifecycles); a session on another machine is delegated to
 * that host over SSH — never stopped/resumed locally, since its pid and tmux
 * socket only mean something where it actually runs. Pure, so every branch is
 * unit-tested without a live pool. Mirrors `focus`/`jumpTo`'s remote branch.
 */
export declare function resolveDetachTarget(s: ActiveSession, self: string): DetachTarget;
/**
 * Resolve `<id>` to exactly one live session by prefix. Mirrors `focus`'s match
 * so the two verbs accept the same ids.
 */
export declare function resolveOne(activeById: Map<string, ActiveSession>, id: string): ActiveSession | {
    error: string;
};
