agentic-browser 2.6.1 → 2.6.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.
@@ -2,7 +2,7 @@
2
2
  import fs from "node:fs";
3
3
  import path from "node:path";
4
4
  import readline from "node:readline/promises";
5
- //#region src/cli/commands/setup.ts
5
+ // src/cli/commands/setup.ts
6
6
  const SERVER_ENTRY = {
7
7
  command: "npx",
8
8
  args: ["agentic-browser", "mcp"]
@@ -22,11 +22,14 @@ function detectTools(cwd = process.cwd()) {
22
22
  }
23
23
  function readJsonFile(filePath) {
24
24
  if (!fs.existsSync(filePath)) return {};
25
+ let parsed;
25
26
  try {
26
- return JSON.parse(fs.readFileSync(filePath, "utf8"));
27
- } catch {
28
- return {};
27
+ parsed = JSON.parse(fs.readFileSync(filePath, "utf8"));
28
+ } catch (err) {
29
+ throw new Error(`Cannot parse ${filePath}: ${err.message}. Fix or remove the file, then re-run setup.`, { cause: err });
29
30
  }
31
+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) throw new Error(`Cannot parse ${filePath}: expected a JSON object. Fix or remove the file, then re-run setup.`);
32
+ return parsed;
30
33
  }
31
34
  function writeJsonFile(filePath, data) {
32
35
  fs.mkdirSync(path.dirname(filePath), { recursive: true });
@@ -62,14 +65,18 @@ async function runSetup() {
62
65
  }
63
66
  const selected = choice === targets.length + 1 ? targets : [targets[choice - 1]];
64
67
  console.log();
65
- for (const target of selected) {
68
+ let failed = 0;
69
+ for (const target of selected) try {
66
70
  applyConfig(target);
67
71
  console.log(` Configured ${target.configPath}`);
72
+ } catch (err) {
73
+ failed++;
74
+ process.stderr.write(` Skipped ${target.name}: ${err.message}\n`);
68
75
  }
76
+ if (failed > 0) process.exitCode = 1;
69
77
  console.log("\nDone. Restart your AI tool to pick up the new MCP server.");
70
78
  } finally {
71
79
  rl.close();
72
80
  }
73
81
  }
74
- //#endregion
75
82
  export { runSetup };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentic-browser",
3
- "version": "2.6.1",
3
+ "version": "2.6.2",
4
4
  "description": "CLI and MCP server for AI agents to control Chrome via CDP",
5
5
  "keywords": [
6
6
  "agent",
@@ -66,30 +66,32 @@
66
66
  "typecheck": "tsc"
67
67
  },
68
68
  "dependencies": {
69
- "@modelcontextprotocol/sdk": "^1.29.0",
70
- "commander": "^15.0.0",
71
- "ws": "^8.21.1",
72
- "zod": "^4.4.3"
69
+ "@modelcontextprotocol/sdk": "^1.32.2",
70
+ "commander": "^15.1.0",
71
+ "ws": "^8.22.2",
72
+ "zod": "^4.6.7"
73
73
  },
74
74
  "devDependencies": {
75
75
  "@semantic-release/commit-analyzer": "^13.0.1",
76
- "@semantic-release/github": "^12.0.9",
77
- "@semantic-release/npm": "^13.1.5",
76
+ "@semantic-release/github": "^12.0.10",
77
+ "@semantic-release/npm": "^13.2.0",
78
78
  "@semantic-release/release-notes-generator": "^14.1.1",
79
- "@types/node": "^26.1.1",
80
- "@types/ws": "^8.18.1",
81
- "oxfmt": "^0.59.0",
82
- "oxlint": "^1.74.0",
83
- "react": "^19.2.7",
84
- "react-dom": "^19.2.7",
85
- "semantic-release": "^25.0.8",
86
- "tsdown": "^0.22.12",
87
- "typescript": "^6.0.2",
88
- "vitest": "^4.1.10",
89
- "vocs": "1.4.1"
79
+ "@types/node": "^26.6.6",
80
+ "@types/ws": "^8.18.2",
81
+ "oxfmt": "^0.78.0",
82
+ "oxlint": "^1.93.0",
83
+ "react": "^19.3.1",
84
+ "react-dom": "^19.3.1",
85
+ "semantic-release": "^25.0.9",
86
+ "tsdown": "^0.23.7",
87
+ "typescript": "^7.0.2",
88
+ "vite": "^8.3.7",
89
+ "vitest": "^5.1.0",
90
+ "vocs": "2.12.0",
91
+ "waku": "1.0.0-rc.4"
90
92
  },
91
93
  "engines": {
92
94
  "node": ">=22"
93
95
  },
94
- "packageManager": "pnpm@11.15.1"
96
+ "packageManager": "pnpm@12.18.0"
95
97
  }