@weapp-vite/mcp 1.3.3 → 1.3.5
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/dist/index.mjs +4 -22
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/
|
|
|
8
8
|
import fs$1 from 'node:fs/promises';
|
|
9
9
|
import path from 'node:path';
|
|
10
10
|
import { z } from 'zod';
|
|
11
|
-
import { closeSharedMiniProgram, acquireSharedMiniProgram, releaseSharedMiniProgram } from '@weapp-vite/devtools-runtime';
|
|
11
|
+
import { closeSharedMiniProgram, resolveDevtoolsProjectPath, resolveDevtoolsWorkspacePath, acquireSharedMiniProgram, releaseSharedMiniProgram, toDevtoolsSerializableValue } from '@weapp-vite/devtools-runtime';
|
|
12
12
|
import { ResourceTemplate, McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
13
13
|
import fs from 'node:fs';
|
|
14
14
|
import { createRequire } from 'node:module';
|
|
@@ -652,10 +652,10 @@ class RuntimeSessionManager {
|
|
|
652
652
|
return [...this.logs];
|
|
653
653
|
}
|
|
654
654
|
resolveProjectPath(projectPath) {
|
|
655
|
-
return
|
|
655
|
+
return resolveDevtoolsProjectPath(this.workspaceRoot, projectPath);
|
|
656
656
|
}
|
|
657
657
|
resolveWorkspacePath(filePath) {
|
|
658
|
-
return
|
|
658
|
+
return resolveDevtoolsWorkspacePath(this.workspaceRoot, filePath);
|
|
659
659
|
}
|
|
660
660
|
async withMiniProgram(input, runner) {
|
|
661
661
|
const projectPath = this.resolveProjectPath(input.projectPath);
|
|
@@ -807,25 +807,7 @@ async function summarizeElement(element, withWxml = false) {
|
|
|
807
807
|
});
|
|
808
808
|
}
|
|
809
809
|
function toSerializableValue(value) {
|
|
810
|
-
|
|
811
|
-
return value;
|
|
812
|
-
}
|
|
813
|
-
if (typeof value === "bigint") {
|
|
814
|
-
return value.toString();
|
|
815
|
-
}
|
|
816
|
-
if (value instanceof Date) {
|
|
817
|
-
return value.toISOString();
|
|
818
|
-
}
|
|
819
|
-
if (Buffer.isBuffer(value)) {
|
|
820
|
-
return value.toString("base64");
|
|
821
|
-
}
|
|
822
|
-
if (Array.isArray(value)) {
|
|
823
|
-
return value.map((item) => toSerializableValue(item));
|
|
824
|
-
}
|
|
825
|
-
if (typeof value === "object") {
|
|
826
|
-
return Object.fromEntries(Object.entries(value).map(([key, item]) => [key, toSerializableValue(item)]));
|
|
827
|
-
}
|
|
828
|
-
return String(value);
|
|
810
|
+
return toDevtoolsSerializableValue(value);
|
|
829
811
|
}
|
|
830
812
|
async function callRequiredMethod(target, methodName, ...args) {
|
|
831
813
|
const method = readProperty(target, methodName);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weapp-vite/mcp",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.5",
|
|
5
5
|
"description": "mcp",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "ISC",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
35
35
|
"zod": "^4.4.3",
|
|
36
|
-
"@weapp-vite/devtools-runtime": "0.
|
|
36
|
+
"@weapp-vite/devtools-runtime": "0.3.1"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"dev": "unbuild --stub",
|