/** * @module @arcis/node/intelligence/client * Cloud IP-reputation client with a local LRU+TTL cache. * * Design rules: * 1. `check()` is synchronous and never blocks the request path. On a cache * miss it returns `found:false` for THIS request and schedules a * background refresh, so the hot path adds ~0ms. Subsequent requests from * the same IP read the cached verdict (Pattern: opportunistic refresh, not * on the hot path). * 2. Fail-open (Pattern 4): a network error, timeout, or non-200 resolves to * `found:false` and never throws into the request path. * 3. Private / loopback / unresolved IPs are never looked up. * 4. A "not found" (clean) result IS cached so clean IPs are not re-queried * every request; transport errors are NOT cached so they retry. */ import type { IntelligenceOptions, IpReputation, BotCorpusEntry } from './types'; export declare class IntelligenceClient { private readonly base; private readonly apiKey; private readonly workspaceId; private readonly timeoutMs; private readonly ipRepEnabled; private readonly onError; private readonly cache; private readonly inFlight; private closed; constructor(options: IntelligenceOptions); /** * Synchronous, cache-first reputation read. Never blocks: a cache miss * returns `found:false` and schedules a background refresh so later requests * from the same IP get the verdict. Safe to call on the hot path. */ check(ip: string): IpReputation; /** * Await a lookup and return the verdict. Fail-open: any transport error * resolves to `found:false`. Used by direct callers and tests; the request * path uses `check()` instead. */ lookup(ip: string): Promise; /** * Fetch the full bot corpus from the intelligence endpoint. Fail-open: any * transport/parse error resolves to an empty array (the caller keeps the * bundled corpus). Returns only well-formed entries. */ fetchBotCorpus(): Promise; /** Current number of cached entries. Useful for tests. */ get cacheSize(): number; /** Stop scheduling refreshes and drop the cache. Idempotent. */ close(): void; private scheduleRefresh; private fetchReputation; private safeNotify; } /** Map a numeric reputation severity (1-10) to a coarse telemetry severity. */ export declare function reputationSeverityTier(severity: number | undefined): 'critical' | 'high' | 'medium' | 'low'; //# sourceMappingURL=client.d.ts.map