@cloudbase/cloudbase-mcp 2.6.3 → 2.6.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.
- package/dist/cli.cjs +3 -3
- package/dist/index.cjs +233 -16
- package/dist/index.js +233 -16
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -360,7 +360,7 @@ function registerEnvTools(server) {
|
|
|
360
360
|
content: [
|
|
361
361
|
{
|
|
362
362
|
type: "text",
|
|
363
|
-
text: JSON.stringify(result, null, 2)
|
|
363
|
+
text: `${JSON.stringify(result, null, 2)}\n\n请注意安全域名需要10分钟才能生效,用户也应该了解这一点。`,
|
|
364
364
|
},
|
|
365
365
|
],
|
|
366
366
|
};
|
|
@@ -517,7 +517,7 @@ ${envIdSection}
|
|
|
517
517
|
## 环境信息
|
|
518
518
|
- 操作系统: ${os_1.default.type()} ${os_1.default.release()}
|
|
519
519
|
- Node.js版本: ${process.version}
|
|
520
|
-
- MCP 版本:${process.env.npm_package_version || "2.6.
|
|
520
|
+
- MCP 版本:${process.env.npm_package_version || "2.6.4" || 0}
|
|
521
521
|
- 系统架构: ${os_1.default.arch()}
|
|
522
522
|
- 时间: ${new Date().toISOString()}
|
|
523
523
|
- 请求ID: ${requestId}
|
|
@@ -1417,7 +1417,7 @@ class InteractiveServer {
|
|
|
1417
1417
|
this.stop().catch((err) => {
|
|
1418
1418
|
(0, logger_js_1.debug)("Error stopping server after timeout:", err);
|
|
1419
1419
|
});
|
|
1420
|
-
resolve({ type: "envId", data: null, cancelled: true });
|
|
1420
|
+
resolve({ type: "envId", data: null, cancelled: true, timeout: true, timeoutDuration });
|
|
1421
1421
|
}
|
|
1422
1422
|
}, timeoutDuration);
|
|
1423
1423
|
// Store timeout ID so we can clear it if resolved early
|
|
@@ -3997,14 +3997,59 @@ class EnvironmentManager {
|
|
|
3997
3997
|
}
|
|
3998
3998
|
// 2. 自动设置环境ID (pass mcpServer for IDE detection)
|
|
3999
3999
|
(0, logger_js_1.debug)('未找到环境ID,尝试自动设置...');
|
|
4000
|
-
|
|
4000
|
+
let setupResult;
|
|
4001
|
+
try {
|
|
4002
|
+
setupResult = await (0, interactive_js_1._promptAndSetEnvironmentId)(true, { server: mcpServer });
|
|
4003
|
+
}
|
|
4004
|
+
catch (setupError) {
|
|
4005
|
+
// Preserve original error information
|
|
4006
|
+
const errorObj = setupError instanceof Error ? setupError : new Error(String(setupError));
|
|
4007
|
+
(0, logger_js_1.error)('自动设置环境ID时发生异常:', {
|
|
4008
|
+
error: errorObj.message,
|
|
4009
|
+
stack: errorObj.stack,
|
|
4010
|
+
name: errorObj.name,
|
|
4011
|
+
});
|
|
4012
|
+
// Re-throw with enhanced context
|
|
4013
|
+
const enhancedError = new Error(`自动设置环境ID失败: ${errorObj.message}`);
|
|
4014
|
+
enhancedError.originalError = errorObj;
|
|
4015
|
+
enhancedError.failureInfo = {
|
|
4016
|
+
reason: 'unknown_error',
|
|
4017
|
+
error: errorObj.message,
|
|
4018
|
+
errorCode: 'SETUP_EXCEPTION',
|
|
4019
|
+
};
|
|
4020
|
+
throw enhancedError;
|
|
4021
|
+
}
|
|
4022
|
+
const autoEnvId = setupResult.selectedEnvId;
|
|
4001
4023
|
if (!autoEnvId) {
|
|
4002
|
-
|
|
4024
|
+
// Build detailed error message from failure info
|
|
4025
|
+
const errorMessage = this._buildDetailedErrorMessage(setupResult.failureInfo);
|
|
4026
|
+
(0, logger_js_1.error)('自动设置环境ID失败:', {
|
|
4027
|
+
reason: setupResult.failureInfo?.reason,
|
|
4028
|
+
errorCode: setupResult.failureInfo?.errorCode,
|
|
4029
|
+
error: setupResult.failureInfo?.error,
|
|
4030
|
+
details: setupResult.failureInfo?.details,
|
|
4031
|
+
});
|
|
4032
|
+
// Create error with detailed information
|
|
4033
|
+
const detailedError = new Error(errorMessage);
|
|
4034
|
+
detailedError.failureInfo = setupResult.failureInfo;
|
|
4035
|
+
throw detailedError;
|
|
4003
4036
|
}
|
|
4004
4037
|
(0, logger_js_1.debug)('自动设置环境ID成功:', { envId: autoEnvId });
|
|
4005
4038
|
this._setCachedEnvId(autoEnvId);
|
|
4006
4039
|
return autoEnvId;
|
|
4007
4040
|
}
|
|
4041
|
+
catch (err) {
|
|
4042
|
+
// Log the error with full context before re-throwing
|
|
4043
|
+
const errorObj = err instanceof Error ? err : new Error(String(err));
|
|
4044
|
+
(0, logger_js_1.error)('获取环境ID失败:', {
|
|
4045
|
+
message: errorObj.message,
|
|
4046
|
+
stack: errorObj.stack,
|
|
4047
|
+
name: errorObj.name,
|
|
4048
|
+
failureInfo: errorObj.failureInfo,
|
|
4049
|
+
originalError: errorObj.originalError,
|
|
4050
|
+
});
|
|
4051
|
+
throw errorObj;
|
|
4052
|
+
}
|
|
4008
4053
|
finally {
|
|
4009
4054
|
this.envIdPromise = null;
|
|
4010
4055
|
}
|
|
@@ -4015,6 +4060,65 @@ class EnvironmentManager {
|
|
|
4015
4060
|
process.env.CLOUDBASE_ENV_ID = envId;
|
|
4016
4061
|
(0, logger_js_1.debug)('已更新环境ID缓存:', { envId });
|
|
4017
4062
|
}
|
|
4063
|
+
// Build detailed error message from failure info
|
|
4064
|
+
_buildDetailedErrorMessage(failureInfo) {
|
|
4065
|
+
if (!failureInfo) {
|
|
4066
|
+
return "CloudBase Environment ID not found after auto setup. Please set CLOUDBASE_ENV_ID or run setupEnvironmentId tool.";
|
|
4067
|
+
}
|
|
4068
|
+
const { reason, error: errorMsg, errorCode, helpUrl, details } = failureInfo;
|
|
4069
|
+
let message = "CloudBase Environment ID not found after auto setup.\n\n";
|
|
4070
|
+
message += `原因: ${this._getReasonDescription(reason)}\n`;
|
|
4071
|
+
if (errorMsg) {
|
|
4072
|
+
message += `错误: ${errorMsg}\n`;
|
|
4073
|
+
}
|
|
4074
|
+
if (errorCode) {
|
|
4075
|
+
message += `错误代码: ${errorCode}\n`;
|
|
4076
|
+
}
|
|
4077
|
+
// Add specific details based on failure reason
|
|
4078
|
+
if (reason === 'tcb_init_failed' && details?.initTcbError) {
|
|
4079
|
+
const initError = details.initTcbError;
|
|
4080
|
+
if (initError.needRealNameAuth) {
|
|
4081
|
+
message += "\n需要完成实名认证才能使用 CloudBase 服务。\n";
|
|
4082
|
+
}
|
|
4083
|
+
if (initError.needCamAuth) {
|
|
4084
|
+
message += "\n需要 CAM 权限才能使用 CloudBase 服务。\n";
|
|
4085
|
+
}
|
|
4086
|
+
}
|
|
4087
|
+
if (reason === 'env_creation_failed' && details?.createEnvError) {
|
|
4088
|
+
const createError = details.createEnvError;
|
|
4089
|
+
message += `\n环境创建失败: ${createError.message || '未知错误'}\n`;
|
|
4090
|
+
}
|
|
4091
|
+
if (reason === 'env_query_failed' && details?.queryEnvError) {
|
|
4092
|
+
message += `\n环境查询失败: ${details.queryEnvError}\n`;
|
|
4093
|
+
}
|
|
4094
|
+
if (reason === 'timeout' && details?.timeoutDuration) {
|
|
4095
|
+
message += `\n超时时间: ${details.timeoutDuration / 1000} 秒\n`;
|
|
4096
|
+
message += "提示: 请确保浏览器窗口已打开,并在规定时间内完成环境选择。\n";
|
|
4097
|
+
}
|
|
4098
|
+
message += "\n解决方案:\n";
|
|
4099
|
+
message += "1. 手动设置环境ID: 设置环境变量 CLOUDBASE_ENV_ID\n";
|
|
4100
|
+
message += "2. 使用工具设置: 运行 setupEnvironmentId 工具\n";
|
|
4101
|
+
if (helpUrl) {
|
|
4102
|
+
message += `3. 查看帮助文档: ${helpUrl}\n`;
|
|
4103
|
+
}
|
|
4104
|
+
else {
|
|
4105
|
+
message += "3. 查看帮助文档: https://docs.cloudbase.net/cli-v1/env\n";
|
|
4106
|
+
}
|
|
4107
|
+
return message;
|
|
4108
|
+
}
|
|
4109
|
+
_getReasonDescription(reason) {
|
|
4110
|
+
const descriptions = {
|
|
4111
|
+
'timeout': '环境选择超时',
|
|
4112
|
+
'cancelled': '用户取消了环境选择',
|
|
4113
|
+
'no_environments': '没有可用环境',
|
|
4114
|
+
'login_failed': '登录失败',
|
|
4115
|
+
'tcb_init_failed': 'CloudBase 服务初始化失败',
|
|
4116
|
+
'env_query_failed': '环境列表查询失败',
|
|
4117
|
+
'env_creation_failed': '环境创建失败',
|
|
4118
|
+
'unknown_error': '未知错误',
|
|
4119
|
+
};
|
|
4120
|
+
return descriptions[reason] || '未知原因';
|
|
4121
|
+
}
|
|
4018
4122
|
// 手动设置环境ID(用于外部调用)
|
|
4019
4123
|
async setEnvId(envId) {
|
|
4020
4124
|
this._setCachedEnvId(envId);
|
|
@@ -4328,6 +4432,11 @@ async function _promptAndSetEnvironmentId(autoSelectSingle, options) {
|
|
|
4328
4432
|
selectedEnvId: null,
|
|
4329
4433
|
cancelled: false,
|
|
4330
4434
|
error: "请先登录云开发账户",
|
|
4435
|
+
failureInfo: {
|
|
4436
|
+
reason: 'login_failed',
|
|
4437
|
+
error: "请先登录云开发账户",
|
|
4438
|
+
errorCode: "LOGIN_REQUIRED",
|
|
4439
|
+
},
|
|
4331
4440
|
};
|
|
4332
4441
|
}
|
|
4333
4442
|
// Get UIN for telemetry
|
|
@@ -4458,13 +4567,15 @@ async function _promptAndSetEnvironmentId(autoSelectSingle, options) {
|
|
|
4458
4567
|
(0, logger_js_1.debug)("降级到 listEnvs() 也失败:", fallbackError instanceof Error ? fallbackError : new Error(String(fallbackError)));
|
|
4459
4568
|
}
|
|
4460
4569
|
}
|
|
4461
|
-
// Report query_env_list event
|
|
4570
|
+
// Report query_env_list event with detailed information
|
|
4462
4571
|
await telemetry_js_1.telemetryReporter.report('toolkit_env_setup', {
|
|
4463
4572
|
step: 'query_env_list',
|
|
4464
4573
|
success: queryEnvSuccess ? 'true' : 'false',
|
|
4465
4574
|
uin: setupContext.uin || 'unknown',
|
|
4466
4575
|
error: queryEnvError ? queryEnvError.substring(0, 200) : undefined,
|
|
4467
|
-
envCount: (envResult?.EnvList || []).length
|
|
4576
|
+
envCount: (envResult?.EnvList || []).length,
|
|
4577
|
+
hasInitTcbError: !!setupContext.initTcbError,
|
|
4578
|
+
tcbServiceInitialized: setupContext.tcbServiceInitialized,
|
|
4468
4579
|
});
|
|
4469
4580
|
(0, logger_js_1.debug)("[interactive] Environment query result:", {
|
|
4470
4581
|
hasResult: !!envResult,
|
|
@@ -4472,6 +4583,24 @@ async function _promptAndSetEnvironmentId(autoSelectSingle, options) {
|
|
|
4472
4583
|
querySuccess: queryEnvSuccess,
|
|
4473
4584
|
queryError: queryEnvError
|
|
4474
4585
|
});
|
|
4586
|
+
// If query failed completely, return error
|
|
4587
|
+
if (!queryEnvSuccess && queryEnvError) {
|
|
4588
|
+
(0, logger_js_1.debug)("[interactive] Environment query failed completely, returning error");
|
|
4589
|
+
return {
|
|
4590
|
+
selectedEnvId: null,
|
|
4591
|
+
cancelled: false,
|
|
4592
|
+
error: `无法获取环境列表: ${queryEnvError}`,
|
|
4593
|
+
failureInfo: {
|
|
4594
|
+
reason: 'env_query_failed',
|
|
4595
|
+
error: `无法获取环境列表: ${queryEnvError}`,
|
|
4596
|
+
errorCode: "ENV_QUERY_FAILED",
|
|
4597
|
+
helpUrl: "https://docs.cloudbase.net/cli-v1/env",
|
|
4598
|
+
details: {
|
|
4599
|
+
queryEnvError,
|
|
4600
|
+
},
|
|
4601
|
+
},
|
|
4602
|
+
};
|
|
4603
|
+
}
|
|
4475
4604
|
const { EnvList } = envResult || {};
|
|
4476
4605
|
let selectedEnvId = null;
|
|
4477
4606
|
// 4. 如果没有环境,尝试自动创建免费环境
|
|
@@ -4482,11 +4611,15 @@ async function _promptAndSetEnvironmentId(autoSelectSingle, options) {
|
|
|
4482
4611
|
});
|
|
4483
4612
|
if (!EnvList || EnvList.length === 0) {
|
|
4484
4613
|
(0, logger_js_1.debug)("[interactive] No environments found");
|
|
4485
|
-
// Report no_envs event
|
|
4614
|
+
// Report no_envs event with context
|
|
4486
4615
|
await telemetry_js_1.telemetryReporter.report('toolkit_env_setup', {
|
|
4487
4616
|
step: 'no_envs',
|
|
4488
4617
|
success: 'true',
|
|
4489
|
-
uin: setupContext.uin || 'unknown'
|
|
4618
|
+
uin: setupContext.uin || 'unknown',
|
|
4619
|
+
hasInitTcbError: !!setupContext.initTcbError,
|
|
4620
|
+
tcbServiceInitialized: setupContext.tcbServiceInitialized,
|
|
4621
|
+
initTcbErrorCode: setupContext.initTcbError?.code,
|
|
4622
|
+
inCloudMode,
|
|
4490
4623
|
});
|
|
4491
4624
|
// Only try to create free environment if TCB service is initialized successfully
|
|
4492
4625
|
// If InitTcb failed, skip environment creation
|
|
@@ -4638,11 +4771,19 @@ async function _promptAndSetEnvironmentId(autoSelectSingle, options) {
|
|
|
4638
4771
|
if (inCloudMode) {
|
|
4639
4772
|
(0, logger_js_1.debug)("[interactive] CloudMode: Returning error message");
|
|
4640
4773
|
let errorMsg = "未找到可用环境";
|
|
4774
|
+
let failureReason = 'no_environments';
|
|
4775
|
+
let errorCode = "NO_ENVIRONMENTS";
|
|
4641
4776
|
if (setupContext.initTcbError) {
|
|
4642
4777
|
errorMsg += `\nCloudBase 初始化失败: ${setupContext.initTcbError.message}`;
|
|
4778
|
+
failureReason = 'tcb_init_failed';
|
|
4779
|
+
errorCode = setupContext.initTcbError.code || "TCB_INIT_FAILED";
|
|
4643
4780
|
}
|
|
4644
4781
|
if (setupContext.createEnvError) {
|
|
4645
4782
|
errorMsg += `\n环境创建失败: ${setupContext.createEnvError.message}`;
|
|
4783
|
+
if (failureReason === 'no_environments') {
|
|
4784
|
+
failureReason = 'env_creation_failed';
|
|
4785
|
+
}
|
|
4786
|
+
errorCode = setupContext.createEnvError.code || "ENV_CREATION_FAILED";
|
|
4646
4787
|
}
|
|
4647
4788
|
const helpUrl = setupContext.createEnvError?.helpUrl || setupContext.initTcbError?.helpUrl;
|
|
4648
4789
|
if (helpUrl) {
|
|
@@ -4652,7 +4793,17 @@ async function _promptAndSetEnvironmentId(autoSelectSingle, options) {
|
|
|
4652
4793
|
selectedEnvId: null,
|
|
4653
4794
|
cancelled: false,
|
|
4654
4795
|
error: errorMsg,
|
|
4655
|
-
noEnvs: true
|
|
4796
|
+
noEnvs: true,
|
|
4797
|
+
failureInfo: {
|
|
4798
|
+
reason: failureReason,
|
|
4799
|
+
error: errorMsg,
|
|
4800
|
+
errorCode,
|
|
4801
|
+
helpUrl,
|
|
4802
|
+
details: {
|
|
4803
|
+
initTcbError: setupContext.initTcbError,
|
|
4804
|
+
createEnvError: setupContext.createEnvError,
|
|
4805
|
+
},
|
|
4806
|
+
},
|
|
4656
4807
|
};
|
|
4657
4808
|
}
|
|
4658
4809
|
// In normal mode, show UI (even if creation failed or skipped)
|
|
@@ -4713,7 +4864,23 @@ async function _promptAndSetEnvironmentId(autoSelectSingle, options) {
|
|
|
4713
4864
|
cloudbase, // Pass manager for refreshing env list
|
|
4714
4865
|
resolvedServer);
|
|
4715
4866
|
if (result.cancelled) {
|
|
4716
|
-
|
|
4867
|
+
const isTimeout = result.timeout === true;
|
|
4868
|
+
const timeoutDuration = result.timeoutDuration;
|
|
4869
|
+
return {
|
|
4870
|
+
selectedEnvId: null,
|
|
4871
|
+
cancelled: true,
|
|
4872
|
+
failureInfo: {
|
|
4873
|
+
reason: isTimeout ? 'timeout' : 'cancelled',
|
|
4874
|
+
error: isTimeout
|
|
4875
|
+
? `环境选择超时(${timeoutDuration ? timeoutDuration / 1000 : 120}秒),请重新尝试或手动设置环境ID`
|
|
4876
|
+
: "用户取消了环境选择",
|
|
4877
|
+
errorCode: isTimeout ? "ENV_SELECTION_TIMEOUT" : "USER_CANCELLED",
|
|
4878
|
+
helpUrl: isTimeout ? "https://docs.cloudbase.net/cli-v1/env" : undefined,
|
|
4879
|
+
details: isTimeout ? {
|
|
4880
|
+
timeoutDuration,
|
|
4881
|
+
} : undefined,
|
|
4882
|
+
},
|
|
4883
|
+
};
|
|
4717
4884
|
}
|
|
4718
4885
|
if (result.switch) {
|
|
4719
4886
|
// Report switch_account event
|
|
@@ -4736,20 +4903,70 @@ async function _promptAndSetEnvironmentId(autoSelectSingle, options) {
|
|
|
4736
4903
|
// 自动设置环境ID(无需MCP工具调用)
|
|
4737
4904
|
async function autoSetupEnvironmentId(mcpServer) {
|
|
4738
4905
|
try {
|
|
4739
|
-
const { selectedEnvId, cancelled, error, noEnvs } = await _promptAndSetEnvironmentId(true, { server: mcpServer });
|
|
4906
|
+
const { selectedEnvId, cancelled, error, noEnvs, failureInfo } = await _promptAndSetEnvironmentId(true, { server: mcpServer });
|
|
4740
4907
|
if (error || noEnvs || cancelled) {
|
|
4741
|
-
(0, logger_js_1.debug)("Auto setup environment ID interrupted or failed
|
|
4908
|
+
(0, logger_js_1.debug)("Auto setup environment ID interrupted or failed.", {
|
|
4742
4909
|
error,
|
|
4743
4910
|
noEnvs,
|
|
4744
4911
|
cancelled,
|
|
4912
|
+
failureInfo,
|
|
4745
4913
|
});
|
|
4914
|
+
// Report failure to telemetry with detailed information
|
|
4915
|
+
if (failureInfo) {
|
|
4916
|
+
const telemetryData = {
|
|
4917
|
+
step: 'auto_setup_failed',
|
|
4918
|
+
success: 'false',
|
|
4919
|
+
reason: failureInfo.reason,
|
|
4920
|
+
errorCode: failureInfo.errorCode,
|
|
4921
|
+
error: failureInfo.error?.substring(0, 200),
|
|
4922
|
+
};
|
|
4923
|
+
// Add detailed context based on failure reason
|
|
4924
|
+
if (failureInfo.details) {
|
|
4925
|
+
if (failureInfo.details.initTcbError) {
|
|
4926
|
+
telemetryData.initTcbErrorCode = failureInfo.details.initTcbError.code;
|
|
4927
|
+
telemetryData.needRealNameAuth = failureInfo.details.initTcbError.needRealNameAuth;
|
|
4928
|
+
telemetryData.needCamAuth = failureInfo.details.initTcbError.needCamAuth;
|
|
4929
|
+
}
|
|
4930
|
+
if (failureInfo.details.createEnvError) {
|
|
4931
|
+
telemetryData.createEnvErrorCode = failureInfo.details.createEnvError.code;
|
|
4932
|
+
}
|
|
4933
|
+
if (failureInfo.details.queryEnvError) {
|
|
4934
|
+
telemetryData.queryEnvError = failureInfo.details.queryEnvError.substring(0, 200);
|
|
4935
|
+
}
|
|
4936
|
+
if (failureInfo.details.timeoutDuration) {
|
|
4937
|
+
telemetryData.timeoutDuration = failureInfo.details.timeoutDuration;
|
|
4938
|
+
}
|
|
4939
|
+
}
|
|
4940
|
+
if (failureInfo.helpUrl) {
|
|
4941
|
+
telemetryData.helpUrl = failureInfo.helpUrl;
|
|
4942
|
+
}
|
|
4943
|
+
await telemetry_js_1.telemetryReporter.report('toolkit_env_setup', telemetryData);
|
|
4944
|
+
}
|
|
4945
|
+
else {
|
|
4946
|
+
// Fallback: report without failureInfo
|
|
4947
|
+
await telemetry_js_1.telemetryReporter.report('toolkit_env_setup', {
|
|
4948
|
+
step: 'auto_setup_failed',
|
|
4949
|
+
success: 'false',
|
|
4950
|
+
reason: 'unknown',
|
|
4951
|
+
error: error || (noEnvs ? 'no_environments' : cancelled ? 'cancelled' : 'unknown'),
|
|
4952
|
+
});
|
|
4953
|
+
}
|
|
4746
4954
|
return null;
|
|
4747
4955
|
}
|
|
4748
4956
|
(0, logger_js_1.debug)("Auto setup environment ID successful.", { selectedEnvId });
|
|
4749
4957
|
return selectedEnvId;
|
|
4750
4958
|
}
|
|
4751
4959
|
catch (error) {
|
|
4752
|
-
|
|
4960
|
+
const errorObj = error instanceof Error ? error : new Error(String(error));
|
|
4961
|
+
console.error("自动配置环境ID时出错:", errorObj);
|
|
4962
|
+
// Report unexpected error to telemetry
|
|
4963
|
+
await telemetry_js_1.telemetryReporter.report('toolkit_env_setup', {
|
|
4964
|
+
step: 'auto_setup_exception',
|
|
4965
|
+
success: 'false',
|
|
4966
|
+
reason: 'unknown_error',
|
|
4967
|
+
error: errorObj.message.substring(0, 200),
|
|
4968
|
+
stack: errorObj.stack?.substring(0, 500),
|
|
4969
|
+
});
|
|
4753
4970
|
return null;
|
|
4754
4971
|
}
|
|
4755
4972
|
}
|
|
@@ -8430,7 +8647,7 @@ class TelemetryReporter {
|
|
|
8430
8647
|
const nodeVersion = process.version; // Node.js版本
|
|
8431
8648
|
const arch = os_1.default.arch(); // 系统架构
|
|
8432
8649
|
// 从构建时注入的版本号获取MCP版本信息
|
|
8433
|
-
const mcpVersion = process.env.npm_package_version || "2.6.
|
|
8650
|
+
const mcpVersion = process.env.npm_package_version || "2.6.4" || 0;
|
|
8434
8651
|
return {
|
|
8435
8652
|
userAgent: `${osType} ${osRelease} ${arch} ${nodeVersion} CloudBase-MCP/${mcpVersion}`,
|
|
8436
8653
|
deviceId: this.deviceId,
|
|
@@ -9777,7 +9994,7 @@ function registerSetupTools(server) {
|
|
|
9777
9994
|
title: "下载项目模板",
|
|
9778
9995
|
description: `自动下载并部署CloudBase项目模板。⚠️ **MANDATORY FOR NEW PROJECTS** ⚠️
|
|
9779
9996
|
|
|
9780
|
-
**CRITICAL**: This tool MUST be called FIRST when starting a new project.\n\n支持的模板:\n- react: React + CloudBase 全栈应用模板\n- vue: Vue + CloudBase 全栈应用模板\n- miniprogram: 微信小程序 + 云开发模板 \n- uniapp: UniApp + CloudBase 跨端应用模板\n- rules: 只包含AI编辑器配置文件(包含Cursor、WindSurf、CodeBuddy等所有主流编辑器配置),适合在已有项目中补充AI编辑器配置\n\n支持的IDE类型:\n- all: 下载所有IDE配置(默认)\n- cursor: Cursor AI编辑器\n- windsurf: WindSurf AI编辑器\n- codebuddy: CodeBuddy AI编辑器\n- claude-code: Claude Code AI编辑器\n- cline: Cline AI编辑器\n- gemini-cli: Gemini CLI\n- opencode: OpenCode AI编辑器\n- qwen-code: 通义灵码\n- baidu-comate: 百度Comate\n- openai-codex-cli: OpenAI Codex CLI\n- augment-code: Augment Code\n- github-copilot: GitHub Copilot\n- roocode: RooCode AI编辑器\n- tongyi-lingma: 通义灵码\n- trae: Trae AI编辑器\n- qoder: Qoder AI编辑器\n- antigravity: Google Antigravity AI编辑器\n- vscode: Visual Studio Code\n\n特别说明:\n- rules 模板会自动包含当前 mcp 版本号信息(版本号:${ true ? "2.6.
|
|
9997
|
+
**CRITICAL**: This tool MUST be called FIRST when starting a new project.\n\n支持的模板:\n- react: React + CloudBase 全栈应用模板\n- vue: Vue + CloudBase 全栈应用模板\n- miniprogram: 微信小程序 + 云开发模板 \n- uniapp: UniApp + CloudBase 跨端应用模板\n- rules: 只包含AI编辑器配置文件(包含Cursor、WindSurf、CodeBuddy等所有主流编辑器配置),适合在已有项目中补充AI编辑器配置\n\n支持的IDE类型:\n- all: 下载所有IDE配置(默认)\n- cursor: Cursor AI编辑器\n- windsurf: WindSurf AI编辑器\n- codebuddy: CodeBuddy AI编辑器\n- claude-code: Claude Code AI编辑器\n- cline: Cline AI编辑器\n- gemini-cli: Gemini CLI\n- opencode: OpenCode AI编辑器\n- qwen-code: 通义灵码\n- baidu-comate: 百度Comate\n- openai-codex-cli: OpenAI Codex CLI\n- augment-code: Augment Code\n- github-copilot: GitHub Copilot\n- roocode: RooCode AI编辑器\n- tongyi-lingma: 通义灵码\n- trae: Trae AI编辑器\n- qoder: Qoder AI编辑器\n- antigravity: Google Antigravity AI编辑器\n- vscode: Visual Studio Code\n\n特别说明:\n- rules 模板会自动包含当前 mcp 版本号信息(版本号:${ true ? "2.6.4" : 0}),便于后续维护和版本追踪\n- 下载 rules 模板时,如果项目中已存在 README.md 文件,系统会自动保护该文件不被覆盖(除非设置 overwrite=true)`,
|
|
9781
9998
|
inputSchema: {
|
|
9782
9999
|
template: zod_1.z
|
|
9783
10000
|
.enum(["react", "vue", "miniprogram", "uniapp", "rules"])
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/cloudbase-mcp",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.4",
|
|
4
4
|
"description": "腾讯云开发 MCP Server,通过AI提示词和MCP协议+云开发,让开发更智能、更高效,当你在Cursor/ VSCode GitHub Copilot/WinSurf/CodeBuddy/Augment Code/Claude Code等AI编程工具里写代码时,它能自动帮你生成可直接部署的前后端应用+小程序,并一键发布到腾讯云开发 CloudBase。",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.js",
|