@wecom/wecom-openclaw-plugin 2026.3.24-beta.1 → 2026.3.24-beta.3
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 +62 -171
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.esm.js +50 -159
- package/dist/index.esm.js.map +1 -1
- package/dist/src/openclaw-compat.d.ts +48 -0
- package/package.json +1 -1
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* 本模块在加载时一次性探测 SDK 导出,存在则直接 re-export SDK 版本,
|
|
8
8
|
* 不存在则导出 fallback 实现。其他模块统一从本文件导入,无需关心底层兼容细节。
|
|
9
9
|
*/
|
|
10
|
+
export declare const DEFAULT_ACCOUNT_ID = "default";
|
|
10
11
|
/** 与 openclaw plugin-sdk 中 WebMediaResult 兼容的类型 */
|
|
11
12
|
export type WebMediaResult = {
|
|
12
13
|
buffer: Buffer;
|
|
@@ -40,9 +41,56 @@ export declare function detectMime(bufferOrOpts: Buffer | DetectMimeOptions): Pr
|
|
|
40
41
|
* SDK 版本抛出的业务异常(如 LocalMediaAccessError)会直接透传。
|
|
41
42
|
*/
|
|
42
43
|
export declare function loadOutboundMediaFromUrl(mediaUrl: string, options?: OutboundMediaLoadOptions): Promise<WebMediaResult>;
|
|
44
|
+
/**
|
|
45
|
+
* 向 allowFrom 列表添加通配符 "*"(兼容入口)
|
|
46
|
+
*
|
|
47
|
+
* 当 dmPolicy 为 "open" 时,需要确保 allowFrom 中包含 "*" 以允许所有来源。
|
|
48
|
+
* 优先使用 SDK 版本(plugin-sdk/setup 或 plugin-sdk/core),不可用时使用 fallback。
|
|
49
|
+
*
|
|
50
|
+
* 注意:此函数为同步函数,与 SDK 原始签名一致。
|
|
51
|
+
* SDK 引用在模块加载时异步探测并缓存,调用时同步读取缓存。
|
|
52
|
+
*/
|
|
53
|
+
export declare function addWildcardAllowFrom(allowFrom: string[]): string[];
|
|
43
54
|
/**
|
|
44
55
|
* 获取默认媒体本地路径白名单(兼容入口)
|
|
45
56
|
*
|
|
46
57
|
* 优先使用 SDK 版本,不可用时手动构建白名单(与 weclaw/src/media/local-roots.ts 逻辑一致)。
|
|
47
58
|
*/
|
|
48
59
|
export declare function getDefaultMediaLocalRoots(): Promise<readonly string[]>;
|
|
60
|
+
export declare function emptyPluginConfigSchema(): Record<string, unknown>;
|
|
61
|
+
/**
|
|
62
|
+
* 解析可选的分隔条目
|
|
63
|
+
* @param value 输入字符串,支持逗号、分号、换行符分隔
|
|
64
|
+
* @returns 解析后的字符串数组,如果输入为空则返回 undefined
|
|
65
|
+
*/
|
|
66
|
+
export declare function parseOptionalDelimitedEntries(value?: string): string[] | undefined;
|
|
67
|
+
/**
|
|
68
|
+
* 构建账户范围的 DM 安全策略
|
|
69
|
+
*/
|
|
70
|
+
export declare function buildAccountScopedDmSecurityPolicy(params: {
|
|
71
|
+
cfg: Record<string, unknown>;
|
|
72
|
+
channelKey: string;
|
|
73
|
+
accountId?: string | null;
|
|
74
|
+
fallbackAccountId?: string | null;
|
|
75
|
+
policy?: string | null;
|
|
76
|
+
allowFrom?: Array<string | number> | null;
|
|
77
|
+
defaultPolicy?: string;
|
|
78
|
+
allowFromPathSuffix?: string;
|
|
79
|
+
policyPathSuffix?: string;
|
|
80
|
+
approveChannelId?: string;
|
|
81
|
+
approveHint?: string;
|
|
82
|
+
normalizeEntry?: (raw: string) => string;
|
|
83
|
+
}): {
|
|
84
|
+
policy: string;
|
|
85
|
+
allowFrom: Array<string | number>;
|
|
86
|
+
policyPath?: string;
|
|
87
|
+
allowFromPath: string;
|
|
88
|
+
approveHint: string;
|
|
89
|
+
normalizeEntry?: (raw: string) => string;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* 格式化配对审批提示信息(参考 moltbot 实现)
|
|
93
|
+
* @param channelId 频道ID
|
|
94
|
+
* @returns 配对审批提示字符串
|
|
95
|
+
*/
|
|
96
|
+
export declare function formatPairingApproveHint(channelId: string): string;
|