browser-pilot 0.0.13 → 0.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,11 +18,6 @@ interface TransportOptions {
18
18
  */
19
19
  declare function createTransport(wsUrl: string, options?: TransportOptions): Promise<Transport>;
20
20
 
21
- /**
22
- * CDP Client implementation
23
- * Handles command/response correlation and event subscription
24
- */
25
-
26
21
  interface CDPClientOptions extends TransportOptions {
27
22
  /** Enable debug logging */
28
23
  debug?: boolean;
@@ -36,18 +31,27 @@ interface CDPClient {
36
31
  off(event: string, handler: (params: Record<string, unknown>) => void): void;
37
32
  /** Subscribe to all events (for debugging/logging) */
38
33
  onAny(handler: (method: string, params: Record<string, unknown>) => void): void;
34
+ /** Unsubscribe from all-event handler */
35
+ offAny(handler: (method: string, params: Record<string, unknown>) => void): void;
39
36
  /** Close the CDP connection */
40
37
  close(): Promise<void>;
41
38
  /** Attach to a target and return session ID */
42
39
  attachToTarget(targetId: string): Promise<string>;
43
40
  /** Get the current session ID (after attaching to target) */
44
41
  readonly sessionId: string | undefined;
42
+ /** Override the current session ID when reusing an existing attached target */
43
+ setSessionId(sessionId: string | undefined): void;
45
44
  /** Check if connection is open */
46
45
  readonly isConnected: boolean;
47
46
  }
47
+ /**
48
+ * Create a CDP client from an already-connected transport.
49
+ * Used by the daemon fast-path (Unix socket transport).
50
+ */
51
+ declare function createCDPClientFromTransport(transport: Transport, options?: CDPClientOptions): CDPClient;
48
52
  /**
49
53
  * Create a new CDP client connected to the given WebSocket URL
50
54
  */
51
55
  declare function createCDPClient(wsUrl: string, options?: CDPClientOptions): Promise<CDPClient>;
52
56
 
53
- export { type CDPClient as C, type Transport as T, type CDPClientOptions as a, createTransport as b, createCDPClient as c, type TransportOptions as d };
57
+ export { type CDPClient as C, type Transport as T, type CDPClientOptions as a, createCDPClientFromTransport as b, createCDPClient as c, createTransport as d, type TransportOptions as e };
@@ -18,11 +18,6 @@ interface TransportOptions {
18
18
  */
19
19
  declare function createTransport(wsUrl: string, options?: TransportOptions): Promise<Transport>;
20
20
 
21
- /**
22
- * CDP Client implementation
23
- * Handles command/response correlation and event subscription
24
- */
25
-
26
21
  interface CDPClientOptions extends TransportOptions {
27
22
  /** Enable debug logging */
28
23
  debug?: boolean;
@@ -36,18 +31,27 @@ interface CDPClient {
36
31
  off(event: string, handler: (params: Record<string, unknown>) => void): void;
37
32
  /** Subscribe to all events (for debugging/logging) */
38
33
  onAny(handler: (method: string, params: Record<string, unknown>) => void): void;
34
+ /** Unsubscribe from all-event handler */
35
+ offAny(handler: (method: string, params: Record<string, unknown>) => void): void;
39
36
  /** Close the CDP connection */
40
37
  close(): Promise<void>;
41
38
  /** Attach to a target and return session ID */
42
39
  attachToTarget(targetId: string): Promise<string>;
43
40
  /** Get the current session ID (after attaching to target) */
44
41
  readonly sessionId: string | undefined;
42
+ /** Override the current session ID when reusing an existing attached target */
43
+ setSessionId(sessionId: string | undefined): void;
45
44
  /** Check if connection is open */
46
45
  readonly isConnected: boolean;
47
46
  }
47
+ /**
48
+ * Create a CDP client from an already-connected transport.
49
+ * Used by the daemon fast-path (Unix socket transport).
50
+ */
51
+ declare function createCDPClientFromTransport(transport: Transport, options?: CDPClientOptions): CDPClient;
48
52
  /**
49
53
  * Create a new CDP client connected to the given WebSocket URL
50
54
  */
51
55
  declare function createCDPClient(wsUrl: string, options?: CDPClientOptions): Promise<CDPClient>;
52
56
 
53
- export { type CDPClient as C, type Transport as T, type CDPClientOptions as a, createTransport as b, createCDPClient as c, type TransportOptions as d };
57
+ export { type CDPClient as C, type Transport as T, type CDPClientOptions as a, createCDPClientFromTransport as b, createCDPClient as c, createTransport as d, type TransportOptions as e };
@@ -0,0 +1,12 @@
1
+ import {
2
+ createCDPClient,
3
+ createCDPClientFromTransport
4
+ } from "./chunk-LCNFBXB5.mjs";
5
+ import {
6
+ CDPError
7
+ } from "./chunk-DTVRFXKI.mjs";
8
+ export {
9
+ CDPError,
10
+ createCDPClient,
11
+ createCDPClientFromTransport
12
+ };