@xiaou66/vite-plugin-vue-mcp-next 1.3.6 → 1.3.7

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.
@@ -803,6 +803,47 @@ interface ConsoleRecord {
803
803
  /** 记录时间戳,用于还原日志与网络请求、用户操作之间的先后关系。 */
804
804
  readonly timestamp: number;
805
805
  }
806
+ /**
807
+ * Runtime Console 参数 inspect 请求。
808
+ *
809
+ * 该请求只在 AI 明确需要查看对象内容时触发,预算参数用于限制页面主线程上的读取成本。
810
+ */
811
+ interface RuntimeConsoleArgInspectRequest {
812
+ /** 并发隔离事件名,服务端用它等待对应 runtime 回调;直接测试 registry 时可省略。 */
813
+ readonly event?: string;
814
+ /** 来自 ConsoleArgReference 的临时对象引用 ID。 */
815
+ readonly argId: string;
816
+ /** 最大递归深度,默认由 runtime 侧的序列化工具兜底。 */
817
+ readonly maxDepth?: number;
818
+ /** 单个对象最多读取的 key 数量。 */
819
+ readonly maxKeys?: number;
820
+ /** 单个数组最多读取的元素数量。 */
821
+ readonly maxArrayItems?: number;
822
+ /** 单个字符串最多保留的长度。 */
823
+ readonly maxStringLength?: number;
824
+ /** 单次 inspect 最多访问的对象或数组节点数量。 */
825
+ readonly maxTotalNodes?: number;
826
+ }
827
+ /**
828
+ * Runtime Console 参数 inspect 结果。
829
+ *
830
+ * 引用过期或页面刷新时返回结构化错误,避免 MCP 客户端把空结果误解为对象为空。
831
+ */
832
+ type RuntimeConsoleArgInspectResult = {
833
+ /** 表示 inspect 成功。 */
834
+ readonly ok: true;
835
+ /** 被读取的临时对象引用 ID。 */
836
+ readonly argId: string;
837
+ /** 有预算的对象快照,仍然不是原对象的无损拷贝。 */
838
+ readonly preview: unknown;
839
+ } | {
840
+ /** 表示引用不可用或读取失败。 */
841
+ readonly ok: false;
842
+ /** 被请求的临时对象引用 ID。 */
843
+ readonly argId: string;
844
+ /** 给 AI 展示的失败原因。 */
845
+ readonly error: string;
846
+ };
806
847
  /**
807
848
  * 页面网络请求的统一记录。
808
849
  *
@@ -946,6 +987,10 @@ interface VueRuntimeRpc {
946
987
  manageStorage(options: RuntimeStorageRequest): void | Promise<void>;
947
988
  /** 回传 Runtime 存储访问结果,使用事件名隔离并发 MCP 请求。 */
948
989
  onStorageUpdated(event: string, data: RuntimeStorageResult): void;
990
+ /** 按需读取 console 日志中的对象参数,避免日志采集阶段自动遍历复杂对象。 */
991
+ inspectConsoleArg(options: RuntimeConsoleArgInspectRequest): void | Promise<void>;
992
+ /** 回传 console 对象参数 inspect 结果。 */
993
+ onConsoleArgInspected(event: string, data: RuntimeConsoleArgInspectResult): void;
949
994
  /** 读取 Vue component inspector tree,用于 `get_component_tree` 工具。 */
