/**
 * RenewalManager — coordinates capability-token auto-renewal.
 *
 * Triggers a re-issue when ≥80% of the token lifetime has elapsed.
 * Debounced: a renewal in flight blocks duplicate triggers; once it
 * resolves, the gate is rotated and the timer is reset.
 *
 * The manager is loop-agnostic: any caller (minimal-loop, sdk-loop, or
 * a long-running background job) can `await maybeRenew()` between tool
 * calls. The decision is purely time-based; no per-call cost reset.
 */
import type { CapabilityGate } from "./capability-gate.js";
export interface RenewalRequest {
    readonly currentToken?: string;
    readonly issuedAtEpochSeconds: number;
    readonly expiresAtEpochSeconds: number;
}
export interface RenewedToken {
    readonly token: string;
    readonly issuedAtEpochSeconds: number;
    readonly expiresAtEpochSeconds: number;
}
export interface RenewalManagerOptions {
    /** Capability gate exposing getExpiresAt / getIssuedAt / rotateToken. */
    readonly gate: CapabilityGate;
    /** Re-issue callback — host computes the new token (e.g. via boot_agent). */
    readonly reissue: (req: RenewalRequest) => Promise<RenewedToken>;
    /**
     * Lifetime fraction at which renewal triggers. Default 0.80. Must be
     * in (0, 1).
     */
    readonly thresholdFraction?: number;
    /** Clock injection for tests. Default `() => Date.now() / 1000`. */
    readonly now?: () => number;
}
export declare class RenewalManager {
    private readonly gate;
    private readonly reissue;
    private readonly thresholdFraction;
    private readonly now;
    private inFlight;
    constructor(opts: RenewalManagerOptions);
    /**
     * Trigger renewal if the current token is past the threshold. Idempotent
     * across concurrent callers via the in-flight promise.
     */
    maybeRenew(): Promise<boolean>;
}
//# sourceMappingURL=renewal-manager.d.ts.map