/** * Rate Limiter for Multi-Agent Operations * * Provides sliding window rate limiting to prevent API abuse * and ensure stable performance across different platforms. */ export interface RateLimitConfig { /** Maximum requests per window */ maxRequests: number; /** Window duration in milliseconds */ windowMs: number; /** Grace period for burst requests */ burstAllowance?: number; } export interface RateLimitResult { allowed: boolean; remaining: number; resetTime: number; retryAfter?: number; } /** * Sliding Window Rate Limiter * * Uses a sliding window approach for accurate rate limiting. * Automatically cleans up old entries to prevent memory leaks. */ export declare class RateLimiter { private requests; private config; private cleanupInterval; constructor(config: RateLimitConfig); /** * Check if request is allowed for the given key */ checkLimit(key: string): RateLimitResult; /** * Clean up old request records to prevent memory leaks */ private cleanup; /** * Get current stats for debugging */ getStats(): { totalKeys: number; totalRequests: number; }; /** * Reset all rate limiting data */ reset(): void; /** * Clean up resources */ destroy(): void; } /** * Platform-specific rate limit configurations */ export declare const RATE_LIMITS: { readonly SLACK_MENTION: { readonly maxRequests: 50; readonly windowMs: 60000; readonly burstAllowance: 5; }; readonly DISCORD_MENTION: { readonly maxRequests: 100; readonly windowMs: 60000; readonly burstAllowance: 10; }; readonly AGENT_OPERATIONS: { readonly maxRequests: 30; readonly windowMs: 60000; readonly burstAllowance: 3; }; }; //# sourceMappingURL=rate-limiter.d.ts.map