@cloudbase/cloudbase-mcp 2.28.0 → 2.29.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/index.cjs CHANGED
@@ -86626,6 +86626,182 @@ class Profiler {
86626
86626
  module.exports = Profiler;
86627
86627
 
86628
86628
 
86629
+ /***/ }),
86630
+
86631
+ /***/ 23656:
86632
+ /***/ ((__unused_webpack_module, exports) => {
86633
+
86634
+ "use strict";
86635
+
86636
+ /**
86637
+ * Guidance + bounded wait when a cloud function is not Active.
86638
+ * SCF rejects UpdateFunctionConfiguration / UpdateFunctionCode while Status=Updating.
86639
+ */
86640
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
86641
+ exports.functionUpdatingRuntime = exports.FUNCTION_UPDATING_WAIT = exports.FUNCTION_BUSY_STATUSES = exports.FUNCTION_UPDATING_RETRY_AFTER_SECONDS = exports.FUNCTION_UPDATING_ERROR_CODE = void 0;
86642
+ exports.getErrorMessage = getErrorMessage;
86643
+ exports.isFunctionBusyStatus = isFunctionBusyStatus;
86644
+ exports.isFunctionUpdatingError = isFunctionUpdatingError;
86645
+ exports.buildFunctionUpdatingMessage = buildFunctionUpdatingMessage;
86646
+ exports.buildFunctionUpdatingNextActions = buildFunctionUpdatingNextActions;
86647
+ exports.buildFunctionUpdatingPayload = buildFunctionUpdatingPayload;
86648
+ exports.waitUntilFunctionActive = waitUntilFunctionActive;
86649
+ exports.FUNCTION_UPDATING_ERROR_CODE = "FUNCTION_UPDATING";
86650
+ /** Agents must wait at least this long before retrying the same write. */
86651
+ exports.FUNCTION_UPDATING_RETRY_AFTER_SECONDS = 10;
86652
+ exports.FUNCTION_BUSY_STATUSES = [
86653
+ "Updating",
86654
+ "Creating",
86655
+ "Publishing",
86656
+ "Deleting",
86657
+ ];
86658
+ exports.FUNCTION_UPDATING_WAIT = {
86659
+ intervalMs: 2000,
86660
+ maxAttempts: 5,
86661
+ timeoutMs: 12_000,
86662
+ };
86663
+ /**
86664
+ * Injectable sleep for unit tests. Production uses setTimeout.
86665
+ * Tests must restore the original function in afterEach.
86666
+ */
86667
+ exports.functionUpdatingRuntime = {
86668
+ sleep: (ms) => new Promise((resolve) => {
86669
+ setTimeout(resolve, ms);
86670
+ }),
86671
+ };
86672
+ function getErrorMessage(error) {
86673
+ if (error instanceof Error) {
86674
+ return error.message;
86675
+ }
86676
+ return String(error);
86677
+ }
86678
+ function isFunctionBusyStatus(status) {
86679
+ if (typeof status !== "string") {
86680
+ return false;
86681
+ }
86682
+ return exports.FUNCTION_BUSY_STATUSES.includes(status);
86683
+ }
86684
+ const UPDATING_ERROR_PATTERNS = [
86685
+ /当前函数处于\s*Updating/i,
86686
+ /函数处于\s*Updating/i,
86687
+ /currently\s+(?:in\s+)?updating/i,
86688
+ /function\s+is\s+(?:currently\s+)?updating/i,
86689
+ /Status\s*(?:is|=|:)?\s*Updating/i,
86690
+ /scf\/UpdateFunction(?:Configuration|Code).{0,80}Updating/i,
86691
+ /函数状态异常,检查超时/,
86692
+ ];
86693
+ function isFunctionUpdatingError(error) {
86694
+ const message = getErrorMessage(error);
86695
+ return UPDATING_ERROR_PATTERNS.some((pattern) => pattern.test(message));
86696
+ }
86697
+ function buildFunctionUpdatingMessage(params) {
86698
+ const namePart = params.functionName
86699
+ ? `函数 \`${params.functionName}\``
86700
+ : "目标函数";
86701
+ const statusPart = params.status ? `(当前 Status=${params.status})` : "";
86702
+ const lines = [
86703
+ `${namePart} 尚未就绪${statusPart},无法执行 manageFunctions(action="${params.action}")。`,
86704
+ `不要立即重试同一写操作(SCF 会在 Updating 期间连续拒绝 UpdateFunctionConfiguration / UpdateFunctionCode)。`,
86705
+ `请等待 ${exports.FUNCTION_UPDATING_RETRY_AFTER_SECONDS} 秒后重试,或先调用 queryFunctions(action="getFunctionDetail") 确认 Status 为 Active。`,
86706
+ ];
86707
+ if (params.rawMessage) {
86708
+ lines.push(`原始错误: ${params.rawMessage}`);
86709
+ }
86710
+ return lines.join("\n");
86711
+ }
86712
+ function buildFunctionUpdatingNextActions(params) {
86713
+ const functionName = params.functionName;
86714
+ return [
86715
+ {
86716
+ tool: "queryFunctions",
86717
+ action: "getFunctionDetail",
86718
+ reason: "查看函数 Status,等到 Active 后再写配置/代码",
86719
+ suggested_args: {
86720
+ action: "getFunctionDetail",
86721
+ ...(functionName ? { functionName } : {}),
86722
+ },
86723
+ },
86724
+ {
86725
+ tool: "manageFunctions",
86726
+ action: params.action,
86727
+ reason: `等待 ${exports.FUNCTION_UPDATING_RETRY_AFTER_SECONDS} 秒且 Status=Active 后,用相同参数重试;禁止立刻连打`,
86728
+ suggested_args: {
86729
+ action: params.action,
86730
+ ...(functionName ? { functionName } : {}),
86731
+ },
86732
+ },
86733
+ ];
86734
+ }
86735
+ function buildFunctionUpdatingPayload(params) {
86736
+ return {
86737
+ success: false,
86738
+ errorCode: exports.FUNCTION_UPDATING_ERROR_CODE,
86739
+ retryAfterSeconds: exports.FUNCTION_UPDATING_RETRY_AFTER_SECONDS,
86740
+ message: buildFunctionUpdatingMessage(params),
86741
+ data: {
86742
+ action: params.action,
86743
+ ...(params.functionName ? { functionName: params.functionName } : {}),
86744
+ ...(params.status ? { status: params.status } : {}),
86745
+ retryAfterSeconds: exports.FUNCTION_UPDATING_RETRY_AFTER_SECONDS,
86746
+ doNotRetryImmediately: true,
86747
+ ...(typeof params.waitedAttempts === "number"
86748
+ ? { waitedAttempts: params.waitedAttempts }
86749
+ : {}),
86750
+ ...(params.timedOut ? { waitTimedOut: true } : {}),
86751
+ ...(params.rawMessage ? { rawError: params.rawMessage.slice(0, 500) } : {}),
86752
+ },
86753
+ nextActions: buildFunctionUpdatingNextActions(params),
86754
+ };
86755
+ }
86756
+ /**
86757
+ * Poll function Status until it leaves a busy state.
86758
+ * Always bounded: maxAttempts AND timeoutMs; never spins without a sleep between polls.
86759
+ */
86760
+ async function waitUntilFunctionActive(getStatus, options = {}) {
86761
+ const intervalMs = options.intervalMs ?? exports.FUNCTION_UPDATING_WAIT.intervalMs;
86762
+ const maxAttempts = options.maxAttempts ?? exports.FUNCTION_UPDATING_WAIT.maxAttempts;
86763
+ const timeoutMs = options.timeoutMs ?? exports.FUNCTION_UPDATING_WAIT.timeoutMs;
86764
+ const sleep = options.sleep ?? ((ms) => exports.functionUpdatingRuntime.sleep(ms));
86765
+ const now = options.now ?? Date.now;
86766
+ if (maxAttempts < 1) {
86767
+ throw new Error("waitUntilFunctionActive maxAttempts must be >= 1");
86768
+ }
86769
+ if (intervalMs < 0 || timeoutMs < 0) {
86770
+ throw new Error("waitUntilFunctionActive intervalMs/timeoutMs must be >= 0");
86771
+ }
86772
+ if (options.initialStatus !== undefined &&
86773
+ !isFunctionBusyStatus(options.initialStatus)) {
86774
+ return {
86775
+ ready: true,
86776
+ status: options.initialStatus,
86777
+ attempts: 0,
86778
+ timedOut: false,
86779
+ };
86780
+ }
86781
+ const startedAt = now();
86782
+ let attempts = 0;
86783
+ let status = options.initialStatus;
86784
+ while (attempts < maxAttempts) {
86785
+ if (now() - startedAt >= timeoutMs) {
86786
+ return { ready: false, status, attempts, timedOut: true };
86787
+ }
86788
+ attempts += 1;
86789
+ status = await getStatus();
86790
+ if (!isFunctionBusyStatus(status)) {
86791
+ return { ready: true, status, attempts, timedOut: false };
86792
+ }
86793
+ if (attempts >= maxAttempts) {
86794
+ break;
86795
+ }
86796
+ if (now() - startedAt + intervalMs >= timeoutMs) {
86797
+ return { ready: false, status, attempts, timedOut: true };
86798
+ }
86799
+ await sleep(intervalMs);
86800
+ }
86801
+ return { ready: false, status, attempts, timedOut: false };
86802
+ }
86803
+
86804
+
86629
86805
  /***/ }),
