@cloudbase/cloudbase-mcp 2.6.4 → 2.7.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 +1 -1
- package/dist/index.cjs +109 -58
- package/dist/index.d.ts +1 -0
- package/dist/index.js +110 -58
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -89292,7 +89292,21 @@ function registerFunctionTools(server) {
|
|
|
89292
89292
|
// }
|
|
89293
89293
|
// 使用闭包中的 cloudBaseOptions
|
|
89294
89294
|
const cloudbase = await getManager();
|
|
89295
|
-
const
|
|
89295
|
+
const functionDetail = await cloudbase.functions.getFunctionDetail(funcParam.name);
|
|
89296
|
+
functionDetail.Environment;
|
|
89297
|
+
const vpc = (typeof functionDetail.VpcConfig === 'object' && functionDetail.VpcConfig !== null && functionDetail.VpcConfig.SubnetId && functionDetail.VpcConfig.VpcId) ? {
|
|
89298
|
+
subnetId: functionDetail.VpcConfig.SubnetId,
|
|
89299
|
+
vpcId: functionDetail.VpcConfig.VpcId
|
|
89300
|
+
} : undefined;
|
|
89301
|
+
const result = await cloudbase.functions.updateFunctionConfig({
|
|
89302
|
+
name: funcParam.name,
|
|
89303
|
+
envVariables: Object.assign({}, functionDetail.Environment.Variables.reduce((acc, curr) => {
|
|
89304
|
+
acc[curr.Key] = curr.Value;
|
|
89305
|
+
return acc;
|
|
89306
|
+
}, {}), funcParam.envVariables ?? {}),
|
|
89307
|
+
timeout: funcParam.timeout ?? functionDetail.Timeout,
|
|
89308
|
+
vpc: Object.assign({}, vpc, funcParam.vpc ?? {}),
|
|
89309
|
+
});
|
|
89296
89310
|
(0, cloudbase_manager_js_1.logCloudBaseResult)(server.logger, result);
|
|
89297
89311
|
return {
|
|
89298
89312
|
content: [
|
|
@@ -137005,7 +137019,7 @@ class TelemetryReporter {
|
|
|
137005
137019
|
const nodeVersion = process.version; // Node.js版本
|
|
137006
137020
|
const arch = os_1.default.arch(); // 系统架构
|
|
137007
137021
|
// 从构建时注入的版本号获取MCP版本信息
|
|
137008
|
-
const mcpVersion = process.env.npm_package_version || "2.
|
|
137022
|
+
const mcpVersion = process.env.npm_package_version || "2.7.0" || 0;
|
|
137009
137023
|
return {
|
|
137010
137024
|
userAgent: `${osType} ${osRelease} ${arch} ${nodeVersion} CloudBase-MCP/${mcpVersion}`,
|
|
137011
137025
|
deviceId: this.deviceId,
|
|
@@ -203569,7 +203583,7 @@ ${envIdSection}
|
|
|
203569
203583
|
## 环境信息
|
|
203570
203584
|
- 操作系统: ${os_1.default.type()} ${os_1.default.release()}
|
|
203571
203585
|
- Node.js版本: ${process.version}
|
|
203572
|
-
- MCP 版本:${process.env.npm_package_version || "2.
|
|
203586
|
+
- MCP 版本:${process.env.npm_package_version || "2.7.0" || 0}
|
|
203573
203587
|
- 系统架构: ${os_1.default.arch()}
|
|
203574
203588
|
- 时间: ${new Date().toISOString()}
|
|
203575
203589
|
- 请求ID: ${requestId}
|
|
@@ -217885,6 +217899,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
217885
217899
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
217886
217900
|
};
|
|
217887
217901
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
217902
|
+
exports.RAW_IDE_FILE_MAPPINGS = void 0;
|
|
217888
217903
|
exports.registerSetupTools = registerSetupTools;
|
|
217889
217904
|
const adm_zip_1 = __importDefault(__webpack_require__(30283));
|
|
217890
217905
|
const fs = __importStar(__webpack_require__(29021));
|
|
@@ -217939,45 +217954,72 @@ const IDE_TYPES = [
|
|
|
217939
217954
|
"antigravity", // Google Antigravity AI编辑器
|
|
217940
217955
|
"vscode", // Visual Studio Code
|
|
217941
217956
|
"kiro", // Kiro AI编辑器
|
|
217957
|
+
"aider", // Aider AI编辑器
|
|
217942
217958
|
];
|
|
217943
217959
|
// IDE到文件的映射关系
|
|
217944
217960
|
// 注意:以 "/" 结尾的路径表示目录,会包含该目录下的所有文件
|
|
217945
|
-
|
|
217946
|
-
cursor: [
|
|
217947
|
-
|
|
217948
|
-
|
|
217961
|
+
exports.RAW_IDE_FILE_MAPPINGS = {
|
|
217962
|
+
cursor: [
|
|
217963
|
+
{ path: ".cursor/rules/" },
|
|
217964
|
+
{ path: ".cursor/mcp.json", isMcpConfig: true },
|
|
217965
|
+
],
|
|
217966
|
+
windsurf: [{ path: ".windsurf/rules/" }],
|
|
217967
|
+
codebuddy: [
|
|
217968
|
+
{ path: ".rules/cloudbase-rules.md" },
|
|
217969
|
+
{ path: "CODEBUDDY.md" },
|
|
217970
|
+
{ path: ".mcp.json", isMcpConfig: true },
|
|
217971
|
+
],
|
|
217949
217972
|
"claude-code": [
|
|
217950
|
-
"CLAUDE.md",
|
|
217951
|
-
".mcp.json",
|
|
217952
|
-
".claude/
|
|
217953
|
-
|
|
217954
|
-
|
|
217955
|
-
|
|
217973
|
+
{ path: "CLAUDE.md" },
|
|
217974
|
+
{ path: ".mcp.json", isMcpConfig: true },
|
|
217975
|
+
{ path: ".claude/" },
|
|
217976
|
+
],
|
|
217977
|
+
cline: [{ path: ".clinerules/" }],
|
|
217978
|
+
"gemini-cli": [
|
|
217979
|
+
{ path: ".gemini/GEMINI.md" },
|
|
217980
|
+
{ path: ".gemini/settings.json", isMcpConfig: true },
|
|
217981
|
+
],
|
|
217982
|
+
opencode: [{ path: ".opencode.json", isMcpConfig: true }],
|
|
217983
|
+
"qwen-code": [
|
|
217984
|
+
{ path: ".qwen/QWEN.md" },
|
|
217985
|
+
{ path: ".qwen/settings.json", isMcpConfig: true },
|
|
217956
217986
|
],
|
|
217957
|
-
cline: [".clinerules/"],
|
|
217958
|
-
"gemini-cli": [".gemini/GEMINI.md", ".gemini/settings.json"],
|
|
217959
|
-
opencode: [".opencode.json"],
|
|
217960
|
-
"qwen-code": [".qwen/QWEN.md", ".qwen/settings.json"],
|
|
217961
217987
|
"baidu-comate": [
|
|
217962
|
-
".comate/rules/cloudbase-rules.mdr",
|
|
217963
|
-
".comate/rules/cloudbaase-rules.mdr",
|
|
217964
|
-
".comate/mcp.json",
|
|
217988
|
+
{ path: ".comate/rules/cloudbase-rules.mdr" },
|
|
217989
|
+
{ path: ".comate/rules/cloudbaase-rules.mdr" },
|
|
217990
|
+
{ path: ".comate/mcp.json", isMcpConfig: true },
|
|
217991
|
+
],
|
|
217992
|
+
"openai-codex-cli": [
|
|
217993
|
+
{ path: ".codex/config.toml", isMcpConfig: true },
|
|
217994
|
+
{ path: "AGENTS.md" },
|
|
217965
217995
|
],
|
|
217966
|
-
"
|
|
217967
|
-
"
|
|
217968
|
-
|
|
217969
|
-
|
|
217970
|
-
|
|
217971
|
-
|
|
217972
|
-
|
|
217973
|
-
|
|
217974
|
-
|
|
217975
|
-
|
|
217996
|
+
"augment-code": [{ path: ".augment-guidelines" }],
|
|
217997
|
+
"github-copilot": [{ path: ".github/copilot-instructions.md" }],
|
|
217998
|
+
roocode: [
|
|
217999
|
+
{ path: ".roo/rules/cloudbaase-rules.md" },
|
|
218000
|
+
{ path: ".roo/mcp.json", isMcpConfig: true },
|
|
218001
|
+
],
|
|
218002
|
+
"tongyi-lingma": [{ path: ".lingma/rules/cloudbaase-rules.md" }],
|
|
218003
|
+
trae: [{ path: ".trae/rules/" }],
|
|
218004
|
+
qoder: [{ path: ".qoder/rules/" }],
|
|
218005
|
+
antigravity: [{ path: ".agent/rules/" }],
|
|
218006
|
+
vscode: [
|
|
218007
|
+
{ path: ".vscode/mcp.json", isMcpConfig: true },
|
|
218008
|
+
{ path: ".vscode/settings.json" },
|
|
218009
|
+
],
|
|
218010
|
+
kiro: [
|
|
218011
|
+
{ path: ".kiro/settings/mcp.json", isMcpConfig: true },
|
|
218012
|
+
{ path: ".kiro/steering/" },
|
|
218013
|
+
],
|
|
218014
|
+
aider: [{ path: "mcp.json", isMcpConfig: true }],
|
|
217976
218015
|
};
|
|
218016
|
+
const IDE_FILE_MAPPINGS = structuredClone(exports.RAW_IDE_FILE_MAPPINGS);
|
|
217977
218017
|
// 所有IDE配置文件的完整列表 - 通过IDE_FILE_MAPPINGS计算得出
|
|
217978
|
-
const ALL_IDE_FILES = Array.from(new Set(Object.values(IDE_FILE_MAPPINGS)
|
|
218018
|
+
const ALL_IDE_FILES = Array.from(new Set(Object.values(IDE_FILE_MAPPINGS)
|
|
218019
|
+
.flat()
|
|
218020
|
+
.map((descriptor) => descriptor.path)));
|
|
217979
218021
|
// 为"all"选项添加映射
|
|
217980
|
-
IDE_FILE_MAPPINGS["all"] = ALL_IDE_FILES;
|
|
218022
|
+
IDE_FILE_MAPPINGS["all"] = ALL_IDE_FILES.map((path) => ({ path }));
|
|
217981
218023
|
// IDE描述映射
|
|
217982
218024
|
const IDE_DESCRIPTIONS = {
|
|
217983
218025
|
all: "所有IDE配置",
|
|
@@ -218000,6 +218042,7 @@ const IDE_DESCRIPTIONS = {
|
|
|
218000
218042
|
antigravity: "Google Antigravity AI编辑器",
|
|
218001
218043
|
vscode: "Visual Studio Code",
|
|
218002
218044
|
kiro: "Kiro AI编辑器",
|
|
218045
|
+
aider: "Aider AI编辑器",
|
|
218003
218046
|
};
|
|
218004
218047
|
// INTEGRATION_IDE 环境变量值到 IDE 类型的映射
|
|
218005
218048
|
const INTEGRATION_IDE_MAPPING = {
|
|
@@ -218184,6 +218227,20 @@ function matchesPath(file, pathPattern) {
|
|
|
218184
218227
|
return file === pathPattern;
|
|
218185
218228
|
}
|
|
218186
218229
|
}
|
|
218230
|
+
// 构建 IDE 配置文件检查清单
|
|
218231
|
+
// 返回所有需要检查的路径模式列表
|
|
218232
|
+
function buildIDEChecklist() {
|
|
218233
|
+
return ALL_IDE_FILES;
|
|
218234
|
+
}
|
|
218235
|
+
// 检查文件是否在检查清单范围内
|
|
218236
|
+
function isInChecklist(file, checklist) {
|
|
218237
|
+
for (const pattern of checklist) {
|
|
218238
|
+
if (matchesPath(file, pattern)) {
|
|
218239
|
+
return true;
|
|
218240
|
+
}
|
|
218241
|
+
}
|
|
218242
|
+
return false;
|
|
218243
|
+
}
|
|
218187
218244
|
// 文件过滤函数
|
|
218188
218245
|
function filterFilesByIDE(files, ide) {
|
|
218189
218246
|
if (ide === "all") {
|
|
@@ -218193,32 +218250,24 @@ function filterFilesByIDE(files, ide) {
|
|
|
218193
218250
|
if (!ideFiles) {
|
|
218194
218251
|
return files; // 如果找不到映射,返回所有文件
|
|
218195
218252
|
}
|
|
218196
|
-
//
|
|
218197
|
-
const
|
|
218198
|
-
//
|
|
218199
|
-
for (const ideFile of ALL_IDE_FILES) {
|
|
218200
|
-
// 检查这个文件是否属于当前IDE需要的文件
|
|
218201
|
-
let isCurrentIDEFile = false;
|
|
218202
|
-
for (const currentIDEFile of ideFiles) {
|
|
218203
|
-
if (matchesPath(ideFile, currentIDEFile)) {
|
|
218204
|
-
isCurrentIDEFile = true;
|
|
218205
|
-
break;
|
|
218206
|
-
}
|
|
218207
|
-
}
|
|
218208
|
-
// 如果不属于当前IDE,加入排除列表
|
|
218209
|
-
if (!isCurrentIDEFile) {
|
|
218210
|
-
filesToExclude.push(ideFile);
|
|
218211
|
-
}
|
|
218212
|
-
}
|
|
218213
|
-
// 排除不需要的IDE配置文件,保留其他所有文件
|
|
218253
|
+
// 构建检查清单
|
|
218254
|
+
const checklist = buildIDEChecklist();
|
|
218255
|
+
// 两阶段过滤
|
|
218214
218256
|
return files.filter((file) => {
|
|
218215
|
-
//
|
|
218216
|
-
|
|
218217
|
-
|
|
218218
|
-
|
|
218257
|
+
// 阶段1: 检查文件是否在检查清单范围内
|
|
218258
|
+
if (!isInChecklist(file, checklist)) {
|
|
218259
|
+
// 不在检查清单范围内,直接保留
|
|
218260
|
+
return true;
|
|
218261
|
+
}
|
|
218262
|
+
// 阶段2: 在检查清单范围内,检查是否属于当前 IDE
|
|
218263
|
+
for (const ideFile of ideFiles) {
|
|
218264
|
+
if (matchesPath(file, ideFile.path)) {
|
|
218265
|
+
// 属于当前 IDE,保留
|
|
218266
|
+
return true;
|
|
218219
218267
|
}
|
|
218220
218268
|
}
|
|
218221
|
-
|
|
218269
|
+
// 在检查清单范围内但不属于当前 IDE,排除
|
|
218270
|
+
return false;
|
|
218222
218271
|
});
|
|
218223
218272
|
}
|
|
218224
218273
|
// 创建过滤后的目录结构
|
|
@@ -218246,7 +218295,7 @@ function registerSetupTools(server) {
|
|
|
218246
218295
|
title: "下载项目模板",
|
|
218247
218296
|
description: `自动下载并部署CloudBase项目模板。⚠️ **MANDATORY FOR NEW PROJECTS** ⚠️
|
|
218248
218297
|
|
|
218249
|
-
**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.
|
|
218298
|
+
**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- kiro: Kiro AI编辑器\n- aider: Aider AI编辑器\n\n特别说明:\n- rules 模板会自动包含当前 mcp 版本号信息(版本号:${ true ? "2.7.0" : 0}),便于后续维护和版本追踪\n- 下载 rules 模板时,如果项目中已存在 README.md 文件,系统会自动保护该文件不被覆盖(除非设置 overwrite=true)`,
|
|
218250
218299
|
inputSchema: {
|
|
218251
218300
|
template: zod_1.z
|
|
218252
218301
|
.enum(["react", "vue", "miniprogram", "uniapp", "rules"])
|
|
@@ -220666,7 +220715,7 @@ function tryStat(path) {
|
|
|
220666
220715
|
"use strict";
|
|
220667
220716
|
|
|
220668
220717
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
220669
|
-
exports.envManager = exports.createCloudBaseManagerWithOptions = exports.resetCloudBaseManagerCache = exports.getEnvId = exports.getCloudBaseManager = exports.shouldRegisterTool = exports.getCloudModeStatus = exports.enableCloudMode = exports.isCloudMode = exports.logout = exports.getLoginState = exports.warn = exports.error = exports.info = exports.reportToolCall = exports.reportToolkitLifecycle = exports.telemetryReporter = exports.StdioServerTransport = exports.getDefaultServer = exports.createCloudBaseMcpServer = void 0;
|
|
220718
|
+
exports.RAW_IDE_FILE_MAPPINGS = exports.envManager = exports.createCloudBaseManagerWithOptions = exports.resetCloudBaseManagerCache = exports.getEnvId = exports.getCloudBaseManager = exports.shouldRegisterTool = exports.getCloudModeStatus = exports.enableCloudMode = exports.isCloudMode = exports.logout = exports.getLoginState = exports.warn = exports.error = exports.info = exports.reportToolCall = exports.reportToolkitLifecycle = exports.telemetryReporter = exports.StdioServerTransport = exports.getDefaultServer = exports.createCloudBaseMcpServer = void 0;
|
|
220670
220719
|
exports.getInteractiveServerAsync = getInteractiveServerAsync;
|
|
220671
220720
|
// CloudBase MCP Server Library
|
|
220672
220721
|
var server_js_1 = __webpack_require__(31422);
|
|
@@ -220693,6 +220742,8 @@ Object.defineProperty(exports, "getEnvId", ({ enumerable: true, get: function ()
|
|
|
220693
220742
|
Object.defineProperty(exports, "resetCloudBaseManagerCache", ({ enumerable: true, get: function () { return cloudbase_manager_js_1.resetCloudBaseManagerCache; } }));
|
|
220694
220743
|
Object.defineProperty(exports, "createCloudBaseManagerWithOptions", ({ enumerable: true, get: function () { return cloudbase_manager_js_1.createCloudBaseManagerWithOptions; } }));
|
|
220695
220744
|
Object.defineProperty(exports, "envManager", ({ enumerable: true, get: function () { return cloudbase_manager_js_1.envManager; } }));
|
|
220745
|
+
var setup_js_1 = __webpack_require__(76556);
|
|
220746
|
+
Object.defineProperty(exports, "RAW_IDE_FILE_MAPPINGS", ({ enumerable: true, get: function () { return setup_js_1.RAW_IDE_FILE_MAPPINGS; } }));
|
|
220696
220747
|
/**
|
|
220697
220748
|
* Get interactive server instance (CommonJS compatible)
|
|
220698
220749
|
*/
|
|
@@ -229778,7 +229829,7 @@ class CloudService {
|
|
|
229778
229829
|
[service]: `https://${service}.internal.tencentcloudapi.com`,
|
|
229779
229830
|
})).reduce((acc, cur) => (Object.assign(Object.assign({}, acc), cur)), {});
|
|
229780
229831
|
if (internalEndpoint) {
|
|
229781
|
-
return intranetUrlMap[this.service]
|
|
229832
|
+
return intranetUrlMap[this.service] || `https://${this.service}.internal.tencentcloudapi.com`;
|
|
229782
229833
|
}
|
|
229783
229834
|
if (urlMap[this.service]) {
|
|
229784
229835
|
return urlMap[this.service];
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export type { UploadFileParams, ListFilesParams, DeleteFileParams, GetFileInfoPa
|
|
|
3
3
|
export { getLoginState, logout } from "./auth.js";
|
|
4
4
|
export { isCloudMode, enableCloudMode, getCloudModeStatus, shouldRegisterTool } from "./utils/cloud-mode.js";
|
|
5
5
|
export { getCloudBaseManager, getEnvId, resetCloudBaseManagerCache, createCloudBaseManagerWithOptions, envManager } from "./cloudbase-manager.js";
|
|
6
|
+
export { RAW_IDE_FILE_MAPPINGS } from "./tools/setup.js";
|
|
6
7
|
export type { InteractiveResult } from "./interactive-server.js";
|
|
7
8
|
/**
|
|
8
9
|
* Get interactive server instance (CommonJS compatible)
|
package/dist/index.js
CHANGED
|
@@ -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.
|
|
520
|
+
- MCP 版本:${process.env.npm_package_version || "2.7.0" || 0}
|
|
521
521
|
- 系统架构: ${os_1.default.arch()}
|
|
522
522
|
- 时间: ${new Date().toISOString()}
|
|
523
523
|
- 请求ID: ${requestId}
|
|
@@ -8647,7 +8647,7 @@ class TelemetryReporter {
|
|
|
8647
8647
|
const nodeVersion = process.version; // Node.js版本
|
|
8648
8648
|
const arch = os_1.default.arch(); // 系统架构
|
|
8649
8649
|
// 从构建时注入的版本号获取MCP版本信息
|
|
8650
|
-
const mcpVersion = process.env.npm_package_version || "2.
|
|
8650
|
+
const mcpVersion = process.env.npm_package_version || "2.7.0" || 0;
|
|
8651
8651
|
return {
|
|
8652
8652
|
userAgent: `${osType} ${osRelease} ${arch} ${nodeVersion} CloudBase-MCP/${mcpVersion}`,
|
|
8653
8653
|
deviceId: this.deviceId,
|
|
@@ -9220,7 +9220,21 @@ function registerFunctionTools(server) {
|
|
|
9220
9220
|
// }
|
|
9221
9221
|
// 使用闭包中的 cloudBaseOptions
|
|
9222
9222
|
const cloudbase = await getManager();
|
|
9223
|
-
const
|
|
9223
|
+
const functionDetail = await cloudbase.functions.getFunctionDetail(funcParam.name);
|
|
9224
|
+
functionDetail.Environment;
|
|
9225
|
+
const vpc = (typeof functionDetail.VpcConfig === 'object' && functionDetail.VpcConfig !== null && functionDetail.VpcConfig.SubnetId && functionDetail.VpcConfig.VpcId) ? {
|
|
9226
|
+
subnetId: functionDetail.VpcConfig.SubnetId,
|
|
9227
|
+
vpcId: functionDetail.VpcConfig.VpcId
|
|
9228
|
+
} : undefined;
|
|
9229
|
+
const result = await cloudbase.functions.updateFunctionConfig({
|
|
9230
|
+
name: funcParam.name,
|
|
9231
|
+
envVariables: Object.assign({}, functionDetail.Environment.Variables.reduce((acc, curr) => {
|
|
9232
|
+
acc[curr.Key] = curr.Value;
|
|
9233
|
+
return acc;
|
|
9234
|
+
}, {}), funcParam.envVariables ?? {}),
|
|
9235
|
+
timeout: funcParam.timeout ?? functionDetail.Timeout,
|
|
9236
|
+
vpc: Object.assign({}, vpc, funcParam.vpc ?? {}),
|
|
9237
|
+
});
|
|
9224
9238
|
(0, cloudbase_manager_js_1.logCloudBaseResult)(server.logger, result);
|
|
9225
9239
|
return {
|
|
9226
9240
|
content: [
|
|
@@ -9633,6 +9647,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
9633
9647
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
9634
9648
|
};
|
|
9635
9649
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
9650
|
+
exports.RAW_IDE_FILE_MAPPINGS = void 0;
|
|
9636
9651
|
exports.registerSetupTools = registerSetupTools;
|
|
9637
9652
|
const adm_zip_1 = __importDefault(__webpack_require__(2872));
|
|
9638
9653
|
const fs = __importStar(__webpack_require__(4421));
|
|
@@ -9687,45 +9702,72 @@ const IDE_TYPES = [
|
|
|
9687
9702
|
"antigravity", // Google Antigravity AI编辑器
|
|
9688
9703
|
"vscode", // Visual Studio Code
|
|
9689
9704
|
"kiro", // Kiro AI编辑器
|
|
9705
|
+
"aider", // Aider AI编辑器
|
|
9690
9706
|
];
|
|
9691
9707
|
// IDE到文件的映射关系
|
|
9692
9708
|
// 注意:以 "/" 结尾的路径表示目录,会包含该目录下的所有文件
|
|
9693
|
-
|
|
9694
|
-
cursor: [
|
|
9695
|
-
|
|
9696
|
-
|
|
9709
|
+
exports.RAW_IDE_FILE_MAPPINGS = {
|
|
9710
|
+
cursor: [
|
|
9711
|
+
{ path: ".cursor/rules/" },
|
|
9712
|
+
{ path: ".cursor/mcp.json", isMcpConfig: true },
|
|
9713
|
+
],
|
|
9714
|
+
windsurf: [{ path: ".windsurf/rules/" }],
|
|
9715
|
+
codebuddy: [
|
|
9716
|
+
{ path: ".rules/cloudbase-rules.md" },
|
|
9717
|
+
{ path: "CODEBUDDY.md" },
|
|
9718
|
+
{ path: ".mcp.json", isMcpConfig: true },
|
|
9719
|
+
],
|
|
9697
9720
|
"claude-code": [
|
|
9698
|
-
"CLAUDE.md",
|
|
9699
|
-
".mcp.json",
|
|
9700
|
-
".claude/
|
|
9701
|
-
|
|
9702
|
-
|
|
9703
|
-
|
|
9721
|
+
{ path: "CLAUDE.md" },
|
|
9722
|
+
{ path: ".mcp.json", isMcpConfig: true },
|
|
9723
|
+
{ path: ".claude/" },
|
|
9724
|
+
],
|
|
9725
|
+
cline: [{ path: ".clinerules/" }],
|
|
9726
|
+
"gemini-cli": [
|
|
9727
|
+
{ path: ".gemini/GEMINI.md" },
|
|
9728
|
+
{ path: ".gemini/settings.json", isMcpConfig: true },
|
|
9729
|
+
],
|
|
9730
|
+
opencode: [{ path: ".opencode.json", isMcpConfig: true }],
|
|
9731
|
+
"qwen-code": [
|
|
9732
|
+
{ path: ".qwen/QWEN.md" },
|
|
9733
|
+
{ path: ".qwen/settings.json", isMcpConfig: true },
|
|
9704
9734
|
],
|
|
9705
|
-
cline: [".clinerules/"],
|
|
9706
|
-
"gemini-cli": [".gemini/GEMINI.md", ".gemini/settings.json"],
|
|
9707
|
-
opencode: [".opencode.json"],
|
|
9708
|
-
"qwen-code": [".qwen/QWEN.md", ".qwen/settings.json"],
|
|
9709
9735
|
"baidu-comate": [
|
|
9710
|
-
".comate/rules/cloudbase-rules.mdr",
|
|
9711
|
-
".comate/rules/cloudbaase-rules.mdr",
|
|
9712
|
-
".comate/mcp.json",
|
|
9736
|
+
{ path: ".comate/rules/cloudbase-rules.mdr" },
|
|
9737
|
+
{ path: ".comate/rules/cloudbaase-rules.mdr" },
|
|
9738
|
+
{ path: ".comate/mcp.json", isMcpConfig: true },
|
|
9739
|
+
],
|
|
9740
|
+
"openai-codex-cli": [
|
|
9741
|
+
{ path: ".codex/config.toml", isMcpConfig: true },
|
|
9742
|
+
{ path: "AGENTS.md" },
|
|
9713
9743
|
],
|
|
9714
|
-
"
|
|
9715
|
-
"
|
|
9716
|
-
|
|
9717
|
-
|
|
9718
|
-
|
|
9719
|
-
|
|
9720
|
-
|
|
9721
|
-
|
|
9722
|
-
|
|
9723
|
-
|
|
9744
|
+
"augment-code": [{ path: ".augment-guidelines" }],
|
|
9745
|
+
"github-copilot": [{ path: ".github/copilot-instructions.md" }],
|
|
9746
|
+
roocode: [
|
|
9747
|
+
{ path: ".roo/rules/cloudbaase-rules.md" },
|
|
9748
|
+
{ path: ".roo/mcp.json", isMcpConfig: true },
|
|
9749
|
+
],
|
|
9750
|
+
"tongyi-lingma": [{ path: ".lingma/rules/cloudbaase-rules.md" }],
|
|
9751
|
+
trae: [{ path: ".trae/rules/" }],
|
|
9752
|
+
qoder: [{ path: ".qoder/rules/" }],
|
|
9753
|
+
antigravity: [{ path: ".agent/rules/" }],
|
|
9754
|
+
vscode: [
|
|
9755
|
+
{ path: ".vscode/mcp.json", isMcpConfig: true },
|
|
9756
|
+
{ path: ".vscode/settings.json" },
|
|
9757
|
+
],
|
|
9758
|
+
kiro: [
|
|
9759
|
+
{ path: ".kiro/settings/mcp.json", isMcpConfig: true },
|
|
9760
|
+
{ path: ".kiro/steering/" },
|
|
9761
|
+
],
|
|
9762
|
+
aider: [{ path: "mcp.json", isMcpConfig: true }],
|
|
9724
9763
|
};
|
|
9764
|
+
const IDE_FILE_MAPPINGS = structuredClone(exports.RAW_IDE_FILE_MAPPINGS);
|
|
9725
9765
|
// 所有IDE配置文件的完整列表 - 通过IDE_FILE_MAPPINGS计算得出
|
|
9726
|
-
const ALL_IDE_FILES = Array.from(new Set(Object.values(IDE_FILE_MAPPINGS)
|
|
9766
|
+
const ALL_IDE_FILES = Array.from(new Set(Object.values(IDE_FILE_MAPPINGS)
|
|
9767
|
+
.flat()
|
|
9768
|
+
.map((descriptor) => descriptor.path)));
|
|
9727
9769
|
// 为"all"选项添加映射
|
|
9728
|
-
IDE_FILE_MAPPINGS["all"] = ALL_IDE_FILES;
|
|
9770
|
+
IDE_FILE_MAPPINGS["all"] = ALL_IDE_FILES.map((path) => ({ path }));
|
|
9729
9771
|
// IDE描述映射
|
|
9730
9772
|
const IDE_DESCRIPTIONS = {
|
|
9731
9773
|
all: "所有IDE配置",
|
|
@@ -9748,6 +9790,7 @@ const IDE_DESCRIPTIONS = {
|
|
|
9748
9790
|
antigravity: "Google Antigravity AI编辑器",
|
|
9749
9791
|
vscode: "Visual Studio Code",
|
|
9750
9792
|
kiro: "Kiro AI编辑器",
|
|
9793
|
+
aider: "Aider AI编辑器",
|
|
9751
9794
|
};
|
|
9752
9795
|
// INTEGRATION_IDE 环境变量值到 IDE 类型的映射
|
|
9753
9796
|
const INTEGRATION_IDE_MAPPING = {
|
|
@@ -9932,6 +9975,20 @@ function matchesPath(file, pathPattern) {
|
|
|
9932
9975
|
return file === pathPattern;
|
|
9933
9976
|
}
|
|
9934
9977
|
}
|
|
9978
|
+
// 构建 IDE 配置文件检查清单
|
|
9979
|
+
// 返回所有需要检查的路径模式列表
|
|
9980
|
+
function buildIDEChecklist() {
|
|
9981
|
+
return ALL_IDE_FILES;
|
|
9982
|
+
}
|
|
9983
|
+
// 检查文件是否在检查清单范围内
|
|
9984
|
+
function isInChecklist(file, checklist) {
|
|
9985
|
+
for (const pattern of checklist) {
|
|
9986
|
+
if (matchesPath(file, pattern)) {
|
|
9987
|
+
return true;
|
|
9988
|
+
}
|
|
9989
|
+
}
|
|
9990
|
+
return false;
|
|
9991
|
+
}
|
|
9935
9992
|
// 文件过滤函数
|
|
9936
9993
|
function filterFilesByIDE(files, ide) {
|
|
9937
9994
|
if (ide === "all") {
|
|
@@ -9941,32 +9998,24 @@ function filterFilesByIDE(files, ide) {
|
|
|
9941
9998
|
if (!ideFiles) {
|
|
9942
9999
|
return files; // 如果找不到映射,返回所有文件
|
|
9943
10000
|
}
|
|
9944
|
-
//
|
|
9945
|
-
const
|
|
9946
|
-
//
|
|
9947
|
-
for (const ideFile of ALL_IDE_FILES) {
|
|
9948
|
-
// 检查这个文件是否属于当前IDE需要的文件
|
|
9949
|
-
let isCurrentIDEFile = false;
|
|
9950
|
-
for (const currentIDEFile of ideFiles) {
|
|
9951
|
-
if (matchesPath(ideFile, currentIDEFile)) {
|
|
9952
|
-
isCurrentIDEFile = true;
|
|
9953
|
-
break;
|
|
9954
|
-
}
|
|
9955
|
-
}
|
|
9956
|
-
// 如果不属于当前IDE,加入排除列表
|
|
9957
|
-
if (!isCurrentIDEFile) {
|
|
9958
|
-
filesToExclude.push(ideFile);
|
|
9959
|
-
}
|
|
9960
|
-
}
|
|
9961
|
-
// 排除不需要的IDE配置文件,保留其他所有文件
|
|
10001
|
+
// 构建检查清单
|
|
10002
|
+
const checklist = buildIDEChecklist();
|
|
10003
|
+
// 两阶段过滤
|
|
9962
10004
|
return files.filter((file) => {
|
|
9963
|
-
//
|
|
9964
|
-
|
|
9965
|
-
|
|
9966
|
-
|
|
10005
|
+
// 阶段1: 检查文件是否在检查清单范围内
|
|
10006
|
+
if (!isInChecklist(file, checklist)) {
|
|
10007
|
+
// 不在检查清单范围内,直接保留
|
|
10008
|
+
return true;
|
|
10009
|
+
}
|
|
10010
|
+
// 阶段2: 在检查清单范围内,检查是否属于当前 IDE
|
|
10011
|
+
for (const ideFile of ideFiles) {
|
|
10012
|
+
if (matchesPath(file, ideFile.path)) {
|
|
10013
|
+
// 属于当前 IDE,保留
|
|
10014
|
+
return true;
|
|
9967
10015
|
}
|
|
9968
10016
|
}
|
|
9969
|
-
|
|
10017
|
+
// 在检查清单范围内但不属于当前 IDE,排除
|
|
10018
|
+
return false;
|
|
9970
10019
|
});
|
|
9971
10020
|
}
|
|
9972
10021
|
// 创建过滤后的目录结构
|
|
@@ -9994,7 +10043,7 @@ function registerSetupTools(server) {
|
|
|
9994
10043
|
title: "下载项目模板",
|
|
9995
10044
|
description: `自动下载并部署CloudBase项目模板。⚠️ **MANDATORY FOR NEW PROJECTS** ⚠️
|
|
9996
10045
|
|
|
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.
|
|
10046
|
+
**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- kiro: Kiro AI编辑器\n- aider: Aider AI编辑器\n\n特别说明:\n- rules 模板会自动包含当前 mcp 版本号信息(版本号:${ true ? "2.7.0" : 0}),便于后续维护和版本追踪\n- 下载 rules 模板时,如果项目中已存在 README.md 文件,系统会自动保护该文件不被覆盖(除非设置 overwrite=true)`,
|
|
9998
10047
|
inputSchema: {
|
|
9999
10048
|
template: zod_1.z
|
|
10000
10049
|
.enum(["react", "vue", "miniprogram", "uniapp", "rules"])
|
|
@@ -13653,7 +13702,7 @@ var __webpack_exports__ = {};
|
|
|
13653
13702
|
var exports = __webpack_exports__;
|
|
13654
13703
|
|
|
13655
13704
|
Object.defineProperty(exports, "BJ", ({ value: true }));
|
|
13656
|
-
exports.vY = exports.q8 = exports.bM = exports.fW = exports._k = exports.T$ = exports.$n = exports.S = exports.bT = exports.ri = exports.BS = exports.R8 = exports.z3 = exports.pq = exports.R4 = exports.ps = exports.v7 = exports.S7 = exports.dD = exports.Gh = void 0;
|
|
13705
|
+
exports.pk = exports.vY = exports.q8 = exports.bM = exports.fW = exports._k = exports.T$ = exports.$n = exports.S = exports.bT = exports.ri = exports.BS = exports.R8 = exports.z3 = exports.pq = exports.R4 = exports.ps = exports.v7 = exports.S7 = exports.dD = exports.Gh = void 0;
|
|
13657
13706
|
exports.SJ = getInteractiveServerAsync;
|
|
13658
13707
|
// CloudBase MCP Server Library
|
|
13659
13708
|
var server_js_1 = __webpack_require__(1422);
|
|
@@ -13680,6 +13729,8 @@ Object.defineProperty(exports, "fW", ({ enumerable: true, get: function () { ret
|
|
|
13680
13729
|
Object.defineProperty(exports, "bM", ({ enumerable: true, get: function () { return cloudbase_manager_js_1.resetCloudBaseManagerCache; } }));
|
|
13681
13730
|
Object.defineProperty(exports, "q8", ({ enumerable: true, get: function () { return cloudbase_manager_js_1.createCloudBaseManagerWithOptions; } }));
|
|
13682
13731
|
Object.defineProperty(exports, "vY", ({ enumerable: true, get: function () { return cloudbase_manager_js_1.envManager; } }));
|
|
13732
|
+
var setup_js_1 = __webpack_require__(6556);
|
|
13733
|
+
Object.defineProperty(exports, "pk", ({ enumerable: true, get: function () { return setup_js_1.RAW_IDE_FILE_MAPPINGS; } }));
|
|
13683
13734
|
/**
|
|
13684
13735
|
* Get interactive server instance (CommonJS compatible)
|
|
13685
13736
|
*/
|
|
@@ -13692,6 +13743,7 @@ async function getInteractiveServerAsync() {
|
|
|
13692
13743
|
|
|
13693
13744
|
})();
|
|
13694
13745
|
|
|
13746
|
+
const __webpack_exports__RAW_IDE_FILE_MAPPINGS = __webpack_exports__.pk;
|
|
13695
13747
|
const __webpack_exports__StdioServerTransport = __webpack_exports__.S7;
|
|
13696
13748
|
const __webpack_exports___esModule = __webpack_exports__.BJ;
|
|
13697
13749
|
const __webpack_exports__createCloudBaseManagerWithOptions = __webpack_exports__.q8;
|
|
@@ -13714,4 +13766,4 @@ const __webpack_exports__resetCloudBaseManagerCache = __webpack_exports__.bM;
|
|
|
13714
13766
|
const __webpack_exports__shouldRegisterTool = __webpack_exports__.T$;
|
|
13715
13767
|
const __webpack_exports__telemetryReporter = __webpack_exports__.v7;
|
|
13716
13768
|
const __webpack_exports__warn = __webpack_exports__.R8;
|
|
13717
|
-
export { __webpack_exports__StdioServerTransport as StdioServerTransport, __webpack_exports___esModule as __esModule, __webpack_exports__createCloudBaseManagerWithOptions as createCloudBaseManagerWithOptions, __webpack_exports__createCloudBaseMcpServer as createCloudBaseMcpServer, __webpack_exports__enableCloudMode as enableCloudMode, __webpack_exports__envManager as envManager, __webpack_exports__error as error, __webpack_exports__getCloudBaseManager as getCloudBaseManager, __webpack_exports__getCloudModeStatus as getCloudModeStatus, __webpack_exports__getDefaultServer as getDefaultServer, __webpack_exports__getEnvId as getEnvId, __webpack_exports__getInteractiveServerAsync as getInteractiveServerAsync, __webpack_exports__getLoginState as getLoginState, __webpack_exports__info as info, __webpack_exports__isCloudMode as isCloudMode, __webpack_exports__logout as logout, __webpack_exports__reportToolCall as reportToolCall, __webpack_exports__reportToolkitLifecycle as reportToolkitLifecycle, __webpack_exports__resetCloudBaseManagerCache as resetCloudBaseManagerCache, __webpack_exports__shouldRegisterTool as shouldRegisterTool, __webpack_exports__telemetryReporter as telemetryReporter, __webpack_exports__warn as warn };
|
|
13769
|
+
export { __webpack_exports__RAW_IDE_FILE_MAPPINGS as RAW_IDE_FILE_MAPPINGS, __webpack_exports__StdioServerTransport as StdioServerTransport, __webpack_exports___esModule as __esModule, __webpack_exports__createCloudBaseManagerWithOptions as createCloudBaseManagerWithOptions, __webpack_exports__createCloudBaseMcpServer as createCloudBaseMcpServer, __webpack_exports__enableCloudMode as enableCloudMode, __webpack_exports__envManager as envManager, __webpack_exports__error as error, __webpack_exports__getCloudBaseManager as getCloudBaseManager, __webpack_exports__getCloudModeStatus as getCloudModeStatus, __webpack_exports__getDefaultServer as getDefaultServer, __webpack_exports__getEnvId as getEnvId, __webpack_exports__getInteractiveServerAsync as getInteractiveServerAsync, __webpack_exports__getLoginState as getLoginState, __webpack_exports__info as info, __webpack_exports__isCloudMode as isCloudMode, __webpack_exports__logout as logout, __webpack_exports__reportToolCall as reportToolCall, __webpack_exports__reportToolkitLifecycle as reportToolkitLifecycle, __webpack_exports__resetCloudBaseManagerCache as resetCloudBaseManagerCache, __webpack_exports__shouldRegisterTool as shouldRegisterTool, __webpack_exports__telemetryReporter as telemetryReporter, __webpack_exports__warn as warn };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/cloudbase-mcp",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
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",
|