@cloudbase/cloudbase-mcp 2.30.0 → 2.31.0
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 +2 -2
- package/dist/index.cjs +127 -12
- package/dist/index.js +127 -12
- package/package.json +1 -1
- package/server.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -117356,6 +117356,8 @@ exports.CLOUDRUN_ENV_TYPE = exports.CLOUDRUN_DEPLOY_REGISTRATION_INTERVAL_MS = e
|
|
|
117356
117356
|
exports.buildManageCloudRunErrorMessage = buildManageCloudRunErrorMessage;
|
|
117357
117357
|
exports.isValidCloudRunBuildId = isValidCloudRunBuildId;
|
|
117358
117358
|
exports.isValidCloudRunRunId = isValidCloudRunRunId;
|
|
117359
|
+
exports.isCloudRunCodingBuildLogError = isCloudRunCodingBuildLogError;
|
|
117360
|
+
exports.buildGetDeployLogCodingFallback = buildGetDeployLogCodingFallback;
|
|
117359
117361
|
exports.waitForCloudRunDeployRegistration = waitForCloudRunDeployRegistration;
|
|
117360
117362
|
exports.buildCloudRunDeployNextStep = buildCloudRunDeployNextStep;
|
|
117361
117363
|
exports.buildCloudRunDeployProgressHint = buildCloudRunDeployProgressHint;
|
|
@@ -117585,6 +117587,76 @@ function isValidCloudRunBuildId(value) {
|
|
|
117585
117587
|
function isValidCloudRunRunId(value) {
|
|
117586
117588
|
return typeof value === "string" && value.trim().length > 0;
|
|
117587
117589
|
}
|
|
117590
|
+
/**
|
|
117591
|
+
* DescribeCloudRunBuildLog / getBuildLog fails when the Tencent Cloud account
|
|
117592
|
+
* has no CODING user. Agents should switch to getProcessLog (RunId) instead of
|
|
117593
|
+
* retrying getDeployLog.
|
|
117594
|
+
*/
|
|
117595
|
+
function isCloudRunCodingBuildLogError(error) {
|
|
117596
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
117597
|
+
return /DescribeCloudRunBuildLog|please login CODING|login CODING|User not created or may not qcloud user/i.test(message);
|
|
117598
|
+
}
|
|
117599
|
+
function buildGetDeployLogCodingFallback(options) {
|
|
117600
|
+
const runId = isValidCloudRunRunId(options.runId) ? options.runId.trim() : undefined;
|
|
117601
|
+
// Narrow to follow-up actions only — never suggest getDeployLog again.
|
|
117602
|
+
const next_step = runId
|
|
117603
|
+
? {
|
|
117604
|
+
tool: "queryCloudRun",
|
|
117605
|
+
action: "getProcessLog",
|
|
117606
|
+
suggested_args: {
|
|
117607
|
+
action: "getProcessLog",
|
|
117608
|
+
detailServerName: options.serverName,
|
|
117609
|
+
runId,
|
|
117610
|
+
},
|
|
117611
|
+
note: "getDeployLog needs CODING / DescribeCloudRunBuildLog. Use getProcessLog for deploy-step and runtime logs.",
|
|
117612
|
+
}
|
|
117613
|
+
: {
|
|
117614
|
+
tool: "queryCloudRun",
|
|
117615
|
+
action: "getDeployRecords",
|
|
117616
|
+
suggested_args: {
|
|
117617
|
+
action: "getDeployRecords",
|
|
117618
|
+
detailServerName: options.serverName,
|
|
117619
|
+
},
|
|
117620
|
+
note: "Read latestDeploy.RunId from getDeployRecords, then queryCloudRun(action=\"getProcessLog\"). Skip retrying getDeployLog for CODING login errors.",
|
|
117621
|
+
};
|
|
117622
|
+
const nextActions = [
|
|
117623
|
+
{
|
|
117624
|
+
tool: "queryCloudRun",
|
|
117625
|
+
action: next_step.action,
|
|
117626
|
+
args: {
|
|
117627
|
+
action: next_step.action,
|
|
117628
|
+
detailServerName: options.serverName,
|
|
117629
|
+
...(runId ? { runId } : {}),
|
|
117630
|
+
},
|
|
117631
|
+
},
|
|
117632
|
+
];
|
|
117633
|
+
if (next_step.action === "getDeployRecords") {
|
|
117634
|
+
nextActions.push({
|
|
117635
|
+
tool: "queryCloudRun",
|
|
117636
|
+
action: "getProcessLog",
|
|
117637
|
+
args: {
|
|
117638
|
+
action: "getProcessLog",
|
|
117639
|
+
detailServerName: options.serverName,
|
|
117640
|
+
},
|
|
117641
|
+
});
|
|
117642
|
+
}
|
|
117643
|
+
const message = options.reason === "image_no_build"
|
|
117644
|
+
? `Service '${options.serverName}' has no cloud source build (BuildId=0). Skip getDeployLog; use queryCloudRun(action="getProcessLog"${runId ? `, runId="${runId}"` : ""}) for deploy-step and runtime logs.`
|
|
117645
|
+
: `getDeployLog (DescribeCloudRunBuildLog) failed because this account is not a CODING user. Do not retry getDeployLog. Use queryCloudRun(action="getProcessLog", detailServerName="${options.serverName}"${runId ? `, runId="${runId}"` : ""}) — RunId comes from getDeployRecords/latestDeploy.`;
|
|
117646
|
+
return {
|
|
117647
|
+
success: false,
|
|
117648
|
+
error: options.reason === "image_no_build"
|
|
117649
|
+
? "NO_CODING_BUILD_FOR_IMAGE_DEPLOY"
|
|
117650
|
+
: "CODING_BUILD_LOG_UNAVAILABLE",
|
|
117651
|
+
message,
|
|
117652
|
+
nextActions,
|
|
117653
|
+
data: {
|
|
117654
|
+
...(runId ? { runId } : {}),
|
|
117655
|
+
next_step,
|
|
117656
|
+
...(options.upstreamError ? { upstreamError: options.upstreamError } : {}),
|
|
117657
|
+
},
|
|
117658
|
+
};
|
|
117659
|
+
}
|
|
117588
117660
|
function extractServerManageTaskInfo(resp) {
|
|
117589
117661
|
const data = (resp ?? {});
|
|
117590
117662
|
const task = (data.Task ?? data.task ?? {});
|
|
@@ -118256,13 +118328,53 @@ function registerCloudRunTools(server) {
|
|
|
118256
118328
|
};
|
|
118257
118329
|
}
|
|
118258
118330
|
const buildId = input.buildId ?? latestDeploy.BuildId;
|
|
118331
|
+
const latestRunId = isValidCloudRunRunId(latestDeploy.RunId)
|
|
118332
|
+
? latestDeploy.RunId.trim()
|
|
118333
|
+
: undefined;
|
|
118334
|
+
// Image deploys typically have BuildId=0 and no CODING build.
|
|
118335
|
+
if (!isValidCloudRunBuildId(buildId)) {
|
|
118336
|
+
return {
|
|
118337
|
+
content: [
|
|
118338
|
+
{
|
|
118339
|
+
type: "text",
|
|
118340
|
+
text: JSON.stringify(buildGetDeployLogCodingFallback({
|
|
118341
|
+
serverName,
|
|
118342
|
+
runId: latestRunId,
|
|
118343
|
+
reason: "image_no_build",
|
|
118344
|
+
}), null, 2),
|
|
118345
|
+
},
|
|
118346
|
+
],
|
|
118347
|
+
};
|
|
118348
|
+
}
|
|
118259
118349
|
// Build log (CODING / DescribeCloudRunBuildLog). Meaningful only for
|
|
118260
|
-
// cloud source builds
|
|
118261
|
-
//
|
|
118262
|
-
|
|
118263
|
-
|
|
118264
|
-
|
|
118265
|
-
|
|
118350
|
+
// cloud source builds. Accounts without a CODING user fail here —
|
|
118351
|
+
// rewrite to getProcessLog instead of bubbling the raw English error.
|
|
118352
|
+
let buildLogResult;
|
|
118353
|
+
try {
|
|
118354
|
+
buildLogResult = await cloudrunService.getBuildLog({
|
|
118355
|
+
serverName,
|
|
118356
|
+
buildId,
|
|
118357
|
+
});
|
|
118358
|
+
}
|
|
118359
|
+
catch (error) {
|
|
118360
|
+
if (isCloudRunCodingBuildLogError(error)) {
|
|
118361
|
+
const upstreamError = error instanceof Error ? error.message : String(error);
|
|
118362
|
+
return {
|
|
118363
|
+
content: [
|
|
118364
|
+
{
|
|
118365
|
+
type: "text",
|
|
118366
|
+
text: JSON.stringify(buildGetDeployLogCodingFallback({
|
|
118367
|
+
serverName,
|
|
118368
|
+
runId: latestRunId,
|
|
118369
|
+
upstreamError,
|
|
118370
|
+
reason: "coding",
|
|
118371
|
+
}), null, 2),
|
|
118372
|
+
},
|
|
118373
|
+
],
|
|
118374
|
+
};
|
|
118375
|
+
}
|
|
118376
|
+
throw error;
|
|
118377
|
+
}
|
|
118266
118378
|
let processLogs = [];
|
|
118267
118379
|
let processLogsWarning;
|
|
118268
118380
|
if (latestDeploy.RunId && typeof cloudrunService.getProcessLog === 'function') {
|
|
@@ -118276,7 +118388,10 @@ function registerCloudRunTools(server) {
|
|
|
118276
118388
|
processLogsWarning = error instanceof Error ? error.message : String(error);
|
|
118277
118389
|
}
|
|
118278
118390
|
}
|
|
118279
|
-
const
|
|
118391
|
+
const buildLogRecord = buildLogResult && typeof buildLogResult === "object"
|
|
118392
|
+
? buildLogResult
|
|
118393
|
+
: undefined;
|
|
118394
|
+
const buildLogText = typeof buildLogRecord?.Log?.Text === 'string' ? buildLogRecord.Log.Text : '';
|
|
118280
118395
|
const processLogText = Array.isArray(processLogs) && processLogs.length > 0 ? normalizeProcessLogText(processLogs) : '';
|
|
118281
118396
|
const combinedLogText = [buildLogText, processLogText].filter(Boolean).join('\n');
|
|
118282
118397
|
return {
|
|
@@ -118288,7 +118403,7 @@ function registerCloudRunTools(server) {
|
|
|
118288
118403
|
data: {
|
|
118289
118404
|
buildId,
|
|
118290
118405
|
deployRecord: latestDeploy,
|
|
118291
|
-
buildLog:
|
|
118406
|
+
buildLog: buildLogRecord?.Log || null,
|
|
118292
118407
|
// Optional best-effort attach; prefer dedicated getProcessLog for runtime diagnosis
|
|
118293
118408
|
processLogs,
|
|
118294
118409
|
combinedLogText,
|
|
@@ -143780,7 +143895,7 @@ class TelemetryReporter {
|
|
|
143780
143895
|
const arch = os_1.default.arch(); // 系统架构
|
|
143781
143896
|
// Build-time injected version; guard for vitest / non-webpack runtimes.
|
|
143782
143897
|
const mcpVersion = process.env.npm_package_version ||
|
|
143783
|
-
( true ? "2.
|
|
143898
|
+
( true ? "2.31.0" : 0);
|
|
143784
143899
|
return {
|
|
143785
143900
|
userAgent: `${osType} ${osRelease} ${arch} ${nodeVersion} CloudBase-MCP/${mcpVersion}`,
|
|
143786
143901
|
deviceId: this.deviceId,
|
|
@@ -225500,7 +225615,7 @@ ${envIdSection}
|
|
|
225500
225615
|
## 环境信息
|
|
225501
225616
|
- 操作系统: ${os_1.default.type()} ${os_1.default.release()}
|
|
225502
225617
|
- Node.js版本: ${process.version}
|
|
225503
|
-
- MCP 版本:${process.env.npm_package_version || ( true ? "2.
|
|
225618
|
+
- MCP 版本:${process.env.npm_package_version || ( true ? "2.31.0" : 0)}
|
|
225504
225619
|
- 系统架构: ${os_1.default.arch()}
|
|
225505
225620
|
- 时间: ${new Date().toISOString()}
|
|
225506
225621
|
- 请求ID: ${requestId}
|
|
@@ -225581,7 +225696,7 @@ function createWrappedHandler(name, handler, server) {
|
|
|
225581
225696
|
requestId: (typeof error === 'object' && error && 'requestId' in error) ? error.requestId : '',
|
|
225582
225697
|
ide: server.ide || process.env.INTEGRATION_IDE || ''
|
|
225583
225698
|
});
|
|
225584
|
-
const mcpVersion = true ? "2.
|
|
225699
|
+
const mcpVersion = true ? "2.31.0" : 0;
|
|
225585
225700
|
const requestIdSuffix = requestId ? `\n🆔 RequestId: ${requestId}` : '';
|
|
225586
225701
|
const enhancedErrorMessage = `${errorMessage}${requestIdSuffix}\n\n📦 CloudBase MCP v${mcpVersion}\n🔗 遇到问题?请复制以下链接到浏览器打开\n即可自动携带错误详情快速创建 GitHub Issue:\n${issueLink}`;
|
|
225587
225702
|
// 创建新的错误对象,保持原有的错误类型但更新消息
|
|
@@ -243024,7 +243139,7 @@ function registerSetupTools(server) {
|
|
|
243024
243139
|
server.registerTool("downloadTemplate", {
|
|
243025
243140
|
title: "下载项目模板",
|
|
243026
243141
|
description: `自动下载并部署CloudBase项目模板。
|
|
243027
|
-
**Note**: Call this tool when the user requests to create a new project using a CloudBase template.\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- 其他IDE类型见下方列表\n\n注意:如果未传入 ide 参数且无法从环境变量检测到 IDE,将提示错误并要求传入 ide 参数\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- kiro: Kiro AI编辑器\n- aider: Aider AI编辑器\n\n特别说明:\n- rules 模板会自动包含当前 mcp 版本号信息(版本号:${ true ? "2.
|
|
243142
|
+
**Note**: Call this tool when the user requests to create a new project using a CloudBase template.\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- 其他IDE类型见下方列表\n\n注意:如果未传入 ide 参数且无法从环境变量检测到 IDE,将提示错误并要求传入 ide 参数\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- kiro: Kiro AI编辑器\n- aider: Aider AI编辑器\n\n特别说明:\n- rules 模板会自动包含当前 mcp 版本号信息(版本号:${ true ? "2.31.0" : 0}),便于后续维护和版本追踪\n- 下载 rules 模板时,如果项目中已存在 README.md 文件,系统会自动保护该文件不被覆盖(除非设置 overwrite=true)`,
|
|
243028
243143
|
inputSchema: {
|
|
243029
243144
|
template: zod_1.z
|
|
243030
243145
|
.enum(["react", "vue", "miniprogram", "uniapp", "rules"])
|
package/dist/index.js
CHANGED
|
@@ -3474,7 +3474,7 @@ ${envIdSection}
|
|
|
3474
3474
|
## 环境信息
|
|
3475
3475
|
- 操作系统: ${os_1.default.type()} ${os_1.default.release()}
|
|
3476
3476
|
- Node.js版本: ${process.version}
|
|
3477
|
-
- MCP 版本:${process.env.npm_package_version || ( true ? "2.
|
|
3477
|
+
- MCP 版本:${process.env.npm_package_version || ( true ? "2.31.0" : 0)}
|
|
3478
3478
|
- 系统架构: ${os_1.default.arch()}
|
|
3479
3479
|
- 时间: ${new Date().toISOString()}
|
|
3480
3480
|
- 请求ID: ${requestId}
|
|
@@ -3555,7 +3555,7 @@ function createWrappedHandler(name, handler, server) {
|
|
|
3555
3555
|
requestId: (typeof error === 'object' && error && 'requestId' in error) ? error.requestId : '',
|
|
3556
3556
|
ide: server.ide || process.env.INTEGRATION_IDE || ''
|
|
3557
3557
|
});
|
|
3558
|
-
const mcpVersion = true ? "2.
|
|
3558
|
+
const mcpVersion = true ? "2.31.0" : 0;
|
|
3559
3559
|
const requestIdSuffix = requestId ? `\n🆔 RequestId: ${requestId}` : '';
|
|
3560
3560
|
const enhancedErrorMessage = `${errorMessage}${requestIdSuffix}\n\n📦 CloudBase MCP v${mcpVersion}\n🔗 遇到问题?请复制以下链接到浏览器打开\n即可自动携带错误详情快速创建 GitHub Issue:\n${issueLink}`;
|
|
3561
3561
|
// 创建新的错误对象,保持原有的错误类型但更新消息
|
|
@@ -10503,6 +10503,8 @@ exports.CLOUDRUN_ENV_TYPE = exports.CLOUDRUN_DEPLOY_REGISTRATION_INTERVAL_MS = e
|
|
|
10503
10503
|
exports.buildManageCloudRunErrorMessage = buildManageCloudRunErrorMessage;
|
|
10504
10504
|
exports.isValidCloudRunBuildId = isValidCloudRunBuildId;
|
|
10505
10505
|
exports.isValidCloudRunRunId = isValidCloudRunRunId;
|
|
10506
|
+
exports.isCloudRunCodingBuildLogError = isCloudRunCodingBuildLogError;
|
|
10507
|
+
exports.buildGetDeployLogCodingFallback = buildGetDeployLogCodingFallback;
|
|
10506
10508
|
exports.waitForCloudRunDeployRegistration = waitForCloudRunDeployRegistration;
|
|
10507
10509
|
exports.buildCloudRunDeployNextStep = buildCloudRunDeployNextStep;
|
|
10508
10510
|
exports.buildCloudRunDeployProgressHint = buildCloudRunDeployProgressHint;
|
|
@@ -10732,6 +10734,76 @@ function isValidCloudRunBuildId(value) {
|
|
|
10732
10734
|
function isValidCloudRunRunId(value) {
|
|
10733
10735
|
return typeof value === "string" && value.trim().length > 0;
|
|
10734
10736
|
}
|
|
10737
|
+
/**
|
|
10738
|
+
* DescribeCloudRunBuildLog / getBuildLog fails when the Tencent Cloud account
|
|
10739
|
+
* has no CODING user. Agents should switch to getProcessLog (RunId) instead of
|
|
10740
|
+
* retrying getDeployLog.
|
|
10741
|
+
*/
|
|
10742
|
+
function isCloudRunCodingBuildLogError(error) {
|
|
10743
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
10744
|
+
return /DescribeCloudRunBuildLog|please login CODING|login CODING|User not created or may not qcloud user/i.test(message);
|
|
10745
|
+
}
|
|
10746
|
+
function buildGetDeployLogCodingFallback(options) {
|
|
10747
|
+
const runId = isValidCloudRunRunId(options.runId) ? options.runId.trim() : undefined;
|
|
10748
|
+
// Narrow to follow-up actions only — never suggest getDeployLog again.
|
|
10749
|
+
const next_step = runId
|
|
10750
|
+
? {
|
|
10751
|
+
tool: "queryCloudRun",
|
|
10752
|
+
action: "getProcessLog",
|
|
10753
|
+
suggested_args: {
|
|
10754
|
+
action: "getProcessLog",
|
|
10755
|
+
detailServerName: options.serverName,
|
|
10756
|
+
runId,
|
|
10757
|
+
},
|
|
10758
|
+
note: "getDeployLog needs CODING / DescribeCloudRunBuildLog. Use getProcessLog for deploy-step and runtime logs.",
|
|
10759
|
+
}
|
|
10760
|
+
: {
|
|
10761
|
+
tool: "queryCloudRun",
|
|
10762
|
+
action: "getDeployRecords",
|
|
10763
|
+
suggested_args: {
|
|
10764
|
+
action: "getDeployRecords",
|
|
10765
|
+
detailServerName: options.serverName,
|
|
10766
|
+
},
|
|
10767
|
+
note: "Read latestDeploy.RunId from getDeployRecords, then queryCloudRun(action=\"getProcessLog\"). Skip retrying getDeployLog for CODING login errors.",
|
|
10768
|
+
};
|
|
10769
|
+
const nextActions = [
|
|
10770
|
+
{
|
|
10771
|
+
tool: "queryCloudRun",
|
|
10772
|
+
action: next_step.action,
|
|
10773
|
+
args: {
|
|
10774
|
+
action: next_step.action,
|
|
10775
|
+
detailServerName: options.serverName,
|
|
10776
|
+
...(runId ? { runId } : {}),
|
|
10777
|
+
},
|
|
10778
|
+
},
|
|
10779
|
+
];
|
|
10780
|
+
if (next_step.action === "getDeployRecords") {
|
|
10781
|
+
nextActions.push({
|
|
10782
|
+
tool: "queryCloudRun",
|
|
10783
|
+
action: "getProcessLog",
|
|
10784
|
+
args: {
|
|
10785
|
+
action: "getProcessLog",
|
|
10786
|
+
detailServerName: options.serverName,
|
|
10787
|
+
},
|
|
10788
|
+
});
|
|
10789
|
+
}
|
|
10790
|
+
const message = options.reason === "image_no_build"
|
|
10791
|
+
? `Service '${options.serverName}' has no cloud source build (BuildId=0). Skip getDeployLog; use queryCloudRun(action="getProcessLog"${runId ? `, runId="${runId}"` : ""}) for deploy-step and runtime logs.`
|
|
10792
|
+
: `getDeployLog (DescribeCloudRunBuildLog) failed because this account is not a CODING user. Do not retry getDeployLog. Use queryCloudRun(action="getProcessLog", detailServerName="${options.serverName}"${runId ? `, runId="${runId}"` : ""}) — RunId comes from getDeployRecords/latestDeploy.`;
|
|
10793
|
+
return {
|
|
10794
|
+
success: false,
|
|
10795
|
+
error: options.reason === "image_no_build"
|
|
10796
|
+
? "NO_CODING_BUILD_FOR_IMAGE_DEPLOY"
|
|
10797
|
+
: "CODING_BUILD_LOG_UNAVAILABLE",
|
|
10798
|
+
message,
|
|
10799
|
+
nextActions,
|
|
10800
|
+
data: {
|
|
10801
|
+
...(runId ? { runId } : {}),
|
|
10802
|
+
next_step,
|
|
10803
|
+
...(options.upstreamError ? { upstreamError: options.upstreamError } : {}),
|
|
10804
|
+
},
|
|
10805
|
+
};
|
|
10806
|
+
}
|
|
10735
10807
|
function extractServerManageTaskInfo(resp) {
|
|
10736
10808
|
const data = (resp ?? {});
|
|
10737
10809
|
const task = (data.Task ?? data.task ?? {});
|
|
@@ -11403,13 +11475,53 @@ function registerCloudRunTools(server) {
|
|
|
11403
11475
|
};
|
|
11404
11476
|
}
|
|
11405
11477
|
const buildId = input.buildId ?? latestDeploy.BuildId;
|
|
11478
|
+
const latestRunId = isValidCloudRunRunId(latestDeploy.RunId)
|
|
11479
|
+
? latestDeploy.RunId.trim()
|
|
11480
|
+
: undefined;
|
|
11481
|
+
// Image deploys typically have BuildId=0 and no CODING build.
|
|
11482
|
+
if (!isValidCloudRunBuildId(buildId)) {
|
|
11483
|
+
return {
|
|
11484
|
+
content: [
|
|
11485
|
+
{
|
|
11486
|
+
type: "text",
|
|
11487
|
+
text: JSON.stringify(buildGetDeployLogCodingFallback({
|
|
11488
|
+
serverName,
|
|
11489
|
+
runId: latestRunId,
|
|
11490
|
+
reason: "image_no_build",
|
|
11491
|
+
}), null, 2),
|
|
11492
|
+
},
|
|
11493
|
+
],
|
|
11494
|
+
};
|
|
11495
|
+
}
|
|
11406
11496
|
// Build log (CODING / DescribeCloudRunBuildLog). Meaningful only for
|
|
11407
|
-
// cloud source builds
|
|
11408
|
-
//
|
|
11409
|
-
|
|
11410
|
-
|
|
11411
|
-
|
|
11412
|
-
|
|
11497
|
+
// cloud source builds. Accounts without a CODING user fail here —
|
|
11498
|
+
// rewrite to getProcessLog instead of bubbling the raw English error.
|
|
11499
|
+
let buildLogResult;
|
|
11500
|
+
try {
|
|
11501
|
+
buildLogResult = await cloudrunService.getBuildLog({
|
|
11502
|
+
serverName,
|
|
11503
|
+
buildId,
|
|
11504
|
+
});
|
|
11505
|
+
}
|
|
11506
|
+
catch (error) {
|
|
11507
|
+
if (isCloudRunCodingBuildLogError(error)) {
|
|
11508
|
+
const upstreamError = error instanceof Error ? error.message : String(error);
|
|
11509
|
+
return {
|
|
11510
|
+
content: [
|
|
11511
|
+
{
|
|
11512
|
+
type: "text",
|
|
11513
|
+
text: JSON.stringify(buildGetDeployLogCodingFallback({
|
|
11514
|
+
serverName,
|
|
11515
|
+
runId: latestRunId,
|
|
11516
|
+
upstreamError,
|
|
11517
|
+
reason: "coding",
|
|
11518
|
+
}), null, 2),
|
|
11519
|
+
},
|
|
11520
|
+
],
|
|
11521
|
+
};
|
|
11522
|
+
}
|
|
11523
|
+
throw error;
|
|
11524
|
+
}
|
|
11413
11525
|
let processLogs = [];
|
|
11414
11526
|
let processLogsWarning;
|
|
11415
11527
|
if (latestDeploy.RunId && typeof cloudrunService.getProcessLog === 'function') {
|
|
@@ -11423,7 +11535,10 @@ function registerCloudRunTools(server) {
|
|
|
11423
11535
|
processLogsWarning = error instanceof Error ? error.message : String(error);
|
|
11424
11536
|
}
|
|
11425
11537
|
}
|
|
11426
|
-
const
|
|
11538
|
+
const buildLogRecord = buildLogResult && typeof buildLogResult === "object"
|
|
11539
|
+
? buildLogResult
|
|
11540
|
+
: undefined;
|
|
11541
|
+
const buildLogText = typeof buildLogRecord?.Log?.Text === 'string' ? buildLogRecord.Log.Text : '';
|
|
11427
11542
|
const processLogText = Array.isArray(processLogs) && processLogs.length > 0 ? normalizeProcessLogText(processLogs) : '';
|
|
11428
11543
|
const combinedLogText = [buildLogText, processLogText].filter(Boolean).join('\n');
|
|
11429
11544
|
return {
|
|
@@ -11435,7 +11550,7 @@ function registerCloudRunTools(server) {
|
|
|
11435
11550
|
data: {
|
|
11436
11551
|
buildId,
|
|
11437
11552
|
deployRecord: latestDeploy,
|
|
11438
|
-
buildLog:
|
|
11553
|
+
buildLog: buildLogRecord?.Log || null,
|
|
11439
11554
|
// Optional best-effort attach; prefer dedicated getProcessLog for runtime diagnosis
|
|
11440
11555
|
processLogs,
|
|
11441
11556
|
combinedLogText,
|
|
@@ -13440,7 +13555,7 @@ class TelemetryReporter {
|
|
|
13440
13555
|
const arch = os_1.default.arch(); // 系统架构
|
|
13441
13556
|
// Build-time injected version; guard for vitest / non-webpack runtimes.
|
|
13442
13557
|
const mcpVersion = process.env.npm_package_version ||
|
|
13443
|
-
( true ? "2.
|
|
13558
|
+
( true ? "2.31.0" : 0);
|
|
13444
13559
|
return {
|
|
13445
13560
|
userAgent: `${osType} ${osRelease} ${arch} ${nodeVersion} CloudBase-MCP/${mcpVersion}`,
|
|
13446
13561
|
deviceId: this.deviceId,
|
|
@@ -19347,7 +19462,7 @@ function registerSetupTools(server) {
|
|
|
19347
19462
|
server.registerTool("downloadTemplate", {
|
|
19348
19463
|
title: "下载项目模板",
|
|
19349
19464
|
description: `自动下载并部署CloudBase项目模板。
|
|
19350
|
-
**Note**: Call this tool when the user requests to create a new project using a CloudBase template.\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- 其他IDE类型见下方列表\n\n注意:如果未传入 ide 参数且无法从环境变量检测到 IDE,将提示错误并要求传入 ide 参数\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- kiro: Kiro AI编辑器\n- aider: Aider AI编辑器\n\n特别说明:\n- rules 模板会自动包含当前 mcp 版本号信息(版本号:${ true ? "2.
|
|
19465
|
+
**Note**: Call this tool when the user requests to create a new project using a CloudBase template.\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- 其他IDE类型见下方列表\n\n注意:如果未传入 ide 参数且无法从环境变量检测到 IDE,将提示错误并要求传入 ide 参数\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- kiro: Kiro AI编辑器\n- aider: Aider AI编辑器\n\n特别说明:\n- rules 模板会自动包含当前 mcp 版本号信息(版本号:${ true ? "2.31.0" : 0}),便于后续维护和版本追踪\n- 下载 rules 模板时,如果项目中已存在 README.md 文件,系统会自动保护该文件不被覆盖(除非设置 overwrite=true)`,
|
|
19351
19466
|
inputSchema: {
|
|
19352
19467
|
template: zod_1.z
|
|
19353
19468
|
.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.
|
|
3
|
+
"version": "2.31.0",
|
|
4
4
|
"mcpName": "io.github.TencentCloudBase/cloudbase-mcp",
|
|
5
5
|
"packageManager": "pnpm@10.8.0",
|
|
6
6
|
"description": "CloudBase MCP Server — operate Tencent CloudBase (database, auth, functions, storage, hosting) from AI coding tools via the Model Context Protocol. Part of CloudBase AI Toolkit.",
|
package/server.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "io.github.TencentCloudBase/cloudbase-mcp",
|
|
4
4
|
"title": "CloudBase",
|
|
5
5
|
"description": "CloudBase MCP: DB, functions, storage, hosting via @cloudbase/cloudbase-mcp",
|
|
6
|
-
"version": "2.
|
|
6
|
+
"version": "2.31.0",
|
|
7
7
|
"websiteUrl": "https://github.com/TencentCloudBase/CloudBase-AI-Toolkit",
|
|
8
8
|
"repository": {
|
|
9
9
|
"url": "https://github.com/TencentCloudBase/CloudBase-AI-Toolkit",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"registryType": "npm",
|
|
26
26
|
"registryBaseUrl": "https://registry.npmjs.org",
|
|
27
27
|
"identifier": "@cloudbase/cloudbase-mcp",
|
|
28
|
-
"version": "2.
|
|
28
|
+
"version": "2.31.0",
|
|
29
29
|
"runtimeHint": "npx",
|
|
30
30
|
"transport": {
|
|
31
31
|
"type": "stdio"
|