import type { Database } from "../../../shared/sqlite";
export declare const GIT_SWEEP_COOLDOWN_MS: number;
export declare const GIT_SWEEP_LEASE_TTL_MS: number;
export declare const GIT_SWEEP_LEASE_RENEWAL_MS: number;
export type GitSweepSkipReason = "lease_active" | "cooldown_active";
export interface GitSweepLeaseAcquired {
    acquired: true;
    projectPath: string;
    holderId: string;
    acquiredAt: number;
    leaseExpiresAt: number;
}
export interface GitSweepLeaseSkipped {
    acquired: false;
    projectPath: string;
    reason: GitSweepSkipReason;
    leaseHolder: string | null;
    leaseExpiresAt: number | null;
    lastSweptAt: number | null;
    nextAllowedAt: number | null;
}
export type GitSweepLeaseResult = GitSweepLeaseAcquired | GitSweepLeaseSkipped;
export interface GitSweepCoordinatorState {
    projectPath: string;
    leaseHolder: string | null;
    leaseExpiresAt: number | null;
    lastSweptAt: number | null;
}
export interface AcquireGitSweepLeaseOptions {
    cooldownMs?: number;
    leaseTtlMs?: number;
    /**
     * Skip the recently-swept cooldown gate, acquiring on mutual-exclusion
     * (lease) alone. Used by the backlog-drain path: draining unembedded rows
     * has no git-log cost and must run every tick until the backlog clears, so
     * it must not be starved by a cooldown the dream-timer sweep advanced.
     * Cross-process duplication is still prevented by the lease itself, and the
     * caller releases with releaseGitSweepLease (which does NOT advance the
     * cooldown), keeping the dream-timer's cooldown tracking independent.
     */
    ignoreCooldown?: boolean;
}
export declare function getGitSweepCoordinatorState(db: Database, projectPath: string): GitSweepCoordinatorState | null;
export declare function acquireGitSweepLease(db: Database, projectPath: string, holderId: string, options?: AcquireGitSweepLeaseOptions): GitSweepLeaseResult;
export declare function renewGitSweepLease(db: Database, projectPath: string, holderId: string, leaseTtlMs?: number): boolean;
export declare function markGitSweepSuccessAndRelease(db: Database, projectPath: string, holderId: string): boolean;
export declare function releaseGitSweepLease(db: Database, projectPath: string, holderId: string): void;
//# sourceMappingURL=sweep-coordinator.d.ts.map