@xiaou66/vite-plugin-vue-mcp-next 1.3.5 → 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.
package/README.md CHANGED
@@ -528,7 +528,7 @@ interface ConsoleRecord {
528
528
  source: 'cdp' | 'hook'
529
529
  level: 'log' | 'info' | 'warn' | 'error' | 'debug'
530
530
  message: string
531
- args?: unknown[]
531
+ args?: string[]
532
532
  stack?: string
533
533
  timestamp: number
534
534
  }
package/dist/index.cjs CHANGED
@@ -68,6 +68,7 @@ var MCP_TOOL_NAMES = {
68
68
  takeScreenshot: "take_screenshot",
69
69
  getConsoleLogs: "get_console_logs",
70
70
  clearConsoleLogs: "clear_console_logs",
71
+ inspectConsoleArg: "inspect_console_arg",
71
72
  evaluateScript: "evaluate_script",
72
73
  getNetworkRequests: "get_network_requests",
73
74
  getNetworkRequestDetail: "get_network_request_detail",
@@ -528,6 +529,34 @@ function registerConsoleTools(server, ctx) {
528
529
  return createToolResponse({ ok: true });
529
530
  }
530
531
  );
532
+ server.registerTool(
533
+ MCP_TOOL_NAMES.inspectConsoleArg,
534
+ {
535
+ description: "Inspect an object argument captured from runtime console logs by argId.",
536
+ inputSchema: {
537
+ argId: import_zod.z.string(),
538
+ maxDepth: import_zod.z.number().optional(),
539
+ maxKeys: import_zod.z.number().optional(),
540
+ maxArrayItems: import_zod.z.number().optional(),
541
+ maxStringLength: import_zod.z.number().optional(),
542
+ maxTotalNodes: import_zod.z.number().optional()
543
+ }
544
+ },
545
+ async (input) => {
546
+ const data = await requestRuntimeData(ctx, (event) => {
547
+ void ctx.rpcServer?.inspectConsoleArg({
548
+ event,
549
+ argId: input.argId,
550
+ maxDepth: input.maxDepth,
551
+ maxKeys: input.maxKeys,
552
+ maxArrayItems: input.maxArrayItems,
553
+ maxStringLength: input.maxStringLength,
554
+ maxTotalNodes: input.maxTotalNodes
555
+ });
556
+ });
557
+ return createToolResponse({ source: "hook", data });
558
+ }
559
+ );
531
560
  }
532
561
 
533
562
  // src/mcp/tools/dom.ts
@@ -2658,6 +2687,10 @@ function createServerVueRuntimeRpc(ctx) {
2658
2687
  onStorageUpdated: (event, data) => {
2659
2688
  void ctx.hooks.callHook(event, data);
2660
2689
  },
2690
+ inspectConsoleArg: () => void 0,
2691
+ onConsoleArgInspected: (event, data) => {
2692
+ void ctx.hooks.callHook(event, data);
2693
+ },
2661
2694
  recordPerformance: () => void 0,
2662
2695
  onPerformanceRecorded: (event, data) => {
2663
2696
  void ctx.hooks.callHook(event, data);
@@ -3607,16 +3640,8 @@ var import_node_path10 = __toESM(require("path"), 1);
3607
3640
  // src/plugin/skillConfig/writers.ts
3608
3641
  var import_promises6 = __toESM(require("fs/promises"), 1);
3609
3642
  var import_node_path9 = __toESM(require("path"), 1);
3610
- var GENERATED_SKILL_CONFIG_MARKER = "<!-- Generated by vite-plugin-vue-mcp-next. Safe to edit, but automatic updates only apply while this marker remains. -->";
3611
3643
  async function writeGeneratedTextFile(options) {
3612
3644
  try {
3613
- const current = await readOptionalTextFile3(options.filePath);
3614
- if (current && !current.includes(GENERATED_SKILL_CONFIG_MARKER)) {
3615
- console.warn(
3616
- `[vite-plugin-vue-mcp-next] Skipped ${options.targetName} at ${options.filePath}: file is not generated by this plugin`
3617
- );
3618
- return;
3619
- }
3620
3645
  await import_promises6.default.mkdir(import_node_path9.default.dirname(options.filePath), { recursive: true });
3621
3646
  await import_promises6.default.writeFile(options.filePath, options.content);
3622
3647
  } catch (error) {
@@ -3625,22 +3650,9 @@ async function writeGeneratedTextFile(options) {
3625
3650
  );
3626
3651
  }
3627
3652
  }
3628
- async function readOptionalTextFile3(filePath) {
3629
- try {
3630
- return await import_promises6.default.readFile(filePath, "utf-8");
3631
- } catch (error) {
3632
- if (isNodeError4(error) && error.code === "ENOENT") {
3633
- return "";
3634
- }
3635
- throw error;
3636
- }
3637
- }
3638
3653
  function formatError4(error) {
3639
3654
  return error instanceof Error ? error.message : String(error);
3640
3655
  }
3641
- function isNodeError4(error) {
3642
- return error instanceof Error && "code" in error;
3643
- }
3644
3656
 
3645
3657
  // src/plugin/skillConfig/index.ts
3646
3658
  var PACKAGE_NAME = "@xiaou66/vite-plugin-vue-mcp-next";
@@ -3703,7 +3715,7 @@ async function readPackagedSkillContent(root) {
3703
3715
  try {
3704
3716
  return await import_promises7.default.readFile(candidate, "utf-8");
3705
3717
  } catch (error) {
3706
- if (isNodeError5(error) && error.code === "ENOENT") {
3718
+ if (isNodeError4(error) && error.code === "ENOENT") {
3707
3719
  continue;
3708
3720
  }
3709
3721
  throw error;
@@ -3735,7 +3747,7 @@ async function hasDirectoryEntry(entryPath) {
3735
3747
  const stat = await import_promises7.default.stat(entryPath);
3736
3748
  return stat.isDirectory();
3737
3749
  } catch (error) {
3738
- if (isNodeError5(error) && error.code === "ENOENT") {
3750
+ if (isNodeError4(error) && error.code === "ENOENT") {
3739
3751
  return false;
3740
3752
  }
3741
3753
  console.warn(
@@ -3747,7 +3759,7 @@ async function hasDirectoryEntry(entryPath) {
3747
3759
  function formatError5(error) {
3748
3760
  return error instanceof Error ? error.message : String(error);
3749
3761
  }
3750
- function isNodeError5(error) {
3762
+ function isNodeError4(error) {
3751
3763
  return error instanceof Error && "code" in error;
3752
3764
  }
3753
3765