import { type SessionHolder, type SessionHolderProbes } from "./session-holders.ts";
/** Read only the header, asynchronously: checking admission must not load or mutate a transcript. */
export declare function sessionIdFromFile(sessionFile: string): Promise<string | undefined>;
/** Fresh lease evidence for each admission; a clean exit or stale identity clears the next retry. */
export declare function foreignSessionHolders(sessionFile: string | undefined, sessionId?: string, probes?: SessionHolderProbes): Promise<SessionHolder[]>;
/** One terminal-safe line; cwd can contain newlines or escape sequences. */
export declare function describeSessionHolders(holders: readonly SessionHolder[]): string;
export declare const SESSION_HOLDER_LOOKUP_FAILED = "Unable to inspect session holders; continuing without holder information.";
/** Live foreign holders of `sessionFile` before an interactive resume switches onto it; a failed lookup stays advisory. */
export declare function checkSessionHolders(sessionFile: string): Promise<{
    readonly holders: readonly SessionHolder[];
} | {
    readonly lookupFailed: true;
}>;
/**
 * Why taking over is not offered, or `undefined` when it is: a holder whose identity is unverified could be a
 * reused pid, and a holder inside a multi-session host would take every other session of that host down with it.
 */
export declare function takeOverRefusal(holders: readonly SessionHolder[], retry?: string): string | undefined;
/**
 * The socket of the one multi-session host that holds the session, when every holder is a session of that host and
 * the host published its public socket: a terminal can then attach to the live session there instead of opening a
 * second writer or stopping the host (#6059: the OmO desktop's sessions run on such a host).
 */
export declare function hostAttachSocket(holders: readonly SessionHolder[]): string | undefined;
/**
 * Explicit take-over of a session another live process holds (senpi#5744). The holder set is read again right
 * before signalling and intersected with the pids the person confirmed; only verified, single-session holders are
 * asked to exit (SIGTERM). Then it waits until none of them holds the file. Returns false when a confirmed holder
 * can no longer be signalled safely, is still there at the deadline, or another process holds the session by then.
 */
export declare function stopSessionHolders(sessionFile: string, confirmed: readonly SessionHolder[], timeoutMs?: number): Promise<boolean>;
/** The post-switch advisory line, or `undefined` when no other process holds the session. */
export declare function sessionHolderWarning(sessionFile: string | undefined, sessionId?: string): Promise<string | undefined>;
//# sourceMappingURL=foreign-session-holders.d.ts.map