/**
 * ForkController — fork creation, wormhole compression, and
 * backfill-rejection helpers.
 *
 * Extracted from fork.methods.js.
 *
 * @module domain/services/controllers/ForkController
 */
import { type RuntimeHostOpenOptions, type RuntimeHostProduct } from '../../warp/RuntimeHostProduct.ts';
import type ProvenancePayload from '../provenance/ProvenancePayload.ts';
import type { LoadedCheckpoint } from '../state/checkpointLoad.ts';
import type CommitMessageCodecPort from '../../../ports/CommitMessageCodecPort.ts';
import type CodecPort from '../../../ports/CodecPort.ts';
import type CryptoPort from '../../../ports/CryptoPort.ts';
import type LoggerPort from '../../../ports/LoggerPort.ts';
import type BlobStoragePort from '../../../ports/BlobStoragePort.ts';
import type GCPolicy from '../GCPolicy.ts';
type ForkRuntimeOpenOptions = RuntimeHostOpenOptions;
type ForkedGraph = RuntimeHostProduct;
type ForkPersistence = ForkRuntimeOpenOptions['persistence'];
type ForkHost = {
    _persistence: ForkPersistence;
    _graphName: string;
    _gcPolicy: GCPolicy;
    _adjacencyCache: {
        maxSize?: number;
    } | null;
    _checkpointPolicy: {
        every: number;
    } | null;
    _autoMaterialize: boolean;
    _onDeleteWithData: 'reject' | 'cascade' | 'warn';
    _logger: LoggerPort | null;
    _crypto: CryptoPort;
    _codec: CodecPort;
    _blobStorage: BlobStoragePort | null;
    _patchBlobStorage: BlobStoragePort | null;
    _commitMessageCodec: CommitMessageCodecPort;
    discoverWriters(): Promise<string[]>;
};
export default class ForkController {
    _host: ForkHost;
    constructor(host: ForkHost);
    fork({ from, at, forkName, forkWriterId }: {
        from: string;
        at: string;
        forkName?: string;
        forkWriterId?: string;
    }): Promise<ForkedGraph>;
    createWormhole(fromSha: string, toSha: string): Promise<{
        fromSha: string;
        toSha: string;
        writerId: string;
        payload: ProvenancePayload;
        patchCount: number;
    }>;
    _isAncestor(ancestorSha: string, descendantSha: string): Promise<boolean>;
    _relationToCheckpointHead(ckHead: string, incomingSha: string): Promise<'same' | 'ahead' | 'behind' | 'diverged'>;
    _validatePatchAgainstCheckpoint(writerId: string, incomingSha: string, checkpoint: CheckpointFrontier | null | undefined): Promise<void>;
}
type CheckpointFrontier = Pick<LoadedCheckpoint, 'schema' | 'frontier'>;
export {};
