browser-pilot 0.0.1
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.
- package/LICENSE +21 -0
- package/README.md +539 -0
- package/dist/actions.cjs +277 -0
- package/dist/actions.d.cts +33 -0
- package/dist/actions.d.ts +33 -0
- package/dist/actions.mjs +8 -0
- package/dist/browser.cjs +2765 -0
- package/dist/browser.d.cts +71 -0
- package/dist/browser.d.ts +71 -0
- package/dist/browser.mjs +19 -0
- package/dist/cdp.cjs +279 -0
- package/dist/cdp.d.cts +230 -0
- package/dist/cdp.d.ts +230 -0
- package/dist/cdp.mjs +10 -0
- package/dist/chunk-BCOZUKWS.mjs +251 -0
- package/dist/chunk-FI55U7JS.mjs +2108 -0
- package/dist/chunk-R3PS4PCM.mjs +207 -0
- package/dist/chunk-YEHK2XY3.mjs +250 -0
- package/dist/chunk-ZIQA4JOT.mjs +226 -0
- package/dist/cli.cjs +3587 -0
- package/dist/cli.d.cts +23 -0
- package/dist/cli.d.ts +23 -0
- package/dist/cli.mjs +827 -0
- package/dist/client-7Nqka5MV.d.cts +53 -0
- package/dist/client-7Nqka5MV.d.ts +53 -0
- package/dist/index.cjs +3074 -0
- package/dist/index.d.cts +157 -0
- package/dist/index.d.ts +157 -0
- package/dist/index.mjs +64 -0
- package/dist/providers.cjs +238 -0
- package/dist/providers.d.cts +86 -0
- package/dist/providers.d.ts +86 -0
- package/dist/providers.mjs +16 -0
- package/dist/types-Cs89wle0.d.cts +925 -0
- package/dist/types-DL_-3BZk.d.ts +925 -0
- package/dist/types-D_uDqh0Z.d.cts +56 -0
- package/dist/types-D_uDqh0Z.d.ts +56 -0
- package/package.json +91 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WebSocket transport layer for CDP
|
|
3
|
+
* Uses Web Standard WebSocket API for compatibility with Workers, Node, and Bun
|
|
4
|
+
*/
|
|
5
|
+
interface Transport {
|
|
6
|
+
send(message: string): void;
|
|
7
|
+
close(): Promise<void>;
|
|
8
|
+
onMessage(handler: (message: string) => void): void;
|
|
9
|
+
onClose(handler: () => void): void;
|
|
10
|
+
onError(handler: (error: Error) => void): void;
|
|
11
|
+
}
|
|
12
|
+
interface TransportOptions {
|
|
13
|
+
timeout?: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Create a WebSocket transport connection
|
|
17
|
+
* Works in Node.js, Bun, Deno, and Cloudflare Workers
|
|
18
|
+
*/
|
|
19
|
+
declare function createTransport(wsUrl: string, options?: TransportOptions): Promise<Transport>;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* CDP Client implementation
|
|
23
|
+
* Handles command/response correlation and event subscription
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
interface CDPClientOptions extends TransportOptions {
|
|
27
|
+
/** Enable debug logging */
|
|
28
|
+
debug?: boolean;
|
|
29
|
+
}
|
|
30
|
+
interface CDPClient {
|
|
31
|
+
/** Send a CDP command and wait for response */
|
|
32
|
+
send<T = unknown>(method: string, params?: Record<string, unknown>, sessionId?: string): Promise<T>;
|
|
33
|
+
/** Subscribe to a CDP event */
|
|
34
|
+
on(event: string, handler: (params: Record<string, unknown>) => void): void;
|
|
35
|
+
/** Unsubscribe from a CDP event */
|
|
36
|
+
off(event: string, handler: (params: Record<string, unknown>) => void): void;
|
|
37
|
+
/** Subscribe to all events (for debugging/logging) */
|
|
38
|
+
onAny(handler: (method: string, params: Record<string, unknown>) => void): void;
|
|
39
|
+
/** Close the CDP connection */
|
|
40
|
+
close(): Promise<void>;
|
|
41
|
+
/** Attach to a target and return session ID */
|
|
42
|
+
attachToTarget(targetId: string): Promise<string>;
|
|
43
|
+
/** Get the current session ID (after attaching to target) */
|
|
44
|
+
readonly sessionId: string | undefined;
|
|
45
|
+
/** Check if connection is open */
|
|
46
|
+
readonly isConnected: boolean;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Create a new CDP client connected to the given WebSocket URL
|
|
50
|
+
*/
|
|
51
|
+
declare function createCDPClient(wsUrl: string, options?: CDPClientOptions): Promise<CDPClient>;
|
|
52
|
+
|
|
53
|
+
export { type CDPClient as C, type Transport as T, type CDPClientOptions as a, createTransport as b, createCDPClient as c, type TransportOptions as d };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WebSocket transport layer for CDP
|
|
3
|
+
* Uses Web Standard WebSocket API for compatibility with Workers, Node, and Bun
|
|
4
|
+
*/
|
|
5
|
+
interface Transport {
|
|
6
|
+
send(message: string): void;
|
|
7
|
+
close(): Promise<void>;
|
|
8
|
+
onMessage(handler: (message: string) => void): void;
|
|
9
|
+
onClose(handler: () => void): void;
|
|
10
|
+
onError(handler: (error: Error) => void): void;
|
|
11
|
+
}
|
|
12
|
+
interface TransportOptions {
|
|
13
|
+
timeout?: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Create a WebSocket transport connection
|
|
17
|
+
* Works in Node.js, Bun, Deno, and Cloudflare Workers
|
|
18
|
+
*/
|
|
19
|
+
declare function createTransport(wsUrl: string, options?: TransportOptions): Promise<Transport>;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* CDP Client implementation
|
|
23
|
+
* Handles command/response correlation and event subscription
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
interface CDPClientOptions extends TransportOptions {
|
|
27
|
+
/** Enable debug logging */
|
|
28
|
+
debug?: boolean;
|
|
29
|
+
}
|
|
30
|
+
interface CDPClient {
|
|
31
|
+
/** Send a CDP command and wait for response */
|
|
32
|
+
send<T = unknown>(method: string, params?: Record<string, unknown>, sessionId?: string): Promise<T>;
|
|
33
|
+
/** Subscribe to a CDP event */
|
|
34
|
+
on(event: string, handler: (params: Record<string, unknown>) => void): void;
|
|
35
|
+
/** Unsubscribe from a CDP event */
|
|
36
|
+
off(event: string, handler: (params: Record<string, unknown>) => void): void;
|
|
37
|
+
/** Subscribe to all events (for debugging/logging) */
|
|
38
|
+
onAny(handler: (method: string, params: Record<string, unknown>) => void): void;
|
|
39
|
+
/** Close the CDP connection */
|
|
40
|
+
close(): Promise<void>;
|
|
41
|
+
/** Attach to a target and return session ID */
|
|
42
|
+
attachToTarget(targetId: string): Promise<string>;
|
|
43
|
+
/** Get the current session ID (after attaching to target) */
|
|
44
|
+
readonly sessionId: string | undefined;
|
|
45
|
+
/** Check if connection is open */
|
|
46
|
+
readonly isConnected: boolean;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Create a new CDP client connected to the given WebSocket URL
|
|
50
|
+
*/
|
|
51
|
+
declare function createCDPClient(wsUrl: string, options?: CDPClientOptions): Promise<CDPClient>;
|
|
52
|
+
|
|
53
|
+
export { type CDPClient as C, type Transport as T, type CDPClientOptions as a, createTransport as b, createCDPClient as c, type TransportOptions as d };
|