/** * Opens a headed (visible) browser at appUrl and returns a captureId. * The user logs in manually, then calls completeSessionCapture() to harvest storageState. * Sessions expire after 10 minutes if not completed. * * Throws 'HEADLESS_ENV' if running in Docker/Linux without a display server. * The API route surfaces this as a 503 so the frontend can switch to manual JSON paste. */ export declare function startSessionCapture(appUrl: string): Promise; /** Captures storageState from the open browser, closes it, and returns the JSON string. */ export declare function completeSessionCapture(captureId: string): Promise; /** Closes the browser without capturing — called on Cancel. */ export declare function cancelSessionCapture(captureId: string): Promise; /** * Headless login + session capture — works on Docker/cloud (no display needed). * Tries DOM-based login first (fast, free). If it fails and llmConfig is provided, * falls back to Stagehand AI-guided login (handles modals, multi-step, marketing pages). * * Returns { storageState, cookies, localStorage } on success. * Throws a human-readable error on failure. */ export declare function validateAndCaptureSession(appUrl: string, creds: { username: string; password: string; totpSecret?: string; httpBasicUsername?: string; httpBasicPassword?: string; }, llmConfig?: { modelName: string; apiKey: string; }, captchaOpts?: { apiKey?: string; provider?: '2captcha' | 'capsolver'; }, loginInstructions?: string): Promise<{ storageState: string; cookies: number; localStorage: number; finalUrl?: string; }>;