@omercnet/paseo-shared-browser 4.1.10 → 4.1.11-next.500.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/README.md +9 -1
- package/npm-shrinkwrap.json +149 -37
- package/package.json +5 -4
- package/scripts/agent-browser-native.mjs +94 -0
- package/scripts/prepare-runtime.mjs +14 -17
- package/server/agent-browser-runtime.ts +1 -1
- package/server/runtime-launch-environment.test.ts +1 -1
- package/server/runtime-video-opt-in.test.ts +1 -1
package/README.md
CHANGED
|
@@ -40,7 +40,7 @@ organization names.
|
|
|
40
40
|
controller when a takeover is needed, and continues the selected action after control is granted.
|
|
41
41
|
Closing a tab or browser still requires its own confirmation. Actions that need a fresh frame wait
|
|
42
42
|
for one before sending input.
|
|
43
|
-
- The plugin owns `agent-browser` version `0.
|
|
43
|
+
- The plugin owns `agent-browser` version `0.43.0`, its IPC directory, and the Chromium executable.
|
|
44
44
|
It strips inherited `AGENT_BROWSER_*` variables and sets `AGENT_BROWSER_SOCKET_DIR`,
|
|
45
45
|
`AGENT_BROWSER_IDLE_TIMEOUT_MS=0`, `AGENT_BROWSER_STREAM_PORT=0`, and
|
|
46
46
|
`AGENT_BROWSER_NO_AUTO_DIALOG=1` itself.
|
|
@@ -105,6 +105,14 @@ from `/usr/bin/chromium`. Install a non-Snap Chromium build with the system pack
|
|
|
105
105
|
adding the plugin. Set `PASEO_SHARED_BROWSER_CHROMIUM_EXECUTABLE` to an absolute path when Chromium
|
|
106
106
|
is installed elsewhere. The plugin does not emulate x64 Chromium on Linux.
|
|
107
107
|
|
|
108
|
+
agent-browser 0.43 and newer ships its native binary in a per-platform optional package
|
|
109
|
+
(`@agent-browser/cli-<os>-<arch>`), and runtime preparation stages the host's package into the
|
|
110
|
+
runtime. Install the plugin's dependencies with scripts disabled (`npm install --ignore-scripts` or
|
|
111
|
+
`npm ci --ignore-scripts`, which is what Paseo and `scripts/prepare-dependencies.mjs` do). When the
|
|
112
|
+
platform package is missing, agent-browser's `postinstall` downloads a binary from GitHub releases
|
|
113
|
+
without an integrity check; with scripts disabled, runtime preparation fails instead and names the
|
|
114
|
+
missing package.
|
|
115
|
+
|
|
108
116
|
Runtime preparation keeps no Chrome download cache. When it uses the upstream installer (every
|
|
109
117
|
platform except Linux ARM64, unless `PASEO_SHARED_BROWSER_CHROMIUM_EXECUTABLE` is set), the
|
|
110
118
|
installer runs with a private home inside the staging directory, so each preparation downloads the
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,20 +1,124 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omercnet/paseo-shared-browser",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.11",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@omercnet/paseo-shared-browser",
|
|
9
|
-
"version": "4.1.
|
|
9
|
+
"version": "4.1.11",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@getpaseo/plugin": "0.16.0-beta.
|
|
11
|
+
"@getpaseo/plugin": "0.16.0-beta.2",
|
|
12
12
|
"@modelcontextprotocol/sdk": "1.32.2",
|
|
13
|
-
"agent-browser": "0.
|
|
13
|
+
"agent-browser": "0.43.0",
|
|
14
14
|
"esbuild": "0.28.2",
|
|
15
15
|
"zod": "4.6.7"
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
|
+
"node_modules/@agent-browser/cli-darwin-arm64": {
|
|
19
|
+
"version": "0.43.0",
|
|
20
|
+
"resolved": "https://registry.npmjs.org/@agent-browser/cli-darwin-arm64/-/cli-darwin-arm64-0.43.0.tgz",
|
|
21
|
+
"integrity": "sha512-HV6GP59IjNnowlrXR/5rVM8msPWwQDEONt/tWC8STzUfKZQHKZI/Iv9sf2h2ZhwK8xwoqLhxpf+KxcFgJ0sExQ==",
|
|
22
|
+
"cpu": [
|
|
23
|
+
"arm64"
|
|
24
|
+
],
|
|
25
|
+
"license": "Apache-2.0",
|
|
26
|
+
"optional": true,
|
|
27
|
+
"os": [
|
|
28
|
+
"darwin"
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
"node_modules/@agent-browser/cli-darwin-x64": {
|
|
32
|
+
"version": "0.43.0",
|
|
33
|
+
"resolved": "https://registry.npmjs.org/@agent-browser/cli-darwin-x64/-/cli-darwin-x64-0.43.0.tgz",
|
|
34
|
+
"integrity": "sha512-3NKnKFOWLYDYTz4bJxo4jt+GwjM4VtcW5FDrQY35eUrytig65FEDdXmXKuRbZGq9jEEWxh6rmpS4R6xS53XCaw==",
|
|
35
|
+
"cpu": [
|
|
36
|
+
"x64"
|
|
37
|
+
],
|
|
38
|
+
"license": "Apache-2.0",
|
|
39
|
+
"optional": true,
|
|
40
|
+
"os": [
|
|
41
|
+
"darwin"
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
"node_modules/@agent-browser/cli-linux-arm64-gnu": {
|
|
45
|
+
"version": "0.43.0",
|
|
46
|
+
"resolved": "https://registry.npmjs.org/@agent-browser/cli-linux-arm64-gnu/-/cli-linux-arm64-gnu-0.43.0.tgz",
|
|
47
|
+
"integrity": "sha512-8DC234LGlXCn8A2YXGk6woy1uTjyexvtHd/TOQHLrV2sfUMZD647HTHEJyF+2z1J1oR34LaB5jqHJ9d0REC+Cw==",
|
|
48
|
+
"cpu": [
|
|
49
|
+
"arm64"
|
|
50
|
+
],
|
|
51
|
+
"libc": [
|
|
52
|
+
"glibc"
|
|
53
|
+
],
|
|
54
|
+
"license": "Apache-2.0",
|
|
55
|
+
"optional": true,
|
|
56
|
+
"os": [
|
|
57
|
+
"linux"
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
"node_modules/@agent-browser/cli-linux-arm64-musl": {
|
|
61
|
+
"version": "0.43.0",
|
|
62
|
+
"resolved": "https://registry.npmjs.org/@agent-browser/cli-linux-arm64-musl/-/cli-linux-arm64-musl-0.43.0.tgz",
|
|
63
|
+
"integrity": "sha512-/dYeGX2E1lWZ25q1IZSVs6PaPmr0GmhHU8z/LtCh0anHN4ND50i5fOPbysRBaE8iQCBY74h+1R2kePfEqD7X4Q==",
|
|
64
|
+
"cpu": [
|
|
65
|
+
"arm64"
|
|
66
|
+
],
|
|
67
|
+
"libc": [
|
|
68
|
+
"musl"
|
|
69
|
+
],
|
|
70
|
+
"license": "Apache-2.0",
|
|
71
|
+
"optional": true,
|
|
72
|
+
"os": [
|
|
73
|
+
"linux"
|
|
74
|
+
]
|
|
75
|
+
},
|
|
76
|
+
"node_modules/@agent-browser/cli-linux-x64-gnu": {
|
|
77
|
+
"version": "0.43.0",
|
|
78
|
+
"resolved": "https://registry.npmjs.org/@agent-browser/cli-linux-x64-gnu/-/cli-linux-x64-gnu-0.43.0.tgz",
|
|
79
|
+
"integrity": "sha512-WY8vy2Saa3oRt6XEmz4Sae1W5qS9TjYcbX6IE+dxb8s2APfL9XyQjMHC6jBZrhwqDBIvUeTMCT/P2cq3XLPSBw==",
|
|
80
|
+
"cpu": [
|
|
81
|
+
"x64"
|
|
82
|
+
],
|
|
83
|
+
"libc": [
|
|
84
|
+
"glibc"
|
|
85
|
+
],
|
|
86
|
+
"license": "Apache-2.0",
|
|
87
|
+
"optional": true,
|
|
88
|
+
"os": [
|
|
89
|
+
"linux"
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
"node_modules/@agent-browser/cli-linux-x64-musl": {
|
|
93
|
+
"version": "0.43.0",
|
|
94
|
+
"resolved": "https://registry.npmjs.org/@agent-browser/cli-linux-x64-musl/-/cli-linux-x64-musl-0.43.0.tgz",
|
|
95
|
+
"integrity": "sha512-WpCI0cIaVIVj4trdduDmW90h51BAP5Nhx6lALOqHjUhOOae/TkLL4bK8gJfjPb/nOp2FRjsF1l77f6rVwkpsug==",
|
|
96
|
+
"cpu": [
|
|
97
|
+
"x64"
|
|
98
|
+
],
|
|
99
|
+
"libc": [
|
|
100
|
+
"musl"
|
|
101
|
+
],
|
|
102
|
+
"license": "Apache-2.0",
|
|
103
|
+
"optional": true,
|
|
104
|
+
"os": [
|
|
105
|
+
"linux"
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
"node_modules/@agent-browser/cli-win32-x64-msvc": {
|
|
109
|
+
"version": "0.43.0",
|
|
110
|
+
"resolved": "https://registry.npmjs.org/@agent-browser/cli-win32-x64-msvc/-/cli-win32-x64-msvc-0.43.0.tgz",
|
|
111
|
+
"integrity": "sha512-xhk8wnHk3aiBFSR0pd1Ye3ay2jKjgRardgBJLiB9nXJv0ZkbeP/wh3X7jMiKUfUGE1qqJrKdaM5szQ6iz8/8+w==",
|
|
112
|
+
"cpu": [
|
|
113
|
+
"x64",
|
|
114
|
+
"arm64"
|
|
115
|
+
],
|
|
116
|
+
"license": "Apache-2.0",
|
|
117
|
+
"optional": true,
|
|
118
|
+
"os": [
|
|
119
|
+
"win32"
|
|
120
|
+
]
|
|
121
|
+
},
|
|
18
122
|
"node_modules/@agentclientprotocol/sdk": {
|
|
19
123
|
"version": "1.9.0",
|
|
20
124
|
"resolved": "https://registry.npmjs.org/@agentclientprotocol/sdk/-/sdk-1.9.0.tgz",
|
|
@@ -441,22 +545,22 @@
|
|
|
441
545
|
}
|
|
442
546
|
},
|
|
443
547
|
"node_modules/@getpaseo/client": {
|
|
444
|
-
"version": "0.16.0-beta.
|
|
445
|
-
"resolved": "https://registry.npmjs.org/@getpaseo/client/-/client-0.16.0-beta.
|
|
446
|
-
"integrity": "sha512-
|
|
548
|
+
"version": "0.16.0-beta.2",
|
|
549
|
+
"resolved": "https://registry.npmjs.org/@getpaseo/client/-/client-0.16.0-beta.2.tgz",
|
|
550
|
+
"integrity": "sha512-T7NInK3/731BzDOn+8Wdl7kYSJ+/CVqbW9EMjXhtZSZy2TSPni42Ag4tv1t5b9tw7Lu4uJP7jpXvUKN2hYZxTw==",
|
|
447
551
|
"license": "Apache-2.0",
|
|
448
552
|
"peer": true,
|
|
449
553
|
"dependencies": {
|
|
450
|
-
"@getpaseo/protocol": "0.16.0-beta.
|
|
451
|
-
"@getpaseo/relay": "0.16.0-beta.
|
|
554
|
+
"@getpaseo/protocol": "0.16.0-beta.2",
|
|
555
|
+
"@getpaseo/relay": "0.16.0-beta.2",
|
|
452
556
|
"ws": "^8.20.0",
|
|
453
557
|
"zod": "^4.4.3"
|
|
454
558
|
}
|
|
455
559
|
},
|
|
456
560
|
"node_modules/@getpaseo/plugin": {
|
|
457
|
-
"version": "0.16.0-beta.
|
|
458
|
-
"resolved": "https://registry.npmjs.org/@getpaseo/plugin/-/plugin-0.16.0-beta.
|
|
459
|
-
"integrity": "sha512-
|
|
561
|
+
"version": "0.16.0-beta.2",
|
|
562
|
+
"resolved": "https://registry.npmjs.org/@getpaseo/plugin/-/plugin-0.16.0-beta.2.tgz",
|
|
563
|
+
"integrity": "sha512-rJL1cOD0nV1wGWJo6dgGVMkIygce5RWwO40n3FYffvDYl/x4ir6xF2ieYLCkYhW/5V4KyDZKFmZ4fQ/Ajh9xvg==",
|
|
460
564
|
"license": "Apache-2.0",
|
|
461
565
|
"dependencies": {
|
|
462
566
|
"@agentclientprotocol/sdk": "^1.4.0",
|
|
@@ -464,8 +568,8 @@
|
|
|
464
568
|
"use-sync-external-store": "^1.6.0"
|
|
465
569
|
},
|
|
466
570
|
"peerDependencies": {
|
|
467
|
-
"@getpaseo/client": "0.16.0-beta.
|
|
468
|
-
"@getpaseo/protocol": "0.16.0-beta.
|
|
571
|
+
"@getpaseo/client": "0.16.0-beta.2",
|
|
572
|
+
"@getpaseo/protocol": "0.16.0-beta.2",
|
|
469
573
|
"react": ">=19.1.0 <20",
|
|
470
574
|
"react-native": ">=0.81.5",
|
|
471
575
|
"zod": "^4.4.3"
|
|
@@ -477,9 +581,9 @@
|
|
|
477
581
|
}
|
|
478
582
|
},
|
|
479
583
|
"node_modules/@getpaseo/protocol": {
|
|
480
|
-
"version": "0.16.0-beta.
|
|
481
|
-
"resolved": "https://registry.npmjs.org/@getpaseo/protocol/-/protocol-0.16.0-beta.
|
|
482
|
-
"integrity": "sha512-
|
|
584
|
+
"version": "0.16.0-beta.2",
|
|
585
|
+
"resolved": "https://registry.npmjs.org/@getpaseo/protocol/-/protocol-0.16.0-beta.2.tgz",
|
|
586
|
+
"integrity": "sha512-w3LynGf+Q0mT9XlKVHnXlNeH/wCpaZcBATYJMh61kiQMNsjKrf61x1kOp9Vutst3nyts0iABVAYVHd+DnUxESQ==",
|
|
483
587
|
"license": "Apache-2.0",
|
|
484
588
|
"peer": true,
|
|
485
589
|
"dependencies": {
|
|
@@ -488,9 +592,9 @@
|
|
|
488
592
|
}
|
|
489
593
|
},
|
|
490
594
|
"node_modules/@getpaseo/relay": {
|
|
491
|
-
"version": "0.16.0-beta.
|
|
492
|
-
"resolved": "https://registry.npmjs.org/@getpaseo/relay/-/relay-0.16.0-beta.
|
|
493
|
-
"integrity": "sha512-
|
|
595
|
+
"version": "0.16.0-beta.2",
|
|
596
|
+
"resolved": "https://registry.npmjs.org/@getpaseo/relay/-/relay-0.16.0-beta.2.tgz",
|
|
597
|
+
"integrity": "sha512-U9asFRYeo72+6DuNGqdtsMjFi9HrowDrEJw+LKMU8958iYM1SzohB9nm1uAZv7KStxgD5naqgEUdbw9x84yuuA==",
|
|
494
598
|
"license": "Apache-2.0",
|
|
495
599
|
"peer": true,
|
|
496
600
|
"dependencies": {
|
|
@@ -503,9 +607,9 @@
|
|
|
503
607
|
}
|
|
504
608
|
},
|
|
505
609
|
"node_modules/@hono/node-server": {
|
|
506
|
-
"version": "2.1.
|
|
507
|
-
"resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-2.1.
|
|
508
|
-
"integrity": "sha512-
|
|
610
|
+
"version": "2.1.8",
|
|
611
|
+
"resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-2.1.8.tgz",
|
|
612
|
+
"integrity": "sha512-jdf7FHh6A1lzjpHHQUgxsg2GeER2vMetnAOfeActzcoli6jamlK+NAwL6Dsr5Fl3BS3tYUQzCdtZjU8Qxv7bEA==",
|
|
509
613
|
"license": "MIT",
|
|
510
614
|
"engines": {
|
|
511
615
|
"node": ">=20"
|
|
@@ -610,17 +714,25 @@
|
|
|
610
714
|
}
|
|
611
715
|
},
|
|
612
716
|
"node_modules/agent-browser": {
|
|
613
|
-
"version": "0.
|
|
614
|
-
"resolved": "https://registry.npmjs.org/agent-browser/-/agent-browser-0.
|
|
615
|
-
"integrity": "sha512
|
|
717
|
+
"version": "0.43.0",
|
|
718
|
+
"resolved": "https://registry.npmjs.org/agent-browser/-/agent-browser-0.43.0.tgz",
|
|
719
|
+
"integrity": "sha512-TExwnZAW39fUBDJhUPrw8KKGmcjzBo7FxNqoP2/usHG1ODsjGI2jAWq3+Q6I5JYyBMjePFEsj8KGB68mALtglA==",
|
|
616
720
|
"hasInstallScript": true,
|
|
617
721
|
"license": "Apache-2.0",
|
|
618
722
|
"bin": {
|
|
619
723
|
"agent-browser": "bin/agent-browser.js"
|
|
620
724
|
},
|
|
621
725
|
"engines": {
|
|
622
|
-
"node": ">=
|
|
623
|
-
|
|
726
|
+
"node": ">=22.0.0"
|
|
727
|
+
},
|
|
728
|
+
"optionalDependencies": {
|
|
729
|
+
"@agent-browser/cli-darwin-arm64": "0.43.0",
|
|
730
|
+
"@agent-browser/cli-darwin-x64": "0.43.0",
|
|
731
|
+
"@agent-browser/cli-linux-arm64-gnu": "0.43.0",
|
|
732
|
+
"@agent-browser/cli-linux-arm64-musl": "0.43.0",
|
|
733
|
+
"@agent-browser/cli-linux-x64-gnu": "0.43.0",
|
|
734
|
+
"@agent-browser/cli-linux-x64-musl": "0.43.0",
|
|
735
|
+
"@agent-browser/cli-win32-x64-msvc": "0.43.0"
|
|
624
736
|
}
|
|
625
737
|
},
|
|
626
738
|
"node_modules/ajv": {
|
|
@@ -870,9 +982,9 @@
|
|
|
870
982
|
"license": "MIT"
|
|
871
983
|
},
|
|
872
984
|
"node_modules/encodeurl": {
|
|
873
|
-
"version": "2.0.
|
|
874
|
-
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.
|
|
875
|
-
"integrity": "sha512-
|
|
985
|
+
"version": "2.0.3",
|
|
986
|
+
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.3.tgz",
|
|
987
|
+
"integrity": "sha512-mIteYONiEfc4xWf2F1WXovh1c8npzS00vNeiUPdwFF+QlVJni+gNvpQltLMQhob8rew/bWWc/bGTuUr0EUGt0w==",
|
|
876
988
|
"license": "MIT",
|
|
877
989
|
"engines": {
|
|
878
990
|
"node": ">= 0.8"
|
|
@@ -1208,9 +1320,9 @@
|
|
|
1208
1320
|
}
|
|
1209
1321
|
},
|
|
1210
1322
|
"node_modules/hono": {
|
|
1211
|
-
"version": "4.13.
|
|
1212
|
-
"resolved": "https://registry.npmjs.org/hono/-/hono-4.13.
|
|
1213
|
-
"integrity": "sha512-
|
|
1323
|
+
"version": "4.13.18",
|
|
1324
|
+
"resolved": "https://registry.npmjs.org/hono/-/hono-4.13.18.tgz",
|
|
1325
|
+
"integrity": "sha512-H9q/E1XizaWstJxUW881dmLxEj+t/TrGGnyxINkm4+sK0qUwsMtFdo2BWI9Vs3cIS19MU6b6iCijoUoEf4f3DA==",
|
|
1214
1326
|
"license": "MIT",
|
|
1215
1327
|
"engines": {
|
|
1216
1328
|
"node": ">=16.9.0"
|
|
@@ -1878,9 +1990,9 @@
|
|
|
1878
1990
|
"license": "ISC"
|
|
1879
1991
|
},
|
|
1880
1992
|
"node_modules/ws": {
|
|
1881
|
-
"version": "8.
|
|
1882
|
-
"resolved": "https://registry.npmjs.org/ws/-/ws-8.
|
|
1883
|
-
"integrity": "sha512
|
|
1993
|
+
"version": "8.23.0",
|
|
1994
|
+
"resolved": "https://registry.npmjs.org/ws/-/ws-8.23.0.tgz",
|
|
1995
|
+
"integrity": "sha512-wCkmX8QMOrKjgO8HW2WyDbTSGeqkocxgDzS9iR79rEAexty6/2qzilx3Ag8Tqf9ykop3irLKle0MtVn5qjVnoQ==",
|
|
1884
1996
|
"license": "MIT",
|
|
1885
1997
|
"peer": true,
|
|
1886
1998
|
"engines": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omercnet/paseo-shared-browser",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.11-next.500.1",
|
|
4
4
|
"description": "One real Chromium session per Paseo workspace, shared live across every connected client.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"browser",
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"index.client.tsx",
|
|
30
30
|
"index.server.ts",
|
|
31
31
|
"client",
|
|
32
|
+
"scripts/agent-browser-native.mjs",
|
|
32
33
|
"scripts/chromium-release.mjs",
|
|
33
34
|
"scripts/prepare-dependencies.mjs",
|
|
34
35
|
"scripts/prepare-runtime.mjs",
|
|
@@ -56,15 +57,15 @@
|
|
|
56
57
|
"test:video": "vitest run tests/video.smoke.test.ts --testTimeout=30000"
|
|
57
58
|
},
|
|
58
59
|
"dependencies": {
|
|
59
|
-
"@getpaseo/plugin": "0.16.0-beta.
|
|
60
|
+
"@getpaseo/plugin": "0.16.0-beta.2",
|
|
60
61
|
"@modelcontextprotocol/sdk": "1.32.2",
|
|
61
|
-
"agent-browser": "0.
|
|
62
|
+
"agent-browser": "0.43.0",
|
|
62
63
|
"esbuild": "0.28.2",
|
|
63
64
|
"zod": "4.6.7"
|
|
64
65
|
},
|
|
65
66
|
"devDependencies": {
|
|
66
67
|
"@biomejs/biome": "^2.5.10",
|
|
67
|
-
"@getpaseo/server": "0.16.0-beta.
|
|
68
|
+
"@getpaseo/server": "0.16.0-beta.2",
|
|
68
69
|
"@tanstack/react-query": "^5.102.3",
|
|
69
70
|
"@types/node": "^24.10.1",
|
|
70
71
|
"@types/react": "^19.2.18",
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { chmod, cp, readFile } from "node:fs/promises";
|
|
3
|
+
import { createRequire } from "node:module";
|
|
4
|
+
import { dirname, join } from "node:path";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Detects the C library the way agent-browser's own launcher does
|
|
8
|
+
* (scripts/native.js hostLibc), so the staged platform package is the one it
|
|
9
|
+
* looks up at run time.
|
|
10
|
+
*/
|
|
11
|
+
export function hostLibc() {
|
|
12
|
+
if (process.platform !== "linux") return null;
|
|
13
|
+
process.report.excludeNetwork = true;
|
|
14
|
+
const report = process.report.getReport();
|
|
15
|
+
if (report.header.glibcVersionRuntime) return "glibc";
|
|
16
|
+
if (report.sharedObjects.some((path) => /(?:^|\/)ld-musl-|libc\.musl-/.test(path))) return "musl";
|
|
17
|
+
const loaderArch = process.arch === "arm64" ? "aarch64" : "x86_64";
|
|
18
|
+
return existsSync(`/lib/ld-musl-${loaderArch}.so.1`) ? "musl" : "glibc";
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Names the optional dependency that carries the native agent-browser binary
|
|
23
|
+
* for a host, mirroring agent-browser's nativeTarget(). Windows ARM64 runs the
|
|
24
|
+
* x64 build through emulation.
|
|
25
|
+
*/
|
|
26
|
+
export function agentBrowserPlatformPackage(os, cpu, libc) {
|
|
27
|
+
const archKey = cpu === "x64" || cpu === "arm64" ? cpu : null;
|
|
28
|
+
if (!archKey) return null;
|
|
29
|
+
switch (os) {
|
|
30
|
+
case "darwin":
|
|
31
|
+
return { name: `@agent-browser/cli-darwin-${archKey}`, file: "agent-browser" };
|
|
32
|
+
case "linux":
|
|
33
|
+
return {
|
|
34
|
+
name: `@agent-browser/cli-linux-${archKey}-${libc === "musl" ? "musl" : "gnu"}`,
|
|
35
|
+
file: "agent-browser",
|
|
36
|
+
};
|
|
37
|
+
case "win32":
|
|
38
|
+
return { name: "@agent-browser/cli-win32-x64-msvc", file: "agent-browser.exe" };
|
|
39
|
+
default:
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Copies agent-browser and the host's platform package into runtimeModules,
|
|
46
|
+
* side by side, which is the layout agent-browser's launcher resolves the
|
|
47
|
+
* native binary from. The platform package is found from the installed
|
|
48
|
+
* agent-browser, so hoisted, nested and isolated (Bun) layouts all work.
|
|
49
|
+
* Returns the staged native binary.
|
|
50
|
+
*/
|
|
51
|
+
export async function stageAgentBrowserPackages({
|
|
52
|
+
agentBrowserRoot,
|
|
53
|
+
runtimeModules,
|
|
54
|
+
version,
|
|
55
|
+
os = process.platform,
|
|
56
|
+
cpu = process.arch,
|
|
57
|
+
libc = os === "linux" ? hostLibc() : null,
|
|
58
|
+
}) {
|
|
59
|
+
const target = agentBrowserPlatformPackage(os, cpu, libc);
|
|
60
|
+
if (!target) throw new Error(`Unsupported agent-browser platform: ${os}-${cpu}`);
|
|
61
|
+
|
|
62
|
+
let manifestPath;
|
|
63
|
+
try {
|
|
64
|
+
manifestPath = createRequire(join(agentBrowserRoot, "package.json")).resolve(
|
|
65
|
+
`${target.name}/package.json`,
|
|
66
|
+
);
|
|
67
|
+
} catch {
|
|
68
|
+
throw new Error(
|
|
69
|
+
`agent-browser ${version} needs its optional dependency ${target.name}, which is not installed. ` +
|
|
70
|
+
"Reinstall the plugin dependencies without omitting optional packages.",
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
const manifest = JSON.parse(await readFile(manifestPath, "utf8"));
|
|
74
|
+
if (manifest.name !== target.name || manifest.version !== version) {
|
|
75
|
+
throw new Error(
|
|
76
|
+
`Expected ${target.name} ${version}, found ${manifest.name ?? "unknown"} ${manifest.version ?? "unknown"} at ${manifestPath}`,
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
const packageRoot = dirname(manifestPath);
|
|
80
|
+
if (!existsSync(join(packageRoot, "bin", target.file))) {
|
|
81
|
+
throw new Error(`${target.name} ${version} has no bin/${target.file}`);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
await cp(agentBrowserRoot, join(runtimeModules, "agent-browser"), {
|
|
85
|
+
recursive: true,
|
|
86
|
+
force: true,
|
|
87
|
+
});
|
|
88
|
+
const stagedPackage = join(runtimeModules, ...target.name.split("/"));
|
|
89
|
+
await cp(packageRoot, stagedPackage, { recursive: true, force: true });
|
|
90
|
+
const binary = join(stagedPackage, "bin", target.file);
|
|
91
|
+
// Package managers do not always keep the execute bit; the staged copy is ours to fix.
|
|
92
|
+
if (os !== "win32") await chmod(binary, 0o700);
|
|
93
|
+
return binary;
|
|
94
|
+
}
|
|
@@ -4,10 +4,11 @@ import { constants } from "node:fs";
|
|
|
4
4
|
import { access, chmod, cp, lstat, mkdir, readdir, rm, symlink, writeFile } from "node:fs/promises";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
6
6
|
import { arch, homedir, platform } from "node:os";
|
|
7
|
-
import { dirname, join, resolve } from "node:path";
|
|
7
|
+
import { dirname, join, relative, resolve } from "node:path";
|
|
8
8
|
import { fileURLToPath } from "node:url";
|
|
9
9
|
import { promisify } from "node:util";
|
|
10
10
|
import { build } from "esbuild";
|
|
11
|
+
import { stageAgentBrowserPackages } from "./agent-browser-native.mjs";
|
|
11
12
|
import { installChromiumRelease } from "./chromium-release.mjs";
|
|
12
13
|
import { discardRuntime, replaceRuntime } from "./replace-runtime.mjs";
|
|
13
14
|
|
|
@@ -19,7 +20,7 @@ function resolveDependencyRoot(packageName) {
|
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
const execFileAsync = promisify(execFile);
|
|
22
|
-
const expectedVersion = "0.
|
|
23
|
+
const expectedVersion = "0.43.0";
|
|
23
24
|
const hostPlatform = platform();
|
|
24
25
|
const hostArch = arch();
|
|
25
26
|
const projectRoot = dirname(dirname(fileURLToPath(import.meta.url)));
|
|
@@ -187,19 +188,14 @@ async function installChromium() {
|
|
|
187
188
|
return runtimeChromiumEntry;
|
|
188
189
|
}
|
|
189
190
|
|
|
190
|
-
|
|
191
|
+
// The entry runs the native binary directly through a relative link, so the runtime stays
|
|
192
|
+
// relocatable. The agent-browser.js launcher would rewrite .bin/agent-browser to an absolute
|
|
193
|
+
// path on its first run.
|
|
194
|
+
async function stageAgentBrowserEntry(nativeBinary) {
|
|
191
195
|
if (hostPlatform === "win32") {
|
|
192
|
-
|
|
193
|
-
if (executableArch !== "x64") {
|
|
194
|
-
throw new Error(`Unsupported agent-browser Windows architecture: ${hostArch}`);
|
|
195
|
-
}
|
|
196
|
-
await cp(
|
|
197
|
-
join(packagedAgentBrowser, "bin", `agent-browser-win32-${executableArch}.exe`),
|
|
198
|
-
runtimeEntry,
|
|
199
|
-
{ force: true },
|
|
200
|
-
);
|
|
196
|
+
await cp(nativeBinary, runtimeEntry, { force: true });
|
|
201
197
|
} else {
|
|
202
|
-
await symlink(
|
|
198
|
+
await symlink(relative(dirname(runtimeEntry), nativeBinary), runtimeEntry);
|
|
203
199
|
}
|
|
204
200
|
await chmod(runtimeEntry, 0o700);
|
|
205
201
|
}
|
|
@@ -208,11 +204,12 @@ await rm(stagingRoot, { recursive: true, force: true });
|
|
|
208
204
|
try {
|
|
209
205
|
await mkdir(join(runtimeModules, ".bin"), { recursive: true, mode: 0o700 });
|
|
210
206
|
await chmod(pluginDataRoot, 0o700);
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
207
|
+
const nativeBinary = await stageAgentBrowserPackages({
|
|
208
|
+
agentBrowserRoot: packagedAgentBrowser,
|
|
209
|
+
runtimeModules,
|
|
210
|
+
version: expectedVersion,
|
|
214
211
|
});
|
|
215
|
-
await stageAgentBrowserEntry();
|
|
212
|
+
await stageAgentBrowserEntry(nativeBinary);
|
|
216
213
|
|
|
217
214
|
const binaryOverride = process.env.PASEO_SHARED_BROWSER_AGENT_BROWSER_BINARY;
|
|
218
215
|
if (binaryOverride)
|
|
@@ -57,7 +57,7 @@ import { createScreencastSourceTime } from "./screencast-source-time";
|
|
|
57
57
|
import { createVideoSourceRecovery } from "./video-source-recovery";
|
|
58
58
|
|
|
59
59
|
const execFileAsync = promisify(execFile);
|
|
60
|
-
export const AGENT_BROWSER_VERSION = "0.
|
|
60
|
+
export const AGENT_BROWSER_VERSION = "0.43.0";
|
|
61
61
|
const PRIVATE_DIRECTORY_MODE = 0o700;
|
|
62
62
|
const PRIVATE_FILE_MODE = 0o600;
|
|
63
63
|
const DEFAULT_TIMEOUT_MS = 15_000;
|
|
@@ -23,7 +23,7 @@ vi.mock("node:child_process", () => ({
|
|
|
23
23
|
callback: (error: null, result: { stdout: string }) => void,
|
|
24
24
|
) => {
|
|
25
25
|
exec.calls.push({ file, args, env: options.env });
|
|
26
|
-
callback(null, { stdout: args.includes("--version") ? "0.
|
|
26
|
+
callback(null, { stdout: args.includes("--version") ? "0.43.0\n" : "{}\n" });
|
|
27
27
|
},
|
|
28
28
|
}));
|
|
29
29
|
|
|
@@ -15,7 +15,7 @@ vi.mock("node:child_process", async (importOriginal) => ({
|
|
|
15
15
|
_args: string[],
|
|
16
16
|
_options: unknown,
|
|
17
17
|
callback: (error: null, result: { stdout: string }) => void,
|
|
18
|
-
) => callback(null, { stdout: "0.
|
|
18
|
+
) => callback(null, { stdout: "0.43.0\n" }),
|
|
19
19
|
}));
|
|
20
20
|
|
|
21
21
|
const temporary: string[] = [];
|