/**
 * Rate-limiting middleware for QuantRisk MCP.
 *
 * Enforces two windows per user:
 *   - Per-minute:  burstable, resets every 60 seconds
 *   - Per-day:     total daily budget, resets at midnight UTC (via DO alarm)
 *
 * Limits by tier:
 *   Free  — 10 calls/minute, 100 calls/day
 *   Paid  — 60 calls/minute, 5,000 calls/day
 *
 * State is stored in the UserState Durable Object, which owns the counters
 * and the alarm for daily resets. This file delegates the actual counter
 * mutation to the DO via internal HTTP.
 *
 * Throws RateLimitError with retry-after information on violation.
 */
import type { UserTier } from "../services/stripe.js";
export interface RateLimitEnv {
    USER_STATE: DurableObjectNamespace;
}
/**
 * Check and increment the rate limit counters for a user.
 *
 * Must be called AFTER auth (so we have `userId` and `userTier`).
 * Must be called BEFORE the tool handler.
 *
 * @param userId   Stable user identifier (API key hash or "anon:<ip>")
 * @param userTier The user's subscription tier
 * @param env      Environment bindings (USER_STATE DO namespace)
 * @throws RateLimitError if any window is exceeded
 */
export declare function checkRateLimit(userId: string, userTier: UserTier, env: RateLimitEnv): Promise<void>;
//# sourceMappingURL=rate-limit.d.ts.map