import type { BrowserType } from './types.js'; export interface Config { searxngUrl: string | null; searxngMode: 'native' | 'docker'; searxngPort: number; fetchTimeoutMs: number; fetchMaxRetries: number; maxRedirects: number; fetchAllowPrivate: boolean; playwrightLoadTimeoutMs: number; playwrightNavTimeoutMs: number; /** Upper bound on the browser tier's challenge-completion poll. A detected * challenge is polled (not settled once) until the real page renders or a * `cf_clearance` cookie appears; a challenge that clears within this window * proceeds normally, otherwise it fast-fails. The effective deadline is the * min() of this and the caller's remaining fetch budget. */ challengeCompletionTimeoutMs: number; searxngQueryTimeoutMs: number; searchFetchTimeoutMs: number; searchFetchTimeoutBalancedMs: number; searchFetchTimeoutDeepMs: number; searchStageBudgetBalancedMs: number; searchStageBudgetDeepMs: number; searchTotalTimeoutMs: number; /** Total per-URL fetch budget pool (ms) shared across a NARROW candidate set * during search enrichment. When set, each URL's per-URL budget is scaled up * proportionally to `1/candidateCount` (fewer candidates → more time each), * always clamped to the stage budget. `0`/undefined preserves the legacy * small per-URL budget regardless of candidate count. */ searchNarrowSetBudgetMs: number; /** Max candidate count for which a domain-narrowed (`include_domains`) search * forces the browser-render path during enrichment. JS-heavy documentation * SPAs hand back an empty shell over the HTTP tier; rendering recovers real * content. Bounded to a FEW URLs so latency/cost stays controlled — broad * (non-domain-narrowed, many-URL) searches never escalate. `0` disables the * escalation entirely. */ searchNarrowRenderMaxCandidates: number; /** Pre-launch the browser engine before search enrichment so the first * hydration fetch doesn't pay the browser cold-start inline. Latency-only — * no change to results. Defaults on; set false to disable. */ searchPrewarmBrowser: boolean; /** Hold mojeek out of the primary search dispatch wave (probe-only). mojeek * reputation-blocks (403) most callers, contributing 0 results while burning * retry latency and tripping its breaker — a per-call tax that cascades the * pool toward bing-only under burst. Probe-only keeps it available to the * degraded-recovery wave (when the pool collapses and needs every signal) * without paying its cost on the happy path. Defaults on; set false * (WIGOLO_MOJEEK_PROBE_ONLY=false) to restore it to the primary wave. */ searchMojeekProbeOnly: boolean; validateTimeoutMs: number; maxBrowsers: number; browserIdleTimeoutMs: number; browserFallbackThreshold: number; authStatePath: string | null; chromeProfilePath: string | null; cdpUrl: string | null; dataDir: string; cacheTtlSearch: number; cacheTtlContent: number; fastStaleMaxHours: number; fastTimeoutMs: number; crawlConcurrency: number; crawlDelayMs: number; crawlPrivateConcurrency: number; crawlPrivateDelayMs: number; useProxy: boolean; proxyUrl: string | null; /** Opt-in challenge-solver service URL (Tier-B escape hatch). Off unless set. */ solverUrl: string | null; /** Opt-in hosted reader-service URL (Tier-B escape hatch). Off unless set. */ hostedReaderUrl: string | null; userAgent: string | null; validateLinks: boolean; respectRobotsTxt: boolean; braveApiKey: string | null; /** GitHub API personal access token. When set, the github-code adapter * passes it as a Bearer token so search calls run authenticated. Lifts * the 10 req/min unauthed cap to 30 req/min, eliminates the most common * 401 path for org-private result hydration, and is the env var named * in engine_warnings hints. Optional — the adapter still runs unauthed. */ githubToken: string | null; logLevel: 'debug' | 'info' | 'warn' | 'error'; logFormat: 'json' | 'text'; reranker: 'onnx' | 'none' | 'custom'; rerankerModel: string; rerankerMaxLength: number; rerankerReadyTimeoutMs: number; rerankerRequestTimeoutMs: number; rerankerIdleTimeoutMs: number; relevanceThreshold: number; findSimilarColdStartThreshold: number; bootstrapMaxAttempts: number; bootstrapBackoffSeconds: number[]; healthProbeIntervalMs: number; daemonPort: number; daemonHost: string; pluginsDir: string; browserTypes: BrowserType[]; shellHistoryPath: string; multiQueryConcurrency: number; multiQueryMax: number; embeddingModel: string; embeddingIdleTimeoutMs: number; embeddingMaxTextLength: number; /** * Search backend selector. Resolves `WIGOLO_SEARCH` env > persisted * `searchBackend` in config.json > built-in default (null = 'core'). * `null` means "unset"; the search-provider factory treats it as 'core'. */ searchBackend: string | null; llmProvider: string | null; /** * Base URL for a custom OpenAI-compatible LLM backend. Only consulted when * `llmProvider` is the `ollama` alias; overrides the default * http://localhost:11434. `null` means "use the default local Ollama base". */ llmBaseUrl: string | null; llmCacheTtlDays: number; llmMaxCallsPerRequest: number; /** * Opt-in auto-detect ladder for a local language model server. Resolves * `WIGOLO_LOCAL_LLM` env > persisted `localLlm` > default: * - 'off' : disabled (DEFAULT) — behavior is unchanged from before this * knob existed; no probe is ever made. * - 'auto' : probe the default local endpoint and use it when reachable. * - an http(s):// URL : probe that explicit endpoint instead of the default. * Any other value normalizes to 'off' (fail-safe). Consumed by * `resolveLocalModelTier()`; never mutates the keyless / cloud LLM path. */ localLlm: 'off' | 'auto' | string; /** * Preferred model name for the local-LLM tier. `null` lets the tier * auto-pick an installed model. Resolves `WIGOLO_LOCAL_LLM_MODEL` env > * persisted `localLlmModel` > null. */ localLlmModel: string | null; /** * TLS-impersonation HTTP tier mode: * - 'off' : tier disabled, current pipeline unchanged (DEFAULT) * - 'auto' : only invoked on anti-bot signal (403/429/503 or challenge body) * - 'on' : tried first for cold domains, then HTTP, then Playwright */ tlsTier: 'off' | 'auto' | 'on'; /** * Anti-bot fingerprint hardening / challenge-handling mode for the browser * tier: * - 'off' : never harden — the browser tier always uses the pooled default * fingerprint. * - 'auto' : harden ONLY when a browser fetch is an anti-bot / challenge * escalation (DEFAULT). A plain SPA-shell render or an explicit * browser request (render_js:'always' / auth / actions) is * unaffected. * - 'on' : harden every browser fetch. * Any other value normalizes to 'auto' (the safe default). */ stealth: 'off' | 'auto' | 'on'; /** Browser fingerprint profile passed to the TLS-impersonation backend. */ tlsBrowser: string; /** Successes required before a domain is auto-promoted to TLS-first routing. */ tlsSuccessThreshold: number; /** * Extra domains (beyond the built-in anti-bot allowlist) that should try the * TLS-impersonation tier FIRST during a content fetch — even when `tlsTier` * is 'off'. Curated for known anti-bot, connection-timeout-prone content * domains (e.g. stackoverflow.com) whose plain-HTTP fetch times out before * returning a response, so the signal-based escalation never fires. */ tlsDomains: string[]; } export declare function validateTlsBrowser(raw: string | null | undefined, fallback: string): string; export declare function getConfig(): Config; export declare function resetConfig(): void; //# sourceMappingURL=config.d.ts.map