/** * Script runner for `chrome-devtools-axi run`. * * Reads a script from stdin, provides a minimal `page` global, and executes it. * Only the script's own console.log output is visible to the caller. */ type CallTool = (name: string, args?: Record) => Promise; /** Wrap plain JS expressions for MCP evaluate_script, but pass functions through unchanged. */ export declare function wrapJsExpression(js: string): string; /** Extract the actual JS value from MCP evaluate_script response wrapper. */ export declare function parseEvalOutput(output: string): unknown; /** Returns true when the string looks like a @uid ref (e.g. "@12", "26_181"). */ export declare function isUidRef(s: string): boolean; export interface OpenResult { url: string; status: number | null; } export interface PageHelper { open(url: string): Promise; eval(jsOrFn: string | ((...args: unknown[]) => unknown)): Promise; wait(ms: number): Promise; wait(selector: string, timeout?: number): Promise; snapshot(): Promise; click(refOrSelector: string): Promise; fill(refOrSelector: string, text: string): Promise; type(text: string): Promise; press(key: string): Promise; back(): Promise; } export declare function createPageHelper(callTool: CallTool): PageHelper; export interface RunResult { stdout: string; } /** Read all of stdin into a string. */ export declare function readStdin(): Promise; export declare function runScript(content: string, callTool: CallTool): Promise; export {};