const windowMs = 60 * 60 * 1000; const maxHits = 8; const buckets = new Map(); export function rateLimitHit(key: string): boolean { const now = Date.now(); const prev = buckets.get(key) ?? []; const fresh = prev.filter((t) => now - t < windowMs); fresh.push(now); buckets.set(key, fresh); return fresh.length <= maxHits; }