@cloudbase/cloudbase-mcp 2.35.2 → 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/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:
@@ -587,6 +540,8 @@ export declare const reportToolCall: (params: {
587
540
  duration?: number;
588
541
  error?: string;
589
542
  inputParams?: any;
543
+ /** 工具级 action(如 auth 的 status/set_env),用于区分"同一个工具做了什么" */
544
+ action?: string;
590
545
  cloudBaseOptions?: CloudBaseOptions;
591
546
  ide?: string;
592
547
  client?: string;