@cloudbase/cloudbase-mcp 2.36.1 → 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 +1 -1
- package/dist/index.cjs +740 -156
- package/dist/index.d.ts +36 -1
- package/dist/index.js +746 -158
- package/package.json +2 -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`.
|
|
@@ -558,6 +578,13 @@ export declare const reportToolCall: (params: {
|
|
|
558
578
|
client?: string;
|
|
559
579
|
mcpClientInfo?: McpClientInfo;
|
|
560
580
|
mcpClientCapabilities?: McpClientCapabilities;
|
|
581
|
+
/**
|
|
582
|
+
* `auth` 的「环境准备」结果(只有 auth 会给,其余工具恒为 undefined)。
|
|
583
|
+
* 为什么必须上报:无环境的用户到底卡在购买页、实名、还是 CAM 授权,
|
|
584
|
+
* payload 里分得很清楚,但没进埋点之前,三种情况在数据里长得一模一样。
|
|
585
|
+
*/
|
|
586
|
+
envSetupStatus?: string;
|
|
587
|
+
envSetupFailReason?: string;
|
|
561
588
|
}) => Promise<void>;
|
|
562
589
|
|
|
563
590
|
export declare const reportToolkitLifecycle: (params: {
|
|
@@ -573,6 +600,8 @@ export declare const reportToolkitLifecycle: (params: {
|
|
|
573
600
|
|
|
574
601
|
export declare function resetCloudBaseManagerCache(): void;
|
|
575
602
|
|
|
603
|
+
export declare function runWithEnvSlot<T>(slot: EnvSlot, fn: () => T): T;
|
|
604
|
+
|
|
576
605
|
/**
|
|
577
606
|
* Check if a tool should be registered in cloud mode
|
|
578
607
|
* @param toolName - The name of the tool
|
|
@@ -690,7 +719,13 @@ declare class TelemetryReporter {
|
|
|
690
719
|
};
|
|
691
720
|
/**
|
|
692
721
|
* 获取设备唯一标识
|
|
693
|
-
*
|
|
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 超时即降级。
|
|
694
729
|
*/
|
|
695
730
|
private getDeviceId;
|
|
696
731
|
/**
|