Package: @hexos/common

Configuration for in-memory request rate limiting.

Controls how many requests a user or conversation can make within a sliding time window. The scope field determines the rate limit key: per user, per conversation, or the more restrictive of both.

Related: RuntimeConfig applies this to the runtime, SlidingWindowRateLimiter implements the algorithm.

interface RateLimitConfig {
    enabled?: boolean;
    scope?: 'user' | 'conversation' | 'user-or-conversation';
    windowMs?: number;
    maxRequests?: number;
}

enabled

boolean

scope

'user' | 'conversation' | 'user-or-conversation'

windowMs

number

maxRequests

number