browser-debugger-cli
Version:
DevTools telemetry in your terminal. For humans and agents. Direct WebSocket to Chrome's debugging port.
38 lines • 1.53 kB
TypeScript
import type { CDPConnection } from '../../connection/cdp.js';
import type { Protocol } from '../../connection/typed-cdp.js';
import { type SessionMetadata } from '../../session/metadata.js';
/**
* Validate that an active session is running
*
* @returns PID of running session
* @throws CommandError When no active session is found
*/
export declare function validateActiveSession(): number;
/**
* Get session metadata with validation
*
* @returns Session metadata including targetId and webSocketDebuggerUrl
* @throws Error When metadata is invalid or missing required fields
*/
export declare function getValidatedSessionMetadata(): SessionMetadata;
/**
* Verify that the CDP target still exists
*
* Uses the centralized fetchCDPTargetById utility which includes timeout
* safeguards and consistent error handling.
*
* @param metadata - Session metadata containing targetId
* @param port - CDP port number
* @throws CommandError When target not found (tab may have been closed)
*/
export declare function verifyTargetExists(metadata: SessionMetadata, port: number): Promise<void>;
/**
* Execute JavaScript in browser context via CDP
*
* @param cdp - CDP connection instance
* @param script - JavaScript expression to execute
* @returns Execution result
* @throws Error When script execution throws exception or returns invalid response
*/
export declare function executeScript(cdp: CDPConnection, script: string): Promise<Protocol.Runtime.EvaluateResponse>;
//# sourceMappingURL=evalHelpers.d.ts.map