/** * Weavetab — anticaptcha/detector.ts * Comprehensive CAPTCHA detection covering all major real-world CAPTCHA types. * Detects: reCAPTCHA v2/v3, hCaptcha, Turnstile, GeeTest, FunCaptcha, * slider/drag, press-and-hold, DataDome, PerimeterX, and custom CAPTCHAs. * No external API keys. All detection via DOM inspection + CDP. * Weavetab by fy2ne */ import CDP from "chrome-remote-interface"; export type CaptchaType = "recaptcha_v2" | "recaptcha_v3" | "hcaptcha" | "turnstile" | "geetest" | "geetest_v4" | "funcaptcha" | "slider" | "press_and_hold" | "datadome" | "perimeter_x" | "custom" | "unknown"; export type InteractionType = "checkbox" | "image_select" | "drag" | "hold" | "text" | "math" | "rotate" | "none" | "unknown"; export interface CaptchaDetection { detected: boolean; type: CaptchaType; interactionType: InteractionType; difficulty: "easy" | "medium" | "hard" | "extreme"; selector: string; iframe?: string; widgetId?: string; confidence: number; /** Approximate drag distance in pixels for slider CAPTCHAs (0 if unknown) */ sliderTrackWidth?: number; /** Estimated hold duration in ms for press-and-hold CAPTCHAs */ holdDurationMs?: number; metadata: { siteKey?: string; version?: string; hasAudio?: boolean; hasChallenge?: boolean; requiresUserInteraction?: boolean; geetestVersion?: number; frameOrigin?: string; }; } /** * Comprehensive CAPTCHA detection using multiple heuristics. * Returns the highest-confidence detection found on the page. */ export declare function detectCaptcha(session: CDP.Client): Promise; /** * Check if a CAPTCHA is currently blocking the workflow. * Uses both detection and a visibility/blocking check. */ export declare function isCaptchaBlocking(session: CDP.Client): Promise; /** * Quickly check if the current page shows a CAPTCHA without the full detection. * Cheaper than detectCaptcha — use for polling. */ export declare function quickCaptchaCheck(session: CDP.Client): Promise;