import type { ArkmeBotSummary, ArkmeChatClientEvent, ArkmeSourceItem, ArkmeSourceList } from '../types.js'; import type { SourceService } from './source-service.js'; import type { ConversationDirectoryVisibilityService } from './conversation-directory-visibility-service.js'; import { type ServiceRuntime } from './service.js'; import type { ArkmeChatPolicyUpdatedHint, ArkmeConversationListPreferenceUpdatedHint } from '../chat-realtime.js'; type DirectoryHint = ArkmeChatPolicyUpdatedHint | ArkmeConversationListPreferenceUpdatedHint; /** Merge pages and live changes without interpreting page absence as removal. */ export declare function mergeDirectorySource(previous: ArkmeSourceItem | undefined, incoming: ArkmeSourceItem, keepLive?: boolean, keepLiveName?: boolean): ArkmeSourceItem; /** One account lifecycle owns cache restoration, a twenty-row scan, and directory deltas. */ export declare class ConversationDirectoryService { private readonly runtime; private readonly source; private readonly preferences; private readonly readBots; private readonly warmAvatar; private readonly emit; private readonly restoreBots; private userId; private disposed; private generation; private revision; private cachedAtMillis; private sourceRemovals; private pendingReadAcks; private visibilityMutations; private sources; private mutations; private nameMutations; private visibility; private bots; private cachedBotKeys; private botPinnedKeys; private deletedBotRefs; private special; private phase; private error; private restore; private scan; private firstPage; private rescanRequested; private rawBaselineComplete; private rawBaseline; private controller; private persistence; private diskPending; private diskWriting; private cacheFailure; private lastPublished; private avatars; private avatarWork; private readonly pendingChanges; private changeWork; private recoveryScan; private refreshTimer; private refreshRetries; private refreshError; constructor(runtime: ServiceRuntime, source: SourceService, preferences: ConversationDirectoryVisibilityService, readBots: (signal: AbortSignal) => Promise<{ items: ArkmeBotSummary[]; }>, warmAvatar: (ref: string, signal: AbortSignal) => Promise, emit: (page: ArkmeSourceList) => void, restoreBots?: (items: ArkmeBotSummary[], userId: number) => Promise); dispose(): void; reset(): void; private activate; read(force?: boolean, signal?: AbortSignal): Promise; private readSnapshot; /** Notification callers join the same scan, but only accept a complete current connection baseline. */ complete(): Promise; /** Join the directory owner; never combine its rows with a separately refreshed global count. */ attentionSummary(retry?: boolean): Promise; settled(): Promise; private startScan; private apply; private snapshot; private publish; private flushDisk; private startAvatars; rememberBots(items: ArkmeBotSummary[], expectedUserId: number): Promise; forgetSource(sourceRef: string, expectedUserId: number): Promise; forgetBot(botRef: string, expectedUserId?: number): Promise; pinBot(botRef: string, pinned: boolean): Promise; rememberSpecial(patch: typeof this.special, expectedUserId?: number): Promise; confirmVisibility(entryKind: 'source' | 'bot', entryRef: string, hidden: boolean, expectedUserId?: number): Promise; confirmPin(sourceRef: string, pinned: boolean, policyUpdatedAtMillis: number, expectedUserId?: number): Promise; /** Raw owner identities stay in Host; Browser receives only confirmed directory deltas. */ invalidate(hint: DirectoryHint): Promise; private resumeChanges; private scheduleChanges; private flushChanges; accept(event: ArkmeChatClientEvent): Promise; } export {}; //# sourceMappingURL=conversation-directory-service.d.ts.map