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.
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Provider type definitions
3
+ */
4
+ interface ProviderSession {
5
+ /** WebSocket URL to connect to CDP */
6
+ wsUrl: string;
7
+ /** Provider-specific session ID (for resumption) */
8
+ sessionId?: string;
9
+ /** Additional metadata from the provider */
10
+ metadata?: Record<string, unknown>;
11
+ /** Close the provider session */
12
+ close(): Promise<void>;
13
+ }
14
+ interface Provider {
15
+ /** Provider name identifier */
16
+ readonly name: string;
17
+ /** Create a new browser session */
18
+ createSession(options?: CreateSessionOptions): Promise<ProviderSession>;
19
+ /** Resume an existing session by ID */
20
+ resumeSession?(sessionId: string): Promise<ProviderSession>;
21
+ }
22
+ interface CreateSessionOptions {
23
+ /** Viewport width */
24
+ width?: number;
25
+ /** Viewport height */
26
+ height?: number;
27
+ /** Enable recording (if provider supports) */
28
+ recording?: boolean;
29
+ /** Proxy configuration */
30
+ proxy?: ProxyConfig;
31
+ /** Additional provider-specific options */
32
+ [key: string]: unknown;
33
+ }
34
+ interface ProxyConfig {
35
+ server: string;
36
+ username?: string;
37
+ password?: string;
38
+ }
39
+ interface ConnectOptions {
40
+ /** Provider type */
41
+ provider: 'browserbase' | 'browserless' | 'generic';
42
+ /** API key for hosted providers */
43
+ apiKey?: string;
44
+ /** Project ID (for BrowserBase) */
45
+ projectId?: string;
46
+ /** Direct WebSocket URL (for generic provider) */
47
+ wsUrl?: string;
48
+ /** Session creation options */
49
+ session?: CreateSessionOptions;
50
+ /** Enable debug logging */
51
+ debug?: boolean;
52
+ /** Connection timeout in ms */
53
+ timeout?: number;
54
+ }
55
+
56
+ export type { ConnectOptions as C, Provider as P, CreateSessionOptions as a, ProviderSession as b, ProxyConfig as c };
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Provider type definitions
3
+ */
4
+ interface ProviderSession {
5
+ /** WebSocket URL to connect to CDP */
6
+ wsUrl: string;
7
+ /** Provider-specific session ID (for resumption) */
8
+ sessionId?: string;
9
+ /** Additional metadata from the provider */
10
+ metadata?: Record<string, unknown>;
11
+ /** Close the provider session */
12
+ close(): Promise<void>;
13
+ }
14
+ interface Provider {
15
+ /** Provider name identifier */
16
+ readonly name: string;
17
+ /** Create a new browser session */
18
+ createSession(options?: CreateSessionOptions): Promise<ProviderSession>;
19
+ /** Resume an existing session by ID */
20
+ resumeSession?(sessionId: string): Promise<ProviderSession>;
21
+ }
22
+ interface CreateSessionOptions {
23
+ /** Viewport width */
24
+ width?: number;
25
+ /** Viewport height */
26
+ height?: number;
27
+ /** Enable recording (if provider supports) */
28
+ recording?: boolean;
29
+ /** Proxy configuration */
30
+ proxy?: ProxyConfig;
31
+ /** Additional provider-specific options */
32
+ [key: string]: unknown;
33
+ }
34
+ interface ProxyConfig {
35
+ server: string;
36
+ username?: string;
37
+ password?: string;
38
+ }
39
+ interface ConnectOptions {
40
+ /** Provider type */
41
+ provider: 'browserbase' | 'browserless' | 'generic';
42
+ /** API key for hosted providers */
43
+ apiKey?: string;
44
+ /** Project ID (for BrowserBase) */
45
+ projectId?: string;
46
+ /** Direct WebSocket URL (for generic provider) */
47
+ wsUrl?: string;
48
+ /** Session creation options */
49
+ session?: CreateSessionOptions;
50
+ /** Enable debug logging */
51
+ debug?: boolean;
52
+ /** Connection timeout in ms */
53
+ timeout?: number;
54
+ }
55
+
56
+ export type { ConnectOptions as C, Provider as P, CreateSessionOptions as a, ProviderSession as b, ProxyConfig as c };
package/package.json ADDED
@@ -0,0 +1,91 @@
1
+ {
2
+ "name": "browser-pilot",
3
+ "version": "0.0.1",
4
+ "description": "Lightweight CDP-based browser automation for Node.js, Bun, and Cloudflare Workers",
5
+ "type": "module",
6
+ "main": "./dist/index.cjs",
7
+ "module": "./dist/index.mjs",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.mjs",
13
+ "require": "./dist/index.cjs"
14
+ },
15
+ "./cdp": {
16
+ "types": "./dist/cdp.d.ts",
17
+ "import": "./dist/cdp.mjs",
18
+ "require": "./dist/cdp.cjs"
19
+ },
20
+ "./providers": {
21
+ "types": "./dist/providers.d.ts",
22
+ "import": "./dist/providers.mjs",
23
+ "require": "./dist/providers.cjs"
24
+ },
25
+ "./browser": {
26
+ "types": "./dist/browser.d.ts",
27
+ "import": "./dist/browser.mjs",
28
+ "require": "./dist/browser.cjs"
29
+ },
30
+ "./actions": {
31
+ "types": "./dist/actions.d.ts",
32
+ "import": "./dist/actions.mjs",
33
+ "require": "./dist/actions.cjs"
34
+ },
35
+ "./cli": {
36
+ "types": "./dist/cli.d.ts",
37
+ "import": "./dist/cli.mjs",
38
+ "require": "./dist/cli.cjs"
39
+ }
40
+ },
41
+ "bin": {
42
+ "bp": "./dist/cli.mjs",
43
+ "browser-pilot": "./dist/cli.mjs"
44
+ },
45
+ "files": [
46
+ "dist"
47
+ ],
48
+ "sideEffects": false,
49
+ "scripts": {
50
+ "clean": "rm -rf dist",
51
+ "build": "tsup",
52
+ "test": "bun test",
53
+ "test:unit": "bun test tests/unit",
54
+ "test:integration": "bun test tests/integration --timeout 30000",
55
+ "test:cli": "bun test tests/cli --timeout 30000",
56
+ "test:e2e": "bun test tests/e2e --timeout 30000",
57
+ "test:all": "bun test tests/ --timeout 30000",
58
+ "typecheck": "tsc --noEmit",
59
+ "lint": "biome check .",
60
+ "lint:fix": "biome check --write .",
61
+ "format": "biome format --write .",
62
+ "check": "bun run typecheck && bun run lint",
63
+ "prepublishOnly": "bun run build",
64
+ "bp": "bun ./src/cli/index.ts",
65
+ "browser-pilot": "bun ./src/cli/index.ts",
66
+ "fixtures:serve": "bun tests/fixtures/server.ts"
67
+ },
68
+ "devDependencies": {
69
+ "@biomejs/biome": "^2.3.10",
70
+ "@types/bun": "latest",
71
+ "chrome-launcher": "^1.2.1",
72
+ "tsup": "^8.0.0"
73
+ },
74
+ "peerDependencies": {
75
+ "typescript": "^5"
76
+ },
77
+ "publishConfig": {
78
+ "access": "public"
79
+ },
80
+ "keywords": [
81
+ "browser",
82
+ "automation",
83
+ "cdp",
84
+ "chrome",
85
+ "devtools",
86
+ "puppeteer",
87
+ "playwright",
88
+ "cloudflare-workers"
89
+ ],
90
+ "license": "MIT"
91
+ }