vite-plugin-aipanel 1.3.12 → 1.3.13

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.
@@ -48,18 +48,38 @@ function isPageAllowed(url, origins, includeExtensions) {
48
48
  if (origins.some((entry) => isOriginEntryMatch(url, entry))) return true;
49
49
  return includeExtensions && url.startsWith("chrome-extension://");
50
50
  }
51
+ function splitTitleAndUrl(content) {
52
+ if (!content.endsWith(")")) return null;
53
+ let depth = 0;
54
+ for (let i = content.length - 1; i >= 0; i--) {
55
+ const ch = content[i];
56
+ if (ch === ")") depth++;
57
+ else if (ch === "(") {
58
+ depth--;
59
+ if (depth === 0) {
60
+ const url = content.slice(i + 1, -1);
61
+ if (!url || /\s/.test(url)) return null;
62
+ return { title: content.slice(0, i).trim(), url };
63
+ }
64
+ }
65
+ }
66
+ return null;
67
+ }
51
68
  function parseListPages(text) {
52
69
  const pages = [];
53
- for (const line of text.split("\n")) {
54
- const match = line.match(/^(\d+):\s*(.+?)\s*\((\S+)\)/);
55
- if (match) {
56
- pages.push({
57
- pageId: parseInt(match[1], 10),
58
- title: match[2].replace(/\s*\.{3}$/, "").trim(),
59
- url: match[3],
60
- selected: /\[selected\]/i.test(line)
61
- });
62
- }
70
+ for (const rawLine of text.split("\n")) {
71
+ const line = rawLine.trimEnd();
72
+ const selected = /\[selected\]/i.test(line);
73
+ const match = line.replace(/\s*\[selected\]$/i, "").match(/^(\d+):\s*(.*)$/);
74
+ if (!match) continue;
75
+ const parsed = splitTitleAndUrl(match[2]);
76
+ if (!parsed) continue;
77
+ pages.push({
78
+ pageId: parseInt(match[1], 10),
79
+ title: parsed.title.replace(/\s*\.{3}$/, "").trim(),
80
+ url: parsed.url,
81
+ selected
82
+ });
63
83
  }
64
84
  return pages;
65
85
  }
@@ -1,4 +1,5 @@
1
1
  const OFFICIAL_TOOL_META = [
2
+ { name: "analyze_heapsnapshot_contexts", category: "MEMORY", readOnlyHint: true, pageScoped: false, conditions: ["memoryDebugging"] },
2
3
  { name: "click", category: "INPUT", readOnlyHint: false, pageScoped: true, conditions: [] },
3
4
  { name: "click_at", category: "INPUT", readOnlyHint: false, pageScoped: true, conditions: ["experimentalVision"] },
4
5
  { name: "close_heapsnapshot", category: "MEMORY", readOnlyHint: false, pageScoped: false, conditions: ["memoryDebugging"] },
@@ -12,6 +13,8 @@ const OFFICIAL_TOOL_META = [
12
13
  { name: "fill", category: "INPUT", readOnlyHint: false, pageScoped: true, conditions: [] },
13
14
  { name: "fill_form", category: "INPUT", readOnlyHint: false, pageScoped: true, conditions: [] },
14
15
  { name: "get_console_message", category: "DEBUGGING", readOnlyHint: true, pageScoped: true, conditions: [] },
16
+ { name: "get_css_styles", category: "DEBUGGING", readOnlyHint: true, pageScoped: true, conditions: [] },
17
+ { name: "get_devtools_comments", category: "DEBUGGING", readOnlyHint: true, pageScoped: true, conditions: ["devtoolsComments"] },
15
18
  { name: "get_heapsnapshot_class_nodes", category: "MEMORY", readOnlyHint: true, pageScoped: false, conditions: ["memoryDebugging"] },
16
19
  { name: "get_heapsnapshot_details", category: "MEMORY", readOnlyHint: true, pageScoped: false, conditions: ["memoryDebugging"] },
17
20
  { name: "get_heapsnapshot_dominators", category: "MEMORY", readOnlyHint: true, pageScoped: false, conditions: ["memoryDebugging"] },
@@ -37,6 +40,7 @@ const OFFICIAL_TOOL_META = [
37
40
  { name: "list_webmcp_tools", category: "WEBMCP", readOnlyHint: true, pageScoped: true, conditions: [] },
38
41
  { name: "navigate_page", category: "NAVIGATION", readOnlyHint: false, pageScoped: true, conditions: [] },
39
42
  { name: "new_page", category: "NAVIGATION", readOnlyHint: false, pageScoped: false, conditions: [] },
43
+ { name: "open_devtools", category: "DEBUGGING", readOnlyHint: true, pageScoped: true, conditions: ["devtoolsComments"] },
40
44
  { name: "performance_analyze_insight", category: "PERFORMANCE", readOnlyHint: true, pageScoped: true, conditions: [] },
41
45
  { name: "performance_start_trace", category: "PERFORMANCE", readOnlyHint: false, pageScoped: true, conditions: [] },
42
46
  { name: "performance_stop_trace", category: "PERFORMANCE", readOnlyHint: false, pageScoped: true, conditions: [] },
@@ -44,8 +48,10 @@ const OFFICIAL_TOOL_META = [
44
48
  { name: "query_heapsnapshot_objects", category: "MEMORY", readOnlyHint: true, pageScoped: false, conditions: ["memoryDebugging"] },
45
49
  { name: "reload_extension", category: "EXTENSIONS", readOnlyHint: false, pageScoped: false, conditions: [] },
46
50
  { name: "resize_page", category: "EMULATION", readOnlyHint: false, pageScoped: true, conditions: [] },
47
- { name: "screencast_start", category: "DEBUGGING", readOnlyHint: false, pageScoped: true, conditions: ["experimentalScreencast"] },
48
- { name: "screencast_stop", category: "DEBUGGING", readOnlyHint: false, pageScoped: true, conditions: ["experimentalScreencast"] },
51
+ { name: "resolve_devtools_comment", category: "DEBUGGING", readOnlyHint: false, pageScoped: true, conditions: ["devtoolsComments"] },
52
+ { name: "reveal_in_devtools", category: "DEBUGGING", readOnlyHint: true, pageScoped: true, conditions: ["devtoolsComments"] },
53
+ { name: "screencast_start", category: "DEBUGGING", readOnlyHint: false, pageScoped: true, conditions: [] },
54
+ { name: "screencast_stop", category: "DEBUGGING", readOnlyHint: false, pageScoped: true, conditions: [] },
49
55
  { name: "select_page", category: "NAVIGATION", readOnlyHint: true, pageScoped: false, conditions: [] },
50
56
  { name: "take_heapsnapshot", category: "MEMORY", readOnlyHint: false, pageScoped: true, conditions: [] },
51
57
  { name: "take_screenshot", category: "DEBUGGING", readOnlyHint: false, pageScoped: true, conditions: [] },
@@ -87,18 +87,38 @@ function isPageAllowed(url, origins, includeExtensions) {
87
87
  if (origins.some((entry) => isOriginEntryMatch(url, entry))) return true;
88
88
  return includeExtensions && url.startsWith("chrome-extension://");
89
89
  }
90
+ function splitTitleAndUrl(content) {
91
+ if (!content.endsWith(")")) return null;
92
+ let depth = 0;
93
+ for (let i = content.length - 1; i >= 0; i--) {
94
+ const ch = content[i];
95
+ if (ch === ")") depth++;
96
+ else if (ch === "(") {
97
+ depth--;
98
+ if (depth === 0) {
99
+ const url = content.slice(i + 1, -1);
100
+ if (!url || /\s/.test(url)) return null;
101
+ return { title: content.slice(0, i).trim(), url };
102
+ }
103
+ }
104
+ }
105
+ return null;
106
+ }
90
107
  function parseListPages(text) {
91
108
  const pages = [];
92
- for (const line of text.split("\n")) {
93
- const match = line.match(/^(\d+):\s*(.+?)\s*\((\S+)\)/);
94
- if (match) {
95
- pages.push({
96
- pageId: parseInt(match[1], 10),
97
- title: match[2].replace(/\s*\.{3}$/, "").trim(),
98
- url: match[3],
99
- selected: /\[selected\]/i.test(line)
100
- });
101
- }
109
+ for (const rawLine of text.split("\n")) {
110
+ const line = rawLine.trimEnd();
111
+ const selected = /\[selected\]/i.test(line);
112
+ const match = line.replace(/\s*\[selected\]$/i, "").match(/^(\d+):\s*(.*)$/);
113
+ if (!match) continue;
114
+ const parsed = splitTitleAndUrl(match[2]);
115
+ if (!parsed) continue;
116
+ pages.push({
117
+ pageId: parseInt(match[1], 10),
118
+ title: parsed.title.replace(/\s*\.{3}$/, "").trim(),
119
+ url: parsed.url,
120
+ selected
121
+ });
102
122
  }
103
123
  return pages;
104
124
  }
@@ -21,6 +21,7 @@ __export(official_meta_exports, {
21
21
  });
22
22
  module.exports = __toCommonJS(official_meta_exports);
23
23
  const OFFICIAL_TOOL_META = [
24
+ { name: "analyze_heapsnapshot_contexts", category: "MEMORY", readOnlyHint: true, pageScoped: false, conditions: ["memoryDebugging"] },
24
25
  { name: "click", category: "INPUT", readOnlyHint: false, pageScoped: true, conditions: [] },
25
26
  { name: "click_at", category: "INPUT", readOnlyHint: false, pageScoped: true, conditions: ["experimentalVision"] },
26
27
  { name: "close_heapsnapshot", category: "MEMORY", readOnlyHint: false, pageScoped: false, conditions: ["memoryDebugging"] },
@@ -34,6 +35,8 @@ const OFFICIAL_TOOL_META = [
34
35
  { name: "fill", category: "INPUT", readOnlyHint: false, pageScoped: true, conditions: [] },
35
36
  { name: "fill_form", category: "INPUT", readOnlyHint: false, pageScoped: true, conditions: [] },
36
37
  { name: "get_console_message", category: "DEBUGGING", readOnlyHint: true, pageScoped: true, conditions: [] },
38
+ { name: "get_css_styles", category: "DEBUGGING", readOnlyHint: true, pageScoped: true, conditions: [] },
39
+ { name: "get_devtools_comments", category: "DEBUGGING", readOnlyHint: true, pageScoped: true, conditions: ["devtoolsComments"] },
37
40
  { name: "get_heapsnapshot_class_nodes", category: "MEMORY", readOnlyHint: true, pageScoped: false, conditions: ["memoryDebugging"] },
38
41
  { name: "get_heapsnapshot_details", category: "MEMORY", readOnlyHint: true, pageScoped: false, conditions: ["memoryDebugging"] },
39
42
  { name: "get_heapsnapshot_dominators", category: "MEMORY", readOnlyHint: true, pageScoped: false, conditions: ["memoryDebugging"] },
@@ -59,6 +62,7 @@ const OFFICIAL_TOOL_META = [
59
62
  { name: "list_webmcp_tools", category: "WEBMCP", readOnlyHint: true, pageScoped: true, conditions: [] },
60
63
  { name: "navigate_page", category: "NAVIGATION", readOnlyHint: false, pageScoped: true, conditions: [] },
61
64
  { name: "new_page", category: "NAVIGATION", readOnlyHint: false, pageScoped: false, conditions: [] },
65
+ { name: "open_devtools", category: "DEBUGGING", readOnlyHint: true, pageScoped: true, conditions: ["devtoolsComments"] },
62
66
  { name: "performance_analyze_insight", category: "PERFORMANCE", readOnlyHint: true, pageScoped: true, conditions: [] },
63
67
  { name: "performance_start_trace", category: "PERFORMANCE", readOnlyHint: false, pageScoped: true, conditions: [] },
64
68
  { name: "performance_stop_trace", category: "PERFORMANCE", readOnlyHint: false, pageScoped: true, conditions: [] },
@@ -66,8 +70,10 @@ const OFFICIAL_TOOL_META = [
66
70
  { name: "query_heapsnapshot_objects", category: "MEMORY", readOnlyHint: true, pageScoped: false, conditions: ["memoryDebugging"] },
67
71
  { name: "reload_extension", category: "EXTENSIONS", readOnlyHint: false, pageScoped: false, conditions: [] },
68
72
  { name: "resize_page", category: "EMULATION", readOnlyHint: false, pageScoped: true, conditions: [] },
69
- { name: "screencast_start", category: "DEBUGGING", readOnlyHint: false, pageScoped: true, conditions: ["experimentalScreencast"] },
70
- { name: "screencast_stop", category: "DEBUGGING", readOnlyHint: false, pageScoped: true, conditions: ["experimentalScreencast"] },
73
+ { name: "resolve_devtools_comment", category: "DEBUGGING", readOnlyHint: false, pageScoped: true, conditions: ["devtoolsComments"] },
74
+ { name: "reveal_in_devtools", category: "DEBUGGING", readOnlyHint: true, pageScoped: true, conditions: ["devtoolsComments"] },
75
+ { name: "screencast_start", category: "DEBUGGING", readOnlyHint: false, pageScoped: true, conditions: [] },
76
+ { name: "screencast_stop", category: "DEBUGGING", readOnlyHint: false, pageScoped: true, conditions: [] },
71
77
  { name: "select_page", category: "NAVIGATION", readOnlyHint: true, pageScoped: false, conditions: [] },
72
78
  { name: "take_heapsnapshot", category: "MEMORY", readOnlyHint: false, pageScoped: true, conditions: [] },
73
79
  { name: "take_screenshot", category: "DEBUGGING", readOnlyHint: false, pageScoped: true, conditions: [] },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-aipanel",
3
- "version": "1.3.12",
3
+ "version": "1.3.13",
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",
@@ -35,19 +35,19 @@
35
35
  "author": "",
36
36
  "license": "MIT",
37
37
  "dependencies": {
38
- "@aipanel/core": "1.3.12",
39
- "@aipanel/provider-opencode": "1.3.12",
38
+ "@aipanel/core": "1.3.13",
39
+ "@aipanel/provider-opencode": "1.3.13",
40
40
  "@code-inspector/core": "^2.0.9",
41
41
  "@vue/devtools-kit": "^8.0.0",
42
42
  "@vue/language-server": "^3.3.7",
43
- "chrome-devtools-mcp": "^1.9.0",
43
+ "chrome-devtools-mcp": "1.12.0",
44
44
  "execa": "^9.6.1",
45
45
  "picomatch": "^4.0.2",
46
46
  "typescript-language-server": "^5.3.0",
47
47
  "unplugin-vue-inspector": "^3.0.0"
48
48
  },
49
49
  "peerDependencies": {
50
- "@aipanel/provider-deepseek": "1.3.12",
50
+ "@aipanel/provider-deepseek": "1.3.13",
51
51
  "vite": ">=5.0.0"
52
52
  },
53
53
  "peerDependenciesMeta": {
@@ -56,7 +56,7 @@
56
56
  }
57
57
  },
58
58
  "devDependencies": {
59
- "@aipanel/client": "1.3.12",
59
+ "@aipanel/client": "1.3.13",
60
60
  "@types/picomatch": "^4.0.0",
61
61
  "sharp": "^0.34.5"
62
62
  },