vite-plugin-aipanel 1.2.2 → 1.2.3

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.
@@ -54,7 +54,10 @@ class McpProxy {
54
54
  __privateSet(this, _args, options.args ?? [
55
55
  "--auto-connect",
56
56
  "--no-usage-statistics",
57
- "--no-performance-crux"
57
+ "--no-performance-crux",
58
+ // chrome-devtools-mcp >=1.8.0 的 pageIdRouting 按 pageId 路由页面级工具,默认开启。
59
+ // 显式声明强制开启,代理层校验 pageId 后原样转发,由底层工具按 pageId 路由目标页面。
60
+ "--page-id-routing"
58
61
  ]);
59
62
  __privateSet(this, _idleTimeout, options.idleTimeout ?? 0);
60
63
  this.sessionId = crypto.randomUUID();
@@ -342,14 +342,11 @@ async function handleDevTool(res, id, mcp, mapped, args, projectOrigins, toolNam
342
342
  }
343
343
  }
344
344
  }
345
- await mcp.callChromeDevTool("select_page", { pageId, bringToFront: false });
346
- const forwardArgs = { ...args };
347
- delete forwardArgs["pageId"];
348
345
  const forwardBody = JSON.stringify({
349
346
  jsonrpc: "2.0",
350
347
  id,
351
348
  method: "tools/call",
352
- params: { name: mapped, arguments: forwardArgs }
349
+ params: { name: mapped, arguments: args }
353
350
  });
354
351
  const responseText = await mcp.forward(forwardBody);
355
352
  log.debug("MCP response", { mapped, response: responseText.substring(0, 100) });
@@ -85,7 +85,10 @@ class McpProxy {
85
85
  __privateSet(this, _args, options.args ?? [
86
86
  "--auto-connect",
87
87
  "--no-usage-statistics",
88
- "--no-performance-crux"
88
+ "--no-performance-crux",
89
+ // chrome-devtools-mcp >=1.8.0 的 pageIdRouting 按 pageId 路由页面级工具,默认开启。
90
+ // 显式声明强制开启,代理层校验 pageId 后原样转发,由底层工具按 pageId 路由目标页面。
91
+ "--page-id-routing"
89
92
  ]);
90
93
  __privateSet(this, _idleTimeout, options.idleTimeout ?? 0);
91
94
  this.sessionId = import_node_crypto.default.randomUUID();
@@ -355,14 +355,11 @@ async function handleDevTool(res, id, mcp, mapped, args, projectOrigins, toolNam
355
355
  }
356
356
  }
357
357
  }
358
- await mcp.callChromeDevTool("select_page", { pageId, bringToFront: false });
359
- const forwardArgs = { ...args };
360
- delete forwardArgs["pageId"];
361
358
  const forwardBody = JSON.stringify({
362
359
  jsonrpc: "2.0",
363
360
  id,
364
361
  method: "tools/call",
365
- params: { name: mapped, arguments: forwardArgs }
362
+ params: { name: mapped, arguments: args }
366
363
  });
367
364
  const responseText = await mcp.forward(forwardBody);
368
365
  log.debug("MCP response", { mapped, response: responseText.substring(0, 100) });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-aipanel",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "Embed OpenCode Web UI in your Vite dev server for real-time code modification and preview",
5
5
  "type": "module",
6
6
  "main": "lib/index.cjs",
@@ -41,12 +41,12 @@
41
41
  "execa": "^9.6.1",
42
42
  "typescript-language-server": "^5.3.0",
43
43
  "unplugin-vue-inspector": "^3.0.0",
44
- "@aipanel/provider-opencode": "1.2.2",
45
- "@aipanel/core": "1.2.2"
44
+ "@aipanel/provider-opencode": "1.2.3",
45
+ "@aipanel/core": "1.2.3"
46
46
  },
47
47
  "peerDependencies": {
48
48
  "vite": ">=5.0.0",
49
- "@aipanel/provider-deepseek": "1.2.2"
49
+ "@aipanel/provider-deepseek": "1.2.3"
50
50
  },
51
51
  "peerDependenciesMeta": {
52
52
  "@aipanel/provider-deepseek": {
@@ -55,7 +55,7 @@
55
55
  },
56
56
  "devDependencies": {
57
57
  "sharp": "^0.34.5",
58
- "@aipanel/client": "1.2.2"
58
+ "@aipanel/client": "1.2.3"
59
59
  },
60
60
  "scripts": {
61
61
  "build": "pagoda-cli build && vite build -c vite.client.config.ts",