@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 +1 -1
- package/dist/index.cjs +36 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +36 -24
- package/dist/index.js.map +1 -1
- package/dist/runtime/client.cjs +220 -15
- package/dist/runtime/client.cjs.map +1 -1
- package/dist/runtime/client.d.cts +1 -1
- package/dist/runtime/client.d.ts +1 -1
- package/dist/runtime/client.js +220 -15
- package/dist/runtime/client.js.map +1 -1
- package/dist/{types-BKXdHkwk.d.cts → types-DA9dLKJ8.d.cts} +46 -1
- package/dist/{types-BKXdHkwk.d.ts → types-DA9dLKJ8.d.ts} +46 -1
- package/package.json +1 -1
- package/skills/vite-mcp-next/SKILL.md +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Plugin } from 'vite';
|
|
2
|
-
import { l as VueMcpNextOptions } from './types-
|
|
3
|
-
export { C as CdpOptions, a as ConsoleOptions, b as ConsoleRecord, c as CursorMcpConfig, D as DomOptions, E as ElementContextResult, d as ElementPickerOptions, e as ElementPickerShortcut, f as EvaluateOptions, M as McpClientConfigOptions, N as NetworkOptions, g as NetworkRecord, P as PageTarget, R as ResolvedVueMcpNextOptions, i as RuntimeElementContextRequest, j as RuntimeMode, k as RuntimeOptions, S as SkillConfigOptions, V as VueMcpNextContext } from './types-
|
|
2
|
+
import { l as VueMcpNextOptions } from './types-DA9dLKJ8.cjs';
|
|
3
|
+
export { C as CdpOptions, a as ConsoleOptions, b as ConsoleRecord, c as CursorMcpConfig, D as DomOptions, E as ElementContextResult, d as ElementPickerOptions, e as ElementPickerShortcut, f as EvaluateOptions, M as McpClientConfigOptions, N as NetworkOptions, g as NetworkRecord, P as PageTarget, R as ResolvedVueMcpNextOptions, i as RuntimeElementContextRequest, j as RuntimeMode, k as RuntimeOptions, S as SkillConfigOptions, V as VueMcpNextContext } from './types-DA9dLKJ8.cjs';
|
|
4
4
|
import 'hookable';
|
|
5
5
|
|
|
6
6
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Plugin } from 'vite';
|
|
2
|
-
import { l as VueMcpNextOptions } from './types-
|
|
3
|
-
export { C as CdpOptions, a as ConsoleOptions, b as ConsoleRecord, c as CursorMcpConfig, D as DomOptions, E as ElementContextResult, d as ElementPickerOptions, e as ElementPickerShortcut, f as EvaluateOptions, M as McpClientConfigOptions, N as NetworkOptions, g as NetworkRecord, P as PageTarget, R as ResolvedVueMcpNextOptions, i as RuntimeElementContextRequest, j as RuntimeMode, k as RuntimeOptions, S as SkillConfigOptions, V as VueMcpNextContext } from './types-
|
|
2
|
+
import { l as VueMcpNextOptions } from './types-DA9dLKJ8.js';
|
|
3
|
+
export { C as CdpOptions, a as ConsoleOptions, b as ConsoleRecord, c as CursorMcpConfig, D as DomOptions, E as ElementContextResult, d as ElementPickerOptions, e as ElementPickerShortcut, f as EvaluateOptions, M as McpClientConfigOptions, N as NetworkOptions, g as NetworkRecord, P as PageTarget, R as ResolvedVueMcpNextOptions, i as RuntimeElementContextRequest, j as RuntimeMode, k as RuntimeOptions, S as SkillConfigOptions, V as VueMcpNextContext } from './types-DA9dLKJ8.js';
|
|
4
4
|
import 'hookable';
|
|
5
5
|
|
|
6
6
|
/**
|
package/dist/index.js
CHANGED
|
@@ -31,6 +31,7 @@ var MCP_TOOL_NAMES = {
|
|
|
31
31
|
takeScreenshot: "take_screenshot",
|
|
32
32
|
getConsoleLogs: "get_console_logs",
|
|
33
33
|
clearConsoleLogs: "clear_console_logs",
|
|
34
|
+
inspectConsoleArg: "inspect_console_arg",
|
|
34
35
|
evaluateScript: "evaluate_script",
|
|
35
36
|
getNetworkRequests: "get_network_requests",
|
|
36
37
|
getNetworkRequestDetail: "get_network_request_detail",
|
|
@@ -491,6 +492,34 @@ function registerConsoleTools(server, ctx) {
|
|
|
491
492
|
return createToolResponse({ ok: true });
|
|
492
493
|
}
|
|
493
494
|
);
|
|
495
|
+
server.registerTool(
|
|
496
|
+
MCP_TOOL_NAMES.inspectConsoleArg,
|
|
497
|
+
{
|
|
498
|
+
description: "Inspect an object argument captured from runtime console logs by argId.",
|
|
499
|
+
inputSchema: {
|
|
500
|
+
argId: z.string(),
|
|
501
|
+
maxDepth: z.number().optional(),
|
|
502
|
+
maxKeys: z.number().optional(),
|
|
503
|
+
maxArrayItems: z.number().optional(),
|
|
504
|
+
maxStringLength: z.number().optional(),
|
|
505
|
+
maxTotalNodes: z.number().optional()
|
|
506
|
+
}
|
|
507
|
+
},
|
|
508
|
+
async (input) => {
|
|
509
|
+
const data = await requestRuntimeData(ctx, (event) => {
|
|
510
|
+
void ctx.rpcServer?.inspectConsoleArg({
|
|
511
|
+
event,
|
|
512
|
+
argId: input.argId,
|
|
513
|
+
maxDepth: input.maxDepth,
|
|
514
|
+
maxKeys: input.maxKeys,
|
|
515
|
+
maxArrayItems: input.maxArrayItems,
|
|
516
|
+
maxStringLength: input.maxStringLength,
|
|
517
|
+
maxTotalNodes: input.maxTotalNodes
|
|
518
|
+
});
|
|
519
|
+
});
|
|
520
|
+
return createToolResponse({ source: "hook", data });
|
|
521
|
+
}
|
|
522
|
+
);
|
|
494
523
|
}
|
|
495
524
|
|
|
496
525
|
// src/mcp/tools/dom.ts
|
|
@@ -2621,6 +2650,10 @@ function createServerVueRuntimeRpc(ctx) {
|
|
|
2621
2650
|
onStorageUpdated: (event, data) => {
|
|
2622
2651
|
void ctx.hooks.callHook(event, data);
|
|
2623
2652
|
},
|
|
2653
|
+
inspectConsoleArg: () => void 0,
|
|
2654
|
+
onConsoleArgInspected: (event, data) => {
|
|
2655
|
+
void ctx.hooks.callHook(event, data);
|
|
2656
|
+
},
|
|
2624
2657
|
recordPerformance: () => void 0,
|
|
2625
2658
|
onPerformanceRecorded: (event, data) => {
|
|
2626
2659
|
void ctx.hooks.callHook(event, data);
|
|
@@ -3570,16 +3603,8 @@ import path7 from "path";
|
|
|
3570
3603
|
// src/plugin/skillConfig/writers.ts
|
|
3571
3604
|
import fs5 from "fs/promises";
|
|
3572
3605
|
import path6 from "path";
|
|
3573
|
-
var GENERATED_SKILL_CONFIG_MARKER = "<!-- Generated by vite-plugin-vue-mcp-next. Safe to edit, but automatic updates only apply while this marker remains. -->";
|
|
3574
3606
|
async function writeGeneratedTextFile(options) {
|
|
3575
3607
|
try {
|
|
3576
|
-
const current = await readOptionalTextFile3(options.filePath);
|
|
3577
|
-
if (current && !current.includes(GENERATED_SKILL_CONFIG_MARKER)) {
|
|
3578
|
-
console.warn(
|
|
3579
|
-
`[vite-plugin-vue-mcp-next] Skipped ${options.targetName} at ${options.filePath}: file is not generated by this plugin`
|
|
3580
|
-
);
|
|
3581
|
-
return;
|
|
3582
|
-
}
|
|
3583
3608
|
await fs5.mkdir(path6.dirname(options.filePath), { recursive: true });
|
|
3584
3609
|
await fs5.writeFile(options.filePath, options.content);
|
|
3585
3610
|
} catch (error) {
|
|
@@ -3588,22 +3613,9 @@ async function writeGeneratedTextFile(options) {
|
|
|
3588
3613
|
);
|
|
3589
3614
|
}
|
|
3590
3615
|
}
|
|
3591
|
-
async function readOptionalTextFile3(filePath) {
|
|
3592
|
-
try {
|
|
3593
|
-
return await fs5.readFile(filePath, "utf-8");
|
|
3594
|
-
} catch (error) {
|
|
3595
|
-
if (isNodeError4(error) && error.code === "ENOENT") {
|
|
3596
|
-
return "";
|
|
3597
|
-
}
|
|
3598
|
-
throw error;
|
|
3599
|
-
}
|
|
3600
|
-
}
|
|
3601
3616
|
function formatError4(error) {
|
|
3602
3617
|
return error instanceof Error ? error.message : String(error);
|
|
3603
3618
|
}
|
|
3604
|
-
function isNodeError4(error) {
|
|
3605
|
-
return error instanceof Error && "code" in error;
|
|
3606
|
-
}
|
|
3607
3619
|
|
|
3608
3620
|
// src/plugin/skillConfig/index.ts
|
|
3609
3621
|
var PACKAGE_NAME = "@xiaou66/vite-plugin-vue-mcp-next";
|
|
@@ -3666,7 +3678,7 @@ async function readPackagedSkillContent(root) {
|
|
|
3666
3678
|
try {
|
|
3667
3679
|
return await fs6.readFile(candidate, "utf-8");
|
|
3668
3680
|
} catch (error) {
|
|
3669
|
-
if (
|
|
3681
|
+
if (isNodeError4(error) && error.code === "ENOENT") {
|
|
3670
3682
|
continue;
|
|
3671
3683
|
}
|
|
3672
3684
|
throw error;
|
|
@@ -3698,7 +3710,7 @@ async function hasDirectoryEntry(entryPath) {
|
|
|
3698
3710
|
const stat = await fs6.stat(entryPath);
|
|
3699
3711
|
return stat.isDirectory();
|
|
3700
3712
|
} catch (error) {
|
|
3701
|
-
if (
|
|
3713
|
+
if (isNodeError4(error) && error.code === "ENOENT") {
|
|
3702
3714
|
return false;
|
|
3703
3715
|
}
|
|
3704
3716
|
console.warn(
|
|
@@ -3710,7 +3722,7 @@ async function hasDirectoryEntry(entryPath) {
|
|
|
3710
3722
|
function formatError5(error) {
|
|
3711
3723
|
return error instanceof Error ? error.message : String(error);
|
|
3712
3724
|
}
|
|
3713
|
-
function
|
|
3725
|
+
function isNodeError4(error) {
|
|
3714
3726
|
return error instanceof Error && "code" in error;
|
|
3715
3727
|
}
|
|
3716
3728
|
|