export declare const DEFAULT_ACTIVE_CHAT_POLL_STATUSES: Set<string>;
export declare const DEFAULT_CHAT_TAIL_RECENT_MESSAGE_GRACE_MS = 8000;
export interface HotChatSessionLike {
    id?: string | null;
    status?: unknown;
    unread?: unknown;
    inboxBucket?: unknown;
    lastMessageAt?: unknown;
    runtimeLifecycle?: unknown;
    runtimeSurfaceKind?: unknown;
    runtimeRestoredFromStorage?: unknown;
    runtimeRecoveryState?: unknown;
}
export declare function classifyHotChatSessionsForSubscriptionFlush(sessions: HotChatSessionLike[], previousHotSessionIds: ReadonlySet<string>, options?: {
    now?: number;
    recentMessageGraceMs?: number;
    activeStatuses?: ReadonlySet<string>;
    activeSessionIds?: ReadonlySet<string>;
    /**
     * Per-session `lastMessageAt` of the most recent completion tail that has
     * already been flushed to subscribers. A completed-but-unseen session is
     * kept hot for delivery REGARDLESS of the 8s recency timer, but only until
     * its current tail has been delivered once — bounding the guaranteed
     * delivery so a slow-finalizing turn is not re-pushed every tick forever.
     * A newer `lastMessageAt` (fresh turn) re-arms delivery.
     */
    deliveredCompletionTailAt?: ReadonlyMap<string, number>;
    /**
     * (D8) PER-SUBSCRIPTION ACK gate — the authoritative guaranteed-delivery
     * signal. Session ids for which at least one currently-subscribed ws has
     * NOT yet been sent the session's finalized tail (its per-ws
     * `lastDeliveredSignature` is empty / does not match the session's current
     * tail). The daemon computes this from its live ws-subscription map; the
     * classifier keeps every such session hot-for-delivery INDEPENDENT of the
     * seen/unread badge, so a session whose unread badge cleared (or a fresh
     * browser that re-subscribed after the single completion flush already
     * fired) still gets its assistant-final tail delivered. Bounded because a
     * subscriber's `lastDeliveredSignature` converges to the current tail the
     * moment it is actually sent, dropping the session out of this set. When
     * provided, this set is the guaranteed-delivery driver and the
     * `deliveredCompletionTailAt` recency-watermark path is bypassed for these
     * sessions (it stays only as the legacy opt-in for callers that don't pass
     * a per-subscription set).
     */
    underDeliveredSessionIds?: ReadonlySet<string>;
}): {
    active: Set<string>;
    finalizing: Set<string>;
    guaranteedDelivery: Set<string>;
};
/**
 * Detect sessions that just transitioned from an active/generating state into
 * a settled/completed-but-unseen state, so their finalized completion tail can
 * be flushed exactly once regardless of the recency window. Pure: the caller
 * owns the `previousStatus` map and updates it from the returned `nextStatus`.
 */
export declare function detectNewlySettledCompletedSessions(sessions: HotChatSessionLike[], previousStatus: ReadonlyMap<string, string>, options?: {
    activeStatuses?: ReadonlySet<string>;
}): {
    settled: Set<string>;
    nextStatus: Map<string, string>;
};
