/** * Rate Limiter for AI Callers * * Prevents runaway scenarios where AI makes too many requests. * Humans bypass rate limiting entirely. */ import { CallerRole } from './dojoPolicy.js'; interface RateLimitConfig { maxRequestsPerMinute: number; maxConcurrent: number; } export interface RateLimitResult { allowed: boolean; reason?: string; retryAfterMs?: number; } /** * Check if a request is allowed under rate limits. * Call this BEFORE processing a request. */ export declare function checkRateLimit(callerRole?: CallerRole): RateLimitResult; /** * Record that a request has started. * Call this AFTER checkRateLimit returns allowed: true. */ export declare function recordRequestStart(callerRole?: CallerRole): void; /** * Record that a request has completed. * Call this in a finally block after processing. */ export declare function recordRequestEnd(callerRole?: CallerRole): void; /** * Get current rate limit status for monitoring/debugging. */ export declare function getRateLimitStatus(callerRole: CallerRole): { requestsInLastMinute: number; concurrent: number; limits: RateLimitConfig; }; /** * Reset rate limit state (useful for testing). */ export declare function resetRateLimits(): void; export {}; //# sourceMappingURL=rateLimiter.d.ts.map