/**
 * CAS-backed seek materialization cache adapter.
 *
 * Implements SeekCachePort using @git-stunts/git-cas for persistent storage
 * of serialized WarpState snapshots. Each cached state is stored as a CAS
 * asset (chunked blobs + manifest tree), and an index ref tracks the mapping
 * from cache keys to tree OIDs.
 *
 * Index ref: `refs/warp/<graphName>/seek-cache` → blob containing JSON index.
 *
 * Blobs are loose Git objects — `git gc` prunes them using the configured
 * prune expiry (default ~2 weeks). Use vault pinning for GC-safe persistence.
 *
 * **Requires Node >= 22.0.0** (inherited from `@git-stunts/git-cas`).
 *
 * @module infrastructure/adapters/CasSeekCacheAdapter
 */
import SeekCachePort, { type SeekCacheEntry, type SeekCacheSetOptions } from '../../ports/SeekCachePort.ts';
import CasContentEncryptionPolicy from './CasContentEncryptionPolicy.ts';
import type LoggerPort from '../../ports/LoggerPort.ts';
interface CachePersistence {
    readRef(ref: string): Promise<string | null>;
    readBlob(oid: string): Promise<Uint8Array>;
    writeBlob(data: Uint8Array): Promise<string>;
    updateRef(ref: string, oid: string): Promise<void>;
    deleteRef(ref: string): Promise<void>;
}
export default class CasSeekCacheAdapter extends SeekCachePort {
    private readonly _persistence;
    private readonly _plumbing;
    private readonly _maxEntries;
    private readonly _ref;
    private readonly _encryptionKey;
    private readonly _contentEncryption;
    private readonly _logger;
    private readonly _getCas;
    constructor({ persistence, plumbing, graphName, maxEntries, encryptionKey, contentEncryption, logger }: {
        persistence: CachePersistence;
        plumbing: unknown;
        graphName: string;
        maxEntries?: number;
        encryptionKey?: Uint8Array;
        contentEncryption?: CasContentEncryptionPolicy;
        logger?: LoggerPort;
    });
    private _initCas;
    private _readIndex;
    private _writeIndex;
    private _mutateIndex;
    private _entryTimestamp;
    private _enforceMaxEntries;
    private _parseKey;
    private _restoreBuffer;
    get(key: string): Promise<SeekCacheEntry | null>;
    private _getEntry;
    set(key: string, buffer: Uint8Array, options?: SeekCacheSetOptions): Promise<void>;
    private _storeCasAsset;
    has(key: string): Promise<boolean>;
    keys(): Promise<string[]>;
    delete(key: string): Promise<boolean>;
    clear(): Promise<void>;
}
export {};
