/**
 * MaterializeController — CRDT state replay from patches.
 *
 * Three materialization pipelines:
 * 1. materialize() — full or checkpoint-incremental, live frontier
 * 2. materializeCoordinate() — explicit frontier snapshot
 * 3. materializeAt() — specific checkpoint SHA
 *
 * Dependencies are constructor-injected. No host bag.
 * Side effects (notification, GC, auto-checkpoint) are the caller's job.
 */
import { ProvenanceIndex } from '../provenance/ProvenanceIndex.ts';
import { type MaterializeAdjacency } from './MaterializeHelpers.ts';
import { type MaterializeSessionOpener } from './MaterializeSessionBridge.ts';
import type LoggerPort from '../../../ports/LoggerPort.ts';
import type CodecPort from '../../../ports/CodecPort.ts';
import type CryptoPort from '../../../ports/CryptoPort.ts';
import type WarpStateCachePort from '../../../ports/WarpStateCachePort.ts';
import type PatchCollector from '../../capabilities/PatchCollector.ts';
import type DetachedGraphFactory from '../../capabilities/DetachedGraphFactory.ts';
import type WarpState from '../state/WarpState.ts';
import type { TickReceipt } from '../../types/TickReceipt.ts';
import type { PatchDiff } from '../../types/PatchDiff.ts';
import AdjacencyMap from '../../capabilities/AdjacencyMap.ts';
export type MaterializePersistence = {
    readRef(ref: string): Promise<string | null>;
    showNode(sha: string): Promise<string>;
    readTreeOids(treeOid: string): Promise<Record<string, string>>;
    readBlob(oid: string): Promise<Uint8Array>;
};
/** Constructor dependencies for MaterializeController. */
export type MaterializeDeps = {
    logger: LoggerPort;
    codec: CodecPort;
    crypto: CryptoPort;
    persistence: MaterializePersistence;
    getStateCache?: () => WarpStateCachePort | null;
    openStateSession?: MaterializeSessionOpener;
    patches: PatchCollector;
    graphCloner: DetachedGraphFactory;
    graphName: string;
};
/** Full result of a materialization, returned to the caller. */
export type MaterializeResult = {
    state: WarpState;
    stateHash: string;
    adjacency: AdjacencyMap;
    receipts?: TickReceipt[] | undefined;
    diff?: PatchDiff | undefined;
    patchCount: number;
    maxObservedLamport: number;
    provenanceIndex: ProvenanceIndex;
    provenanceDegraded: boolean;
    frontier: Map<string, string> | null;
    ceiling: number | null;
};
export type MaterializeReduceOutput = {
    state: WarpState;
    adjacency?: MaterializeAdjacency;
    receipts?: TickReceipt[];
    diff?: PatchDiff;
};
export default class MaterializeController {
    private readonly _deps;
    private readonly _liveStrategy;
    private readonly _coordinateStrategy;
    private readonly _ceilingStrategy;
    private readonly _checkpointStrategy;
    constructor(deps: MaterializeDeps);
    /** Full materialization — live frontier, optional ceiling. */
    materialize(opts?: {
        receipts?: boolean;
        ceiling?: number | null;
        wantDiff?: boolean;
    }): Promise<MaterializeResult>;
    /** Coordinate materialization — explicit frontier. */
    materializeCoordinate(opts: {
        frontier: Map<string, string> | Record<string, string>;
        ceiling?: number | null;
        receipts?: boolean;
    }): Promise<MaterializeResult>;
    /** Checkpoint materialization — replay from a specific checkpoint SHA. */
    materializeAt(checkpointSha: string): Promise<MaterializeResult>;
    private _assertLoadPersistence;
    private _loadPersistence;
    private _emptyResult;
    private _wrapState;
    private _buildResult;
    private _reducePatches;
    private _reducePatchStream;
    private _createStrategyRuntime;
    private _publishSnapshot;
}
