/** A session's foreground/background presence. */
export type Presence = 'attached' | 'background' | 'parked';
export interface DetachRecord {
    sessionId: string;
    agent: string;
    cwd?: string;
    /** pid of the detached headless continuation `agents sessions detach` spawned. */
    headlessPid: number;
    /**
     * Start-time fingerprint of {@link headlessPid} at spawn, so a liveness check
     * survives PID reuse: the pid is only "our" continuation if it still occupies
     * the process we launched. Null when the platform capture failed.
     */
    headlessStartTime: string | null;
    detachedAtMs: number;
}
export declare function writeDetachRecord(rec: DetachRecord): void;
export declare function readDetachRecord(sessionId: string): DetachRecord | undefined;
export declare function clearDetachRecord(sessionId: string): void;
export declare function listDetachRecords(): DetachRecord[];
/** True while the recorded headless continuation is still the live process we spawned. */
export declare function isHeadlessAlive(rec: DetachRecord): boolean;
/**
 * Presence for a session id from the detach store alone:
 *   - no record            -> undefined (caller decides: `attached` for a live
 *                             interactive row, nothing for cloud/team rows)
 *   - record + pid alive    -> `background` (headless continuation running)
 *   - record + pid exited   -> `parked` (the run finished; transcript is durable)
 */
export declare function presenceFromStore(sessionId: string): Presence | undefined;