950
995
  getInspectorTree(options: {
951
996
  event: string;
@@ -803,6 +803,47 @@ interface ConsoleRecord {
803
803
  /** 记录时间戳,用于还原日志与网络请求、用户操作之间的先后关系。 */
804
804
  readonly timestamp: number;
805
805
  }
806
+ /**
807
+ * Runtime Console 参数 inspect 请求。
808
+ *
809
+ * 该请求只在 AI 明确需要查看对象内容时触发,预算参数用于限制页面主线程上的读取成本。
810
+ */
811
+ interface RuntimeConsoleArgInspectRequest {
812
+ /** 并发隔离事件名,服务端用它等待对应 runtime 回调;直接测试 registry 时可省略。 */
813
+ readonly event?: string;
814
+ /** 来自 ConsoleArgReference 的临时对象引用 ID。 */
815
+ readonly argId: string;
816
+ /** 最大递归深度,默认由 runtime 侧的序列化工具兜底。 */
817
+ readonly maxDepth?: number;
818
+ /** 单个对象最多读取的 key 数量。 */
819
+ readonly maxKeys?: number;
820
+ /** 单个数组最多读取的元素数量。 */
821
+ readonly maxArrayItems?: number;
822
+ /** 单个字符串最多保留的长度。 */
823
+ readonly maxStringLength?: number;
824
+ /** 单次 inspect 最多访问的对象或数组节点数量。 */
825
+ readonly maxTotalNodes?: number;
826
+ }
827
+ /**
828
+ * Runtime Console 参数 inspect 结果。
829
+ *
830
+ * 引用过期或页面刷新时返回结构化错误,避免 MCP 客户端把空结果误解为对象为空。
831
+ */
832
+ type RuntimeConsoleArgInspectResult = {
833
+ /** 表示 inspect 成功。 */
834
+ readonly ok: true;
835
+ /** 被读取的临时对象引用 ID。 */
836
+ readonly argId: string;
837
+ /** 有预算的对象快照,仍然不是原对象的无损拷贝。 */
838
+ readonly preview: unknown;
839
+ } | {
840
+ /** 表示引用不可用或读取失败。 */
841
+ readonly ok: false;
842
+ /** 被请求的临时对象引用 ID。 */
843
+ readonly argId: string;
844
+ /** 给 AI 展示的失败原因。 */
845
+ readonly error: string;
846
+ };
806
847
  /**
807
848
  * 页面网络请求的统一记录。
808
849
  *
@@ -946,6 +987,10 @@ interface VueRuntimeRpc {
946
987
  manageStorage(options: RuntimeStorageRequest): void | Promise<void>;
947
988
  /** 回传 Runtime 存储访问结果,使用事件名隔离并发 MCP 请求。 */
948
989
  onStorageUpdated(event: string, data: RuntimeStorageResult): void;
990
+ /** 按需读取 console 日志中的对象参数,避免日志采集阶段自动遍历复杂对象。 */
991
+ inspectConsoleArg(options: RuntimeConsoleArgInspectRequest): void | Promise<void>;
992
+ /** 回传 console 对象参数 inspect 结果。 */
993
+ onConsoleArgInspected(event: string, data: RuntimeConsoleArgInspectResult): void;
949
994
  /** 读取 Vue component inspector tree,用于 `get_component_tree` 工具。 */
950
995
  getInspectorTree(options: {
951
996
  event: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xiaou66/vite-plugin-vue-mcp-next",
3
- "version": "1.3.6",
3
+ "version": "1.3.7",
4
4
  "description": "Runtime DevTools MCP plugin for Vite and Vue development.",
5
5
  "type": "module",
6
6
  "private": false,
@@ -1,4 +1,3 @@
1
- <!-- Generated by vite-plugin-vue-mcp-next. Safe to edit, but automatic updates only apply while this marker remains. -->
2
1
  ---
3
2
  name: vite-mcp-next
4
3
  description: Use when debugging Vite + Vue local pages with vite-plugin-vue-mcp-next MCP, including DOM, screenshots, console logs, network requests, Vue components, router, or Pinia state.
@@ -30,6 +29,7 @@ Do not use it for static code-only questions where reading files is enough.
30
29
  | Find elements by selector | `query_dom` |
31
30
  | Capture visual evidence | `take_screenshot` |
32
31
  | Read browser logs | `get_console_logs` |
32
+ | Inspect one runtime console object argument | `inspect_console_arg` |
33
33
  | Reset old browser logs | `clear_console_logs` |
34
34
  | Inspect requests | `get_network_requests` |
35
35
  | Inspect one request deeply | `get_network_request_detail` |
@@ -50,7 +50,7 @@ Do not use it for static code-only questions where reading files is enough.
50
50
  2. If the user provides an `elementId` such as `src/App.vue:12:8`, call `get_element_context` before editing source.
51
51
  3. For layout or content questions, call `get_dom_tree` or `query_dom`.
52
52
  4. For visual verification, call `take_screenshot` and report whether `source` is `cdp` or `snapdom`.
53
- 5. For browser errors, call `get_console_logs`.
53
+ 5. For browser errors, call `get_console_logs`; if a runtime Hook log contains an object argument with `argId`, call `inspect_console_arg` only when that object detail is needed.
54
54
  6. For API behavior, call `get_network_requests`, then `get_network_request_detail` for the relevant id.
55
55
  7. For storage questions, call `list_storage` first, then `get_storage_item`, `set_storage_item`, `delete_storage_item`, or `clear_storage` for the selected scope.
56
56
  8. For Vue-specific behavior, call `get_component_tree`, `get_component_state`, `get_router_info`, `get_pinia_tree`, or `get_pinia_state`.