@weapp-vite/mcp 1.3.3 → 1.3.4

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.
Files changed (2) hide show
  1. package/dist/index.mjs +4 -22
  2. 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 path.isAbsolute(projectPath) ? path.normalize(projectPath) : path.resolve(this.workspaceRoot, projectPath);
655
+ return resolveDevtoolsProjectPath(this.workspaceRoot, projectPath);
656
656
  }
657
657
  resolveWorkspacePath(filePath) {
658
- return path.isAbsolute(filePath) ? path.normalize(filePath) : path.resolve(this.workspaceRoot, filePath);
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
- if (value == null || typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
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.3",
4
+ "version": "1.3.4",
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.2.3"
36
+ "@weapp-vite/devtools-runtime": "0.3.0"
37
37
  },
38
38
  "scripts": {
39
39
  "dev": "unbuild --stub",