/** * Stealth mode: OS-level automation (no CDP). * * PowerShell screen capture, native typing/clicking/scrolling, the * human-like typing cadence and the stealth analysis loop. * * Extracted from src/cli/commands/browse.ts (line budget) - pure code * motion, no behaviour change. */ import { type VisionFamily } from '../llm/models'; import type { VisionHarness } from './browse-types'; import { TypingGuard } from '../browser/human-input-guard'; /** * OS-level screen capture using PowerShell. * Returns path to screenshot PNG. */ export declare function captureScreenStealth(): string; /** * Compare two screenshots to detect screen change. * Returns true if screens are different (pixel diff > threshold). */ export declare function screensChanged(prevPath: string, currPath: string): boolean; /** * OS-level keyboard character input using PowerShell SendKeys. */ export declare function typeCharOS(char: string): void; /** * OS-level mouse click at specific screen coordinates. * Writes C# to temp file, loads via Add-Type -Path, calls user32.dll. */ export declare function clickOS(x: number, y: number): void; /** * OS-level scroll using mouse wheel. * positive = up, negative = down. */ export declare function scrollOS(clicks: number): void; /** * OS-level keyboard shortcut (e.g., Ctrl+A, Tab, Enter). */ export declare function pressKeyOS(key: string): void; /** * Keyboard proximity map for generating realistic typos. */ export declare const ADJACENT_KEYS: Record; /** * Generate a realistic typo by picking an adjacent key. */ export declare function getAdjacentKey(char: string): string; /** * Type text with human-like patterns: variable speed, occasional typos, * backspaces, natural pauses. Uses OS-level keyboard (no CDP). */ export declare function typeHumanLike(text: string, baseDelayMs?: number, guard?: TypingGuard): Promise; /** * Wait for the screen to change by comparing screenshots. * Returns the new screenshot path, or null if timed out. */ export declare function waitForScreenChangeStealth(prevPath: string, intervalMs?: number, maxWaitMs?: number, shouldStop?: () => boolean): string | null; /** * Stealth LLM call: send screenshot to vision LLM, get structured action. * Returns JSON: { action, coordinates?, text?, scroll?, reasoning } */ export declare function callStealthLLM(baseUrl: string, apiKey: string, model: string, screenshotPath: string, timeoutMs: number, promptOverride?: string, family?: VisionFamily, /** Opt-in harness backend (one CLI turn); absent = direct (unchanged). */ harness?: VisionHarness | null, /** Run-stable OpenCode session id (sent as x-opencode-session on Zen/Go). */ sessionId?: string | null): Promise<{ action: string; x?: number; y?: number; text?: string; scroll?: number; reasoning?: string; }>; /** * Stealth agent loop: OS-level screen capture → vision LLM → OS-level keyboard/mouse. * No CDP connection, no clipboard, no DevTools detection. */ export declare function runStealthLoop(baseUrl: string, apiKey: string, model: string, maxActions: number, intervalMs: number, timeoutMs: number, charDelayMs: number, continuous: boolean, family?: VisionFamily, /** Opt-in harness backend (one CLI turn per screenshot); absent = direct. */ harness?: VisionHarness | null, /** Run-stable OpenCode session id (sent as x-opencode-session on Zen/Go). */ sessionId?: string | null): Promise;