/**
 * TokenLedgerPoller — periodically calls TokenLedger.scanAll() to keep
 * the SQLite rollup up to date with whatever Claude Code has written.
 *
 * Read-only observability: never mutates the source JSONL files.
 */
import type { TokenLedger } from './TokenLedger.js';
export interface TokenLedgerPollerOptions {
    ledger: TokenLedger;
    /** Polling interval (ms) while the agent is active. Defaults to 60_000. */
    intervalMs?: number;
    /**
     * When provided, the poller backs off to {@link idleIntervalMs} while this
     * returns true (e.g. no active sessions). Scanning JSONL for token usage when
     * nothing is running is wasted work — this trims it from the idle CPU floor.
     * Omit for the prior fixed-cadence behavior. (Responsible Resource Usage.)
     */
    isIdle?: () => boolean;
    /** Polling interval (ms) while idle. Defaults to 5 minutes. */
    idleIntervalMs?: number;
    /** Optional logger (defaults to console.warn for errors only). */
    onError?: (err: unknown) => void;
    /** Optional hook that rides the existing token-ledger cadence after each scan. */
    afterTick?: () => void | Promise<void>;
    /**
     * When set, each tick ALSO scans this agent's Codex rollouts (attributed by
     * cwd) into the ledger's separate codex_token_sessions table. Leave unset on
     * Claude-only hosts — the Codex scan is then skipped entirely.
     */
    codexProjectDir?: string;
    /** Skip Codex rollouts older than this when scanning. Mirrors the Claude window. */
    codexMaxFileAgeMs?: number;
}
export declare class TokenLedgerPoller {
    private ledger;
    private intervalMs;
    private idleIntervalMs;
    private isIdle;
    private timer;
    private cadence;
    private running;
    private onError;
    private afterTick;
    private codexProjectDir;
    private codexMaxFileAgeMs;
    constructor(opts: TokenLedgerPollerOptions);
    start(): void;
    stop(): void;
    private tick;
}
//# sourceMappingURL=TokenLedgerPoller.d.ts.map