crawlio-browser 1.4.2 → 1.4.4

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.2";
4
+ var PKG_VERSION = "1.4.4";
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-ZFI2FHEC.js";
10
+ } from "./chunk-QZGTL4WX.js";
11
11
 
12
12
  // src/mcp-server/index.ts
13
13
  import { randomBytes as randomBytes2 } from "crypto";
@@ -488,6 +488,7 @@ var WebSocketBridge = class {
488
488
  import("child_process").then(({ execFile: execFile2 }) => {
489
489
  execFile2("open", ["-a", "Crawlio"], () => {
490
490
  });
491
+ }).catch(() => {
491
492
  });
492
493
  return;
493
494
  }
@@ -4026,7 +4027,7 @@ function createCodeModeTools(bridge2, crawlio2) {
4026
4027
  process.title = "Crawlio Agent";
4027
4028
  var initMode = process.argv.includes("init") || process.argv.includes("--setup") || process.argv.includes("setup");
4028
4029
  if (initMode) {
4029
- const { runInit } = await import("./init-6IG2YJYU.js");
4030
+ const { runInit } = await import("./init-I76TEVJC.js");
4030
4031
  await runInit(process.argv.slice(2));
4031
4032
  process.exit(0);
4032
4033
  }
@@ -4126,6 +4127,11 @@ async function main() {
4126
4127
  const mcpServer = createMcpServer();
4127
4128
  await mcpServer.connect(transport);
4128
4129
  console.error("[MCP] Crawlio Browser MCP server running (stdio)");
4130
+ process.stdin.on("end", async () => {
4131
+ console.error("[MCP] stdin closed \u2014 client disconnected, shutting down");
4132
+ await bridge.stop();
4133
+ process.exit(0);
4134
+ });
4129
4135
  }
4130
4136
  }
4131
4137
  var ALLOWED_ORIGINS = [
@@ -4218,13 +4224,19 @@ main().catch((e) => {
4218
4224
  console.error("[MCP] Fatal:", e);
4219
4225
  process.exit(1);
4220
4226
  });
4227
+ process.stdout.on("error", (err) => {
4228
+ if (err.code === "EPIPE") return;
4229
+ console.error("[MCP] stdout error:", err.message);
4230
+ });
4231
+ process.stderr.on("error", () => {
4232
+ });
4221
4233
  process.on("uncaughtException", (err) => {
4234
+ if (err.code === "EPIPE") return;
4222
4235
  console.error("[MCP] CRASH \u2014 uncaughtException:", err.stack ?? err.message);
4223
4236
  process.exit(1);
4224
4237
  });
4225
4238
  process.on("unhandledRejection", (reason) => {
4226
- console.error("[MCP] CRASH \u2014 unhandledRejection:", reason instanceof Error ? reason.stack ?? reason.message : reason);
4227
- process.exit(1);
4239
+ console.error("[MCP] unhandledRejection (non-fatal):", reason instanceof Error ? reason.message : reason);
4228
4240
  });
4229
4241
  for (const sig of ["SIGTERM", "SIGINT"]) {
4230
4242
  process.on(sig, async () => {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  PKG_VERSION
3
- } from "./chunk-ZFI2FHEC.js";
3
+ } from "./chunk-QZGTL4WX.js";
4
4
 
5
5
  // src/mcp-server/init.ts
6
6
  import { execFileSync, spawn } from "child_process";
@@ -76,14 +76,21 @@ function buildAddMcpArgs(options) {
76
76
  }
77
77
  function buildStdioEntry(options) {
78
78
  if (platform() === "darwin") {
79
- const serverPath = getServerEntryPath();
80
- const wrapperPath = createAppWrapper(serverPath);
79
+ const serverPath2 = getServerEntryPath();
80
+ const wrapperPath = createAppWrapper(serverPath2);
81
81
  if (wrapperPath) {
82
82
  const args2 = [];
83
83
  if (options?.full) args2.push("--full");
84
84
  return { command: wrapperPath, args: args2 };
85
85
  }
86
86
  }
87
+ const serverPath = getServerEntryPath();
88
+ if (existsSync(serverPath)) {
89
+ const nodePath = resolveNodePath();
90
+ const args2 = [serverPath];
91
+ if (options?.full) args2.push("--full");
92
+ return { command: nodePath, args: args2 };
93
+ }
87
94
  const args = ["-y", `crawlio-browser@${PKG_VERSION}`];
88
95
  if (options?.full) args.push("--full");
89
96
  return { command: "npx", args };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "crawlio-browser",
3
- "version": "1.4.2",
3
+ "version": "1.4.4",
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",