/** * Budget manager for x402-cfo agent. * * Enforces spending limits across multiple time windows (per-request, * hourly, daily, session). Uses a rolling-window ledger to track * spend in real-time and reject requests that would exceed limits. * * All amounts are tracked as integer cents internally to avoid * floating-point drift. */ export interface BudgetLimits { /** Max spend per individual request, in dollars (e.g. 2.00) */ maxPerRequest?: number; /** Max spend per rolling hour, in dollars */ hourly?: number; /** Max spend per rolling 24h, in dollars */ daily?: number; /** Max total spend for this session (agent lifetime), in dollars */ session?: number; } export interface BudgetStatus { /** Total spent this session, dollars */ sessionSpent: string; /** Spent in the current rolling hour, dollars */ hourlySpent: string; /** Spent in the current rolling 24h, dollars */ dailySpent: string; /** Remaining session budget (null if no limit) */ sessionRemaining: string | null; /** Remaining hourly budget (null if no limit) */ hourlyRemaining: string | null; /** Remaining daily budget (null if no limit) */ dailyRemaining: string | null; } export type BudgetDenialReason = 'exceeds_per_request_limit' | 'exceeds_hourly_limit' | 'exceeds_daily_limit' | 'exceeds_session_limit'; export interface BudgetDecision { allowed: boolean; reason?: BudgetDenialReason; /** Human-readable explanation */ message?: string; } export declare class Budget { private limits; private entries; private sessionSpentCents; constructor(limits?: BudgetLimits); /** * Check if a proposed spend amount is allowed under current limits. * Does NOT record the spend — call record() after payment succeeds. */ check(amountDollars: number): BudgetDecision; /** Record a successful spend. */ record(amountDollars: number, timestamp?: number): void; /** Get current budget status. */ status(): BudgetStatus; private spentSince; } //# sourceMappingURL=budget.d.ts.map