/**
 * Peers this node may borrow capacity from.
 *
 * The borrower's half of peer sharing. Each entry is a lender's exposed proxy
 * plus the share token they issued; the lender remains the authority on what
 * that token may do, so nothing here tries to second-guess a grant's policy.
 *
 * Peer cooldowns are kept here rather than in `accountCooldown.ts` on purpose.
 * A peer is not an account: its unavailability reasons are grant-shaped
 * ("paused", "exhausted") rather than window-shaped, and the account cooldown
 * store's Anthropic quota keying is documented as label-based, which a peer key
 * has no business participating in.
 *
 * @module proxy/peerStore
 */
import type { ProxyPeer, ProxyPeerCooldownReason, ProxyPeerInput, ProxyPeerObservation, ProxyPeerPendingProvision } from "../types/index.js";
export declare function initPeerStore(peersFilePath: string): void;
export declare function listPeers(): Promise<ProxyPeer[]>;
export declare function getPeer(name: string): Promise<ProxyPeer | undefined>;
/**
 * Peers worth trying right now, in the order they should be tried.
 *
 * Disabled and cooling peers are dropped rather than sorted last: a borrowed
 * request is already the fallback path, and spending its latency budget on a
 * peer that just said "paused" helps nobody.
 */
export declare function selectBorrowablePeers(now?: number): Promise<ProxyPeer[]>;
export declare function addPeer(input: ProxyPeerInput): Promise<ProxyPeer>;
export declare function removePeer(name: string): Promise<boolean>;
export declare function setPeerEnabled(name: string, enabled: boolean): Promise<ProxyPeer | undefined>;
export declare function updatePeer(name: string, patch: {
    priority?: number;
    note?: string;
    url?: string;
    token?: string;
    receiptSecret?: string;
    reciprocalPeer?: string;
    lastReceiptSequence?: number;
    /** `null` clears an outstanding provisioning request. */
    pendingProvision?: ProxyPeerPendingProvision | null;
}): Promise<ProxyPeer | undefined>;
/** How long a peer should be left alone after this kind of refusal. */
export declare function peerCooldownMs(reason: ProxyPeerCooldownReason): number;
/**
 * Park a peer after a refusal.
 *
 * `retryAfterSeconds` from the lender wins when it is longer than our default —
 * the lender knows when its window turns over and we do not — up to a week.
 */
export declare function coolPeer(name: string, reason: ProxyPeerCooldownReason, retryAfterSeconds?: number): Promise<void>;
/** Clear a cooldown after a peer serves successfully. */
export declare function recordPeerSuccess(name: string, observation?: ProxyPeerObservation): Promise<void>;
