import type { ArkmeGroupAiPolishNotice, ArkmeGroupAiPolishSnapshot, ArkmeInterwovenMention, ArkmeInterwovenState, ArkmeTimelineCursor, ArkmeTimelineItem } from '../types.js'; export interface ArkmeConversationTimelineSnapshot { cache?: import('../types.js').ArkmeTimelinePage['cache'] | undefined; unified?: import('../unified-chat-timeline.js').ArkmeUnifiedTimelineWindow | undefined; mode?: 'latest' | 'around'; aroundSequenceRange?: ArkmeConversationTimelineSequenceRange; items: ArkmeTimelineItem[]; aiPolishNotices: ArkmeGroupAiPolishNotice[]; aiPolishSettings?: ArkmeGroupAiPolishSnapshot; nextCursor?: ArkmeTimelineCursor; hasMore: boolean; newerCursor?: ArkmeTimelineCursor; newerHasMore?: boolean; /** Client-only freshness metadata. It is never sent across the Host boundary. */ fetchedAtMillis?: number; /** Record-owner projection revision. Chat timelines must use latestSequence instead. */ recordRevision?: number; latestSequence?: number; } export interface ArkmeConversationTimelineSequenceRange { minimumSequence: number; maximumSequence: number; } export type ArkmeConversationViewportSnapshot = import('../conversation-viewport-state.js').ConversationViewportState; export declare const ARKME_CONVERSATION_TIMELINE_FRESH_MILLIS = 15000; export declare function arkmeConversationTimelineContentEqual(left: ArkmeConversationTimelineSnapshot | undefined, right: ArkmeConversationTimelineSnapshot | undefined): boolean; export declare function arkmeConversationTimelineSequenceRange(items: readonly ArkmeTimelineItem[], previous?: ArkmeConversationTimelineSequenceRange): ArkmeConversationTimelineSequenceRange | undefined; export declare function arkmeConversationTimelineDeltaItems(mode: 'latest' | 'around', aroundSequenceRange: ArkmeConversationTimelineSequenceRange | undefined, currentItems: readonly ArkmeTimelineItem[], deltaItems: readonly ArkmeTimelineItem[]): ArkmeTimelineItem[]; export declare function arkmeShouldRefreshChatTimeline(snapshot: ArkmeConversationTimelineSnapshot | undefined, nowMillis: number, latestSequence?: number): boolean; export declare function arkmeShouldRefreshRecordTimeline(snapshot: ArkmeConversationTimelineSnapshot | undefined, nowMillis: number, recordRevision: number): boolean; export declare function arkmeConversationRestoredScrollTop(snapshot: ArkmeConversationViewportSnapshot | undefined, layout: { currentScrollTop: number; scrollHeight: number; anchorOffset?: number; }): number; /** * Keeps conversation history immediately reusable while Arkme refreshes it in the background. * Interwoven moments are staged until the ordinary timeline has produced its first snapshot, so * they can never take over an otherwise empty conversation viewport during a cold load. */ export declare class ArkmeConversationMemoryCache { private readonly maxSources; private readonly viewportStore?; private readonly timelines; private readonly interwovenMoments; private readonly interwovenStates; private readonly interwovenRefreshRevisions; private readonly pendingInterwovenMoments; private readonly pendingInterwovenRefreshRevisions; private readonly viewports; private readonly recency; private readonly appliedTimelineDeltas; private readonly timelineBytes; constructor(maxSources?: number, viewportStore?: { getViewport(source: string): ArkmeConversationViewportSnapshot | undefined; storeViewport(source: string, value: ArkmeConversationViewportSnapshot): void; } | undefined); unappliedTimelineDeltaItems(conversationKey: string, items: readonly ArkmeTimelineItem[]): ArkmeTimelineItem[]; consumeTimelineDeltaItems(conversationKey: string, items: readonly ArkmeTimelineItem[]): void; getTimeline(conversationKey: string): ArkmeConversationTimelineSnapshot | undefined; storeTimeline(conversationKey: string, snapshot: ArkmeConversationTimelineSnapshot): ArkmeInterwovenMention[] | undefined; getInterwovenMoments(conversationKey: string): ArkmeInterwovenMention[] | undefined; getInterwovenState(conversationKey: string): ArkmeInterwovenState | undefined; storeInterwovenState(conversationKey: string, state: ArkmeInterwovenState): void; /** Returns true only when the ordinary timeline is ready and the result may be revealed. */ storeInterwovenMoments(conversationKey: string, moments: ArkmeInterwovenMention[], refreshRevision?: number): boolean; isInterwovenFresh(conversationKey: string, refreshRevision: number): boolean; getViewport(conversationKey: string): ArkmeConversationViewportSnapshot | undefined; storeViewport(conversationKey: string, viewport: ArkmeConversationViewportSnapshot): void; /** A Record mutation may affect several cached sources; preserve viewport and require fresh owner reads. */ invalidateTimelines(): void; clear(): void; private touch; } //# sourceMappingURL=conversation-memory-cache.d.ts.map