@weapp-vite/mcp 1.2.0 → 1.2.1
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 +8 -8
- package/package.json +3 -1
package/dist/index.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import process from 'node:process';
|
|
2
2
|
import { fileURLToPath } from 'node:url';
|
|
3
|
-
import fs$1 from 'node:fs/promises';
|
|
4
|
-
import { createRequire } from 'node:module';
|
|
5
|
-
import path from 'node:path';
|
|
6
|
-
import fs from 'node:fs';
|
|
7
|
-
import { spawn } from 'node:child_process';
|
|
8
3
|
import { Buffer } from 'node:buffer';
|
|
9
4
|
import http from 'node:http';
|
|
10
5
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
11
6
|
import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
|
|
7
|
+
import fs$1 from 'node:fs/promises';
|
|
12
8
|
import { McpServer, ResourceTemplate } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
13
9
|
import { z } from 'zod';
|
|
10
|
+
import { createRequire } from 'node:module';
|
|
11
|
+
import path from 'node:path';
|
|
12
|
+
import fs from 'node:fs';
|
|
13
|
+
import { spawn } from 'node:child_process';
|
|
14
14
|
|
|
15
15
|
const MCP_SERVER_NAME = "@weapp-vite/mcp";
|
|
16
16
|
const MCP_SERVER_VERSION = "2.0.0";
|
|
@@ -874,7 +874,7 @@ function writeJson(res, statusCode, payload) {
|
|
|
874
874
|
res.setHeader("content-type", "application/json");
|
|
875
875
|
res.end(JSON.stringify(payload));
|
|
876
876
|
}
|
|
877
|
-
async function startStdioServer
|
|
877
|
+
async function startStdioServer(options) {
|
|
878
878
|
const previousCwd = process.cwd();
|
|
879
879
|
if (options?.workspaceRoot) {
|
|
880
880
|
process.chdir(options.workspaceRoot);
|
|
@@ -979,7 +979,7 @@ async function startWeappViteMcpServer(options) {
|
|
|
979
979
|
if (transport === "streamable-http") {
|
|
980
980
|
return startStreamableHttpServer(options ?? {});
|
|
981
981
|
}
|
|
982
|
-
await startStdioServer
|
|
982
|
+
await startStdioServer(options);
|
|
983
983
|
return {
|
|
984
984
|
transport: "stdio"
|
|
985
985
|
};
|
|
@@ -1002,4 +1002,4 @@ ${message}
|
|
|
1002
1002
|
});
|
|
1003
1003
|
}
|
|
1004
1004
|
|
|
1005
|
-
export { DEFAULT_MAX_FILE_CHARS, DEFAULT_MAX_OUTPUT_CHARS, DEFAULT_MAX_RESULTS, DEFAULT_MCP_ENDPOINT, DEFAULT_MCP_HOST, DEFAULT_MCP_PORT, DEFAULT_TIMEOUT_MS, EXPOSED_PACKAGES, MCP_SERVER_NAME, MCP_SERVER_VERSION, SKIPPED_DIR_NAMES, assertInsideRoot, createWeappViteMcpServer, formatJson, listFilesInDirectory, loadExposedCatalog, loadPackageSummary, normalizeErrorMessage, readFileContent, resolveSubPath, resolveWorkspaceRoot, runCommand, searchTextInDirectory, startStdioServer
|
|
1005
|
+
export { DEFAULT_MAX_FILE_CHARS, DEFAULT_MAX_OUTPUT_CHARS, DEFAULT_MAX_RESULTS, DEFAULT_MCP_ENDPOINT, DEFAULT_MCP_HOST, DEFAULT_MCP_PORT, DEFAULT_TIMEOUT_MS, EXPOSED_PACKAGES, MCP_SERVER_NAME, MCP_SERVER_VERSION, SKIPPED_DIR_NAMES, assertInsideRoot, createWeappViteMcpServer, formatJson, listFilesInDirectory, loadExposedCatalog, loadPackageSummary, normalizeErrorMessage, readFileContent, resolveSubPath, resolveWorkspaceRoot, runCommand, searchTextInDirectory, startStdioServer, startWeappViteMcpServer, toToolError, toToolResult };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weapp-vite/mcp",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.1",
|
|
5
5
|
"description": "mcp",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "ISC",
|
|
@@ -40,6 +40,8 @@
|
|
|
40
40
|
"build": "unbuild",
|
|
41
41
|
"test": "vitest run",
|
|
42
42
|
"test:dev": "vitest",
|
|
43
|
+
"pretest:types": "pnpm build",
|
|
44
|
+
"test:types": "tsd",
|
|
43
45
|
"typecheck": "tsc --noEmit",
|
|
44
46
|
"release": "pnpm publish",
|
|
45
47
|
"lint": "eslint .",
|