@cloudbase/cloudbase-mcp 2.35.1 → 2.36.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/README.md +87 -4
- package/README.zh-CN.md +43 -0
- package/dist/cli.cjs +11 -11
- package/dist/index.cjs +6656 -288
- package/dist/index.d.ts +30 -56
- package/dist/index.js +6629 -230
- package/package.json +1 -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:
|
|
@@ -494,6 +447,24 @@ export declare function logout(_options?: {
|
|
|
494
447
|
site?: string;
|
|
495
448
|
}): Promise<void>;
|
|
496
449
|
|
|
450
|
+
/**
|
|
451
|
+
* 归一化后的客户端能力(字段名保持语义,报表侧再映射到列)。
|
|
452
|
+
* `undefined` = 握手未完成,与「握手完成但什么都没声明」必须分开:
|
|
453
|
+
* 后者是客户端事实,前者只是我们还没拿到。
|
|
454
|
+
*/
|
|
455
|
+
declare type McpClientCapabilities = {
|
|
456
|
+
/** 表单模式 elicitation(客户端声明 `elicitation:{}` 或 `elicitation.form`) */
|
|
457
|
+
elicitationForm: boolean;
|
|
458
|
+
/** URL 模式 elicitation(凭据跳转用;本期不做,只记录) */
|
|
459
|
+
elicitationUrl: boolean;
|
|
460
|
+
/** 声明了 MCP Apps 扩展 */
|
|
461
|
+
ui: boolean;
|
|
462
|
+
roots: boolean;
|
|
463
|
+
sampling: boolean;
|
|
464
|
+
/** 报表友好摘要:`none` 或稳定排序的逗号串(elicitation:form / elicitation:url / ui / roots / sampling) */
|
|
465
|
+
summary: string;
|
|
466
|
+
};
|
|
467
|
+
|
|
497
468
|
/** MCP initialize clientInfo fields available after handshake via Server.getClientVersion(). */
|
|
498
469
|
declare type McpClientInfo = {
|
|
499
470
|
name?: string;
|
|
@@ -569,10 +540,13 @@ export declare const reportToolCall: (params: {
|
|
|
569
540
|
duration?: number;
|
|
570
541
|
error?: string;
|
|
571
542
|
inputParams?: any;
|
|
543
|
+
/** 工具级 action(如 auth 的 status/set_env),用于区分"同一个工具做了什么" */
|
|
544
|
+
action?: string;
|
|
572
545
|
cloudBaseOptions?: CloudBaseOptions;
|
|
573
546
|
ide?: string;
|
|
574
547
|
client?: string;
|
|
575
548
|
mcpClientInfo?: McpClientInfo;
|
|
549
|
+
mcpClientCapabilities?: McpClientCapabilities;
|
|
576
550
|
}) => Promise<void>;
|
|
577
551
|
|
|
578
552
|
export declare const reportToolkitLifecycle: (params: {
|