/**
 * ResourceLedgerPoller — feeds the ResourceLedger (Phase A: rate-limit events).
 *
 * Event-driven, not polled: subscribes to the LlmCircuitBreaker's trip/recover
 * observer (the primary, account-level rate-limit signal) and, when wired, the
 * RateLimitSentinel's session-scoped events. Each emission becomes one durable
 * `rate_limit_events` row. A per-source monotonic sequence makes same-millisecond
 * events distinct and lets the ledger dedupe replays idempotently.
 *
 * Strictly observation: it only reads signals that already fire and writes them
 * down. It never gates, throttles, or reaches back into the breaker (and the
 * breaker swallows observer errors, so this poller can never affect it).
 *
 * CPU/memory sampling (async, bounded) is Phase B and is not in this file yet.
 *
 * Spec: docs/specs/per-agent-resource-ledger.md.
 */
import type { ResourceLedger } from './ResourceLedger.js';
/** The minimal breaker surface this poller needs (avoids importing the class so
 *  monitoring/ stays decoupled from the concrete breaker). */
export interface TripObservableBreaker {
    onTrip(cb: (e: {
        reason: string;
        retryAfterMs?: number;
        ts: number;
        tripCount: number;
    }) => void): () => void;
    onRecover(cb: (e: {
        ts: number;
    }) => void): () => void;
}
/** The minimal sentinel surface (EventEmitter-shaped). Optional. */
export interface RateLimitEventSentinel {
    on(event: string, listener: (...args: any[]) => void): unknown;
    off?(event: string, listener: (...args: any[]) => void): unknown;
}
export interface ResourceLedgerPollerOptions {
    ledger: ResourceLedger;
    breaker: TripObservableBreaker;
    /** Optional — wired in commands/server.ts where the sentinel is constructed. */
    rateLimitSentinel?: RateLimitEventSentinel | null;
    /** Clock seam for tests. */
    now?: () => number;
    /** Account identifier (single shared key today; reserved for fleet roll-up). */
    accountKey?: string;
}
export declare class ResourceLedgerPoller {
    private readonly ledger;
    private readonly breaker;
    private readonly sentinel;
    private readonly now;
    private readonly accountKey;
    private breakerSeq;
    private sentinelSeq;
    private unsubs;
    private started;
    constructor(opts: ResourceLedgerPollerOptions);
    start(): void;
    /** Map a sentinel detection to a kind. Session-scoped server throttles are the
     *  common case; 529-overload is distinguished when the reason says so. */
    private classifySentinel;
    stop(): void;
}
//# sourceMappingURL=ResourceLedgerPoller.d.ts.map