crawlio-browser 1.4.6 → 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.
package/dist/mcp-server/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
WS_PORT,
|
|
8
8
|
WS_RECONNECT_GRACE,
|
|
9
9
|
WS_STALE_THRESHOLD
|
|
10
|
-
} from "./chunk-
|
|
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
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
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() {
|
|
@@ -512,7 +526,15 @@ var WebSocketBridge = class {
|
|
|
512
526
|
if (msg.success) {
|
|
513
527
|
req.resolve(msg.data ?? {});
|
|
514
528
|
} else {
|
|
515
|
-
|
|
529
|
+
const err = new Error(msg.error ?? "Unknown extension error");
|
|
530
|
+
const wire = msg;
|
|
531
|
+
if (wire.permission_required) {
|
|
532
|
+
const errObj = err;
|
|
533
|
+
errObj.permission_required = true;
|
|
534
|
+
errObj.missing = wire.missing;
|
|
535
|
+
errObj.suggestion = wire.suggestion;
|
|
536
|
+
}
|
|
537
|
+
req.reject(err);
|
|
516
538
|
}
|
|
517
539
|
this.pending.delete(msg.id);
|
|
518
540
|
}
|
|
@@ -1421,7 +1443,7 @@ function createTools(bridge2, crawlio2) {
|
|
|
1421
1443
|
// --- AI orchestration tools ---
|
|
1422
1444
|
{
|
|
1423
1445
|
name: "connect_tab",
|
|
1424
|
-
description: "
|
|
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.",
|
|
1425
1447
|
inputSchema: {
|
|
1426
1448
|
type: "object",
|
|
1427
1449
|
properties: {
|
|
@@ -4015,6 +4037,10 @@ function createCodeModeTools(bridge2, crawlio2) {
|
|
|
4015
4037
|
return toolSuccess(result);
|
|
4016
4038
|
} catch (error) {
|
|
4017
4039
|
const msg = error instanceof Error ? error.message : String(error);
|
|
4040
|
+
if (error instanceof Error && error.permission_required) {
|
|
4041
|
+
const missing = error.missing;
|
|
4042
|
+
return toolError(formatPermissionDenial(missing, "execute"));
|
|
4043
|
+
}
|
|
4018
4044
|
return toolError(`Execution error: ${msg}`);
|
|
4019
4045
|
} finally {
|
|
4020
4046
|
clearTimeout(timer);
|
|
@@ -4030,7 +4056,7 @@ function createCodeModeTools(bridge2, crawlio2) {
|
|
|
4030
4056
|
process.title = "Crawlio Agent";
|
|
4031
4057
|
var initMode = process.argv.includes("init") || process.argv.includes("--setup") || process.argv.includes("setup");
|
|
4032
4058
|
if (initMode) {
|
|
4033
|
-
const { runInit } = await import("./init-
|
|
4059
|
+
const { runInit } = await import("./init-4LUNCDCD.js");
|
|
4034
4060
|
await runInit(process.argv.slice(2));
|
|
4035
4061
|
process.exit(0);
|
|
4036
4062
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "crawlio-browser",
|
|
3
|
-
"version": "1.4.
|
|
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",
|