86630
86806
 
86631
86807
  /***/ 23670:
@@ -91433,6 +91609,8 @@ const cloud_mode_js_1 = __webpack_require__(89684);
91433
91609
  const gateway_access_urls_js_1 = __webpack_require__(22435);
91434
91610
  const json_content_js_1 = __webpack_require__(4365);
91435
91611
  const logger_js_1 = __webpack_require__(13039);
91612
+ const tool_result_js_1 = __webpack_require__(9835);
91613
+ const function_updating_js_1 = __webpack_require__(23656);
91436
91614
  const fs_1 = __webpack_require__(29021);
91437
91615
  const path_1 = __importDefault(__webpack_require__(33873));
91438
91616
  exports.SUPPORTED_RUNTIMES = {
@@ -91753,6 +91931,10 @@ function buildFunctionOperationErrorMessage(operation, functionName, functionRoo
91753
91931
  suggestions.push("如果 HTTP 函数只使用原生 Node.js API 且没有第三方依赖,可以保留函数目录中的 index.js 和 scf_bootstrap,工具会跳过依赖安装。");
91754
91932
  suggestions.push("如果你确实依赖 npm 包,请在函数目录下补充 package.json 后重试。");
91755
91933
  }
91934
+ if ((0, function_updating_js_1.isFunctionUpdatingError)(error)) {
91935
+ suggestions.push(`函数当前处于 Updating/非 Active,不要立即重试 ${operation}。` +
91936
+ `请等待约 10 秒,或先 queryFunctions(action="getFunctionDetail") 确认 Status 为 Active 后再重试。`);
91937
+ }
91756
91938
  // Handle invalid parameter value errors from CloudBase API
91757
91939
  if (/invalid parameter value/i.test(baseMessage)) {
91758
91940
  suggestions.push("检测到参数值格式错误。请重点检查以下配置项:");
@@ -91780,6 +91962,24 @@ function wrapFunctionOperationError(operation, functionName, functionRootPath, e
91780
91962
  }
91781
91963
  return wrappedError;
91782
91964
  }
91965
+ async function waitForManageWriteOrGuide(action, functionName, getFunctionDetail, initialDetail) {
91966
+ const waitResult = await (0, function_updating_js_1.waitUntilFunctionActive)(async () => {
91967
+ const latest = await getFunctionDetail(functionName);
91968
+ return typeof latest?.Status === "string" ? latest.Status : undefined;
91969
+ }, {
91970
+ initialStatus: typeof initialDetail?.Status === "string" ? initialDetail.Status : undefined,
91971
+ });
91972
+ if (waitResult.ready) {
91973
+ return undefined;
91974
+ }
91975
+ return (0, function_updating_js_1.buildFunctionUpdatingPayload)({
91976
+ action,
91977
+ functionName,
91978
+ status: waitResult.status,
91979
+ waitedAttempts: waitResult.attempts,
91980
+ timedOut: waitResult.timedOut,
91981
+ });
91982
+ }
91783
91983
  function registerFunctionTools(server) {
91784
91984
  const cloudBaseOptions = server.cloudBaseOptions;
91785
91985
  const deployOverrides = server.pluginOptions?.functions;
@@ -91802,6 +92002,15 @@ function registerFunctionTools(server) {
91802
92002
  return (0, json_content_js_1.jsonContent)(await handler());
91803
92003
  }
91804
92004
  catch (error) {
92005
+ if ((0, tool_result_js_1.isToolPayloadError)(error)) {
92006
+ return (0, json_content_js_1.jsonContent)(error.payload);
92007
+ }
92008
+ if ((0, function_updating_js_1.isFunctionUpdatingError)(error)) {
92009
+ return (0, json_content_js_1.jsonContent)((0, function_updating_js_1.buildFunctionUpdatingPayload)({
92010
+ action: "manageFunctions",
92011
+ rawMessage: (0, function_updating_js_1.getErrorMessage)(error),
92012
+ }));
92013
+ }
91805
92014
  return (0, json_content_js_1.jsonContent)(buildErrorEnvelope(error));
91806
92015
  }
91807
92016
  };
@@ -92356,6 +92565,24 @@ function registerFunctionTools(server) {
92356
92565
  throw new Error("updateFunctionCode 操作时,functionName 参数是必需的");
92357
92566
  }
92358
92567
  const cloudbase = await getManager();
92568
+ if (typeof cloudbase.functions.getFunctionDetail === "function") {
92569
+ try {
92570
+ const currentDetail = await cloudbase.functions.getFunctionDetail(input.functionName);
92571
+ const waited = await waitForManageWriteOrGuide("updateFunctionCode", input.functionName, (name) => cloudbase.functions.getFunctionDetail(name), currentDetail);
92572
+ if (waited) {
92573
+ return waited;
92574
+ }
92575
+ }
92576
+ catch (error) {
92577
+ if ((0, function_updating_js_1.isFunctionUpdatingError)(error)) {
92578
+ return (0, function_updating_js_1.buildFunctionUpdatingPayload)({
92579
+ action: "updateFunctionCode",
92580
+ functionName: input.functionName,
92581
+ rawMessage: (0, function_updating_js_1.getErrorMessage)(error),
92582
+ });
92583
+ }
92584
+ }
92585
+ }
92359
92586
  // 镜像更新分支:后续迭代只需用新镜像 tag 更新函数。
92360
92587
  const updateImageConfig = input.imageConfig ??
92361
92588
  input.func?.imageConfig;
@@ -92374,6 +92601,13 @@ function registerFunctionTools(server) {
92374
92601
  });
