/** * browser.ts — Playwright browser launcher for cv jobs apply * * DESIGN PHILOSOPHY (browser-use methodology): * * We NEVER try to use the user's real Chrome profile while Chrome is running. * Chrome locks its profile directory — any attempt to `launchPersistentContext` * against a locked profile causes a SIGTRAP crash, which is the root cause of * all previous failures. * * Instead we use ONE strategy, always: * - A DEDICATED automation profile at ~/.careervivid/browser-session/ * - This is a persistent Chromium profile separate from the user's real Chrome * - It persists cookies, localStorage, and login sessions across runs * - The user only needs to log in to each ATS once; subsequent runs are instant * - It uses the real Chrome binary (best site compatibility) if available * - It is NEVER locked because we control its full lifecycle * * After launch, the caller is responsible for navigating to the target URL * via page.goto(). The browser starts at about:blank. */ import { type BrowserContext, type Page } from "playwright-core"; /** Type text into a field with random per-character delay (30–120ms) */ export declare function humanType(page: Page, selector: string, text: string): Promise; /** Random delay between actions (simulates reading / thinking) */ export declare function humanDelay(minMs?: number, maxMs?: number): Promise; export interface BrowserLaunchOptions { headless?: boolean; /** @deprecated — ignored. We always use the dedicated automation profile. */ useNativeChrome?: boolean; /** @deprecated — ignored. We always use the dedicated automation profile. */ forceAutomationProfile?: boolean; } export interface ApplyBrowser { context: BrowserContext; page: Page; close: () => Promise; /** Always false — we always use the dedicated automation profile now */ usingAutomationProfile: boolean; } /** * Launch the automation browser. * * Always uses the dedicated CareerVivid profile at ~/.careervivid/browser-session/. * This is the ONLY strategy. No Chrome restart, no profile locking, no SIGTRAP. * * Sessions persist across runs — the user logs in once per ATS, all future * runs skip the login screen automatically. * * @example * const { page } = await launchApplyBrowser(); * await page.goto("https://jobs.example.com/apply"); */ export declare function launchApplyBrowser(_opts?: BrowserLaunchOptions): Promise; export declare function isChromeRunning(): boolean; //# sourceMappingURL=browser.d.ts.map