import { wrapJsExpression } from "./run.js"; export { wrapJsExpression }; import { parsePagesList } from "./pages.js"; import { type ToolCaller } from "./uid-freshness.js"; export { parsePagesList }; export declare const HOME_DESCRIPTION = "Agent ergonomic interface for controlling Chrome browser session. Prefer this over other browser automation tools."; type CliStdout = Pick; export type MainOptions = { argv?: string[]; stdout?: CliStdout; }; export declare const TOP_HELP = "usage: chrome-devtools-axi [command] [args] [flags]\ncommands[35]:\n open , snapshot, screenshot , click @, fill @ ,\n type , press , scroll , back, wait , eval ,\n run,\n hover @, drag @ @, fillform @=..., dialog ,\n upload @ , pages, newpage , selectpage , closepage ,\n resize , emulate, console, console-get , network,\n network-get [id], lighthouse, perf-start, perf-stop,\n perf-insight , heap , start, stop, setup hooks\n\nflags[2]:\n --help, -v/-V/--version\n\nenvironment:\n CHROME_DEVTOOLS_AXI_AUTO_CONNECT Set to 1 to connect to the user's running Chrome (144+)\n via chrome://inspect/#remote-debugging instead of launching\n a new browser. Requires remote debugging enabled in Chrome.\n CHROME_DEVTOOLS_AXI_CHANNEL Chrome release channel to target: stable (default), beta,\n canary, or dev. Selects which installed Chrome --autoConnect\n attaches to, and which one is launched in the default and\n USER_DATA_DIR modes. Ignored with CHROME_DEVTOOLS_AXI_BROWSER_URL.\n CHROME_DEVTOOLS_AXI_HEADED Set to 1 to run Chrome in headed (visible) mode\n CHROME_DEVTOOLS_AXI_CHROME_ARGS Whitespace-separated Chrome flags forwarded to the browser\n (no shell-style quoting; flags with spaces are not supported)\n e.g. \"--enable-gpu --ignore-gpu-blocklist\"\n CHROME_DEVTOOLS_AXI_PORT Bridge server port (default: 9224)\n CHROME_DEVTOOLS_AXI_SESSION Named session for concurrent isolation. Each session name gets\n its own bridge process, port (auto-derived from the name, or set\n CHROME_DEVTOOLS_AXI_PORT), and on-disk state, so multiple sessions\n run at once without colliding. Connection mode and profile are\n unchanged. Defaults to \"default\" (port 9224, legacy state paths).\n e.g. CHROME_DEVTOOLS_AXI_SESSION=worker-1\n CHROME_DEVTOOLS_AXI_BROWSER_URL Connect to an existing Chrome instance instead of launching one.\n http(s):// uses --browserUrl (fetches /json/version).\n ws(s):// uses --wsEndpoint (direct WebSocket).\n e.g. \"http://127.0.0.1:9222\" or \"wss://cluster.example/launch\"\n CHROME_DEVTOOLS_AXI_WS_HEADERS JSON headers for ws(s):// endpoints (only with BROWSER_URL=wss?://)\n e.g. '{\"Authorization\":\"Bearer token\"}'\n CHROME_DEVTOOLS_AXI_USER_DATA_DIR Persistent Chrome profile directory (skips --isolated mode)\n e.g. \"/path/to/.chrome-profile\"\n CHROME_DEVTOOLS_AXI_MCP_PATH Absolute path to a chrome-devtools-mcp script. When set\n without a shared URL, the bridge spawns 'node $MCP_PATH'\n directly instead of 'npx -y chrome-devtools-mcp@latest'.\n With MCP_SERVER_URL also set, selects stdio proxy mode:\n the executable must advertise --serverUrl in --help.\n Local-mode recommendation:\n npm install -g chrome-devtools-mcp\n export CHROME_DEVTOOLS_AXI_MCP_PATH=\"$(npm prefix -g)/lib/node_modules/chrome-devtools-mcp/build/src/bin/chrome-devtools-mcp.js\"\n CHROME_DEVTOOLS_AXI_MCP_SERVER_URL\n Shared MCP service URL. With MCP_PATH, starts a verified\n stdio proxy and passes --server-url=. Without\n MCP_PATH, connects directly over Streamable HTTP (no\n local MCP child); use an absolute http(s) MCP endpoint.\n If unset or blank, the bridge uses standalone stdio mode.\n CHROME_DEVTOOLS_AXI_BRIDGE_TIMEOUT_MS\n Bridge readiness deadline in ms (default: 30000, min: 1000)\n\ngpu:\n Headless Chrome cannot access hardware GPU on most Linux systems.\n For GPU-accelerated WebGL, use headed mode with GPU flags:\n CHROME_DEVTOOLS_AXI_HEADED=1\n CHROME_DEVTOOLS_AXI_CHROME_ARGS=\"--enable-gpu --ignore-gpu-blocklist\"\n For WebGPU, Vulkan must also be enabled (required for the Dawn backend):\n CHROME_DEVTOOLS_AXI_CHROME_ARGS=\"--enable-gpu --ignore-gpu-blocklist --enable-unsafe-webgpu --enable-features=Vulkan\"\n\ntips:\n Pipe output through grep/head to extract specific data from large pages.\n"; export declare function getCommandHelp(command: string): string | null; export interface ScreenshotArgs { filePath: string | null; uid: string | undefined; fullPage: boolean; format: string | undefined; } export declare function parseScreenshotArgs(args: string[]): ScreenshotArgs; export declare function formatScreenshotOutput(filePath: string): string; /** Format raw MCP text result as AXI output: labeled block + truncation + suggestions. */ export declare function formatMcpResult(label: string, text: string, suggestions: string[]): string; export declare function parseFillFormArgs(args: string[]): { entries: { uid: string; value: string; }[]; }; export interface EmulateArgs extends Record { viewport?: string; colorScheme?: string; networkConditions?: string; cpuThrottlingRate?: number; geolocation?: string; userAgent?: string; } export declare function parseEmulateArgs(args: string[]): EmulateArgs; export declare function parseConsoleArgs(args: string[]): { types?: string[]; pageSize?: number; pageIdx?: number; }; export declare function parseNetworkArgs(args: string[]): { resourceTypes?: string[]; pageSize?: number; pageIdx?: number; }; export declare function parseNetworkGetArgs(args: string[]): { reqid?: number; responseFilePath?: string; requestFilePath?: string; }; export declare function parseLighthouseArgs(args: string[]): { device?: string; mode?: string; outputDirPath?: string; }; export declare function parsePerfStartArgs(args: string[]): { reload?: boolean; autoStop?: boolean; filePath?: string; }; /** * Strip the `@` prefix and any generation tag from a uid ref, validating * that the tag (if present) matches the current snapshot generation. A * stale tag throws a loud STALE_REF error rather than letting a silent * no-op fall through to upstream MCP. */ export declare function parseUid(arg: string): string; export declare function parseUidFresh(arg: string, caller?: ToolCaller): Promise; export declare function formatStopOutput(wasStopped: boolean): string; export declare function main(options?: MainOptions | string[]): Promise;