/**
 * CasBlobAdapter — stores content blobs via git-cas.
 *
 * Content is chunked (CDC by default), optionally encrypted, and stored
 * as a CAS tree in the Git object store. The tree OID serves as the
 * storage identifier.
 *
 * Current runtime reads require CAS manifests. Migration tooling can inject an
 * explicit retired raw Git blob read policy while translating old substrates.
 *
 * @module infrastructure/adapters/CasBlobAdapter
 */
import BlobStoragePort from '../../ports/BlobStoragePort.ts';
import { type SubstrateCompatibilityPolicyValue } from './SubstrateCompatibilityPolicy.ts';
import CasContentEncryptionPolicy from './CasContentEncryptionPolicy.ts';
import type LoggerPort from '../../ports/LoggerPort.ts';
export interface BlobPersistence {
    readBlob(oid: string): Promise<Uint8Array | null | undefined>;
}
export default class CasBlobAdapter extends BlobStoragePort {
    private readonly _plumbing;
    private readonly _persistence;
    private readonly _contentEncryption;
    private readonly _logger;
    private readonly _getCas;
    private readonly _compatibilityPolicy;
    constructor({ plumbing, persistence, encryptionKey, contentEncryption, logger, compatibilityPolicy }: {
        plumbing: unknown;
        persistence: BlobPersistence;
        encryptionKey?: Uint8Array;
        contentEncryption?: CasContentEncryptionPolicy;
        logger?: LoggerPort;
        compatibilityPolicy?: SubstrateCompatibilityPolicyValue;
    });
    private _initCas;
    store(content: Uint8Array | string, options?: {
        slug?: string;
        mime?: string | null;
        size?: number | null;
    }): Promise<string>;
    retrieve(oid: string): Promise<Uint8Array>;
    private _restoreFromCas;
    private _fallbackReadBlob;
    private _buildRestoreOpts;
    storeStream(source: AsyncIterable<Uint8Array>, options?: {
        slug?: string;
        mime?: string | null;
        size?: number | null;
    }): Promise<string>;
    retrieveStream(oid: string): AsyncIterable<Uint8Array>;
    private _resolveStreamIterator;
    private _streamFromCas;
    private _readLegacyContentBlobCandidate;
    private _probeLegacyContentBlob;
}
