import type { Kysely } from "kysely";
import type { DB } from "../../processors/vetra-cloud-environment/schema.js";
export interface ClaimedRow {
    id: string;
    tenantId: string | null;
    subdomain: string | null;
    poolState: string | null;
}
export interface ClaimDb {
    /**
     * Atomically flip exactly one AVAILABLE, READY, current-version row to
     * CLAIMED. `FOR UPDATE SKIP LOCKED` guarantees two concurrent claims pick
     * different rows; the `status='READY'` guard ensures a recycled/terminating
     * "zombie" (poolState lingering on a dead env) can never be handed out.
     * Returns the assigned row, or null when none is available.
     */
    claimOneAvailable(addr: string, version: string, nowIso: string): Promise<ClaimedRow | null>;
}
export declare function makeClaimDb(db: Kysely<DB>): ClaimDb;
export interface SeedWarmingInput {
    id: string;
    subdomain: string;
    tenantId: string;
    pinnedVersion: string;
}
export interface PoolRowDb {
    id: string;
    poolState: string | null;
    pinnedVersion: string | null;
    status: string | null;
}
export interface KeeperDb {
    listPoolRows(): Promise<PoolRowDb[]>;
    seedWarming(input: SeedWarmingInput): Promise<void>;
    promoteReadyToAvailable(): Promise<void>;
    /** Clear poolState (→ null) for the given ids — removes them from the pool. */
    clearPoolState(ids: string[]): Promise<void>;
}
/** Keeper-side helpers over the shared `environments` table. */
export declare function makeKeeperDb(db: Kysely<DB>): KeeperDb;
//# sourceMappingURL=pool-db.d.ts.map