@cloudbase/cloudbase-mcp 2.21.1 → 2.22.0-beta.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/508.index.cjs +21 -21
- package/dist/cli.cjs +3 -3
- package/dist/index.cjs +2528 -677
- package/dist/index.d.ts +133 -1
- package/dist/index.js +2550 -710
- package/package.json +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -13,7 +13,24 @@ export declare interface AuthOptions {
|
|
|
13
13
|
oauthCustom?: boolean;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
/**
|
|
17
|
+
* 自定义 API 请求函数,由外部注入,替代 TC3 签名发请求。
|
|
18
|
+
* 入参对齐 CAPI 模式:service + action + version + region + payload。
|
|
19
|
+
* 返回腾讯云 API 响应中 Response 字段的内容(已解包)。
|
|
20
|
+
*/
|
|
21
|
+
export declare type CloudApiRequestFn = (params: {
|
|
22
|
+
service: string;
|
|
23
|
+
action: string;
|
|
24
|
+
version: string;
|
|
25
|
+
region: string;
|
|
26
|
+
payload: Record<string, any>;
|
|
27
|
+
}) => Promise<any>;
|
|
28
|
+
|
|
29
|
+
declare type CloudBaseConfigBase = NonNullable<ConstructorParameters<typeof CloudBase>[0]>;
|
|
30
|
+
|
|
31
|
+
export declare type CloudBaseOptions = CloudBaseConfigBase & {
|
|
32
|
+
requestFn?: CloudApiRequestFn;
|
|
33
|
+
};
|
|
17
34
|
|
|
18
35
|
/**
|
|
19
36
|
* Create a manager with the provided CloudBase options, without using cache
|
|
@@ -53,6 +70,7 @@ export declare function createCloudBaseMcpServer(options?: {
|
|
|
53
70
|
logger?: Logger;
|
|
54
71
|
pluginsEnabled?: string[];
|
|
55
72
|
pluginsDisabled?: string[];
|
|
73
|
+
pluginOptions?: PluginOptions;
|
|
56
74
|
}): Promise<ExtendedMcpServer>;
|
|
57
75
|
|
|
58
76
|
export declare interface DataModel {
|
|
@@ -141,11 +159,50 @@ export declare interface ExtendedMcpServer extends McpServer {
|
|
|
141
159
|
authOptions?: AuthOptions;
|
|
142
160
|
ide?: string;
|
|
143
161
|
logger?: Logger;
|
|
162
|
+
pgRuntimeContext?: PgRuntimeContext;
|
|
163
|
+
enabledPlugins?: string[];
|
|
164
|
+
pluginOptions?: PluginOptions;
|
|
165
|
+
/** 已注册工具的列表,供外部(如微信 IDE)提取并注册到自己的 MCP server */
|
|
166
|
+
toolDefs: Array<{
|
|
167
|
+
name: string;
|
|
168
|
+
description: string;
|
|
169
|
+
inputSchema: any;
|
|
170
|
+
handler: (input: any) => Promise<any>;
|
|
171
|
+
}>;
|
|
144
172
|
setLogger(logger: Logger): void;
|
|
145
173
|
}
|
|
146
174
|
|
|
147
175
|
export declare function formatRuntimeList(): string;
|
|
148
176
|
|
|
177
|
+
/**
|
|
178
|
+
* manageFunctions 工具中部分 action 的 override 钩子
|
|
179
|
+
* 参数使用 CloudBase 领域语言,与 MCP 内部 DTO 解耦
|
|
180
|
+
* 实现方(如微信 IDE)负责在内部做参数适配
|
|
181
|
+
*
|
|
182
|
+
* - createFunction / updateFunctionCode:有默认实现,override 后可走外部专有接口
|
|
183
|
+
* - incrementalDeployFunction:无默认实现,必须通过 pluginOptions 注入
|
|
184
|
+
*/
|
|
185
|
+
export declare interface FunctionDeployOverrides {
|
|
186
|
+
createFunction?: (params: {
|
|
187
|
+
functionName: string;
|
|
188
|
+
functionRootPath: string;
|
|
189
|
+
runtime?: string;
|
|
190
|
+
force?: boolean;
|
|
191
|
+
installDependency?: boolean;
|
|
192
|
+
}) => Promise<any>;
|
|
193
|
+
updateFunctionCode?: (params: {
|
|
194
|
+
functionName: string;
|
|
195
|
+
functionRootPath: string;
|
|
196
|
+
force?: boolean;
|
|
197
|
+
installDependency?: boolean;
|
|
198
|
+
}) => Promise<any>;
|
|
199
|
+
incrementalDeployFunction?: (params: {
|
|
200
|
+
functionName: string;
|
|
201
|
+
functionRootPath: string;
|
|
202
|
+
incrementalFile: string;
|
|
203
|
+
}) => Promise<any>;
|
|
204
|
+
}
|
|
205
|
+
|
|
149
206
|
/**
|
|
150
207
|
* 每次都实时获取最新的 token/secretId/secretKey
|
|
151
208
|
*/
|
|
@@ -276,6 +333,23 @@ export declare function logout(): Promise<void>;
|
|
|
276
333
|
|
|
277
334
|
export { McpServer }
|
|
278
335
|
|
|
336
|
+
declare interface PgRuntimeContext {
|
|
337
|
+
envId: string;
|
|
338
|
+
instanceId: string;
|
|
339
|
+
defaultSchema: string;
|
|
340
|
+
runtimeMode: "cloudbase-manager";
|
|
341
|
+
bootstrapMode: "cloud";
|
|
342
|
+
role?: string;
|
|
343
|
+
createdAt: string;
|
|
344
|
+
updatedAt: string;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
/** 各插件的可选配置 */
|
|
348
|
+
export declare interface PluginOptions {
|
|
349
|
+
functions?: FunctionDeployOverrides;
|
|
350
|
+
storage?: StorageOverrides;
|
|
351
|
+
}
|
|
352
|
+
|
|
279
353
|
export declare const RAW_IDE_FILE_MAPPINGS: Record<string, IdeFileDescriptor[]>;
|
|
280
354
|
|
|
281
355
|
export declare const RECOMMENDED_RUNTIMES: {
|
|
@@ -325,6 +399,64 @@ export declare function simplifyEnvList(envList: any[]): any[];
|
|
|
325
399
|
|
|
326
400
|
export { StdioServerTransport }
|
|
327
401
|
|
|
402
|
+
/**
|
|
403
|
+
* 存储工具中需要 COS SDK 操作的 override 钩子
|
|
404
|
+
* 实现方(如微信 IDE)负责在内部通过 /route/getcosauth 获取临时签名并操作 COS
|
|
405
|
+
*
|
|
406
|
+
* - listFiles / getFileInfo / downloadFile:queryStorage 只读操作
|
|
407
|
+
* - uploadFile / deleteFiles / deleteDirectory:manageStorage 写操作
|
|
408
|
+
* - getFileUrl:获取文件临时下载链接(可选,未提供时使用 CAPI 默认实现)
|
|
409
|
+
*/
|
|
410
|
+
declare interface StorageOverrides {
|
|
411
|
+
/** 列出目录下的文件,替代 storageService.listDirectoryFiles() */
|
|
412
|
+
listFiles?: (params: {
|
|
413
|
+
cloudPath: string;
|
|
414
|
+
}) => Promise<Array<Record<string, any>>>;
|
|
415
|
+
/** 获取文件元信息,替代 storageService.getFileInfo() */
|
|
416
|
+
getFileInfo?: (params: {
|
|
417
|
+
cloudPath: string;
|
|
418
|
+
}) => Promise<Record<string, any>>;
|
|
419
|
+
/** 下载文件到本地,替代 storageService.downloadFile() */
|
|
420
|
+
downloadFile?: (params: {
|
|
421
|
+
cloudPath: string;
|
|
422
|
+
localPath: string;
|
|
423
|
+
}) => Promise<void>;
|
|
424
|
+
/** 下载目录到本地,替代 storageService.downloadDirectory() */
|
|
425
|
+
downloadDirectory?: (params: {
|
|
426
|
+
cloudPath: string;
|
|
427
|
+
localPath: string;
|
|
428
|
+
}) => Promise<void>;
|
|
429
|
+
/** 上传单个文件,替代 storageService.uploadFile() */
|
|
430
|
+
uploadFile?: (params: {
|
|
431
|
+
localPath: string;
|
|
432
|
+
cloudPath: string;
|
|
433
|
+
}) => Promise<void>;
|
|
434
|
+
/** 上传目录,替代 storageService.uploadDirectory() */
|
|
435
|
+
uploadDirectory?: (params: {
|
|
436
|
+
localPath: string;
|
|
437
|
+
cloudPath: string;
|
|
438
|
+
}) => Promise<void>;
|
|
439
|
+
/**
|
|
440
|
+
* 获取文件临时下载链接,替代 storageService.getTemporaryUrl()
|
|
441
|
+
* 可通过 COS getObjectUrl 实现;未提供时走 manager-node 默认路径
|
|
442
|
+
*/
|
|
443
|
+
getFileUrl?: (params: {
|
|
444
|
+
cloudPath: string;
|
|
445
|
+
maxAge?: number;
|
|
446
|
+
}) => Promise<{
|
|
447
|
+
url: string;
|
|
448
|
+
fileId?: string;
|
|
449
|
+
}>;
|
|
450
|
+
/** 删除文件(支持批量),替代 storageService.deleteFile() */
|
|
451
|
+
deleteFiles?: (params: {
|
|
452
|
+
cloudPaths: string[];
|
|
453
|
+
}) => Promise<void>;
|
|
454
|
+
/** 删除目录,替代 storageService.deleteDirectory() */
|
|
455
|
+
deleteDirectory?: (params: {
|
|
456
|
+
cloudPath: string;
|
|
457
|
+
}) => Promise<void>;
|
|
458
|
+
}
|
|
459
|
+
|
|
328
460
|
export declare const SUPPORTED_NODEJS_RUNTIMES: readonly ["Nodejs20.19", "Nodejs18.15", "Nodejs16.13", "Nodejs14.18", "Nodejs12.16", "Nodejs10.15", "Nodejs8.9"];
|
|
329
461
|
|
|
330
462
|
export declare const SUPPORTED_RUNTIMES: {
|