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 CHANGED
@@ -14,7 +14,7 @@
14
14
  [![npm](https://img.shields.io/npm/v/codex-browser-use?style=flat-square&color=cb3837)](https://www.npmjs.com/package/codex-browser-use)
15
15
  [![Website](https://img.shields.io/badge/Website-codex--browser--use.vercel.app-2563EB?style=flat-square)](https://codex-browser-use.vercel.app)
16
16
  [![Node.js](https://img.shields.io/badge/Node.js-26.12.1%2B-339933?style=flat-square&logo=nodedotjs&logoColor=white)](#quick-start)
17
- [![Version](https://img.shields.io/badge/MCP-v4.8.1%20%7C%2036%20tools-5B8DEF?style=flat-square)](#why-its-better)
17
+ [![Version](https://img.shields.io/badge/MCP-v4.8.2%20%7C%2036%20tools-5B8DEF?style=flat-square)](#why-its-better)
18
18
  [![Extension](https://img.shields.io/badge/Extension-v0.6.4-34D399?style=flat-square)](#quick-start)
19
19
  [![GitHub stars](https://img.shields.io/github/stars/khanhle1406/codex-browser-use?style=flat-square)](https://github.com/khanhle1406/codex-browser-use/stargazers)
20
20
 
@@ -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
- if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codex-browser-use",
3
- "version": "4.8.1",
3
+ "version": "4.8.2",
4
4
  "description": "Fast, token-efficient local MCP server that gives any coding agent your real Chrome browser.",
5
5
  "type": "module",
6
6
  "main": "src/server.js",
@@ -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
- if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
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.1" },
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.",