codex-browser-use 4.8.1 → 4.8.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/README.md +1 -1
- package/bin/browser-use.js +14 -1
- package/package.json +1 -1
- package/src/portable-server.js +14 -1
- package/src/server.js +1 -1
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
[](https://www.npmjs.com/package/codex-browser-use)
|
|
15
15
|
[](https://codex-browser-use.vercel.app)
|
|
16
16
|
[](#quick-start)
|
|
17
|
-
[](#why-its-better)
|
|
18
18
|
[](#quick-start)
|
|
19
19
|
[](https://github.com/khanhle1406/codex-browser-use/stargazers)
|
|
20
20
|
|
package/bin/browser-use.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { realpathSync } from "node:fs";
|
|
2
3
|
import { fileURLToPath } from "node:url";
|
|
3
4
|
import { lstat, mkdir, unlink, writeFile } from "node:fs/promises";
|
|
4
5
|
import path from "node:path";
|
|
@@ -192,7 +193,19 @@ export async function main(argv = process.argv.slice(2)) {
|
|
|
192
193
|
return 0;
|
|
193
194
|
}
|
|
194
195
|
|
|
195
|
-
|
|
196
|
+
/** @param {string} metaUrl @returns {boolean} */
|
|
197
|
+
function isExecutedDirectly(metaUrl) {
|
|
198
|
+
if (!process.argv[1]) return false;
|
|
199
|
+
const selfPath = fileURLToPath(metaUrl);
|
|
200
|
+
if (path.resolve(process.argv[1]) === selfPath) return true;
|
|
201
|
+
try {
|
|
202
|
+
return realpathSync(process.argv[1]) === realpathSync(selfPath);
|
|
203
|
+
} catch {
|
|
204
|
+
return false;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
if (isExecutedDirectly(import.meta.url)) {
|
|
196
209
|
main().then((code) => { process.exitCode = code; }).catch((error) => {
|
|
197
210
|
process.stderr.write(`browser-use: ${error.message}\n`);
|
|
198
211
|
process.exitCode = 1;
|
package/package.json
CHANGED
package/src/portable-server.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { realpathSync } from "node:fs";
|
|
2
3
|
import { homedir } from "node:os";
|
|
3
4
|
import path from "node:path";
|
|
4
5
|
import { fileURLToPath } from "node:url";
|
|
@@ -223,7 +224,19 @@ export async function main() {
|
|
|
223
224
|
process.stdin.once("end", stop);
|
|
224
225
|
}
|
|
225
226
|
|
|
226
|
-
|
|
227
|
+
/** @param {string} metaUrl @returns {boolean} */
|
|
228
|
+
function isExecutedDirectly(metaUrl) {
|
|
229
|
+
if (!process.argv[1]) return false;
|
|
230
|
+
const selfPath = fileURLToPath(metaUrl);
|
|
231
|
+
if (path.resolve(process.argv[1]) === selfPath) return true;
|
|
232
|
+
try {
|
|
233
|
+
return realpathSync(process.argv[1]) === realpathSync(selfPath);
|
|
234
|
+
} catch {
|
|
235
|
+
return false;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
if (isExecutedDirectly(import.meta.url)) {
|
|
227
240
|
main().catch((error) => {
|
|
228
241
|
console.error("Fatal portable server error:", error);
|
|
229
242
|
process.exitCode = 1;
|
package/src/server.js
CHANGED
|
@@ -1083,7 +1083,7 @@ export function registerTools(server, deps = {}) {
|
|
|
1083
1083
|
export function createStandaloneServer(deps = {}) {
|
|
1084
1084
|
const profile = deps.profile ?? resolveToolProfile();
|
|
1085
1085
|
const server = new McpServer(
|
|
1086
|
-
{ name: "browser-use", version: "4.8.
|
|
1086
|
+
{ name: "browser-use", version: "4.8.2" },
|
|
1087
1087
|
{
|
|
1088
1088
|
instructions: [
|
|
1089
1089
|
"Browser use through a local Chrome bridge. Can create new session tabs or inspect and claim existing open user tabs in Chrome (via `browser_list_tabs` + `browser_select_tab` or `tab_id`, or `browser.tabs.list()` / `browser.user.openTabs()` + `browser.tabs.read()` / `browser.user.claimTab()` in `browser_run`). Claimed user tabs join the session Chrome Tab Group and are released (kept open & grouped) when a turn ends.",
|