import { type ObservableSnapshot, type SessionFace } from '@deepseek-ai/dsh-client-runtime/client'; import { type RunningTurnFold, type TurnFoldPlan } from './fold-core.ts'; /** How a newly eligible plan should enter the current Chat view. */ export type FoldPresentation = 'initial' | 'live' | 'late'; /** Session-scoped observable consumed by both toggle renderers. */ export interface FoldModel { readonly plans: ReadonlyMap; readonly byStartKey: ReadonlyMap; readonly byEndKey: ReadonlyMap; readonly runningByStartKey: ReadonlyMap; readonly presentationByTurn: ReadonlyMap; readonly defaultExpandedByTurn: ReadonlyMap; readonly loadingOlder: boolean; } /** * Project one SessionFace into stable, O(1)-addressable fold plans. * * It limits same-structure notification checks to two tail turns. The public * Chat order and Turn timeline references still trigger a full structural * recompute when older history or node membership changes. */ export declare class FoldModelController implements ObservableSnapshot { private readonly session; private readonly store; private readonly unsubscribe; private lastOrder; private lastTimeline; private lastOpenState; private lastLoadingOlder; private plans; private running; private presentations; private records; private evidence; private readonly lateDefaults; private disposed; private initial; /** Public only for focused controller tests. */ recomputeCount: number; /** @param session - publicly exposed per-session snapshot source. */ constructor(session: SessionFace); getSnapshot(): FoldModel; subscribe(fn: () => void): () => void; /** * End the temporary default-expanded state used for a late-paginated turn. * * Once a user operates that turn, its normal store state becomes the sole * source of truth for the rest of the page lifetime. * @param turn - affected turn number. */ acknowledgeLateDefault(turn: number): void; /** Stop listening to the session and release model references. */ dispose(): void; private reconcile; private hasEvidenceChanged; private presentationFor; private publish; } //# sourceMappingURL=fold-model-controller.d.ts.map