import { type HostWarm } from "./host-warm.ts";
import { type OpenRpcSession, type RpcSessionEntry, type RpcSessionLaunchProfile, type RpcSessionOpenOptions, type RpcSessionRegistryOptions, type RpcSessionRow } from "./session-registry-types.ts";
export { frozenProfile, type OpenRpcSession, type RpcSessionEntry, type RpcSessionLaunchProfile, type RpcSessionOpenOptions, RpcSessionRegistryError, type RpcSessionRegistryOptions, type RpcSessionRow, type RpcSessionState, type SessionRuntime, sessionIdentity, } from "./session-registry-types.ts";
/** Process-local lifecycle owner for multi-session RPC runtimes. */
export declare class RpcSessionRegistry {
    readonly supportsCompact: (profile?: RpcSessionLaunchProfile) => boolean;
    readonly supportsParkClaim = true;
    private readonly entries;
    private readonly reservations;
    private readonly pendingClaims;
    private readonly teardownHost;
    private nextHandle;
    private readonly options;
    private readonly now;
    readonly closeGraceMs: number;
    /** Present only when the runtime factory can build a session's services alone (`host-warm.ts`). */
    readonly warm?: HostWarm;
    private readonly warmsInFlight?;
    /** The agent directory this host keeps its sessions (and session-move folders) under. */
    get agentDir(): string;
    constructor(options: RpcSessionRegistryOptions);
    /** Number of live entries, including ones still opening or closing. */
    get size(): number;
    reserveHandle(): string;
    /** Commit the ledger's exclusive claim after its existing runtime has acquired a persistent file. */
    claimPark(handle: string, retainOnDisconnect: boolean): Promise<OpenRpcSession>;
    /** Daemon-family identities come from the endpoint's claims and generation registry. */
    holderPids(observedStarts?: ReadonlyMap<number, number | undefined>): Promise<readonly number[]>;
    openSession(requested: RpcSessionLaunchProfile, options?: RpcSessionOpenOptions): Promise<OpenRpcSession>;
    private openNow;
    /**
     * Read-only lookup with no state transitions or attachment accounting.
     * Exists so lifecycle decisions (e.g. deferring a dropped connection's
     * release while a turn is still streaming) can inspect the live entry
     * without claiming it.
     */
    peek(handle: string): RpcSessionEntry | undefined;
    attachSession(handle: string): RpcSessionEntry;
    getForCommand(handle: string, command: string): RpcSessionEntry;
    /**
     * Starts a close synchronously and returns the live entry for routing decisions.
     * `detach` marks a client going away rather than the session ending, which a
     * retained entry answers by staying open at zero attachments.
     */
    beginClose(handle: string, onRole?: (finalizer: boolean) => void, options?: {
        detach?: boolean;
    }): RpcSessionEntry;
    close(handle: string): Promise<void>;
    /** Completes a close previously made visible by beginClose(). */
    closeMarked(handle: string): Promise<void>;
    list(): RpcSessionRow[];
    private syncRuntimeMetadata;
    private validateProfile;
}
//# sourceMappingURL=session-registry.d.ts.map