agent-browser 0.3.0 → 0.3.2
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/bin/agent-browser +0 -0
- package/bin/agent-browser-darwin-arm64 +0 -0
- package/bin/agent-browser-darwin-x64 +0 -0
- package/bin/agent-browser-linux-arm64 +0 -0
- package/bin/agent-browser-linux-x64 +0 -0
- package/bin/agent-browser.cmd +35 -0
- package/dist/cli-light.d.ts +1 -1
- package/dist/cli-light.js +1 -1
- package/package.json +10 -4
- package/scripts/build-all-platforms.sh +68 -0
- package/scripts/copy-native.js +35 -0
- package/scripts/postinstall.js +113 -15
- package/.prettierrc +0 -7
- package/AGENTS.md +0 -26
- package/benchmark/benchmark.ts +0 -521
- package/benchmark/run.ts +0 -322
- package/cli/Cargo.lock +0 -114
- package/cli/Cargo.toml +0 -17
- package/cli/src/main.rs +0 -332
- package/cli/target/.rustc_info.json +0 -1
- package/cli/target/CACHEDIR.TAG +0 -3
- package/cli/target/release/.cargo-lock +0 -0
- package/cli/target/release/.fingerprint/agent-browser-5894536b887e2ce7/bin-agent-browser +0 -1
- package/cli/target/release/.fingerprint/agent-browser-5894536b887e2ce7/bin-agent-browser.json +0 -1
- package/cli/target/release/.fingerprint/agent-browser-5894536b887e2ce7/dep-bin-agent-browser +0 -0
- package/cli/target/release/.fingerprint/agent-browser-5894536b887e2ce7/invoked.timestamp +0 -1
- package/cli/target/release/.fingerprint/agent-browser-5894536b887e2ce7/output-bin-agent-browser +0 -2
- package/cli/target/release/.fingerprint/itoa-653b9192107a1caa/dep-lib-itoa +0 -0
- package/cli/target/release/.fingerprint/itoa-653b9192107a1caa/invoked.timestamp +0 -1
- package/cli/target/release/.fingerprint/itoa-653b9192107a1caa/lib-itoa +0 -1
- package/cli/target/release/.fingerprint/itoa-653b9192107a1caa/lib-itoa.json +0 -1
- package/cli/target/release/.fingerprint/libc-0303d277881093f4/build-script-build-script-build +0 -1
- package/cli/target/release/.fingerprint/libc-0303d277881093f4/build-script-build-script-build.json +0 -1
- package/cli/target/release/.fingerprint/libc-0303d277881093f4/dep-build-script-build-script-build +0 -0
- package/cli/target/release/.fingerprint/libc-0303d277881093f4/invoked.timestamp +0 -1
- package/cli/target/release/.fingerprint/libc-b8c0d8e35a1980d3/run-build-script-build-script-build +0 -1
- package/cli/target/release/.fingerprint/libc-b8c0d8e35a1980d3/run-build-script-build-script-build.json +0 -1
- package/cli/target/release/.fingerprint/libc-d843359d3dd4757b/dep-lib-libc +0 -0
- package/cli/target/release/.fingerprint/libc-d843359d3dd4757b/invoked.timestamp +0 -1
- package/cli/target/release/.fingerprint/libc-d843359d3dd4757b/lib-libc +0 -1
- package/cli/target/release/.fingerprint/libc-d843359d3dd4757b/lib-libc.json +0 -1
- package/cli/target/release/.fingerprint/memchr-dcaf8011940d18dd/dep-lib-memchr +0 -0
- package/cli/target/release/.fingerprint/memchr-dcaf8011940d18dd/invoked.timestamp +0 -1
- package/cli/target/release/.fingerprint/memchr-dcaf8011940d18dd/lib-memchr +0 -1
- package/cli/target/release/.fingerprint/memchr-dcaf8011940d18dd/lib-memchr.json +0 -1
- package/cli/target/release/.fingerprint/proc-macro2-291b57751730d5b3/build-script-build-script-build +0 -1
- package/cli/target/release/.fingerprint/proc-macro2-291b57751730d5b3/build-script-build-script-build.json +0 -1
- package/cli/target/release/.fingerprint/proc-macro2-291b57751730d5b3/dep-build-script-build-script-build +0 -0
- package/cli/target/release/.fingerprint/proc-macro2-291b57751730d5b3/invoked.timestamp +0 -1
- package/cli/target/release/.fingerprint/proc-macro2-a753b344a6b4aa98/dep-lib-proc_macro2 +0 -0
- package/cli/target/release/.fingerprint/proc-macro2-a753b344a6b4aa98/invoked.timestamp +0 -1
- package/cli/target/release/.fingerprint/proc-macro2-a753b344a6b4aa98/lib-proc_macro2 +0 -1
- package/cli/target/release/.fingerprint/proc-macro2-a753b344a6b4aa98/lib-proc_macro2.json +0 -1
- package/cli/target/release/.fingerprint/proc-macro2-fc2999f6676f03db/run-build-script-build-script-build +0 -1
- package/cli/target/release/.fingerprint/proc-macro2-fc2999f6676f03db/run-build-script-build-script-build.json +0 -1
- package/cli/target/release/.fingerprint/quote-352ae41707d371c9/run-build-script-build-script-build +0 -1
- package/cli/target/release/.fingerprint/quote-352ae41707d371c9/run-build-script-build-script-build.json +0 -1
- package/cli/target/release/.fingerprint/quote-7d13be3cbe4f9de4/build-script-build-script-build +0 -1
- package/cli/target/release/.fingerprint/quote-7d13be3cbe4f9de4/build-script-build-script-build.json +0 -1
- package/cli/target/release/.fingerprint/quote-7d13be3cbe4f9de4/dep-build-script-build-script-build +0 -0
- package/cli/target/release/.fingerprint/quote-7d13be3cbe4f9de4/invoked.timestamp +0 -1
- package/cli/target/release/.fingerprint/quote-833e6725e0f7d298/dep-lib-quote +0 -0
- package/cli/target/release/.fingerprint/quote-833e6725e0f7d298/invoked.timestamp +0 -1
- package/cli/target/release/.fingerprint/quote-833e6725e0f7d298/lib-quote +0 -1
- package/cli/target/release/.fingerprint/quote-833e6725e0f7d298/lib-quote.json +0 -1
- package/cli/target/release/.fingerprint/serde-b8c046c16de48f41/run-build-script-build-script-build +0 -1
- package/cli/target/release/.fingerprint/serde-b8c046c16de48f41/run-build-script-build-script-build.json +0 -1
- package/cli/target/release/.fingerprint/serde-d35d32ab52b82a81/build-script-build-script-build +0 -1
- package/cli/target/release/.fingerprint/serde-d35d32ab52b82a81/build-script-build-script-build.json +0 -1
- package/cli/target/release/.fingerprint/serde-d35d32ab52b82a81/dep-build-script-build-script-build +0 -0
- package/cli/target/release/.fingerprint/serde-d35d32ab52b82a81/invoked.timestamp +0 -1
- package/cli/target/release/.fingerprint/serde-d6fb44202dad3efd/dep-lib-serde +0 -0
- package/cli/target/release/.fingerprint/serde-d6fb44202dad3efd/invoked.timestamp +0 -1
- package/cli/target/release/.fingerprint/serde-d6fb44202dad3efd/lib-serde +0 -1
- package/cli/target/release/.fingerprint/serde-d6fb44202dad3efd/lib-serde.json +0 -1
- package/cli/target/release/.fingerprint/serde_core-0f7ba2581c8c0423/dep-lib-serde_core +0 -0
- package/cli/target/release/.fingerprint/serde_core-0f7ba2581c8c0423/invoked.timestamp +0 -1
- package/cli/target/release/.fingerprint/serde_core-0f7ba2581c8c0423/lib-serde_core +0 -1
- package/cli/target/release/.fingerprint/serde_core-0f7ba2581c8c0423/lib-serde_core.json +0 -1
- package/cli/target/release/.fingerprint/serde_core-74db491143173930/run-build-script-build-script-build +0 -1
- package/cli/target/release/.fingerprint/serde_core-74db491143173930/run-build-script-build-script-build.json +0 -1
- package/cli/target/release/.fingerprint/serde_core-f043ae3f4b601577/build-script-build-script-build +0 -1
- package/cli/target/release/.fingerprint/serde_core-f043ae3f4b601577/build-script-build-script-build.json +0 -1
- package/cli/target/release/.fingerprint/serde_core-f043ae3f4b601577/dep-build-script-build-script-build +0 -0
- package/cli/target/release/.fingerprint/serde_core-f043ae3f4b601577/invoked.timestamp +0 -1
- package/cli/target/release/.fingerprint/serde_derive-a5d13e0e658ceae3/dep-lib-serde_derive +0 -0
- package/cli/target/release/.fingerprint/serde_derive-a5d13e0e658ceae3/invoked.timestamp +0 -1
- package/cli/target/release/.fingerprint/serde_derive-a5d13e0e658ceae3/lib-serde_derive +0 -1
- package/cli/target/release/.fingerprint/serde_derive-a5d13e0e658ceae3/lib-serde_derive.json +0 -1
- package/cli/target/release/.fingerprint/serde_json-a8467019a959068f/run-build-script-build-script-build +0 -1
- package/cli/target/release/.fingerprint/serde_json-a8467019a959068f/run-build-script-build-script-build.json +0 -1
- package/cli/target/release/.fingerprint/serde_json-bfa3f43b57842d41/build-script-build-script-build +0 -1
- package/cli/target/release/.fingerprint/serde_json-bfa3f43b57842d41/build-script-build-script-build.json +0 -1
- package/cli/target/release/.fingerprint/serde_json-bfa3f43b57842d41/dep-build-script-build-script-build +0 -0
- package/cli/target/release/.fingerprint/serde_json-bfa3f43b57842d41/invoked.timestamp +0 -1
- package/cli/target/release/.fingerprint/serde_json-f61651a65bf0eb31/dep-lib-serde_json +0 -0
- package/cli/target/release/.fingerprint/serde_json-f61651a65bf0eb31/invoked.timestamp +0 -1
- package/cli/target/release/.fingerprint/serde_json-f61651a65bf0eb31/lib-serde_json +0 -1
- package/cli/target/release/.fingerprint/serde_json-f61651a65bf0eb31/lib-serde_json.json +0 -1
- package/cli/target/release/.fingerprint/syn-6f9a22f8c7f909b0/dep-lib-syn +0 -0
- package/cli/target/release/.fingerprint/syn-6f9a22f8c7f909b0/invoked.timestamp +0 -1
- package/cli/target/release/.fingerprint/syn-6f9a22f8c7f909b0/lib-syn +0 -1
- package/cli/target/release/.fingerprint/syn-6f9a22f8c7f909b0/lib-syn.json +0 -1
- package/cli/target/release/.fingerprint/unicode-ident-60c57228d30a23d0/dep-lib-unicode_ident +0 -0
- package/cli/target/release/.fingerprint/unicode-ident-60c57228d30a23d0/invoked.timestamp +0 -1
- package/cli/target/release/.fingerprint/unicode-ident-60c57228d30a23d0/lib-unicode_ident +0 -1
- package/cli/target/release/.fingerprint/unicode-ident-60c57228d30a23d0/lib-unicode_ident.json +0 -1
- package/cli/target/release/.fingerprint/zmij-60b0e0e9d7c08f71/run-build-script-build-script-build +0 -1
- package/cli/target/release/.fingerprint/zmij-60b0e0e9d7c08f71/run-build-script-build-script-build.json +0 -1
- package/cli/target/release/.fingerprint/zmij-9501bcbd6d8b933c/dep-lib-zmij +0 -0
- package/cli/target/release/.fingerprint/zmij-9501bcbd6d8b933c/invoked.timestamp +0 -1
- package/cli/target/release/.fingerprint/zmij-9501bcbd6d8b933c/lib-zmij +0 -1
- package/cli/target/release/.fingerprint/zmij-9501bcbd6d8b933c/lib-zmij.json +0 -1
- package/cli/target/release/.fingerprint/zmij-aa602f885104061e/build-script-build-script-build +0 -1
- package/cli/target/release/.fingerprint/zmij-aa602f885104061e/build-script-build-script-build.json +0 -1
- package/cli/target/release/.fingerprint/zmij-aa602f885104061e/dep-build-script-build-script-build +0 -0
- package/cli/target/release/.fingerprint/zmij-aa602f885104061e/invoked.timestamp +0 -1
- package/cli/target/release/agent-browser +0 -0
- package/cli/target/release/agent-browser.d +0 -1
- package/cli/target/release/build/libc-0303d277881093f4/build-script-build +0 -0
- package/cli/target/release/build/libc-0303d277881093f4/build_script_build-0303d277881093f4 +0 -0
- package/cli/target/release/build/libc-0303d277881093f4/build_script_build-0303d277881093f4.d +0 -5
- package/cli/target/release/build/libc-b8c0d8e35a1980d3/invoked.timestamp +0 -1
- package/cli/target/release/build/libc-b8c0d8e35a1980d3/output +0 -25
- package/cli/target/release/build/libc-b8c0d8e35a1980d3/root-output +0 -1
- package/cli/target/release/build/libc-b8c0d8e35a1980d3/stderr +0 -0
- package/cli/target/release/build/proc-macro2-291b57751730d5b3/build-script-build +0 -0
- package/cli/target/release/build/proc-macro2-291b57751730d5b3/build_script_build-291b57751730d5b3 +0 -0
- package/cli/target/release/build/proc-macro2-291b57751730d5b3/build_script_build-291b57751730d5b3.d +0 -5
- package/cli/target/release/build/proc-macro2-fc2999f6676f03db/invoked.timestamp +0 -1
- package/cli/target/release/build/proc-macro2-fc2999f6676f03db/output +0 -23
- package/cli/target/release/build/proc-macro2-fc2999f6676f03db/root-output +0 -1
- package/cli/target/release/build/proc-macro2-fc2999f6676f03db/stderr +0 -0
- package/cli/target/release/build/quote-352ae41707d371c9/invoked.timestamp +0 -1
- package/cli/target/release/build/quote-352ae41707d371c9/output +0 -2
- package/cli/target/release/build/quote-352ae41707d371c9/root-output +0 -1
- package/cli/target/release/build/quote-352ae41707d371c9/stderr +0 -0
- package/cli/target/release/build/quote-7d13be3cbe4f9de4/build-script-build +0 -0
- package/cli/target/release/build/quote-7d13be3cbe4f9de4/build_script_build-7d13be3cbe4f9de4 +0 -0
- package/cli/target/release/build/quote-7d13be3cbe4f9de4/build_script_build-7d13be3cbe4f9de4.d +0 -5
- package/cli/target/release/build/serde-b8c046c16de48f41/invoked.timestamp +0 -1
- package/cli/target/release/build/serde-b8c046c16de48f41/out/private.rs +0 -6
- package/cli/target/release/build/serde-b8c046c16de48f41/output +0 -13
- package/cli/target/release/build/serde-b8c046c16de48f41/root-output +0 -1
- package/cli/target/release/build/serde-b8c046c16de48f41/stderr +0 -0
- package/cli/target/release/build/serde-d35d32ab52b82a81/build-script-build +0 -0
- package/cli/target/release/build/serde-d35d32ab52b82a81/build_script_build-d35d32ab52b82a81 +0 -0
- package/cli/target/release/build/serde-d35d32ab52b82a81/build_script_build-d35d32ab52b82a81.d +0 -5
- package/cli/target/release/build/serde_core-74db491143173930/invoked.timestamp +0 -1
- package/cli/target/release/build/serde_core-74db491143173930/out/private.rs +0 -5
- package/cli/target/release/build/serde_core-74db491143173930/output +0 -11
- package/cli/target/release/build/serde_core-74db491143173930/root-output +0 -1
- package/cli/target/release/build/serde_core-74db491143173930/stderr +0 -0
- package/cli/target/release/build/serde_core-f043ae3f4b601577/build-script-build +0 -0
- package/cli/target/release/build/serde_core-f043ae3f4b601577/build_script_build-f043ae3f4b601577 +0 -0
- package/cli/target/release/build/serde_core-f043ae3f4b601577/build_script_build-f043ae3f4b601577.d +0 -5
- package/cli/target/release/build/serde_json-a8467019a959068f/invoked.timestamp +0 -1
- package/cli/target/release/build/serde_json-a8467019a959068f/output +0 -3
- package/cli/target/release/build/serde_json-a8467019a959068f/root-output +0 -1
- package/cli/target/release/build/serde_json-a8467019a959068f/stderr +0 -0
- package/cli/target/release/build/serde_json-bfa3f43b57842d41/build-script-build +0 -0
- package/cli/target/release/build/serde_json-bfa3f43b57842d41/build_script_build-bfa3f43b57842d41 +0 -0
- package/cli/target/release/build/serde_json-bfa3f43b57842d41/build_script_build-bfa3f43b57842d41.d +0 -5
- package/cli/target/release/build/zmij-60b0e0e9d7c08f71/invoked.timestamp +0 -1
- package/cli/target/release/build/zmij-60b0e0e9d7c08f71/output +0 -3
- package/cli/target/release/build/zmij-60b0e0e9d7c08f71/root-output +0 -1
- package/cli/target/release/build/zmij-60b0e0e9d7c08f71/stderr +0 -0
- package/cli/target/release/build/zmij-aa602f885104061e/build-script-build +0 -0
- package/cli/target/release/build/zmij-aa602f885104061e/build_script_build-aa602f885104061e +0 -0
- package/cli/target/release/build/zmij-aa602f885104061e/build_script_build-aa602f885104061e.d +0 -5
- package/cli/target/release/deps/agent_browser-5894536b887e2ce7 +0 -0
- package/cli/target/release/deps/agent_browser-5894536b887e2ce7.d +0 -5
- package/cli/target/release/deps/itoa-653b9192107a1caa.d +0 -8
- package/cli/target/release/deps/libc-d843359d3dd4757b.d +0 -45
- package/cli/target/release/deps/libitoa-653b9192107a1caa.rlib +0 -0
- package/cli/target/release/deps/libitoa-653b9192107a1caa.rmeta +0 -0
- package/cli/target/release/deps/liblibc-d843359d3dd4757b.rlib +0 -0
- package/cli/target/release/deps/liblibc-d843359d3dd4757b.rmeta +0 -0
- package/cli/target/release/deps/libmemchr-dcaf8011940d18dd.rlib +0 -0
- package/cli/target/release/deps/libmemchr-dcaf8011940d18dd.rmeta +0 -0
- package/cli/target/release/deps/libproc_macro2-a753b344a6b4aa98.rlib +0 -0
- package/cli/target/release/deps/libproc_macro2-a753b344a6b4aa98.rmeta +0 -0
- package/cli/target/release/deps/libquote-833e6725e0f7d298.rlib +0 -0
- package/cli/target/release/deps/libquote-833e6725e0f7d298.rmeta +0 -0
- package/cli/target/release/deps/libserde-d6fb44202dad3efd.rlib +0 -0
- package/cli/target/release/deps/libserde-d6fb44202dad3efd.rmeta +0 -0
- package/cli/target/release/deps/libserde_core-0f7ba2581c8c0423.rlib +0 -0
- package/cli/target/release/deps/libserde_core-0f7ba2581c8c0423.rmeta +0 -0
- package/cli/target/release/deps/libserde_derive-a5d13e0e658ceae3.dylib +0 -0
- package/cli/target/release/deps/libserde_json-f61651a65bf0eb31.rlib +0 -0
- package/cli/target/release/deps/libserde_json-f61651a65bf0eb31.rmeta +0 -0
- package/cli/target/release/deps/libsyn-6f9a22f8c7f909b0.rlib +0 -0
- package/cli/target/release/deps/libsyn-6f9a22f8c7f909b0.rmeta +0 -0
- package/cli/target/release/deps/libunicode_ident-60c57228d30a23d0.rlib +0 -0
- package/cli/target/release/deps/libunicode_ident-60c57228d30a23d0.rmeta +0 -0
- package/cli/target/release/deps/libzmij-9501bcbd6d8b933c.rlib +0 -0
- package/cli/target/release/deps/libzmij-9501bcbd6d8b933c.rmeta +0 -0
- package/cli/target/release/deps/memchr-dcaf8011940d18dd.d +0 -30
- package/cli/target/release/deps/proc_macro2-a753b344a6b4aa98.d +0 -17
- package/cli/target/release/deps/quote-833e6725e0f7d298.d +0 -13
- package/cli/target/release/deps/serde-d6fb44202dad3efd.d +0 -14
- package/cli/target/release/deps/serde_core-0f7ba2581c8c0423.d +0 -27
- package/cli/target/release/deps/serde_derive-a5d13e0e658ceae3.d +0 -34
- package/cli/target/release/deps/serde_json-f61651a65bf0eb31.d +0 -22
- package/cli/target/release/deps/syn-6f9a22f8c7f909b0.d +0 -49
- package/cli/target/release/deps/unicode_ident-60c57228d30a23d0.d +0 -8
- package/cli/target/release/deps/zmij-9501bcbd6d8b933c.d +0 -8
- package/src/actions.ts +0 -1670
- package/src/browser.test.ts +0 -157
- package/src/browser.ts +0 -686
- package/src/cli-light.ts +0 -457
- package/src/client.ts +0 -150
- package/src/daemon.ts +0 -187
- package/src/index.ts +0 -1185
- package/src/protocol.test.ts +0 -216
- package/src/protocol.ts +0 -852
- package/src/snapshot.ts +0 -380
- package/src/types.ts +0 -913
- package/tsconfig.json +0 -28
- package/vitest.config.ts +0 -9
package/bin/agent-browser
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
@echo off
|
|
2
|
+
:: Cross-platform launcher for agent-browser (Windows)
|
|
3
|
+
:: Detects architecture and runs the appropriate native binary
|
|
4
|
+
|
|
5
|
+
setlocal
|
|
6
|
+
|
|
7
|
+
set "SCRIPT_DIR=%~dp0"
|
|
8
|
+
|
|
9
|
+
:: Detect architecture
|
|
10
|
+
if "%PROCESSOR_ARCHITECTURE%"=="AMD64" (
|
|
11
|
+
set "ARCH=x64"
|
|
12
|
+
) else if "%PROCESSOR_ARCHITECTURE%"=="ARM64" (
|
|
13
|
+
set "ARCH=arm64"
|
|
14
|
+
) else (
|
|
15
|
+
set "ARCH=x64"
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
set "BINARY=%SCRIPT_DIR%agent-browser-win32-%ARCH%.exe"
|
|
19
|
+
|
|
20
|
+
:: Try native binary first
|
|
21
|
+
if exist "%BINARY%" (
|
|
22
|
+
"%BINARY%" %*
|
|
23
|
+
exit /b %errorlevel%
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
:: Fallback to Node.js implementation
|
|
27
|
+
set "NODE_CLI=%SCRIPT_DIR%..\dist\cli-light.js"
|
|
28
|
+
if exist "%NODE_CLI%" (
|
|
29
|
+
node "%NODE_CLI%" %*
|
|
30
|
+
exit /b %errorlevel%
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
echo Error: No binary found for win32-%ARCH% >&2
|
|
34
|
+
echo Run 'npm run build:native' or 'npm run build:all-platforms' to build >&2
|
|
35
|
+
exit /b 1
|
package/dist/cli-light.d.ts
CHANGED
package/dist/cli-light.js
CHANGED
package/package.json
CHANGED
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-browser",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Headless browser automation CLI for AI agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"bin",
|
|
10
|
+
"scripts"
|
|
11
|
+
],
|
|
7
12
|
"bin": {
|
|
8
13
|
"agent-browser": "./bin/agent-browser"
|
|
9
14
|
},
|
|
10
15
|
"scripts": {
|
|
11
|
-
"build": "tsc
|
|
12
|
-
"build:
|
|
13
|
-
"build:
|
|
16
|
+
"build": "tsc",
|
|
17
|
+
"build:native": "cargo build --release --manifest-path cli/Cargo.toml && node scripts/copy-native.js",
|
|
18
|
+
"build:all-platforms": "docker compose -f docker/docker-compose.yml run --rm build-all",
|
|
19
|
+
"build:docker": "docker build -t agent-browser-builder -f docker/Dockerfile.build .",
|
|
14
20
|
"start": "node dist/index.js",
|
|
15
21
|
"dev": "tsx src/index.ts",
|
|
16
22
|
"typecheck": "tsc --noEmit",
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
set -e
|
|
3
|
+
|
|
4
|
+
# Build agent-browser for all platforms using Docker
|
|
5
|
+
# Usage: ./scripts/build-all-platforms.sh
|
|
6
|
+
|
|
7
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
8
|
+
PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
|
|
9
|
+
OUTPUT_DIR="$PROJECT_ROOT/bin"
|
|
10
|
+
|
|
11
|
+
# Colors
|
|
12
|
+
RED='\033[0;31m'
|
|
13
|
+
GREEN='\033[0;32m'
|
|
14
|
+
YELLOW='\033[1;33m'
|
|
15
|
+
NC='\033[0m' # No Color
|
|
16
|
+
|
|
17
|
+
echo -e "${YELLOW}Building agent-browser for all platforms...${NC}"
|
|
18
|
+
echo ""
|
|
19
|
+
|
|
20
|
+
# Ensure output directory exists
|
|
21
|
+
mkdir -p "$OUTPUT_DIR"
|
|
22
|
+
|
|
23
|
+
# Build the Docker image if needed
|
|
24
|
+
echo -e "${YELLOW}Building Docker cross-compilation image...${NC}"
|
|
25
|
+
docker build -t agent-browser-builder -f "$PROJECT_ROOT/docker/Dockerfile.build" "$PROJECT_ROOT"
|
|
26
|
+
|
|
27
|
+
# Function to build for a target
|
|
28
|
+
build_target() {
|
|
29
|
+
local target=$1
|
|
30
|
+
local output_name=$2
|
|
31
|
+
|
|
32
|
+
echo -e "${YELLOW}Building for ${target}...${NC}"
|
|
33
|
+
|
|
34
|
+
docker run --rm \
|
|
35
|
+
-v "$PROJECT_ROOT/cli:/build" \
|
|
36
|
+
-v "$OUTPUT_DIR:/output" \
|
|
37
|
+
agent-browser-builder \
|
|
38
|
+
-c "cargo zigbuild --release --target ${target} && cp /build/target/${target}/release/agent-browser* /output/${output_name} && chmod +x /output/${output_name} 2>/dev/null || true"
|
|
39
|
+
|
|
40
|
+
if [ -f "$OUTPUT_DIR/$output_name" ]; then
|
|
41
|
+
echo -e "${GREEN}✓ Built ${output_name}${NC}"
|
|
42
|
+
else
|
|
43
|
+
echo -e "${RED}✗ Failed to build ${output_name}${NC}"
|
|
44
|
+
return 1
|
|
45
|
+
fi
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
# Build for each platform
|
|
49
|
+
# Linux x64
|
|
50
|
+
build_target "x86_64-unknown-linux-gnu" "agent-browser-linux-x64"
|
|
51
|
+
|
|
52
|
+
# Linux ARM64
|
|
53
|
+
build_target "aarch64-unknown-linux-gnu" "agent-browser-linux-arm64"
|
|
54
|
+
|
|
55
|
+
# Windows x64
|
|
56
|
+
build_target "x86_64-pc-windows-gnu" "agent-browser-win32-x64.exe"
|
|
57
|
+
|
|
58
|
+
# macOS x64 (via zig for cross-compilation)
|
|
59
|
+
build_target "x86_64-apple-darwin" "agent-browser-darwin-x64"
|
|
60
|
+
|
|
61
|
+
# macOS ARM64 (via zig for cross-compilation)
|
|
62
|
+
build_target "aarch64-apple-darwin" "agent-browser-darwin-arm64"
|
|
63
|
+
|
|
64
|
+
echo ""
|
|
65
|
+
echo -e "${GREEN}Build complete!${NC}"
|
|
66
|
+
echo ""
|
|
67
|
+
echo "Binaries are in: $OUTPUT_DIR"
|
|
68
|
+
ls -la "$OUTPUT_DIR"/agent-browser-*
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Copies the compiled Rust binary to bin/ with platform-specific naming
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { copyFileSync, existsSync, mkdirSync } from 'fs';
|
|
8
|
+
import { dirname, join } from 'path';
|
|
9
|
+
import { fileURLToPath } from 'url';
|
|
10
|
+
import { platform, arch } from 'os';
|
|
11
|
+
|
|
12
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
13
|
+
const projectRoot = join(__dirname, '..');
|
|
14
|
+
|
|
15
|
+
const sourcePath = join(projectRoot, 'cli/target/release/agent-browser');
|
|
16
|
+
const binDir = join(projectRoot, 'bin');
|
|
17
|
+
|
|
18
|
+
// Determine platform suffix
|
|
19
|
+
const platformKey = `${platform()}-${arch()}`;
|
|
20
|
+
const ext = platform() === 'win32' ? '.exe' : '';
|
|
21
|
+
const targetName = `agent-browser-${platformKey}${ext}`;
|
|
22
|
+
const targetPath = join(binDir, targetName);
|
|
23
|
+
|
|
24
|
+
if (!existsSync(sourcePath)) {
|
|
25
|
+
console.error(`Error: Native binary not found at ${sourcePath}`);
|
|
26
|
+
console.error('Run "cargo build --release --manifest-path cli/Cargo.toml" first');
|
|
27
|
+
process.exit(1);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (!existsSync(binDir)) {
|
|
31
|
+
mkdirSync(binDir, { recursive: true });
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
copyFileSync(sourcePath, targetPath);
|
|
35
|
+
console.log(`✓ Copied native binary to ${targetPath}`);
|
package/scripts/postinstall.js
CHANGED
|
@@ -1,17 +1,115 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Postinstall script for agent-browser
|
|
5
|
+
*
|
|
6
|
+
* Downloads the platform-specific native binary if not present.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { existsSync, mkdirSync, chmodSync, createWriteStream, unlinkSync } from 'fs';
|
|
10
|
+
import { dirname, join } from 'path';
|
|
11
|
+
import { fileURLToPath } from 'url';
|
|
12
|
+
import { platform, arch } from 'os';
|
|
13
|
+
import { get } from 'https';
|
|
14
|
+
import { execSync } from 'child_process';
|
|
15
|
+
|
|
16
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
17
|
+
const projectRoot = join(__dirname, '..');
|
|
18
|
+
const binDir = join(projectRoot, 'bin');
|
|
19
|
+
|
|
20
|
+
// Platform detection
|
|
21
|
+
const platformKey = `${platform()}-${arch()}`;
|
|
22
|
+
const ext = platform() === 'win32' ? '.exe' : '';
|
|
23
|
+
const binaryName = `agent-browser-${platformKey}${ext}`;
|
|
24
|
+
const binaryPath = join(binDir, binaryName);
|
|
25
|
+
|
|
26
|
+
// Package info
|
|
27
|
+
const packageJson = JSON.parse(
|
|
28
|
+
(await import('fs')).readFileSync(join(projectRoot, 'package.json'), 'utf8')
|
|
29
|
+
);
|
|
30
|
+
const version = packageJson.version;
|
|
31
|
+
|
|
32
|
+
// GitHub release URL
|
|
33
|
+
const GITHUB_REPO = 'anthropics/agent-browser'; // Update this to your actual repo
|
|
34
|
+
const DOWNLOAD_URL = `https://github.com/${GITHUB_REPO}/releases/download/v${version}/${binaryName}`;
|
|
35
|
+
|
|
36
|
+
async function downloadFile(url, dest) {
|
|
37
|
+
return new Promise((resolve, reject) => {
|
|
38
|
+
const file = createWriteStream(dest);
|
|
39
|
+
|
|
40
|
+
const request = (url) => {
|
|
41
|
+
get(url, (response) => {
|
|
42
|
+
// Handle redirects
|
|
43
|
+
if (response.statusCode === 301 || response.statusCode === 302) {
|
|
44
|
+
request(response.headers.location);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (response.statusCode !== 200) {
|
|
49
|
+
reject(new Error(`Failed to download: HTTP ${response.statusCode}`));
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
response.pipe(file);
|
|
54
|
+
file.on('finish', () => {
|
|
55
|
+
file.close();
|
|
56
|
+
resolve();
|
|
57
|
+
});
|
|
58
|
+
}).on('error', (err) => {
|
|
59
|
+
unlinkSync(dest);
|
|
60
|
+
reject(err);
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
request(url);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
async function main() {
|
|
69
|
+
// Check if binary already exists
|
|
70
|
+
if (existsSync(binaryPath)) {
|
|
71
|
+
console.log(`✓ Native binary already exists: ${binaryName}`);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Ensure bin directory exists
|
|
76
|
+
if (!existsSync(binDir)) {
|
|
77
|
+
mkdirSync(binDir, { recursive: true });
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
console.log(`Downloading native binary for ${platformKey}...`);
|
|
81
|
+
console.log(`URL: ${DOWNLOAD_URL}`);
|
|
82
|
+
|
|
83
|
+
try {
|
|
84
|
+
await downloadFile(DOWNLOAD_URL, binaryPath);
|
|
85
|
+
|
|
86
|
+
// Make executable on Unix
|
|
87
|
+
if (platform() !== 'win32') {
|
|
88
|
+
chmodSync(binaryPath, 0o755);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
console.log(`✓ Downloaded native binary: ${binaryName}`);
|
|
92
|
+
} catch (err) {
|
|
93
|
+
console.log(`⚠ Could not download native binary: ${err.message}`);
|
|
94
|
+
console.log(` The CLI will use Node.js fallback (slightly slower startup)`);
|
|
95
|
+
console.log('');
|
|
96
|
+
console.log('To build the native binary locally:');
|
|
97
|
+
console.log(' 1. Install Rust: https://rustup.rs');
|
|
98
|
+
console.log(' 2. Run: npm run build:native');
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// Reminder about Playwright browsers
|
|
102
|
+
console.log('');
|
|
103
|
+
console.log('╔═══════════════════════════════════════════════════════════════════════════╗');
|
|
104
|
+
console.log('║ To download browser binaries, run: ║');
|
|
105
|
+
console.log('║ ║');
|
|
106
|
+
console.log('║ npx playwright install chromium ║');
|
|
107
|
+
console.log('║ ║');
|
|
108
|
+
console.log('║ On Linux, include system dependencies with: ║');
|
|
109
|
+
console.log('║ ║');
|
|
110
|
+
console.log('║ npx playwright install --with-deps chromium ║');
|
|
111
|
+
console.log('║ ║');
|
|
112
|
+
console.log('╚═══════════════════════════════════════════════════════════════════════════╝');
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
main().catch(console.error);
|
package/.prettierrc
DELETED
package/AGENTS.md
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
# AGENTS.md
|
|
2
|
-
|
|
3
|
-
Instructions for AI coding agents working with this codebase.
|
|
4
|
-
|
|
5
|
-
<!-- opensrc:start -->
|
|
6
|
-
|
|
7
|
-
## Source Code Reference
|
|
8
|
-
|
|
9
|
-
Source code for dependencies is available in `opensrc/` for deeper understanding of implementation details.
|
|
10
|
-
|
|
11
|
-
See `opensrc/sources.json` for the list of available packages and their versions.
|
|
12
|
-
|
|
13
|
-
Use this source code when you need to understand how a package works internally, not just its types/interface.
|
|
14
|
-
|
|
15
|
-
### Fetching Additional Source Code
|
|
16
|
-
|
|
17
|
-
To fetch source code for a package or repository you need to understand, run:
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
npx opensrc <package> # npm package (e.g., npx opensrc zod)
|
|
21
|
-
npx opensrc pypi:<package> # Python package (e.g., npx opensrc pypi:requests)
|
|
22
|
-
npx opensrc crates:<package> # Rust crate (e.g., npx opensrc crates:serde)
|
|
23
|
-
npx opensrc <owner>/<repo> # GitHub repo (e.g., npx opensrc vercel/ai)
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
<!-- opensrc:end -->
|