/** * Weavetab — anticaptcha/integration.ts * Integration layer: auto-detects and solves CAPTCHAs during tool operations. * Falls back to clear user instructions only when all automated approaches fail. * Weavetab by fy2ne */ import CDP from "chrome-remote-interface"; import { type CaptchaDetection } from "./detector.js"; import { type CaptchaSolution } from "./solver.js"; export interface CaptchaIntervention { detected: boolean; detection?: CaptchaDetection; solution?: CaptchaSolution; actionTaken: "auto_solved" | "user_guided" | "not_blocking" | "failed" | "none"; /** Human-readable message to surface to the agent */ userMessage?: string; /** True only when all automated approaches have failed AND user must act */ human_needed: boolean; } /** * Main entry point. Call this when a tool suspects CAPTCHA interference. * Always attempts automated solving first. Only sets human_needed:true as last resort. */ export declare function handleCaptchaIntervention(session: CDP.Client, context: "navigation" | "click" | "form_submit" | "general"): Promise; /** * Lightweight pre-check before performing an action. * Returns true if a CAPTCHA is present and needs solving before proceeding. */ export declare function shouldPauseFoCaptcha(session: CDP.Client): Promise; /** * CAPTCHA-aware navigation wrapper. */ export declare function navigateWithCaptchaHandling(session: CDP.Client, navigateFn: () => Promise): Promise<{ success: boolean; captchaIntervention?: CaptchaIntervention; }>;