// engine/usage-tracker/rate-check.ts — Composed rate-limit evaluation (pure, no I/O).
import { checkDailyLimit, checkCooldown } from './rate-limiter.js';
/**
 * Evaluates both daily limit and cooldown in a single call.
 * Returns the first failing check, or an allowed result if both pass.
 */
export function evaluateRateLimit(callCount, maxCalls, lastCallAt, now) {
    const daily = checkDailyLimit(callCount, maxCalls);
    if (!daily.allowed) {
        return daily;
    }
    const cooldown = checkCooldown(lastCallAt, now);
    if (!cooldown.allowed) {
        return cooldown;
    }
    return daily;
}
//# sourceMappingURL=rate-check.js.map