import type { DomainProfile } from './profiles/domain-profile.js'; export type CrawlEngineName = 'http' | 'browser' | 'browser-stealth' | 'stagehand' | 'vision' | 'recorded-session' | 'native'; export interface CrawlRouteDecisionInput { appUrl: string; appType?: string | null; hasCredentials: boolean; hasStorageState: boolean; hasAuthToken: boolean; hasSkyvern: boolean; hasProxy: boolean; profile: DomainProfile; previousFailureReason?: string; } export interface CrawlRouteDecision { engines: CrawlEngineName[]; reasons: string[]; confidence: number; } /** * Per-domain rendering predictor — learns whether a domain requires a full browser * or can be served by the fast HTTP engine. Implements adaptive crawlee-python pattern. * * Strategy: * 1. On first encounter of a domain, classify the HTTP response body. * 2. Store the decision in memory (Map). All future URLs on same domain skip re-testing. * 3. "Requires browser" signals: React/Vue/Angular root with no content, tiny body (<500 chars meaningful text). */ export declare class RenderingTypePredictor { private cache; /** Return cached decision if available, undefined if unknown. */ getCached(url: string): 'http' | 'browser' | undefined; /** * Analyze an HTTP response body to predict if JS rendering is required. * Returns 'browser' if JS-heavy signals detected, 'http' otherwise. */ predict(url: string, htmlBody: string, statusCode: number): 'http' | 'browser'; /** Force a domain to use a specific engine (e.g. after observing crawl errors). */ set(url: string, engine: 'http' | 'browser'): void; stats(): { cached: number; browserDomains: string[]; httpDomains: string[]; }; } /** Singleton predictor — shared across crawl jobs in the same process. */ export declare const renderingPredictor: RenderingTypePredictor; export declare function chooseCrawlEngines(input: CrawlRouteDecisionInput): CrawlRouteDecision;