agent-browser-stealth 0.14.0
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 +201 -0
- package/README.md +1219 -0
- package/bin/agent-browser-darwin-arm64 +0 -0
- package/bin/agent-browser-local +0 -0
- package/bin/agent-browser.js +109 -0
- package/dist/actions.d.ts +17 -0
- package/dist/actions.d.ts.map +1 -0
- package/dist/actions.js +1917 -0
- package/dist/actions.js.map +1 -0
- package/dist/browser.d.ts +598 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +2287 -0
- package/dist/browser.js.map +1 -0
- package/dist/daemon.d.ts +66 -0
- package/dist/daemon.d.ts.map +1 -0
- package/dist/daemon.js +603 -0
- package/dist/daemon.js.map +1 -0
- package/dist/diff.d.ts +18 -0
- package/dist/diff.d.ts.map +1 -0
- package/dist/diff.js +271 -0
- package/dist/diff.js.map +1 -0
- package/dist/encryption.d.ts +50 -0
- package/dist/encryption.d.ts.map +1 -0
- package/dist/encryption.js +85 -0
- package/dist/encryption.js.map +1 -0
- package/dist/ios-actions.d.ts +11 -0
- package/dist/ios-actions.d.ts.map +1 -0
- package/dist/ios-actions.js +228 -0
- package/dist/ios-actions.js.map +1 -0
- package/dist/ios-manager.d.ts +266 -0
- package/dist/ios-manager.d.ts.map +1 -0
- package/dist/ios-manager.js +1073 -0
- package/dist/ios-manager.js.map +1 -0
- package/dist/protocol.d.ts +26 -0
- package/dist/protocol.d.ts.map +1 -0
- package/dist/protocol.js +935 -0
- package/dist/protocol.js.map +1 -0
- package/dist/snapshot.d.ts +67 -0
- package/dist/snapshot.d.ts.map +1 -0
- package/dist/snapshot.js +514 -0
- package/dist/snapshot.js.map +1 -0
- package/dist/state-utils.d.ts +77 -0
- package/dist/state-utils.d.ts.map +1 -0
- package/dist/state-utils.js +178 -0
- package/dist/state-utils.js.map +1 -0
- package/dist/stealth.d.ts +22 -0
- package/dist/stealth.d.ts.map +1 -0
- package/dist/stealth.js +614 -0
- package/dist/stealth.js.map +1 -0
- package/dist/stream-server.d.ts +117 -0
- package/dist/stream-server.d.ts.map +1 -0
- package/dist/stream-server.js +309 -0
- package/dist/stream-server.js.map +1 -0
- package/dist/types.d.ts +855 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +85 -0
- package/scripts/build-all-platforms.sh +68 -0
- package/scripts/check-creepjs-headless.js +137 -0
- package/scripts/check-sannysoft-webdriver.js +112 -0
- package/scripts/check-version-sync.js +39 -0
- package/scripts/copy-native.js +36 -0
- package/scripts/postinstall.js +275 -0
- package/scripts/sync-upstream.sh +142 -0
- package/scripts/sync-version.js +69 -0
- package/skills/agent-browser/SKILL.md +464 -0
- package/skills/agent-browser/references/authentication.md +202 -0
- package/skills/agent-browser/references/commands.md +263 -0
- package/skills/agent-browser/references/profiling.md +120 -0
- package/skills/agent-browser/references/proxy-support.md +194 -0
- package/skills/agent-browser/references/session-management.md +193 -0
- package/skills/agent-browser/references/snapshot-refs.md +194 -0
- package/skills/agent-browser/references/video-recording.md +173 -0
- package/skills/agent-browser/templates/authenticated-session.sh +100 -0
- package/skills/agent-browser/templates/capture-workflow.sh +69 -0
- package/skills/agent-browser/templates/form-automation.sh +62 -0
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Cross-platform CLI wrapper for agent-browser
|
|
5
|
+
*
|
|
6
|
+
* This wrapper enables npx support on Windows where shell scripts don't work.
|
|
7
|
+
* For global installs, postinstall.js patches the shims to invoke the native
|
|
8
|
+
* binary directly (zero overhead).
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { spawn } from 'child_process';
|
|
12
|
+
import { existsSync, accessSync, chmodSync, constants } from 'fs';
|
|
13
|
+
import { dirname, join } from 'path';
|
|
14
|
+
import { fileURLToPath } from 'url';
|
|
15
|
+
import { platform, arch } from 'os';
|
|
16
|
+
|
|
17
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
18
|
+
|
|
19
|
+
// Map Node.js platform/arch to binary naming convention
|
|
20
|
+
function getBinaryName() {
|
|
21
|
+
const os = platform();
|
|
22
|
+
const cpuArch = arch();
|
|
23
|
+
|
|
24
|
+
let osKey;
|
|
25
|
+
switch (os) {
|
|
26
|
+
case 'darwin':
|
|
27
|
+
osKey = 'darwin';
|
|
28
|
+
break;
|
|
29
|
+
case 'linux':
|
|
30
|
+
osKey = 'linux';
|
|
31
|
+
break;
|
|
32
|
+
case 'win32':
|
|
33
|
+
osKey = 'win32';
|
|
34
|
+
break;
|
|
35
|
+
default:
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
let archKey;
|
|
40
|
+
switch (cpuArch) {
|
|
41
|
+
case 'x64':
|
|
42
|
+
case 'x86_64':
|
|
43
|
+
archKey = 'x64';
|
|
44
|
+
break;
|
|
45
|
+
case 'arm64':
|
|
46
|
+
case 'aarch64':
|
|
47
|
+
archKey = 'arm64';
|
|
48
|
+
break;
|
|
49
|
+
default:
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const ext = os === 'win32' ? '.exe' : '';
|
|
54
|
+
return `agent-browser-${osKey}-${archKey}${ext}`;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function main() {
|
|
58
|
+
const binaryName = getBinaryName();
|
|
59
|
+
|
|
60
|
+
if (!binaryName) {
|
|
61
|
+
console.error(`Error: Unsupported platform: ${platform()}-${arch()}`);
|
|
62
|
+
process.exit(1);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const binaryPath = join(__dirname, binaryName);
|
|
66
|
+
|
|
67
|
+
if (!existsSync(binaryPath)) {
|
|
68
|
+
console.error(`Error: No binary found for ${platform()}-${arch()}`);
|
|
69
|
+
console.error(`Expected: ${binaryPath}`);
|
|
70
|
+
console.error('');
|
|
71
|
+
console.error('Run "npm run build:native" to build for your platform,');
|
|
72
|
+
console.error('or reinstall the package to trigger the postinstall download.');
|
|
73
|
+
process.exit(1);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Ensure binary is executable (fixes EACCES on macOS/Linux when postinstall didn't run,
|
|
77
|
+
// e.g., when using bun which blocks lifecycle scripts by default)
|
|
78
|
+
if (platform() !== 'win32') {
|
|
79
|
+
try {
|
|
80
|
+
accessSync(binaryPath, constants.X_OK);
|
|
81
|
+
} catch {
|
|
82
|
+
// Binary exists but isn't executable - fix it
|
|
83
|
+
try {
|
|
84
|
+
chmodSync(binaryPath, 0o755);
|
|
85
|
+
} catch (chmodErr) {
|
|
86
|
+
console.error(`Error: Cannot make binary executable: ${chmodErr.message}`);
|
|
87
|
+
console.error('Try running: chmod +x ' + binaryPath);
|
|
88
|
+
process.exit(1);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// Spawn the native binary with inherited stdio
|
|
94
|
+
const child = spawn(binaryPath, process.argv.slice(2), {
|
|
95
|
+
stdio: 'inherit',
|
|
96
|
+
windowsHide: false,
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
child.on('error', (err) => {
|
|
100
|
+
console.error(`Error executing binary: ${err.message}`);
|
|
101
|
+
process.exit(1);
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
child.on('close', (code) => {
|
|
105
|
+
process.exit(code ?? 0);
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
main();
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { BrowserManager, ScreencastFrame } from './browser.js';
|
|
2
|
+
import type { Command, Response } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Set the callback for screencast frames
|
|
5
|
+
* This is called by the daemon to set up frame streaming
|
|
6
|
+
*/
|
|
7
|
+
export declare function setScreencastFrameCallback(callback: ((frame: ScreencastFrame) => void) | null): void;
|
|
8
|
+
/**
|
|
9
|
+
* Convert Playwright errors to AI-friendly messages
|
|
10
|
+
* @internal Exported for testing
|
|
11
|
+
*/
|
|
12
|
+
export declare function toAIFriendlyError(error: unknown, selector: string): Error;
|
|
13
|
+
/**
|
|
14
|
+
* Execute a command and return a response
|
|
15
|
+
*/
|
|
16
|
+
export declare function executeCommand(command: Command, browser: BrowserManager): Promise<Response>;
|
|
17
|
+
//# sourceMappingURL=actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../src/actions.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAUpE,OAAO,KAAK,EACV,OAAO,EACP,QAAQ,EAmIT,MAAM,YAAY,CAAC;AAQpB;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,CAAC,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC,GAAG,IAAI,GAClD,IAAI,CAEN;AAQD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,KAAK,CAqDzE;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,QAAQ,CAAC,CAuRjG"}
|