export type DialogVisibilityEntry = {
    callbackId: string | null;
    isFocused: boolean;
    /** Insertion timestamp; used as deterministic fallback when no instance is focused. */
    registeredAt: number;
};
export declare function registerMountedInstance(agentId: string | null, instanceId: string): void;
export declare function unregisterMountedInstance(agentId: string | null, instanceId: string): void;
/** Returns true if at least one terminal is mounted for the given agent id. */
export declare function isAgentDialogMounted(agentId: string): boolean;
export declare function getMountedAgentIds(): string[];
export declare function setVisibleDialogEntry(agentId: string | null, instanceId: string, callbackId: string | null, isFocused: boolean): void;
export declare function clearVisibleDialogEntriesForInstance(agentIds: (string | null | undefined)[], instanceId: string): void;
export declare function updateInstanceFocus(agentIds: (string | null | undefined)[], instanceId: string, isFocused: boolean): void;
/**
 * Determines whether the given instance should accept an incoming
 * `agent:dialog:show` event for the given agent id. Election rule:
 *   - Among all mounted instances for the agent, the focused one wins.
 *   - If none is focused, the earliest-registered one wins (first visible).
 *
 * Note: this consults the *mounted* registry (via the visibility entries
 * we've registered alongside it). A terminal mount that has not yet called
 * `setVisibleDialogEntry` won't participate in election; that's fine because
 * those mounts also wouldn't have a callback attached.
 */
export declare function isElectedDialogReceiver(agentId: string, instanceId: string): boolean;
