import type { DatabaseSync } from 'node:sqlite'; export type ConversationUnreadDomain = 'assistant' | 'conversations'; export type ConversationUnreadReason = 'assistant_reply' | 'proactive' | 'task_result' | 'marked_read' | 'user_message' | 'reset' | 'archived' | 'deleted' | 'updated'; export interface ConversationUnreadSnapshot { conversationId: string; transcriptId: string; lastSeq: number; unreadCount: number; } export interface ConversationUnreadItem extends ConversationUnreadSnapshot { hasActiveRun: boolean; } export interface ConversationUnreadSummary { assistant: ConversationUnreadItem | null; conversations: { totalUnreadCount: number; unreadConversationCount: number; activeRunCount: number; byConversation: ConversationUnreadItem[]; }; } export interface ConversationUnreadPreview { title: string; text: string; } export interface ConversationUnreadEventPayload { conversationId: string; domain: ConversationUnreadDomain; transcriptId: string; lastSeq: number; unreadCount: number; totalDomainUnread: number; unreadConversationCount: number; preview?: ConversationUnreadPreview | null; reason: ConversationUnreadReason; } export declare function classifyConversationUnreadDomain(conversationId: string, db?: DatabaseSync): ConversationUnreadDomain | null; export declare function readConversationUnreadSnapshot(conversationId: string, db?: DatabaseSync): ConversationUnreadSnapshot | null; export declare function updateConversationReadCursor(conversationId: string, transcriptId: string, lastSeq: number, db?: DatabaseSync): void; export declare function advanceConversationReadCursorOnUserMessage(conversationId: string, transcriptId: string, seq: number, db?: DatabaseSync): void; export declare function markAllOrdinaryConversationsRead(db?: DatabaseSync): ConversationUnreadSnapshot[]; export declare function readConversationUnreadMap(conversationIds: readonly string[], db?: DatabaseSync): Map; export declare function readConversationLastMessagePreviewMap(conversationIds: readonly string[], db?: DatabaseSync): Map; export declare function readConversationUnreadSummary(options?: { assistantConversationId?: string | null; activeRunConversationIds?: ReadonlySet; }, db?: DatabaseSync): ConversationUnreadSummary; export declare function buildConversationUnreadEventPayload(conversationId: string, reason: ConversationUnreadReason, options?: { fallbackDomain?: ConversationUnreadDomain | null; assistantDisplayName?: string | null; includePreview?: boolean; }, db?: DatabaseSync): ConversationUnreadEventPayload | null;