92375
92602
  }
92376
92603
  catch (error) {
92604
+ if ((0, function_updating_js_1.isFunctionUpdatingError)(error)) {
92605
+ return (0, function_updating_js_1.buildFunctionUpdatingPayload)({
92606
+ action: "updateFunctionCode",
92607
+ functionName: input.functionName,
92608
+ rawMessage: (0, function_updating_js_1.getErrorMessage)(error),
92609
+ });
92610
+ }
92377
92611
  throw wrapFunctionOperationError("updateFunctionCode", input.functionName, undefined, error);
92378
92612
  }
92379
92613
  (0, cloudbase_manager_js_1.logCloudBaseResult)(server.logger, imageResult);
@@ -92431,6 +92665,13 @@ function registerFunctionTools(server) {
92431
92665
  result = await cloudbase.functions.updateFunctionCode(updateParams);
92432
92666
  }
92433
92667
  catch (error) {
92668
+ if ((0, function_updating_js_1.isFunctionUpdatingError)(error)) {
92669
+ return (0, function_updating_js_1.buildFunctionUpdatingPayload)({
92670
+ action: "updateFunctionCode",
92671
+ functionName: input.functionName,
92672
+ rawMessage: (0, function_updating_js_1.getErrorMessage)(error),
92673
+ });
92674
+ }
92434
92675
  throw wrapFunctionOperationError("updateFunctionCode", input.functionName, processedRootPath, error);
92435
92676
  }
