@cloudbase/cloudbase-mcp 1.8.4 → 1.8.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/README.md +143 -3
- package/dist/cli.cjs +28 -9
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +27 -8
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +28 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +27 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -112,7 +112,7 @@ var init_logger = __esm({
|
|
|
112
112
|
logger = new Logger({
|
|
113
113
|
enabled: (process.env.MCP_DEBUG ?? "true") === "true",
|
|
114
114
|
level: 0 /* DEBUG */,
|
|
115
|
-
console: process.env.
|
|
115
|
+
console: process.env.MCP_CONSOLE_LOG === "true"
|
|
116
116
|
});
|
|
117
117
|
debug = (message, data) => logger.debug(message, data);
|
|
118
118
|
info = (message, data) => logger.info(message, data);
|
|
@@ -171,9 +171,18 @@ __export(interactive_server_exports, {
|
|
|
171
171
|
import express from "express";
|
|
172
172
|
import http from "http";
|
|
173
173
|
import { WebSocketServer } from "ws";
|
|
174
|
-
import open from "open";
|
|
175
174
|
import path2 from "path";
|
|
176
175
|
import { fileURLToPath } from "url";
|
|
176
|
+
async function openUrl(url, options) {
|
|
177
|
+
try {
|
|
178
|
+
const openModule = await import("open");
|
|
179
|
+
const open = openModule.default || openModule;
|
|
180
|
+
return await open(url, options);
|
|
181
|
+
} catch (err) {
|
|
182
|
+
error("Failed to import or use open module", err);
|
|
183
|
+
warn(`Please manually open: ${url}`);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
177
186
|
function getInteractiveServer() {
|
|
178
187
|
if (!interactiveServerInstance) {
|
|
179
188
|
interactiveServerInstance = new InteractiveServer();
|
|
@@ -213,7 +222,10 @@ var init_interactive_server = __esm({
|
|
|
213
222
|
if (typeof globalThis.__filename === "string") {
|
|
214
223
|
return globalThis.__filename;
|
|
215
224
|
}
|
|
216
|
-
|
|
225
|
+
if (typeof __require !== "undefined" && __require.main && __require.main.filename) {
|
|
226
|
+
return __require.main.filename;
|
|
227
|
+
}
|
|
228
|
+
return path2.join(process.cwd(), "interactive-server.js");
|
|
217
229
|
};
|
|
218
230
|
__filename = getFilename();
|
|
219
231
|
__dirname = path2.dirname(__filename);
|
|
@@ -449,7 +461,7 @@ var init_interactive_server = __esm({
|
|
|
449
461
|
const url = `http://localhost:${port}/env-setup/${sessionId}`;
|
|
450
462
|
info(`Opening browser: ${url}`);
|
|
451
463
|
try {
|
|
452
|
-
await
|
|
464
|
+
await openUrl(url, { wait: false });
|
|
453
465
|
info("Browser opened successfully");
|
|
454
466
|
} catch (browserError) {
|
|
455
467
|
error("Failed to open browser", browserError);
|
|
@@ -479,7 +491,7 @@ var init_interactive_server = __esm({
|
|
|
479
491
|
this.sessionData.delete(sessionId);
|
|
480
492
|
}, 5 * 60 * 1e3);
|
|
481
493
|
const url = `http://localhost:${port}/clarification/${sessionId}`;
|
|
482
|
-
await
|
|
494
|
+
await openUrl(url);
|
|
483
495
|
return new Promise((resolve2) => {
|
|
484
496
|
this.currentResolver = resolve2;
|
|
485
497
|
});
|
|
@@ -5637,8 +5649,15 @@ var TelemetryReporter = class {
|
|
|
5637
5649
|
try {
|
|
5638
5650
|
mcpVersion = process.env.npm_package_version || "";
|
|
5639
5651
|
if (!mcpVersion) {
|
|
5640
|
-
|
|
5641
|
-
|
|
5652
|
+
let __dirname2;
|
|
5653
|
+
if (typeof import.meta !== "undefined" && import.meta.url) {
|
|
5654
|
+
const __filename2 = fileURLToPath2(import.meta.url);
|
|
5655
|
+
__dirname2 = dirname2(__filename2);
|
|
5656
|
+
} else if (typeof globalThis.__filename !== "undefined") {
|
|
5657
|
+
__dirname2 = dirname2(globalThis.__filename);
|
|
5658
|
+
} else {
|
|
5659
|
+
__dirname2 = process.cwd();
|
|
5660
|
+
}
|
|
5642
5661
|
const packageJsonPath = join3(__dirname2, "../../package.json");
|
|
5643
5662
|
const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
|
|
5644
5663
|
mcpVersion = packageJson.version || "unknown";
|
|
@@ -5738,7 +5757,7 @@ var TelemetryReporter = class {
|
|
|
5738
5757
|
A101: this.userAgent,
|
|
5739
5758
|
// 运行环境信息
|
|
5740
5759
|
from: "cloudbase-mcp",
|
|
5741
|
-
xDeployEnv:
|
|
5760
|
+
xDeployEnv: "production",
|
|
5742
5761
|
...this.additionalParams
|
|
5743
5762
|
},
|
|
5744
5763
|
events: [
|