import type { Credential } from "@earendil-works/pi-ai";
import { type ConfigValue } from "@earendil-works/pi-ai/utils/config-reference";
import type { PoolState } from "../egress/pool-state.ts";
import type { RunSlot } from "./failover.ts";
import type { AccountStrategy } from "./selection-order.ts";
export type RotationLane = "stored" | "env";
/** Hands a half-open probe lease back, if the slot still holds that exact lease. */
export declare function releaseProbeLease(repository: PoolState, providerId: string, lane: RotationLane, slotName: string, leaseId: string): Promise<void>;
export type RotationSlot = RunSlot & {
    lane: RotationLane;
    /** Env-lane key material for the attempt; never serialized or persisted. */
    envKey?: string;
    envVarName?: string;
    /** Stored-lane account revision: the key account-level health is recorded under; never serialized. */
    storedRevision?: string;
    /** Stored-lane material revision: the key a rejected-token block is recorded under; never serialized. */
    materialRevision?: string;
    /**
     * The half-open probe lease THIS listing took for the attempt; never serialized. `lease` is copied
     * from the shared file and may be another request's, so only this id may be handed back.
     */
    heldLeaseId?: string;
};
export type RotationSources = {
    providerId: string;
    credential: Credential | undefined;
    env: (name: string) => string | undefined;
    repository: PoolState;
    policy?: {
        affinity?: boolean;
        accountStrategy?: AccountStrategy;
        cooldownBaseMs?: number;
        cooldownCapMs?: number;
        slots?: Record<string, {
            env?: string;
            value?: ConfigValue;
        }>;
    };
    now?: () => number;
};
/**
 * Lists the provider's rotation slots with sidecar health overlaid. Stored
 * credentials own the lane when present; env slots participate only when
 * nothing is stored, preserving today's resolution precedence. An env slot's
 * persisted health applies only while its HMAC revision still matches the
 * current env value, so rotating a key in place clears its own stale block.
 */
export declare function listRotationSlots(sources: RotationSources, options?: {
    acquireLeases?: boolean;
    modelId?: string;
}): Promise<RotationSlot[]>;
//# sourceMappingURL=rotation-slots.d.ts.map