// Shared constants and types export const DEFAULT_TIMEOUT_MS = 120_000; // 2 minutes for large downloads export const DEFAULT_MAX_BYTES = 50 * 1024 * 1024; export const DEFAULT_MAX_CHARS = 20_000; export const MAX_VISIBLE_CHARS = 100_000; export const DDG_HTML_URL = "https://html.duckduckgo.com/html/"; export const USER_AGENT = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"; export const BROWSER_HEADERS = { "User-Agent": USER_AGENT, Accept: "text/html,application/xhtml+xml,*/*", "Accept-Language": "en-US,en;q=0.9", "Accept-Encoding": "identity", Connection: "keep-alive", "Sec-Fetch-Dest": "document", "Sec-Fetch-Mode": "navigate", } as const; export interface SearchResult { title: string; url: string; snippet: string; date?: string; } export interface FetchResult { body: Buffer; contentType: string; contentLength: number; status: number; finalUrl: string; }