import type { ApprovalCapabilityGroup, ApprovalDecision, ApprovalGrant, ApprovalGrantId, ApprovalGrantScope, CapabilityKind, ApprovalId, ApprovalRequest, ApprovalReviewRecord, ThreadId } from "@best-agent/protocol";
export interface ApprovalStoreOptions {
    storageRoot: string;
}
export type SaveApprovalGrantInput = {
    action: string;
    group: ApprovalCapabilityGroup;
    kind: CapabilityKind;
    scope: "thread";
    threadId: ThreadId;
} | {
    action: string;
    group: ApprovalCapabilityGroup;
    kind: CapabilityKind;
    scope: Exclude<ApprovalGrantScope, "once" | "thread">;
    threadId?: undefined;
};
export interface ApprovalStore {
    close?(): void | Promise<void>;
    deleteGrantsForThread(threadId: ThreadId): Promise<void>;
    deleteReviewsForThread(threadId: ThreadId): Promise<void>;
    findGrant(group: ApprovalCapabilityGroup, kind: CapabilityKind, action: string, input?: {
        threadId?: ThreadId;
    }): Promise<ApprovalGrant | null>;
    listGrants(): Promise<ApprovalGrant[]>;
    listReviews(threadId: ThreadId, limit?: number): Promise<ApprovalReviewRecord[]>;
    revokeGrant(grantId: ApprovalGrantId): Promise<void>;
    saveGrant(input: SaveApprovalGrantInput): Promise<ApprovalGrant>;
    saveReviewRequest(approval: ApprovalRequest): Promise<ApprovalReviewRecord>;
    settleReview(approvalId: ApprovalId, input: {
        decision?: ApprovalDecision;
        scope?: ApprovalGrantScope;
        status: ApprovalReviewRecord["status"];
    }): Promise<ApprovalReviewRecord | null>;
}
export declare class LocalApprovalStore implements ApprovalStore {
    #private;
    constructor(options: ApprovalStoreOptions);
    close(): void;
    deleteGrantsForThread(threadId: ThreadId): Promise<void>;
    deleteReviewsForThread(threadId: ThreadId): Promise<void>;
    findGrant(group: ApprovalCapabilityGroup, kind: CapabilityKind, action: string, input?: {
        threadId?: ThreadId;
    }): Promise<ApprovalGrant | null>;
    listGrants(): Promise<ApprovalGrant[]>;
    listReviews(threadId: ThreadId, limit?: number): Promise<ApprovalReviewRecord[]>;
    revokeGrant(grantId: ApprovalGrantId): Promise<void>;
    saveGrant(input: SaveApprovalGrantInput): Promise<ApprovalGrant>;
    saveReviewRequest(approval: ApprovalRequest): Promise<ApprovalReviewRecord>;
    settleReview(approvalId: ApprovalId, input: {
        decision?: ApprovalDecision;
        scope?: ApprovalGrantScope;
        status: ApprovalReviewRecord["status"];
    }): Promise<ApprovalReviewRecord | null>;
}
//# sourceMappingURL=approval-store.d.ts.map