@cloudbase/cloudbase-mcp 2.35.2 → 2.36.1
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/README.md +71 -0
- package/README.zh-CN.md +43 -0
- package/dist/cli.cjs +11 -11
- package/dist/index.cjs +7550 -408
- package/dist/index.d.ts +23 -57
- package/dist/index.js +7523 -350
- package/package.json +2 -3
- package/server.json +2 -2
- package/dist/267.index.js +0 -4404
- package/dist/880.index.cjs +0 -4393
- package/dist/931.index.cjs +0 -27665
package/dist/index.d.ts
CHANGED
|
@@ -132,6 +132,15 @@ export declare function createCloudBaseMcpServer(options?: {
|
|
|
132
132
|
name: string;
|
|
133
133
|
version?: string;
|
|
134
134
|
};
|
|
135
|
+
/**
|
|
136
|
+
* 会话标识的取值入口(**调用点注入**,可选)。
|
|
137
|
+
*
|
|
138
|
+
* 有状态 HTTP / 托管路径把当前 transport 的 `sessionId` 传进来(那是公开 getter);
|
|
139
|
+
* stdio、以及无状态托管(`sessionIdGenerator: undefined`)没有会话概念 ⇒ **不注入**,
|
|
140
|
+
* 会话级上报回落到常量,等价于"这个实例就是一个会话"。
|
|
141
|
+
* 只有会话级遥测用得到它;不注入时行为与"每实例一条"完全一致。
|
|
142
|
+
*/
|
|
143
|
+
getSessionId?: () => string | undefined;
|
|
135
144
|
logger?: Logger;
|
|
136
145
|
pluginsEnabled?: string[];
|
|
137
146
|
pluginsDisabled?: string[];
|
|
@@ -315,11 +324,6 @@ export declare interface GetFileInfoParams {
|
|
|
315
324
|
cloudPath: string;
|
|
316
325
|
}
|
|
317
326
|
|
|
318
|
-
/**
|
|
319
|
-
* Get interactive server instance (CommonJS compatible)
|
|
320
|
-
*/
|
|
321
|
-
export declare function getInteractiveServerAsync(): Promise<InteractiveServer>;
|
|
322
|
-
|
|
323
327
|
export declare function getLoginState(options?: EnsureLoginOptions): Promise<LoginState | null>;
|
|
324
328
|
|
|
325
329
|
declare interface GetManagerOptions {
|
|
@@ -389,57 +393,6 @@ declare interface IdeFileDescriptor {
|
|
|
389
393
|
|
|
390
394
|
export declare const info: (message: string, data?: object | Error) => void;
|
|
391
395
|
|
|
392
|
-
export declare interface InteractiveResult {
|
|
393
|
-
type: "envId" | "clarification" | "confirmation";
|
|
394
|
-
data: any;
|
|
395
|
-
cancelled?: boolean;
|
|
396
|
-
switch?: boolean;
|
|
397
|
-
timeout?: boolean;
|
|
398
|
-
timeoutDuration?: number;
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
declare class InteractiveServer {
|
|
402
|
-
private app;
|
|
403
|
-
private server;
|
|
404
|
-
private wss;
|
|
405
|
-
private port;
|
|
406
|
-
private isRunning;
|
|
407
|
-
private currentResolver;
|
|
408
|
-
private sessionData;
|
|
409
|
-
private _mcpServer;
|
|
410
|
-
get mcpServer(): any;
|
|
411
|
-
set mcpServer(server: any);
|
|
412
|
-
private readonly DEFAULT_PORT;
|
|
413
|
-
private readonly FALLBACK_PORTS;
|
|
414
|
-
/** Idle timeout for HTTP/WS connections (e.g. long login). Avoids "connection disconnected" after ~1 min. */
|
|
415
|
-
private static readonly SERVER_IDLE_MS;
|
|
416
|
-
/** WebSocket ping interval to keep connection alive past proxies/firewalls. */
|
|
417
|
-
private static readonly WS_PING_INTERVAL_MS;
|
|
418
|
-
constructor(mcpServer?: any);
|
|
419
|
-
private cleanup;
|
|
420
|
-
/** Apply timeouts so long-lived login does not cause "connection disconnected". */
|
|
421
|
-
private applyServerTimeouts;
|
|
422
|
-
private setupExpress;
|
|
423
|
-
private setupWebSocket;
|
|
424
|
-
start(): Promise<number>;
|
|
425
|
-
stop(): Promise<void>;
|
|
426
|
-
collectEnvId(availableEnvs: any[], accountInfo?: {
|
|
427
|
-
uin?: string;
|
|
428
|
-
region?: string;
|
|
429
|
-
site?: string;
|
|
430
|
-
}, errorContext?: any, // EnvSetupContext
|
|
431
|
-
manager?: any, // CloudBase manager instance for refreshing env list
|
|
432
|
-
mcpServer?: any): Promise<InteractiveResult>;
|
|
433
|
-
clarifyRequest(message: string, options?: string[]): Promise<InteractiveResult>;
|
|
434
|
-
private escapeHtml;
|
|
435
|
-
private getEnvSetupHTML;
|
|
436
|
-
private getEnvSetupHTML_OLD;
|
|
437
|
-
private getClarificationHTML;
|
|
438
|
-
private getConfirmationHTML;
|
|
439
|
-
get running(): boolean;
|
|
440
|
-
get currentPort(): number;
|
|
441
|
-
}
|
|
442
|
-
|
|
443
396
|
/**
|
|
444
397
|
* Check if MCP is running in cloud mode
|
|
445
398
|
* Cloud mode is enabled by:
|
|
@@ -490,9 +443,20 @@ declare interface LoginState {
|
|
|
490
443
|
uin?: string | number;
|
|
491
444
|
}
|
|
492
445
|
|
|
446
|
+
/**
|
|
447
|
+
* 退出登录:只清「当前生效的那一份」。
|
|
448
|
+
*
|
|
449
|
+
* 项目级凭据优先于账号级登录态,所以项目里有 API Key 时,登出只删项目文件、清掉
|
|
450
|
+
* 回填的环境变量,账号登录原样保留(删完它自动接上)。再调一次才轮到全局。
|
|
451
|
+
*
|
|
452
|
+
* 不把 cwd 交给 toolbox 的 `logout()`:那个接口会**无条件先删全局凭据**,
|
|
453
|
+
* 「退出本项目」不该把用户的账号级登录一起注销掉。
|
|
454
|
+
*/
|
|
493
455
|
export declare function logout(_options?: {
|
|
494
456
|
site?: string;
|
|
495
|
-
}): Promise<
|
|
457
|
+
}): Promise<{
|
|
458
|
+
removed: Array<"project" | "global">;
|
|
459
|
+
}>;
|
|
496
460
|
|
|
497
461
|
/**
|
|
498
462
|
* 归一化后的客户端能力(字段名保持语义,报表侧再映射到列)。
|
|
@@ -587,6 +551,8 @@ export declare const reportToolCall: (params: {
|
|
|
587
551
|
duration?: number;
|
|
588
552
|
error?: string;
|
|
589
553
|
inputParams?: any;
|
|
554
|
+
/** 工具级 action(如 auth 的 status/set_env),用于区分"同一个工具做了什么" */
|
|
555
|
+
action?: string;
|
|
590
556
|
cloudBaseOptions?: CloudBaseOptions;
|
|
591
557
|
ide?: string;
|
|
592
558
|
client?: string;
|