@wecom/wecom-openclaw-plugin 2026.3.24-beta.0 → 2026.3.24-beta.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/index.cjs.js +61 -177
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +61 -178
- package/dist/index.esm.js.map +1 -1
- package/dist/src/openclaw-compat.d.ts +10 -0
- package/dist/src/reqid-store.d.ts +3 -11
- package/dist/src/state-manager.d.ts +4 -0
- package/package.json +1 -1
|
@@ -40,6 +40,16 @@ export declare function detectMime(bufferOrOpts: Buffer | DetectMimeOptions): Pr
|
|
|
40
40
|
* SDK 版本抛出的业务异常(如 LocalMediaAccessError)会直接透传。
|
|
41
41
|
*/
|
|
42
42
|
export declare function loadOutboundMediaFromUrl(mediaUrl: string, options?: OutboundMediaLoadOptions): Promise<WebMediaResult>;
|
|
43
|
+
/**
|
|
44
|
+
* 向 allowFrom 列表添加通配符 "*"(兼容入口)
|
|
45
|
+
*
|
|
46
|
+
* 当 dmPolicy 为 "open" 时,需要确保 allowFrom 中包含 "*" 以允许所有来源。
|
|
47
|
+
* 优先使用 SDK 版本(plugin-sdk/setup 或 plugin-sdk/core),不可用时使用 fallback。
|
|
48
|
+
*
|
|
49
|
+
* 注意:此函数为同步函数,与 SDK 原始签名一致。
|
|
50
|
+
* SDK 引用在模块加载时异步探测并缓存,调用时同步读取缓存。
|
|
51
|
+
*/
|
|
52
|
+
export declare function addWildcardAllowFrom(allowFrom: string[]): string[];
|
|
43
53
|
/**
|
|
44
54
|
* 获取默认媒体本地路径白名单(兼容入口)
|
|
45
55
|
*
|
|
@@ -1,27 +1,19 @@
|
|
|
1
1
|
/** Store 配置 */
|
|
2
2
|
interface ReqIdStoreOptions {
|
|
3
|
-
/** TTL 毫秒数,超时的 reqId 视为过期(默认
|
|
3
|
+
/** TTL 毫秒数,超时的 reqId 视为过期(默认 7 天) */
|
|
4
4
|
ttlMs?: number;
|
|
5
5
|
/** 内存最大条目数(默认 200) */
|
|
6
6
|
memoryMaxSize?: number;
|
|
7
|
-
/** 磁盘最大条目数(默认 500) */
|
|
8
|
-
fileMaxEntries?: number;
|
|
9
|
-
/** 磁盘写入防抖时间(毫秒),默认 1000ms */
|
|
10
|
-
flushDebounceMs?: number;
|
|
11
7
|
}
|
|
12
8
|
export interface PersistentReqIdStore {
|
|
13
|
-
/** 设置 chatId 对应的 reqId
|
|
9
|
+
/** 设置 chatId 对应的 reqId(仅写入内存) */
|
|
14
10
|
set(chatId: string, reqId: string): void;
|
|
15
|
-
/** 获取 chatId 对应的 reqId
|
|
11
|
+
/** 获取 chatId 对应的 reqId(仅内存) */
|
|
16
12
|
get(chatId: string): Promise<string | undefined>;
|
|
17
13
|
/** 同步获取 chatId 对应的 reqId(仅内存) */
|
|
18
14
|
getSync(chatId: string): string | undefined;
|
|
19
15
|
/** 删除 chatId 对应的 reqId */
|
|
20
16
|
delete(chatId: string): void;
|
|
21
|
-
/** 启动时从磁盘预热内存,返回加载条目数 */
|
|
22
|
-
warmup(onError?: (error: unknown) => void): Promise<number>;
|
|
23
|
-
/** 立即将内存数据刷写到磁盘(用于优雅退出) */
|
|
24
|
-
flush(): Promise<void>;
|
|
25
17
|
/** 清空内存缓存 */
|
|
26
18
|
clearMemory(): void;
|
|
27
19
|
/** 返回内存中的条目数 */
|
|
@@ -60,10 +60,14 @@ export declare function getReqIdForChat(chatId: string, accountId?: string): str
|
|
|
60
60
|
export declare function deleteReqIdForChat(chatId: string, accountId?: string): void;
|
|
61
61
|
/**
|
|
62
62
|
* 启动时预热 reqId 缓存(从磁盘加载到内存)
|
|
63
|
+
*
|
|
64
|
+
* 注意:由于移除了磁盘存储,此函数现在只返回 0(无预热条目)
|
|
63
65
|
*/
|
|
64
66
|
export declare function warmupReqIdStore(accountId?: string, log?: (...args: unknown[]) => void): Promise<number>;
|
|
65
67
|
/**
|
|
66
68
|
* 立即将 reqId 数据刷写到磁盘(用于优雅退出)
|
|
69
|
+
*
|
|
70
|
+
* 注意:由于移除了磁盘存储,此函数现在是无操作
|
|
67
71
|
*/
|
|
68
72
|
export declare function flushReqIdStore(accountId?: string): Promise<void>;
|
|
69
73
|
/**
|