92436
92677
  (0, cloudbase_manager_js_1.logCloudBaseResult)(server.logger, result);
@@ -92475,6 +92716,10 @@ function registerFunctionTools(server) {
92475
92716
  if (!functionDetail) {
92476
92717
  throw new Error(`函数 ${input.functionName} 不存在或无法获取详情`);
92477
92718
  }
92719
+ const configBusy = await waitForManageWriteOrGuide("updateFunctionConfig", input.functionName, (name) => cloudbase.functions.getFunctionDetail(name), functionDetail);
92720
+ if (configBusy) {
92721
+ return configBusy;
92722
+ }
92478
92723
  const currentVpc = typeof functionDetail.VpcConfig === "object" &&
92479
92724
  functionDetail.VpcConfig !== null &&
92480
92725
  functionDetail.VpcConfig.SubnetId &&
@@ -92484,27 +92729,39 @@ function registerFunctionTools(server) {
92484
92729
  vpcId: functionDetail.VpcConfig.VpcId,
92485
92730
  }
92486
92731
  : undefined;
92487
- const result = await cloudbase.functions.updateFunctionConfig({
92488
- name: input.functionName,
92489
- envVariables: Object.assign({}, (functionDetail.Environment?.Variables || []).reduce((acc, curr) => {
92490
- acc[curr.Key] = curr.Value;
92491
- return acc;
92492
- }, {}), input.envVariables ?? {}),
92493
- timeout: input.timeout ?? functionDetail.Timeout,
92494
- vpc: Object.assign({}, currentVpc, input.vpc ?? {}),
92495
- });
92496
- (0, cloudbase_manager_js_1.logCloudBaseResult)(server.logger, result);
92497
- return buildEnvelope({
92498
- action: input.action,
92499
- functionName: input.functionName,
92500
- raw: result,
92501
- }, `已更新函数 ${input.functionName} 的配置`, [
92502
- {
92503
- tool: "queryFunctions",
92504
- action: "getFunctionDetail",
92505
- reason: "确认配置变更结果",
92506
- },
92507
- ]);
92732
+ try {
92733
+ const result = await cloudbase.functions.updateFunctionConfig({
92734
+ name: input.functionName,
92735
+ envVariables: Object.assign({}, (functionDetail.Environment?.Variables || []).reduce((acc, curr) => {
92736
+ acc[curr.Key] = curr.Value;
92737
+ return acc;
92738
+ }, {}), input.envVariables ?? {}),
92739
+ timeout: input.timeout ?? functionDetail.Timeout,
92740
+ vpc: Object.assign({}, currentVpc, input.vpc ?? {}),
92741
+ });
92742
+ (0, cloudbase_manager_js_1.logCloudBaseResult)(server.logger, result);
92743
+ return buildEnvelope({
92744
+ action: input.action,
92745
+ functionName: input.functionName,
92746
+ raw: result,
92747
+ }, `已更新函数 ${input.functionName} 的配置`, [
92748
+ {
92749
+ tool: "queryFunctions",
92750
+ action: "getFunctionDetail",
92751
+ reason: "确认配置变更结果",
92752
+ },
92753
+ ]);
92754
+ }
92755
+ catch (error) {
92756
+ if ((0, function_updating_js_1.isFunctionUpdatingError)(error)) {
92757
+ return (0, function_updating_js_1.buildFunctionUpdatingPayload)({
92758
+ action: "updateFunctionConfig",
92759
+ functionName: input.functionName,
92760
+ rawMessage: (0, function_updating_js_1.getErrorMessage)(error),
92761
+ });
92762
+ }
92763
+ throw error;
92764
+ }
92508
92765
  }
