/** * BrowserLocalServer — local HTTP server for inter-process browser control. * * Agent main process runs this server so that MCP child processes can * control browser sessions via HTTP instead of sharing in-memory objects. * Binds to 127.0.0.1 only (no external access). */ import { BrowserSessionManager } from '../mcp/tools/browser/browser-session-manager'; /** Action log entry emitted to the caller */ export interface ActionLogNotification { sessionId: string; entry: { timestamp: number; source: 'direct' | 'chat'; action: string; details: string; }; } export declare class BrowserLocalServer { private readonly sessionManager; private server; private port; onActionLog: ((notification: ActionLogNotification) => void) | null; constructor(sessionManager: BrowserSessionManager); /** * Start the HTTP server on a random available port. * @returns the port number */ start(): Promise; /** * Stop the HTTP server. */ stop(): Promise; /** * Get the port the server is listening on. */ getPort(): number; private handleRequest; /** * Record an action log entry and notify via callback. * BrowserActionLog.onChange may also fire for direct operations, but * for chat operations via BrowserLocalServer we use onActionLog to * ensure delivery even before the Web browser panel is connected. */ private emitActionLog; private handleNavigate; private handleClick; private handleFill; private handleGetText; private handleExtract; private handleScreenshot; private handleGetUrl; private handleGetTitle; private handleGetVariable; private handleSetVariable; private handleExecuteScript; private handleListVariables; } //# sourceMappingURL=browser-local-server.d.ts.map