import type { CommitLogChunk, CommitNodeOptions, CommitNodeWithTreeOptions, LogNodesOptions, NodeInfo, PingResult } from '../../ports/CommitPort.ts';
import type { ListRefsOptions } from '../../ports/RefPort.ts';
import type RuntimeStorageCapabilityPort from '../../ports/RuntimeStorageCapabilityPort.ts';
import type BlobStoragePort from '../../ports/BlobStoragePort.ts';
import type TrieStorePort from '../../domain/orset/trie/TrieStorePort.ts';
import type TreeEntryLimit from '../../domain/tree/TreeEntryLimit.ts';
import type TreeEntryPath from '../../domain/tree/TreeEntryPath.ts';
import type TreeEntryPrefixBatch from '../../domain/tree/TreeEntryPrefixBatch.ts';
import type { TreeEntryProbeResult } from '../../ports/TreeEntryProbePort.ts';
import GraphPersistencePort from '../../ports/GraphPersistencePort.ts';
import type CasContentEncryptionPolicy from './CasContentEncryptionPolicy.ts';
import WarpStream from '../../domain/stream/WarpStream.ts';
import type { ContentAnchorObjectType } from '../../domain/services/state/checkpointHelpers.ts';
import { type GitPlumbing } from './gitErrorClassification.ts';
import { type PatchStorageRoute } from '../../ports/CommitMessageCodecPort.ts';
import type OperationPolicyPort from '../../ports/OperationPolicyPort.ts';
import type { OperationPolicyExecuteOptions } from '../../ports/OperationPolicyPort.ts';
export type { GitPlumbing, GitError, CollectableStream } from './gitErrorClassification.ts';
interface GitGraphAdapterOptions {
    readonly plumbing: GitPlumbing;
    readonly retryOptions?: Partial<OperationPolicyExecuteOptions>;
    readonly policy?: OperationPolicyPort;
    readonly casContentEncryption?: CasContentEncryptionPolicy;
}
export default class GitGraphAdapter extends GraphPersistencePort implements RuntimeStorageCapabilityPort {
    private readonly plumbing;
    private readonly _policy;
    private readonly _retryOptions;
    private readonly _gitCasPersistence;
    private readonly _gitCasGraphReader;
    private readonly _recursiveTreeOidReader;
    private readonly _casContentEncryption;
    constructor({ plumbing, retryOptions, policy, casContentEncryption }: GitGraphAdapterOptions);
    private _executeWithRetry;
    /**
     * Distinguishes a legitimate zero-byte blob from a missing object when a
     * blob stream returns no bytes.
     */
    private _assertBlobExistsForEmptyRead;
    get emptyTree(): string;
    createRuntimeBlobStorage(): Promise<BlobStoragePort>;
    createRuntimeTrieStore(): Promise<TrieStorePort>;
    defaultPatchWriteStorage(): PatchStorageRoute;
    private _createCommit;
    commitNode({ message, parents, sign }: CommitNodeOptions): Promise<string>;
    commitNodeWithTree({ treeOid, parents, message, sign }: CommitNodeWithTreeOptions): Promise<string>;
    showNode(sha: string): Promise<string>;
    getNodeInfo(sha: string): Promise<NodeInfo>;
    getCommitTree(sha: string): Promise<string>;
    logNodes({ ref, limit, format }: LogNodesOptions): Promise<string>;
    logNodesStream({ ref, limit, format }: LogNodesOptions): Promise<WarpStream<CommitLogChunk>>;
    writeBlob(content: Uint8Array | string): Promise<string>;
    writeTree(entries: string[]): Promise<string>;
    readTree(treeOid: string): Promise<Record<string, Uint8Array>>;
    readTreeOids(treeOid: string): Promise<Record<string, string>>;
    readTreeEntryOid(treeOid: string, path: TreeEntryPath): Promise<TreeEntryProbeResult>;
    readTreeEntryPrefix(treeOid: string, prefix: TreeEntryPath, limit: TreeEntryLimit): Promise<TreeEntryPrefixBatch>;
    readBlob(oid: string): Promise<Uint8Array>;
    readObjectType(oid: string): Promise<ContentAnchorObjectType>;
    updateRef(ref: string, oid: string): Promise<void>;
    readRef(ref: string): Promise<string | null>;
    compareAndSwapRef(ref: string, newOid: string, expectedOid: string | null): Promise<void>;
    deleteRef(ref: string): Promise<void>;
    nodeExists(sha: string): Promise<boolean>;
    listRefs(prefix: string, options?: ListRefsOptions): Promise<string[]>;
    ping(): Promise<PingResult>;
    countNodes(ref: string): Promise<number>;
    isAncestor(potentialAncestor: string, descendant: string): Promise<boolean>;
    configGet(key: string): Promise<string | null>;
    configSet(key: string, value: string): Promise<void>;
    private _isConfigKeyNotFound;
}
