/** * Playwright browser retrieval adapter. * * Human-in-the-loop (HITL) browser route for subscription content: * 1. Opens a visible browser window navigating to the paper's landing page. * 2. Detects if verification is needed (CAPTCHA, login, cookie consent). * 3. If verification needed → returns status "needs_human" with the page open * for the user to interact with. The LLM relays this to the user. * 4. Once verification is done (or not needed), tries to find a PDF link * or capture HTML full text. * 5. Saves browser state (cookies/storage) after success for future sessions. * * The browser instance is kept alive across MCP calls in the same server process. */ export interface BrowserRetrievalResult { success: boolean; artifact_path: string | null; artifact_type: "pdf" | "html" | null; needs_human_interaction: boolean; human_message: string | null; state_saved: boolean; page_title: string | null; page_url: string | null; error: string | null; } /** * Main browser retrieval function. * * @param url - URL to navigate to (DOI landing page or publisher URL) * @param stateDir - Directory for saving browser state * @param cacheDir - Directory where downloaded artifacts are stored * @param doi - DOI for organizing cached artifacts * @param action - "navigate" (default), "check" (check if verification done), or "close" */ export declare function browserRetrieve(url: string, stateDir: string, cacheDir?: string, doi?: string | null, action?: "navigate" | "check" | "close"): Promise; //# sourceMappingURL=playwright-retriever.d.ts.map