@cloudbase/cloudbase-mcp 2.36.0 → 2.36.2
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 +2 -2
- package/dist/index.cjs +1849 -283
- package/dist/index.d.ts +48 -2
- package/dist/index.js +1855 -285
- package/package.json +3 -2
- package/server.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -220,6 +220,18 @@ export declare interface EnsureLoginOptions extends AuthOptions {
|
|
|
220
220
|
onDeviceCode?: (info: DeviceFlowAuthInfo) => void;
|
|
221
221
|
}
|
|
222
222
|
|
|
223
|
+
/**
|
|
224
|
+
* Where this resolution got its env id.
|
|
225
|
+
* The first four values are already in shipped queries. Do not rename them.
|
|
226
|
+
* `default` stays `default` (an empty result, not a rename to `unresolved`).
|
|
227
|
+
*/
|
|
228
|
+
export declare const ENV_SOURCES: readonly ["cloudBaseOptions", "process.env.CLOUDBASE_ENV_ID", "envManager.cachedEnvId", "project", "login_state", "auto_bound", "default"];
|
|
229
|
+
|
|
230
|
+
export declare type EnvBinding = {
|
|
231
|
+
envId: string | null;
|
|
232
|
+
source: EnvSource;
|
|
233
|
+
};
|
|
234
|
+
|
|
223
235
|
declare class EnvironmentManager {
|
|
224
236
|
private cachedEnvId;
|
|
225
237
|
private envIdPromise;
|
|
@@ -233,6 +245,12 @@ declare class EnvironmentManager {
|
|
|
233
245
|
|
|
234
246
|
export declare const envManager: EnvironmentManager;
|
|
235
247
|
|
|
248
|
+
export declare type EnvSlot = {
|
|
249
|
+
binding: EnvBinding | null;
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
export declare type EnvSource = (typeof ENV_SOURCES)[number];
|
|
253
|
+
|
|
236
254
|
export declare const error: (message: string, data?: object | Error) => void;
|
|
237
255
|
|
|
238
256
|
export declare interface ExtendedMcpServer extends McpServer {
|
|
@@ -261,6 +279,8 @@ export declare interface ExtendedMcpServer extends McpServer {
|
|
|
261
279
|
inputSchema: any;
|
|
262
280
|
handler: (input: any) => Promise<any>;
|
|
263
281
|
}>;
|
|
282
|
+
/** Process (stdio) or unused when the caller already opened a request slot. */
|
|
283
|
+
envSlot: EnvSlot;
|
|
264
284
|
setLogger(logger: Logger): void;
|
|
265
285
|
/**
|
|
266
286
|
* Same as MCP SDK registerTool, but annotations may include CloudBase `category`.
|
|
@@ -443,9 +463,20 @@ declare interface LoginState {
|
|
|
443
463
|
uin?: string | number;
|
|
444
464
|
}
|
|
445
465
|
|
|
466
|
+
/**
|
|
467
|
+
* 退出登录:只清「当前生效的那一份」。
|
|
468
|
+
*
|
|
469
|
+
* 项目级凭据优先于账号级登录态,所以项目里有 API Key 时,登出只删项目文件、清掉
|
|
470
|
+
* 回填的环境变量,账号登录原样保留(删完它自动接上)。再调一次才轮到全局。
|
|
471
|
+
*
|
|
472
|
+
* 不把 cwd 交给 toolbox 的 `logout()`:那个接口会**无条件先删全局凭据**,
|
|
473
|
+
* 「退出本项目」不该把用户的账号级登录一起注销掉。
|
|
474
|
+
*/
|
|
446
475
|
export declare function logout(_options?: {
|
|
447
476
|
site?: string;
|
|
448
|
-
}): Promise<
|
|
477
|
+
}): Promise<{
|
|
478
|
+
removed: Array<"project" | "global">;
|
|
479
|
+
}>;
|
|
449
480
|
|
|
450
481
|
/**
|
|
451
482
|
* 归一化后的客户端能力(字段名保持语义,报表侧再映射到列)。
|
|
@@ -547,6 +578,13 @@ export declare const reportToolCall: (params: {
|
|
|
547
578
|
client?: string;
|
|
548
579
|
mcpClientInfo?: McpClientInfo;
|
|
549
580
|
mcpClientCapabilities?: McpClientCapabilities;
|
|
581
|
+
/**
|
|
582
|
+
* `auth` 的「环境准备」结果(只有 auth 会给,其余工具恒为 undefined)。
|
|
583
|
+
* 为什么必须上报:无环境的用户到底卡在购买页、实名、还是 CAM 授权,
|
|
584
|
+
* payload 里分得很清楚,但没进埋点之前,三种情况在数据里长得一模一样。
|
|
585
|
+
*/
|
|
586
|
+
envSetupStatus?: string;
|
|
587
|
+
envSetupFailReason?: string;
|
|
550
588
|
}) => Promise<void>;
|
|
551
589
|
|
|
552
590
|
export declare const reportToolkitLifecycle: (params: {
|
|
@@ -562,6 +600,8 @@ export declare const reportToolkitLifecycle: (params: {
|
|
|
562
600
|
|
|
563
601
|
export declare function resetCloudBaseManagerCache(): void;
|
|
564
602
|
|
|
603
|
+
export declare function runWithEnvSlot<T>(slot: EnvSlot, fn: () => T): T;
|
|
604
|
+
|
|
565
605
|
/**
|
|
566
606
|
* Check if a tool should be registered in cloud mode
|
|
567
607
|
* @param toolName - The name of the tool
|
|
@@ -679,7 +719,13 @@ declare class TelemetryReporter {
|
|
|
679
719
|
};
|
|
680
720
|
/**
|
|
681
721
|
* 获取设备唯一标识
|
|
682
|
-
*
|
|
722
|
+
*
|
|
723
|
+
* 锚点与降级顺序见 `utils/device-id.ts`:优先系统级不可变标识(IOPlatformUUID /
|
|
724
|
+
* MachineGuid / machine-id),取不到才退到 hostname + CPU + 过滤后的物理网卡 MAC。
|
|
725
|
+
* 容器里 hostname 每次重建都变、macOS 私有 Wi-Fi 地址让 MAC 随 SSID 漂移,
|
|
726
|
+
* 两者都不能当锚点 —— 旧实现把它们全拼进去,同一台 Mac 一天能上报成几十个设备。
|
|
727
|
+
*
|
|
728
|
+
* 子进程(ioreg / reg)只在这里跑一次(构造时),1s 超时即降级。
|
|
683
729
|
*/
|
|
684
730
|
private getDeviceId;
|
|
685
731
|
/**
|