92509
92766
  case "invokeFunction": {
92510
92767
  if (!input.functionName) {
@@ -117417,8 +117674,8 @@ async function describeCloudRunEnvStatus(manager, envId) {
117417
117674
  : "unknown";
117418
117675
  return { isExist: true, status, baseInfo };
117419
117676
  }
117420
- /** CloudRun EnvType for CreateCloudRunEnv (tcbr DescribeEnvBaseInfo enum). */
117421
- exports.CLOUDRUN_ENV_TYPE = "tcbr";
117677
+ /** CloudRun EnvType for CreateCloudRunEnv (baas DescribeEnvBaseInfo enum). */
117678
+ exports.CLOUDRUN_ENV_TYPE = "baas";
117422
117679
  /**
117423
117680
  * Extract VPC binding from DescribeEnvBaseInfo.EnvBaseInfo when the env was
117424
117681
  * opened with an explicit VPC.
@@ -117463,7 +117720,7 @@ function resolveCloudRunDeployVpcInfo(options) {
117463
117720
  };
117464
117721
  }
117465
117722
  /**
117466
- * Build CreateCloudRunEnv Param, always including EnvType=tcbr.
117723
+ * Build CreateCloudRunEnv Param, always including EnvType=baas.
117467
117724
  * Optional vpcId/subnetIds are used when the platform requires an explicit VPC.
117468
117725
  */
117469
117726
  function buildCreateCloudRunEnvParam(options) {
@@ -118180,7 +118437,7 @@ function registerCloudRunTools(server) {
118180
118437
  };
118181
118438
  }
118182
118439
  // 未开通 → 发起异步开通(CreateCloudRunEnv 异步,不阻塞等待)。
118183
- // Always pass EnvType=tcbr; optional vpcId/subnetIds when an explicit VPC is required.
118440
+ // Always pass EnvType=baas; optional vpcId/subnetIds when an explicit VPC is required.
118184
118441
  let createResult;
118185
118442
  try {
118186
118443
  createResult = await manager
@@ -143366,7 +143623,7 @@ class TelemetryReporter {
143366
143623
  const arch = os_1.default.arch(); // 系统架构
143367
143624
  // Build-time injected version; guard for vitest / non-webpack runtimes.
143368
143625
  const mcpVersion = process.env.npm_package_version ||
143369
- ( true ? "2.28.0" : 0);
143626
+ ( true ? "2.29.0" : 0);
143370
143627
  return {
143371
143628
  userAgent: `${osType} ${osRelease} ${arch} ${nodeVersion} CloudBase-MCP/${mcpVersion}`,
143372
143629
  deviceId: this.deviceId,
@@ -225080,7 +225337,7 @@ ${envIdSection}
225080
225337
  ## 环境信息
225081
225338
  - 操作系统: ${os_1.default.type()} ${os_1.default.release()}
225082
225339
  - Node.js版本: ${process.version}
225083
- - MCP 版本:${process.env.npm_package_version || ( true ? "2.28.0" : 0)}
225340
+ - MCP 版本:${process.env.npm_package_version || ( true ? "2.29.0" : 0)}
225084
225341
  - 系统架构: ${os_1.default.arch()}
225085
225342
  - 时间: ${new Date().toISOString()}
225086
225343
  - 请求ID: ${requestId}
@@ -225161,7 +225418,7 @@ function createWrappedHandler(name, handler, server) {
225161
225418
  requestId: (typeof error === 'object' && error && 'requestId' in error) ? error.requestId : '',
225162
225419
  ide: server.ide || process.env.INTEGRATION_IDE || ''
225163
225420
  });
225164
- const mcpVersion = true ? "2.28.0" : 0;
225421
+ const mcpVersion = true ? "2.29.0" : 0;
225165
225422
  const requestIdSuffix = requestId ? `\n🆔 RequestId: ${requestId}` : '';
225166
225423
  const enhancedErrorMessage = `${errorMessage}${requestIdSuffix}\n\n📦 CloudBase MCP v${mcpVersion}\n🔗 遇到问题?请复制以下链接到浏览器打开\n即可自动携带错误详情快速创建 GitHub Issue:\n${issueLink}`;
225167
225424
  // 创建新的错误对象,保持原有的错误类型但更新消息
@@ -242604,7 +242861,7 @@ function registerSetupTools(server) {
242604
242861
  server.registerTool("downloadTemplate", {
242605
242862
  title: "下载项目模板",
242606
242863
  description: `自动下载并部署CloudBase项目模板。
242607
- **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.28.0" : 0}),便于后续维护和版本追踪\n- 下载 rules 模板时,如果项目中已存在 README.md 文件,系统会自动保护该文件不被覆盖(除非设置 overwrite=true)`,
242864
+ **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.29.0" : 0}),便于后续维护和版本追踪\n- 下载 rules 模板时,如果项目中已存在 README.md 文件,系统会自动保护该文件不被覆盖(除非设置 overwrite=true)`,
242608
242865
  inputSchema: {
242609
242866
  template: zod_1.z
242610
242867
  .enum(["react", "vue", "miniprogram", "uniapp", "rules"])