crawlio-browser 1.4.7 → 1.4.8

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.
@@ -1,7 +1,7 @@
1
1
  // src/shared/constants.ts
2
2
  import { homedir } from "os";
3
3
  import { join } from "path";
4
- var PKG_VERSION = "1.4.7";
4
+ var PKG_VERSION = "1.4.8";
5
5
  var WS_PORT = 9333;
6
6
  var WS_HOST = "127.0.0.1";
7
7
  var CRAWLIO_PORT_FILE = join(
@@ -7,7 +7,7 @@ import {
7
7
  WS_PORT,
8
8
  WS_RECONNECT_GRACE,
9
9
  WS_STALE_THRESHOLD
10
- } from "./chunk-RA3LVVKH.js";
10
+ } from "./chunk-EYPPJZP7.js";
11
11
 
12
12
  // src/mcp-server/index.ts
13
13
  import { randomBytes as randomBytes2 } from "crypto";
@@ -446,11 +446,25 @@ var WebSocketBridge = class {
446
446
  } catch {
447
447
  }
448
448
  await new Promise((resolve2, reject) => {
449
- this.httpServer.once("error", (err) => reject(err));
450
- this.httpServer.listen(WS_PORT, WS_HOST, () => {
451
- console.error(`[Bridge] WebSocket server listening on ws://${WS_HOST}:${WS_PORT}`);
452
- resolve2();
453
- });
449
+ let attempts = 0;
450
+ const tryListen = () => {
451
+ const onError = (err) => {
452
+ if (err.code === "EADDRINUSE" && attempts < 3) {
453
+ attempts++;
454
+ console.error(`[Bridge] Port ${WS_PORT} still in use, retry ${attempts}/3...`);
455
+ setTimeout(tryListen, 1e3 * attempts);
456
+ } else {
457
+ reject(err);
458
+ }
459
+ };
460
+ this.httpServer.once("error", onError);
461
+ this.httpServer.listen(WS_PORT, WS_HOST, () => {
462
+ this.httpServer.removeListener("error", onError);
463
+ console.error(`[Bridge] WebSocket server listening on ws://${WS_HOST}:${WS_PORT}`);
464
+ resolve2();
465
+ });
466
+ };
467
+ tryListen();
454
468
  });
455
469
  }
456
470
  get isConnected() {
@@ -1429,7 +1443,7 @@ function createTools(bridge2, crawlio2) {
1429
1443
  // --- AI orchestration tools ---
1430
1444
  {
1431
1445
  name: "connect_tab",
1432
- description: "Connect to a browser tab for capture and interaction. Three modes: (1) provide a URL to find or create a tab, (2) provide a tabId to connect to a specific tab, (3) no args to connect to the active tab. Starts CDP capture automatically.",
1446
+ description: "Pin a specific browser tab for all subsequent commands. Optional \u2014 without this, tools auto-connect to the active tab. Three modes: (1) provide a URL to find or create a tab, (2) provide a tabId to connect to a specific tab, (3) no args to pin the active tab. Starts CDP capture automatically.",
1433
1447
  inputSchema: {
1434
1448
  type: "object",
1435
1449
  properties: {
@@ -4042,7 +4056,7 @@ function createCodeModeTools(bridge2, crawlio2) {
4042
4056
  process.title = "Crawlio Agent";
4043
4057
  var initMode = process.argv.includes("init") || process.argv.includes("--setup") || process.argv.includes("setup");
4044
4058
  if (initMode) {
4045
- const { runInit } = await import("./init-4D3LCB7J.js");
4059
+ const { runInit } = await import("./init-4LUNCDCD.js");
4046
4060
  await runInit(process.argv.slice(2));
4047
4061
  process.exit(0);
4048
4062
  }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  PKG_VERSION
3
- } from "./chunk-RA3LVVKH.js";
3
+ } from "./chunk-EYPPJZP7.js";
4
4
 
5
5
  // src/mcp-server/init.ts
6
6
  import { execFileSync, spawn } from "child_process";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "crawlio-browser",
3
- "version": "1.4.7",
3
+ "version": "1.4.8",
4
4
  "description": "MCP server with 96 CDP-backed tools for browser automation — screenshots, DOM, network capture, framework detection, cookies, storage, session recording, performance metrics via Chrome",
5
5
  "type": "module",
6
6
  "main": "dist/mcp-server/index.js",