@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/cli.js
CHANGED
|
@@ -113,7 +113,7 @@ var init_logger = __esm({
|
|
|
113
113
|
logger = new Logger({
|
|
114
114
|
enabled: (process.env.MCP_DEBUG ?? "true") === "true",
|
|
115
115
|
level: 0 /* DEBUG */,
|
|
116
|
-
console: process.env.
|
|
116
|
+
console: process.env.MCP_CONSOLE_LOG === "true"
|
|
117
117
|
});
|
|
118
118
|
debug = (message, data) => logger.debug(message, data);
|
|
119
119
|
info = (message, data) => logger.info(message, data);
|
|
@@ -165,9 +165,18 @@ var init_auth = __esm({
|
|
|
165
165
|
import express from "express";
|
|
166
166
|
import http from "http";
|
|
167
167
|
import { WebSocketServer } from "ws";
|
|
168
|
-
import open from "open";
|
|
169
168
|
import path2 from "path";
|
|
170
169
|
import { fileURLToPath } from "url";
|
|
170
|
+
async function openUrl(url, options) {
|
|
171
|
+
try {
|
|
172
|
+
const openModule = await import("open");
|
|
173
|
+
const open = openModule.default || openModule;
|
|
174
|
+
return await open(url, options);
|
|
175
|
+
} catch (err) {
|
|
176
|
+
error("Failed to import or use open module", err);
|
|
177
|
+
warn(`Please manually open: ${url}`);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
171
180
|
function getInteractiveServer() {
|
|
172
181
|
if (!interactiveServerInstance) {
|
|
173
182
|
interactiveServerInstance = new InteractiveServer();
|
|
@@ -186,7 +195,10 @@ var init_interactive_server = __esm({
|
|
|
186
195
|
if (typeof globalThis.__filename === "string") {
|
|
187
196
|
return globalThis.__filename;
|
|
188
197
|
}
|
|
189
|
-
|
|
198
|
+
if (typeof __require !== "undefined" && __require.main && __require.main.filename) {
|
|
199
|
+
return __require.main.filename;
|
|
200
|
+
}
|
|
201
|
+
return path2.join(process.cwd(), "interactive-server.js");
|
|
190
202
|
};
|
|
191
203
|
__filename = getFilename();
|
|
192
204
|
__dirname = path2.dirname(__filename);
|
|
@@ -422,7 +434,7 @@ var init_interactive_server = __esm({
|
|
|
422
434
|
const url = `http://localhost:${port}/env-setup/${sessionId}`;
|
|
423
435
|
info(`Opening browser: ${url}`);
|
|
424
436
|
try {
|
|
425
|
-
await
|
|
437
|
+
await openUrl(url, { wait: false });
|
|
426
438
|
info("Browser opened successfully");
|
|
427
439
|
} catch (browserError) {
|
|
428
440
|
error("Failed to open browser", browserError);
|
|
@@ -452,7 +464,7 @@ var init_interactive_server = __esm({
|
|
|
452
464
|
this.sessionData.delete(sessionId);
|
|
453
465
|
}, 5 * 60 * 1e3);
|
|
454
466
|
const url = `http://localhost:${port}/clarification/${sessionId}`;
|
|
455
|
-
await
|
|
467
|
+
await openUrl(url);
|
|
456
468
|
return new Promise((resolve2) => {
|
|
457
469
|
this.currentResolver = resolve2;
|
|
458
470
|
});
|
|
@@ -5613,8 +5625,15 @@ var TelemetryReporter = class {
|
|
|
5613
5625
|
try {
|
|
5614
5626
|
mcpVersion = process.env.npm_package_version || "";
|
|
5615
5627
|
if (!mcpVersion) {
|
|
5616
|
-
|
|
5617
|
-
|
|
5628
|
+
let __dirname2;
|
|
5629
|
+
if (typeof import.meta !== "undefined" && import.meta.url) {
|
|
5630
|
+
const __filename2 = fileURLToPath2(import.meta.url);
|
|
5631
|
+
__dirname2 = dirname2(__filename2);
|
|
5632
|
+
} else if (typeof globalThis.__filename !== "undefined") {
|
|
5633
|
+
__dirname2 = dirname2(globalThis.__filename);
|
|
5634
|
+
} else {
|
|
5635
|
+
__dirname2 = process.cwd();
|
|
5636
|
+
}
|
|
5618
5637
|
const packageJsonPath = join3(__dirname2, "../../package.json");
|
|
5619
5638
|
const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
|
|
5620
5639
|
mcpVersion = packageJson.version || "unknown";
|
|
@@ -5714,7 +5733,7 @@ var TelemetryReporter = class {
|
|
|
5714
5733
|
A101: this.userAgent,
|
|
5715
5734
|
// 运行环境信息
|
|
5716
5735
|
from: "cloudbase-mcp",
|
|
5717
|
-
xDeployEnv:
|
|
5736
|
+
xDeployEnv: "production",
|
|
5718
5737
|
...this.additionalParams
|
|
5719
5738
|
},
|
|
5720
5739
|
events: [
|