// Planu — Web Fetcher: In-memory cache + default config
export const DEFAULT_CONFIG = {
    defaultTtlSeconds: 3600,
    maxRetries: 2,
    retryBackoffMs: 1000,
    timeoutMs: 10_000,
    userAgent: 'Planu/1.0',
};
const fetchCache = new Map();
export function getCached(url) {
    const entry = fetchCache.get(url);
    if (!entry) {
        return null;
    }
    if (Date.now() - entry.fetchedAt > entry.ttlMs) {
        fetchCache.delete(url);
        return null;
    }
    return entry.data;
}
export function setCache(url, data, ttlMs) {
    fetchCache.set(url, { data, fetchedAt: Date.now(), ttlMs });
}
export function clearCache() {
    fetchCache.clear();
}
//# sourceMappingURL=cache.js.map