@midscene/web 1.7.5-beta-20260420052829.0 → 1.7.5-beta-20260420065618.0

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.
@@ -23,7 +23,7 @@ class BridgeClient {
23
23
  ]
24
24
  } : {},
25
25
  query: {
26
- version: "1.7.5-beta-20260420052829.0"
26
+ version: "1.7.5-beta-20260420065618.0"
27
27
  }
28
28
  });
29
29
  const timeout = setTimeout(()=>{
@@ -86,7 +86,7 @@ class BridgeServer {
86
86
  logMsg('one client connected');
87
87
  this.socket = socket;
88
88
  const clientVersion = socket.handshake.query.version;
89
- logMsg(`Bridge connected, cli-side version v1.7.5-beta-20260420052829.0, browser-side version v${clientVersion}`);
89
+ logMsg(`Bridge connected, cli-side version v1.7.5-beta-20260420065618.0, browser-side version v${clientVersion}`);
90
90
  socket.on(BridgeEvent.CallResponse, (params)=>{
91
91
  const id = params.id;
92
92
  const response = params.response;
@@ -110,7 +110,7 @@ class BridgeServer {
110
110
  setTimeout(()=>{
111
111
  this.onConnect?.();
112
112
  const payload = {
113
- version: "1.7.5-beta-20260420052829.0"
113
+ version: "1.7.5-beta-20260420065618.0"
114
114
  };
115
115
  socket.emit(BridgeEvent.Connected, payload);
116
116
  Promise.resolve().then(()=>{
@@ -65,7 +65,7 @@ class ExtensionBridgePageBrowserSide extends page {
65
65
  throw new Error('Connection denied by user');
66
66
  }
67
67
  }
68
- this.onLogMessage(`Bridge connected, cli-side version v${this.bridgeClient.serverVersion}, browser-side version v1.7.5-beta-20260420052829.0`, 'log');
68
+ this.onLogMessage(`Bridge connected, cli-side version v${this.bridgeClient.serverVersion}, browser-side version v1.7.5-beta-20260420065618.0`, 'log');
69
69
  }
70
70
  async connect() {
71
71
  return await this.setupBridgeClient();
package/dist/es/cli.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { existsSync } from "node:fs";
2
2
  import { join } from "node:path";
3
3
  import { createReportCliCommands } from "@midscene/core";
4
- import { CLIError, runToolsCLI } from "@midscene/shared/cli";
4
+ import { reportCLIError, runToolsCLI } from "@midscene/shared/cli";
5
5
  import dotenv from "dotenv";
6
6
  import { WebMidsceneTools } from "./mcp-tools.mjs";
7
7
  import { WebCdpMidsceneTools } from "./mcp-tools-cdp.mjs";
@@ -40,11 +40,10 @@ tools = isBridge ? new WebMidsceneTools() : isCdp ? new WebCdpMidsceneTools(cdpE
40
40
  runToolsCLI(tools, 'midscene-web', {
41
41
  stripPrefix: 'web_',
42
42
  argv,
43
- version: "1.7.5-beta-20260420052829.0",
43
+ version: "1.7.5-beta-20260420065618.0",
44
44
  extraCommands: createReportCliCommands()
45
45
  }).catch((e)=>{
46
- if (!(e instanceof CLIError)) console.error(e);
47
- process.exit(e instanceof CLIError ? e.exitCode : 1);
46
+ process.exit(reportCLIError(e));
48
47
  });
49
48
 
50
49
  //# sourceMappingURL=cli.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"cli.mjs","sources":["../../src/cli.ts"],"sourcesContent":["import { existsSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { createReportCliCommands } from '@midscene/core';\nimport { CLIError, runToolsCLI } from '@midscene/shared/cli';\nimport dotenv from 'dotenv';\nimport { WebMidsceneTools } from './mcp-tools';\nimport { WebCdpMidsceneTools } from './mcp-tools-cdp';\nimport { WebPuppeteerMidsceneTools } from './mcp-tools-puppeteer';\n\n// Load .env early so MIDSCENE_CDP_ENDPOINT is available during arg parsing\nconst envFile = join(process.cwd(), '.env');\nif (existsSync(envFile)) {\n dotenv.config({ path: envFile });\n}\n\ndeclare const __VERSION__: string;\nconst isBridge = process.argv.includes('--bridge');\nconst cdpIdx = process.argv.indexOf('--cdp');\nconst isCdp = cdpIdx !== -1;\n\n// Fail-fast: mutually exclusive flags\nif (isBridge && isCdp) {\n console.error(\n '--bridge and --cdp are mutually exclusive. Please specify only one.',\n );\n process.exit(1);\n}\n\n// Parse --cdp endpoint value\nlet cdpEndpoint: string | undefined;\nif (isCdp) {\n const next = process.argv[cdpIdx + 1];\n if (next && !next.startsWith('-')) {\n cdpEndpoint = next;\n }\n if (!cdpEndpoint) {\n cdpEndpoint = process.env.MIDSCENE_CDP_ENDPOINT;\n }\n if (!cdpEndpoint) {\n console.error(\n 'CDP endpoint is required. Provide it as: --cdp <ws-endpoint> or set MIDSCENE_CDP_ENDPOINT environment variable.',\n );\n process.exit(1);\n }\n}\n\n// Filter out --bridge, --cdp, and cdp endpoint from argv using absolute indices\nconst bridgeIdx = process.argv.indexOf('--bridge');\nconst cdpValueIdx =\n cdpIdx !== -1 &&\n cdpIdx + 1 < process.argv.length &&\n !process.argv[cdpIdx + 1].startsWith('-')\n ? cdpIdx + 1\n : -1;\nconst skipIndices = new Set(\n [bridgeIdx, cdpIdx, cdpValueIdx].filter((i) => i !== -1),\n);\nconst argv = process.argv\n .slice(2)\n .filter((_, idx) => !skipIndices.has(idx + 2));\n\nlet tools: WebMidsceneTools | WebPuppeteerMidsceneTools | WebCdpMidsceneTools;\nif (isBridge) {\n tools = new WebMidsceneTools();\n} else if (isCdp) {\n tools = new WebCdpMidsceneTools(cdpEndpoint!);\n} else {\n tools = new WebPuppeteerMidsceneTools();\n}\n\nrunToolsCLI(tools, 'midscene-web', {\n stripPrefix: 'web_',\n argv,\n version: __VERSION__,\n extraCommands: createReportCliCommands(),\n}).catch((e) => {\n if (!(e instanceof CLIError)) console.error(e);\n process.exit(e instanceof CLIError ? e.exitCode : 1);\n});\n"],"names":["envFile","join","process","existsSync","dotenv","isBridge","cdpIdx","isCdp","console","cdpEndpoint","next","bridgeIdx","cdpValueIdx","skipIndices","Set","i","argv","_","idx","tools","WebMidsceneTools","WebCdpMidsceneTools","WebPuppeteerMidsceneTools","runToolsCLI","__VERSION__","createReportCliCommands","e","CLIError"],"mappings":";;;;;;;;AAUA,MAAMA,UAAUC,KAAKC,QAAQ,GAAG,IAAI;AACpC,IAAIC,WAAWH,UACbI,OAAO,MAAM,CAAC;IAAE,MAAMJ;AAAQ;AAIhC,MAAM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AAQ,GAAG;AACpD"}
1
+ {"version":3,"file":"cli.mjs","sources":["../../src/cli.ts"],"sourcesContent":["import { existsSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { createReportCliCommands } from '@midscene/core';\nimport { reportCLIError, runToolsCLI } from '@midscene/shared/cli';\nimport dotenv from 'dotenv';\nimport { WebMidsceneTools } from './mcp-tools';\nimport { WebCdpMidsceneTools } from './mcp-tools-cdp';\nimport { WebPuppeteerMidsceneTools } from './mcp-tools-puppeteer';\n\n// Load .env early so MIDSCENE_CDP_ENDPOINT is available during arg parsing\nconst envFile = join(process.cwd(), '.env');\nif (existsSync(envFile)) {\n dotenv.config({ path: envFile });\n}\n\ndeclare const __VERSION__: string;\nconst isBridge = process.argv.includes('--bridge');\nconst cdpIdx = process.argv.indexOf('--cdp');\nconst isCdp = cdpIdx !== -1;\n\n// Fail-fast: mutually exclusive flags\nif (isBridge && isCdp) {\n console.error(\n '--bridge and --cdp are mutually exclusive. Please specify only one.',\n );\n process.exit(1);\n}\n\n// Parse --cdp endpoint value\nlet cdpEndpoint: string | undefined;\nif (isCdp) {\n const next = process.argv[cdpIdx + 1];\n if (next && !next.startsWith('-')) {\n cdpEndpoint = next;\n }\n if (!cdpEndpoint) {\n cdpEndpoint = process.env.MIDSCENE_CDP_ENDPOINT;\n }\n if (!cdpEndpoint) {\n console.error(\n 'CDP endpoint is required. Provide it as: --cdp <ws-endpoint> or set MIDSCENE_CDP_ENDPOINT environment variable.',\n );\n process.exit(1);\n }\n}\n\n// Filter out --bridge, --cdp, and cdp endpoint from argv using absolute indices\nconst bridgeIdx = process.argv.indexOf('--bridge');\nconst cdpValueIdx =\n cdpIdx !== -1 &&\n cdpIdx + 1 < process.argv.length &&\n !process.argv[cdpIdx + 1].startsWith('-')\n ? cdpIdx + 1\n : -1;\nconst skipIndices = new Set(\n [bridgeIdx, cdpIdx, cdpValueIdx].filter((i) => i !== -1),\n);\nconst argv = process.argv\n .slice(2)\n .filter((_, idx) => !skipIndices.has(idx + 2));\n\nlet tools: WebMidsceneTools | WebPuppeteerMidsceneTools | WebCdpMidsceneTools;\nif (isBridge) {\n tools = new WebMidsceneTools();\n} else if (isCdp) {\n tools = new WebCdpMidsceneTools(cdpEndpoint!);\n} else {\n tools = new WebPuppeteerMidsceneTools();\n}\n\nrunToolsCLI(tools, 'midscene-web', {\n stripPrefix: 'web_',\n argv,\n version: __VERSION__,\n extraCommands: createReportCliCommands(),\n}).catch((e) => {\n process.exit(reportCLIError(e));\n});\n"],"names":["envFile","join","process","existsSync","dotenv","isBridge","cdpIdx","isCdp","console","cdpEndpoint","next","bridgeIdx","cdpValueIdx","skipIndices","Set","i","argv","_","idx","tools","WebMidsceneTools","WebCdpMidsceneTools","WebPuppeteerMidsceneTools","runToolsCLI","__VERSION__","createReportCliCommands","e","reportCLIError"],"mappings":";;;;;;;;AAUA,MAAMA,UAAUC,KAAKC,QAAQ,GAAG,IAAI;AACpC,IAAIC,WAAWH,UACbI,OAAO,MAAM,CAAC;IAAE,MAAMJ;AAAQ;AAIhC,MAAMK,WAAWH,QAAQ,IAAI,CAAC,QAAQ,CAAC;AACvC,MAAMI,SAASJ,QAAQ,IAAI,CAAC,OAAO,CAAC;AACpC,MAAMK,QAAQD,AAAW,OAAXA;AAGd,IAAID,YAAYE,OAAO;IACrBC,QAAQ,KAAK,CACX;IAEFN,QAAQ,IAAI,CAAC;AACf;AAGA,IAAIO;AACJ,IAAIF,OAAO;IACT,MAAMG,OAAOR,QAAQ,IAAI,CAACI,SAAS,EAAE;IACrC,IAAII,QAAQ,CAACA,KAAK,UAAU,CAAC,MAC3BD,cAAcC;IAEhB,IAAI,CAACD,aACHA,cAAcP,QAAQ,GAAG,CAAC,qBAAqB;IAEjD,IAAI,CAACO,aAAa;QAChBD,QAAQ,KAAK,CACX;QAEFN,QAAQ,IAAI,CAAC;IACf;AACF;AAGA,MAAMS,YAAYT,QAAQ,IAAI,CAAC,OAAO,CAAC;AACvC,MAAMU,cACJN,AAAW,OAAXA,UACAA,SAAS,IAAIJ,QAAQ,IAAI,CAAC,MAAM,IAChC,CAACA,QAAQ,IAAI,CAACI,SAAS,EAAE,CAAC,UAAU,CAAC,OACjCA,SAAS,IACT;AACN,MAAMO,cAAc,IAAIC,IACtB;IAACH;IAAWL;IAAQM;CAAY,CAAC,MAAM,CAAC,CAACG,IAAMA,AAAM,OAANA;AAEjD,MAAMC,OAAOd,QAAQ,IAAI,CACtB,KAAK,CAAC,GACN,MAAM,CAAC,CAACe,GAAGC,MAAQ,CAACL,YAAY,GAAG,CAACK,MAAM;AAE7C,IAAIC;AAEFA,QADEd,WACM,IAAIe,qBACHb,QACD,IAAIc,oBAAoBZ,eAExB,IAAIa;AAGdC,YAAYJ,OAAO,gBAAgB;IACjC,aAAa;IACbH;IACA,SAASQ;IACT,eAAeC;AACjB,GAAG,KAAK,CAAC,CAACC;IACRxB,QAAQ,IAAI,CAACyB,eAAeD;AAC9B"}
@@ -7,7 +7,7 @@ class WebMCPServer extends BaseMCPServer {
7
7
  constructor(toolsManager){
8
8
  super({
9
9
  name: '@midscene/web-bridge-mcp',
10
- version: "1.7.5-beta-20260420052829.0",
10
+ version: "1.7.5-beta-20260420065618.0",
11
11
  description: 'Control the browser using natural language commands'
12
12
  }, toolsManager);
13
13
  }
@@ -51,7 +51,7 @@ class BridgeClient {
51
51
  ]
52
52
  } : {},
53
53
  query: {
54
- version: "1.7.5-beta-20260420052829.0"
54
+ version: "1.7.5-beta-20260420065618.0"
55
55
  }
56
56
  });
57
57
  const timeout = setTimeout(()=>{
@@ -115,7 +115,7 @@ class BridgeServer {
115
115
  (0, shared_utils_namespaceObject.logMsg)('one client connected');
116
116
  this.socket = socket;
117
117
  const clientVersion = socket.handshake.query.version;
118
- (0, shared_utils_namespaceObject.logMsg)(`Bridge connected, cli-side version v1.7.5-beta-20260420052829.0, browser-side version v${clientVersion}`);
118
+ (0, shared_utils_namespaceObject.logMsg)(`Bridge connected, cli-side version v1.7.5-beta-20260420065618.0, browser-side version v${clientVersion}`);
119
119
  socket.on(external_common_js_namespaceObject.BridgeEvent.CallResponse, (params)=>{
120
120
  const id = params.id;
121
121
  const response = params.response;
@@ -139,7 +139,7 @@ class BridgeServer {
139
139
  setTimeout(()=>{
140
140
  this.onConnect?.();
141
141
  const payload = {
142
- version: "1.7.5-beta-20260420052829.0"
142
+ version: "1.7.5-beta-20260420065618.0"
143
143
  };
144
144
  socket.emit(external_common_js_namespaceObject.BridgeEvent.Connected, payload);
145
145
  Promise.resolve().then(()=>{
@@ -103,7 +103,7 @@ class ExtensionBridgePageBrowserSide extends page_js_default() {
103
103
  throw new Error('Connection denied by user');
104
104
  }
105
105
  }
106
- this.onLogMessage(`Bridge connected, cli-side version v${this.bridgeClient.serverVersion}, browser-side version v1.7.5-beta-20260420052829.0`, 'log');
106
+ this.onLogMessage(`Bridge connected, cli-side version v${this.bridgeClient.serverVersion}, browser-side version v1.7.5-beta-20260420065618.0`, 'log');
107
107
  }
108
108
  async connect() {
109
109
  return await this.setupBridgeClient();
package/dist/lib/cli.js CHANGED
@@ -64,11 +64,10 @@ tools = isBridge ? new external_mcp_tools_js_namespaceObject.WebMidsceneTools()
64
64
  (0, cli_namespaceObject.runToolsCLI)(tools, 'midscene-web', {
65
65
  stripPrefix: 'web_',
66
66
  argv,
67
- version: "1.7.5-beta-20260420052829.0",
67
+ version: "1.7.5-beta-20260420065618.0",
68
68
  extraCommands: (0, core_namespaceObject.createReportCliCommands)()
69
69
  }).catch((e)=>{
70
- if (!(e instanceof cli_namespaceObject.CLIError)) console.error(e);
71
- process.exit(e instanceof cli_namespaceObject.CLIError ? e.exitCode : 1);
70
+ process.exit((0, cli_namespaceObject.reportCLIError)(e));
72
71
  });
73
72
  for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
74
73
  Object.defineProperty(exports, '__esModule', {
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sources":["webpack/runtime/compat_get_default_export","webpack/runtime/define_property_getters","webpack/runtime/has_own_property","../../src/cli.ts"],"sourcesContent":["// getDefaultExport function for compatibility with non-ESM modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};\n","__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","import { existsSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { createReportCliCommands } from '@midscene/core';\nimport { CLIError, runToolsCLI } from '@midscene/shared/cli';\nimport dotenv from 'dotenv';\nimport { WebMidsceneTools } from './mcp-tools';\nimport { WebCdpMidsceneTools } from './mcp-tools-cdp';\nimport { WebPuppeteerMidsceneTools } from './mcp-tools-puppeteer';\n\n// Load .env early so MIDSCENE_CDP_ENDPOINT is available during arg parsing\nconst envFile = join(process.cwd(), '.env');\nif (existsSync(envFile)) {\n dotenv.config({ path: envFile });\n}\n\ndeclare const __VERSION__: string;\nconst isBridge = process.argv.includes('--bridge');\nconst cdpIdx = process.argv.indexOf('--cdp');\nconst isCdp = cdpIdx !== -1;\n\n// Fail-fast: mutually exclusive flags\nif (isBridge && isCdp) {\n console.error(\n '--bridge and --cdp are mutually exclusive. Please specify only one.',\n );\n process.exit(1);\n}\n\n// Parse --cdp endpoint value\nlet cdpEndpoint: string | undefined;\nif (isCdp) {\n const next = process.argv[cdpIdx + 1];\n if (next && !next.startsWith('-')) {\n cdpEndpoint = next;\n }\n if (!cdpEndpoint) {\n cdpEndpoint = process.env.MIDSCENE_CDP_ENDPOINT;\n }\n if (!cdpEndpoint) {\n console.error(\n 'CDP endpoint is required. Provide it as: --cdp <ws-endpoint> or set MIDSCENE_CDP_ENDPOINT environment variable.',\n );\n process.exit(1);\n }\n}\n\n// Filter out --bridge, --cdp, and cdp endpoint from argv using absolute indices\nconst bridgeIdx = process.argv.indexOf('--bridge');\nconst cdpValueIdx =\n cdpIdx !== -1 &&\n cdpIdx + 1 < process.argv.length &&\n !process.argv[cdpIdx + 1].startsWith('-')\n ? cdpIdx + 1\n : -1;\nconst skipIndices = new Set(\n [bridgeIdx, cdpIdx, cdpValueIdx].filter((i) => i !== -1),\n);\nconst argv = process.argv\n .slice(2)\n .filter((_, idx) => !skipIndices.has(idx + 2));\n\nlet tools: WebMidsceneTools | WebPuppeteerMidsceneTools | WebCdpMidsceneTools;\nif (isBridge) {\n tools = new WebMidsceneTools();\n} else if (isCdp) {\n tools = new WebCdpMidsceneTools(cdpEndpoint!);\n} else {\n tools = new WebPuppeteerMidsceneTools();\n}\n\nrunToolsCLI(tools, 'midscene-web', {\n stripPrefix: 'web_',\n argv,\n version: __VERSION__,\n extraCommands: createReportCliCommands(),\n}).catch((e) => {\n if (!(e instanceof CLIError)) console.error(e);\n process.exit(e instanceof CLIError ? e.exitCode : 1);\n});\n"],"names":["__webpack_require__","module","getter","definition","key","Object","obj","prop","envFile","join","process","existsSync","dotenv","isBridge","cdpIdx","isCdp","console","cdpEndpoint","next","bridgeIdx","cdpValueIdx","skipIndices","Set","i","argv","_","idx","tools","WebMidsceneTools","WebCdpMidsceneTools","WebPuppeteerMidsceneTools","runToolsCLI","__VERSION__","createReportCliCommands","e","CLIError"],"mappings":";;;IACAA,oBAAoB,CAAC,GAAG,CAACC;QACxB,IAAIC,SAASD,UAAUA,OAAO,UAAU,GACvC,IAAOA,MAAM,CAAC,UAAU,GACxB,IAAOA;QACRD,oBAAoB,CAAC,CAACE,QAAQ;YAAE,GAAGA;QAAO;QAC1C,OAAOA;IACR;;;ICPAF,oBAAoB,CAAC,GAAG,CAAC,UAASG;QACjC,IAAI,IAAIC,OAAOD,WACR,IAAGH,oBAAoB,CAAC,CAACG,YAAYC,QAAQ,CAACJ,oBAAoB,CAAC,CAAC,UAASI,MACzEC,OAAO,cAAc,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AI,CACtB,KAAK,CAAC,GACN,MAAM,CAAC,CAACe,GAAGC,MAAQ,CAACL,YAAY,GAAG,CAACK,MAAM;AAE7C,IAAIC;AAEFA,QADEd,WACM,IAAIe,sCAAAA,gBAAgBA,KACnBb,QACD,IAAIc,0CAAAA,mBAAmBA,CAACZ,eAExB,IAAIa,gDAAAA,yBAAyBA;AAGvCC,IAAAA,oBAAAA,WAAAA,AAAAA,EAAYJ,OAAO,gBAAgB;IACjC,aAAa;IACbH;IACA,SAASQ;IACT,eAAeC,AAAAA,IAAAA,qBAAAA,uBAAAA,AAAAA;AACjB,GAAG,KAAK,CAAC,CAACC;IACR,IAAI,CAAEA,CAAAA,aAAaC,oBAAAA,QAAO,AAAPA,GAAWnB,QAAQ,KAAK,CAACkB;IAC5CxB,QAAQ,IAAI,CAACwB,aAAaC,oBAAAA,QAAQA,GAAGD,EAAE,QAAQ,GAAG;AACpD"}
1
+ {"version":3,"file":"cli.js","sources":["webpack/runtime/compat_get_default_export","webpack/runtime/define_property_getters","webpack/runtime/has_own_property","../../src/cli.ts"],"sourcesContent":["// getDefaultExport function for compatibility with non-ESM modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};\n","__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","import { existsSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { createReportCliCommands } from '@midscene/core';\nimport { reportCLIError, runToolsCLI } from '@midscene/shared/cli';\nimport dotenv from 'dotenv';\nimport { WebMidsceneTools } from './mcp-tools';\nimport { WebCdpMidsceneTools } from './mcp-tools-cdp';\nimport { WebPuppeteerMidsceneTools } from './mcp-tools-puppeteer';\n\n// Load .env early so MIDSCENE_CDP_ENDPOINT is available during arg parsing\nconst envFile = join(process.cwd(), '.env');\nif (existsSync(envFile)) {\n dotenv.config({ path: envFile });\n}\n\ndeclare const __VERSION__: string;\nconst isBridge = process.argv.includes('--bridge');\nconst cdpIdx = process.argv.indexOf('--cdp');\nconst isCdp = cdpIdx !== -1;\n\n// Fail-fast: mutually exclusive flags\nif (isBridge && isCdp) {\n console.error(\n '--bridge and --cdp are mutually exclusive. Please specify only one.',\n );\n process.exit(1);\n}\n\n// Parse --cdp endpoint value\nlet cdpEndpoint: string | undefined;\nif (isCdp) {\n const next = process.argv[cdpIdx + 1];\n if (next && !next.startsWith('-')) {\n cdpEndpoint = next;\n }\n if (!cdpEndpoint) {\n cdpEndpoint = process.env.MIDSCENE_CDP_ENDPOINT;\n }\n if (!cdpEndpoint) {\n console.error(\n 'CDP endpoint is required. Provide it as: --cdp <ws-endpoint> or set MIDSCENE_CDP_ENDPOINT environment variable.',\n );\n process.exit(1);\n }\n}\n\n// Filter out --bridge, --cdp, and cdp endpoint from argv using absolute indices\nconst bridgeIdx = process.argv.indexOf('--bridge');\nconst cdpValueIdx =\n cdpIdx !== -1 &&\n cdpIdx + 1 < process.argv.length &&\n !process.argv[cdpIdx + 1].startsWith('-')\n ? cdpIdx + 1\n : -1;\nconst skipIndices = new Set(\n [bridgeIdx, cdpIdx, cdpValueIdx].filter((i) => i !== -1),\n);\nconst argv = process.argv\n .slice(2)\n .filter((_, idx) => !skipIndices.has(idx + 2));\n\nlet tools: WebMidsceneTools | WebPuppeteerMidsceneTools | WebCdpMidsceneTools;\nif (isBridge) {\n tools = new WebMidsceneTools();\n} else if (isCdp) {\n tools = new WebCdpMidsceneTools(cdpEndpoint!);\n} else {\n tools = new WebPuppeteerMidsceneTools();\n}\n\nrunToolsCLI(tools, 'midscene-web', {\n stripPrefix: 'web_',\n argv,\n version: __VERSION__,\n extraCommands: createReportCliCommands(),\n}).catch((e) => {\n process.exit(reportCLIError(e));\n});\n"],"names":["__webpack_require__","module","getter","definition","key","Object","obj","prop","envFile","join","process","existsSync","dotenv","isBridge","cdpIdx","isCdp","console","cdpEndpoint","next","bridgeIdx","cdpValueIdx","skipIndices","Set","i","argv","_","idx","tools","WebMidsceneTools","WebCdpMidsceneTools","WebPuppeteerMidsceneTools","runToolsCLI","__VERSION__","createReportCliCommands","e","reportCLIError"],"mappings":";;;IACAA,oBAAoB,CAAC,GAAG,CAACC;QACxB,IAAIC,SAASD,UAAUA,OAAO,UAAU,GACvC,IAAOA,MAAM,CAAC,UAAU,GACxB,IAAOA;QACRD,oBAAoB,CAAC,CAACE,QAAQ;YAAE,GAAGA;QAAO;QAC1C,OAAOA;IACR;;;ICPAF,oBAAoB,CAAC,GAAG,CAAC,UAASG;QACjC,IAAI,IAAIC,OAAOD,WACR,IAAGH,oBAAoB,CAAC,CAACG,YAAYC,QAAQ,CAACJ,oBAAoB,CAAC,CAAC,UAASI,MACzEC,OAAO,cAAc,CAAC,UAASD,KAAK;YAAE,YAAY;YAAM,KAAKD,UAAU,CAACC,IAAI;QAAC;IAGzF;;;ICNAJ,oBAAoB,CAAC,GAAG,CAACM,KAAKC,OAAUF,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAACC,KAAKC;;;;;;;;;;;;ACUlF,MAAMC,UAAUC,AAAAA,IAAAA,mCAAAA,IAAAA,AAAAA,EAAKC,QAAQ,GAAG,IAAI;AACpC,IAAIC,AAAAA,IAAAA,iCAAAA,UAAAA,AAAAA,EAAWH,UACbI,0BAAAA,MAAa,CAAC;IAAE,MAAMJ;AAAQ;AAIhC,MAAMK,WAAWH,QAAQ,IAAI,CAAC,QAAQ,CAAC;AACvC,MAAMI,SAASJ,QAAQ,IAAI,CAAC,OAAO,CAAC;AACpC,MAAMK,QAAQD,AAAW,OAAXA;AAGd,IAAID,YAAYE,OAAO;IACrBC,QAAQ,KAAK,CACX;IAEFN,QAAQ,IAAI,CAAC;AACf;AAGA,IAAIO;AACJ,IAAIF,OAAO;IACT,MAAMG,OAAOR,QAAQ,IAAI,CAACI,SAAS,EAAE;IACrC,IAAII,QAAQ,CAACA,KAAK,UAAU,CAAC,MAC3BD,cAAcC;IAEhB,IAAI,CAACD,aACHA,cAAcP,QAAQ,GAAG,CAAC,qBAAqB;IAEjD,IAAI,CAACO,aAAa;QAChBD,QAAQ,KAAK,CACX;QAEFN,QAAQ,IAAI,CAAC;IACf;AACF;AAGA,MAAMS,YAAYT,QAAQ,IAAI,CAAC,OAAO,CAAC;AACvC,MAAMU,cACJN,AAAW,OAAXA,UACAA,SAAS,IAAIJ,QAAQ,IAAI,CAAC,MAAM,IAChC,CAACA,QAAQ,IAAI,CAACI,SAAS,EAAE,CAAC,UAAU,CAAC,OACjCA,SAAS,IACT;AACN,MAAMO,cAAc,IAAIC,IACtB;IAACH;IAAWL;IAAQM;CAAY,CAAC,MAAM,CAAC,CAACG,IAAMA,AAAM,OAANA;AAEjD,MAAMC,OAAOd,QAAQ,IAAI,CACtB,KAAK,CAAC,GACN,MAAM,CAAC,CAACe,GAAGC,MAAQ,CAACL,YAAY,GAAG,CAACK,MAAM;AAE7C,IAAIC;AAEFA,QADEd,WACM,IAAIe,sCAAAA,gBAAgBA,KACnBb,QACD,IAAIc,0CAAAA,mBAAmBA,CAACZ,eAExB,IAAIa,gDAAAA,yBAAyBA;AAGvCC,IAAAA,oBAAAA,WAAAA,AAAAA,EAAYJ,OAAO,gBAAgB;IACjC,aAAa;IACbH;IACA,SAASQ;IACT,eAAeC,AAAAA,IAAAA,qBAAAA,uBAAAA,AAAAA;AACjB,GAAG,KAAK,CAAC,CAACC;IACRxB,QAAQ,IAAI,CAACyB,AAAAA,IAAAA,oBAAAA,cAAAA,AAAAA,EAAeD;AAC9B"}
@@ -37,7 +37,7 @@ class WebMCPServer extends mcp_namespaceObject.BaseMCPServer {
37
37
  constructor(toolsManager){
38
38
  super({
39
39
  name: '@midscene/web-bridge-mcp',
40
- version: "1.7.5-beta-20260420052829.0",
40
+ version: "1.7.5-beta-20260420065618.0",
41
41
  description: 'Control the browser using natural language commands'
42
42
  }, toolsManager);
43
43
  }
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "Browser use",
9
9
  "Android use"
10
10
  ],
11
- "version": "1.7.5-beta-20260420052829.0",
11
+ "version": "1.7.5-beta-20260420065618.0",
12
12
  "repository": "https://github.com/web-infra-dev/midscene",
13
13
  "homepage": "https://midscenejs.com/",
14
14
  "main": "./dist/lib/index.js",
@@ -110,9 +110,9 @@
110
110
  "socket.io": "^4.8.1",
111
111
  "socket.io-client": "4.8.1",
112
112
  "ws": "^8.18.1",
113
- "@midscene/core": "1.7.5-beta-20260420052829.0",
114
- "@midscene/shared": "1.7.5-beta-20260420052829.0",
115
- "@midscene/playground": "1.7.5-beta-20260420052829.0"
113
+ "@midscene/playground": "1.7.5-beta-20260420065618.0",
114
+ "@midscene/core": "1.7.5-beta-20260420065618.0",
115
+ "@midscene/shared": "1.7.5-beta-20260420065618.0"
116
116
  },
117
117
  "devDependencies": {
118
118
  "@playwright/test": "^1.45.0",