@dingxiang-me/openclaw-wechat 0.4.9

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.
@@ -0,0 +1,412 @@
1
+ {
2
+ "id": "openclaw-wechat",
3
+ "name": "OpenClaw-Wechat",
4
+ "version": "0.4.9",
5
+ "description": "WeCom (企业微信) channel plugin for OpenClaw (自建应用回调 + 发送 API).",
6
+ "channels": [
7
+ "wecom"
8
+ ],
9
+ "extensions": [
10
+ "./src/index.js"
11
+ ],
12
+ "configSchema": {
13
+ "type": "object",
14
+ "additionalProperties": false,
15
+ "properties": {
16
+ "enabled": {
17
+ "type": "boolean",
18
+ "default": true,
19
+ "description": "是否启用 WeCom 渠道"
20
+ },
21
+ "corpId": {
22
+ "type": "string",
23
+ "minLength": 1,
24
+ "description": "企业微信 Corp ID"
25
+ },
26
+ "corpSecret": {
27
+ "type": "string",
28
+ "minLength": 1,
29
+ "description": "企业微信 Corp Secret",
30
+ "x-sensitive": true
31
+ },
32
+ "agentId": {
33
+ "oneOf": [
34
+ {
35
+ "type": "number"
36
+ },
37
+ {
38
+ "type": "string",
39
+ "pattern": "^[0-9]+$"
40
+ }
41
+ ],
42
+ "description": "企业微信 Agent ID"
43
+ },
44
+ "callbackToken": {
45
+ "type": "string",
46
+ "minLength": 1,
47
+ "description": "回调 Token",
48
+ "x-sensitive": true
49
+ },
50
+ "callbackAesKey": {
51
+ "type": "string",
52
+ "minLength": 1,
53
+ "description": "回调 AES Key",
54
+ "x-sensitive": true
55
+ },
56
+ "webhookPath": {
57
+ "type": "string",
58
+ "description": "Webhook 路径",
59
+ "default": "/wecom/callback"
60
+ },
61
+ "bot": {
62
+ "type": "object",
63
+ "description": "企业微信 AI 机器人(Bot API 模式)配置(JSON 回调 + 原生 stream)",
64
+ "additionalProperties": false,
65
+ "properties": {
66
+ "enabled": {
67
+ "type": "boolean",
68
+ "default": false,
69
+ "description": "是否启用 Bot 模式"
70
+ },
71
+ "token": {
72
+ "type": "string",
73
+ "description": "Bot 模式回调 Token"
74
+ },
75
+ "encodingAesKey": {
76
+ "type": "string",
77
+ "description": "Bot 模式回调 EncodingAESKey(43 位)",
78
+ "x-sensitive": true
79
+ },
80
+ "webhookPath": {
81
+ "type": "string",
82
+ "default": "/wecom/bot/callback",
83
+ "description": "Bot 模式 webhook 路径"
84
+ },
85
+ "placeholderText": {
86
+ "type": "string",
87
+ "default": "消息已收到,正在处理中,请稍等片刻。",
88
+ "description": "Bot 模式初始 stream 占位文本"
89
+ },
90
+ "streamExpireMs": {
91
+ "type": "integer",
92
+ "minimum": 30000,
93
+ "maximum": 3600000,
94
+ "default": 600000,
95
+ "description": "Bot 流式会话保留时长(毫秒)"
96
+ }
97
+ }
98
+ },
99
+ "outboundProxy": {
100
+ "type": "string",
101
+ "description": "可选:WeCom 出站 API 代理(如 http://127.0.0.1:7890)"
102
+ },
103
+ "allowFrom": {
104
+ "type": "array",
105
+ "description": "可选:允许发送消息的用户列表(空=不限制,支持 '*')",
106
+ "items": {
107
+ "type": "string",
108
+ "minLength": 1
109
+ }
110
+ },
111
+ "allowFromRejectMessage": {
112
+ "type": "string",
113
+ "description": "发送者未授权时的拒绝提示文案"
114
+ },
115
+ "adminUsers": {
116
+ "type": "array",
117
+ "description": "管理员用户 ID(可绕过指令白名单)",
118
+ "items": {
119
+ "type": "string",
120
+ "minLength": 1
121
+ }
122
+ },
123
+ "commands": {
124
+ "type": "object",
125
+ "description": "指令白名单控制(启用后仅允许 allowlist 内的 / 指令)",
126
+ "additionalProperties": false,
127
+ "properties": {
128
+ "enabled": {
129
+ "type": "boolean",
130
+ "default": false,
131
+ "description": "是否启用指令白名单(默认关闭,保持兼容)"
132
+ },
133
+ "allowlist": {
134
+ "type": "array",
135
+ "description": "允许的指令列表(如 /status、/new)",
136
+ "items": {
137
+ "type": "string",
138
+ "minLength": 1
139
+ }
140
+ },
141
+ "rejectMessage": {
142
+ "type": "string",
143
+ "description": "命中未授权指令时返回给用户的提示文本"
144
+ }
145
+ }
146
+ },
147
+ "groupChat": {
148
+ "type": "object",
149
+ "description": "群聊触发策略",
150
+ "additionalProperties": false,
151
+ "properties": {
152
+ "enabled": {
153
+ "type": "boolean",
154
+ "default": true,
155
+ "description": "是否启用群聊消息处理"
156
+ },
157
+ "requireMention": {
158
+ "type": "boolean",
159
+ "default": false,
160
+ "description": "群聊是否必须包含 @ 提及才触发"
161
+ },
162
+ "mentionPatterns": {
163
+ "type": "array",
164
+ "description": "提及匹配关键字(默认 ['@'])",
165
+ "items": {
166
+ "type": "string",
167
+ "minLength": 1
168
+ }
169
+ }
170
+ }
171
+ },
172
+ "debounce": {
173
+ "type": "object",
174
+ "description": "文本消息防抖合并",
175
+ "additionalProperties": false,
176
+ "properties": {
177
+ "enabled": {
178
+ "type": "boolean",
179
+ "default": false,
180
+ "description": "是否启用文本防抖(默认关闭,保持兼容)"
181
+ },
182
+ "windowMs": {
183
+ "type": "integer",
184
+ "minimum": 100,
185
+ "maximum": 10000,
186
+ "default": 1200,
187
+ "description": "防抖窗口(毫秒)"
188
+ },
189
+ "maxBatch": {
190
+ "type": "integer",
191
+ "minimum": 1,
192
+ "maximum": 50,
193
+ "default": 6,
194
+ "description": "单次最多合并消息条数"
195
+ }
196
+ }
197
+ },
198
+ "streaming": {
199
+ "type": "object",
200
+ "description": "Agent 模式增量回包策略(通过多条文本消息模拟,非 Bot 原生 stream)",
201
+ "additionalProperties": false,
202
+ "properties": {
203
+ "enabled": {
204
+ "type": "boolean",
205
+ "default": false,
206
+ "description": "是否启用流式回复(默认关闭,保持兼容)"
207
+ },
208
+ "minChars": {
209
+ "type": "integer",
210
+ "minimum": 20,
211
+ "maximum": 2000,
212
+ "default": 120,
213
+ "description": "最小增量字符数,达到后才发送下一段"
214
+ },
215
+ "minIntervalMs": {
216
+ "type": "integer",
217
+ "minimum": 200,
218
+ "maximum": 10000,
219
+ "default": 1200,
220
+ "description": "两次增量发送的最短间隔(毫秒)"
221
+ }
222
+ }
223
+ },
224
+ "voiceTranscription": {
225
+ "type": "object",
226
+ "description": "语音转写回退配置(当企业微信 Recognition 缺失时使用)",
227
+ "additionalProperties": false,
228
+ "properties": {
229
+ "enabled": {
230
+ "type": "boolean",
231
+ "default": true,
232
+ "description": "是否启用插件侧语音转写回退"
233
+ },
234
+ "provider": {
235
+ "type": "string",
236
+ "enum": [
237
+ "local-whisper-cli",
238
+ "local-whisper"
239
+ ],
240
+ "default": "local-whisper-cli",
241
+ "description": "本地转写提供方类型"
242
+ },
243
+ "command": {
244
+ "type": "string",
245
+ "description": "可选:本地转写命令(默认按 provider 自动探测)"
246
+ },
247
+ "apiBaseUrl": {
248
+ "type": "string",
249
+ "description": "已弃用:历史 OpenAI 转写配置,不再使用"
250
+ },
251
+ "apiKey": {
252
+ "type": "string",
253
+ "description": "已弃用:历史 OpenAI 转写配置,不再使用",
254
+ "x-sensitive": true
255
+ },
256
+ "apiKeyEnv": {
257
+ "type": "string",
258
+ "description": "已弃用:历史 OpenAI 转写配置,不再使用"
259
+ },
260
+ "modelPath": {
261
+ "type": "string",
262
+ "description": "local-whisper-cli 使用的本地模型文件路径(如 ggml/gguf)"
263
+ },
264
+ "model": {
265
+ "type": "string",
266
+ "default": "base",
267
+ "description": "local-whisper 使用的模型名(tiny/base/small/...)"
268
+ },
269
+ "language": {
270
+ "type": "string",
271
+ "description": "可选:转写语言(如 zh)"
272
+ },
273
+ "prompt": {
274
+ "type": "string",
275
+ "description": "可选:转写提示词"
276
+ },
277
+ "timeoutMs": {
278
+ "type": "integer",
279
+ "minimum": 1000,
280
+ "default": 20000,
281
+ "description": "转写请求超时时间(毫秒)"
282
+ },
283
+ "maxBytes": {
284
+ "type": "integer",
285
+ "minimum": 262144,
286
+ "default": 10485760,
287
+ "description": "允许转写的最大音频大小(字节)"
288
+ },
289
+ "ffmpegEnabled": {
290
+ "type": "boolean",
291
+ "default": true,
292
+ "description": "当音频格式不兼容时,是否允许使用 ffmpeg 转码到 wav"
293
+ },
294
+ "transcodeToWav": {
295
+ "type": "boolean",
296
+ "default": true,
297
+ "description": "是否优先将语音统一转码为 wav 再交给本地模型"
298
+ },
299
+ "requireModelPath": {
300
+ "type": "boolean",
301
+ "default": true,
302
+ "description": "local-whisper-cli 模式下是否强制要求配置 modelPath"
303
+ }
304
+ }
305
+ },
306
+ "accounts": {
307
+ "type": "object",
308
+ "description": "多账户配置(键为账户 ID)",
309
+ "minProperties": 1,
310
+ "additionalProperties": {
311
+ "type": "object",
312
+ "additionalProperties": false,
313
+ "properties": {
314
+ "enabled": {
315
+ "type": "boolean",
316
+ "default": true
317
+ },
318
+ "corpId": {
319
+ "type": "string",
320
+ "minLength": 1
321
+ },
322
+ "corpSecret": {
323
+ "type": "string",
324
+ "minLength": 1,
325
+ "x-sensitive": true
326
+ },
327
+ "agentId": {
328
+ "oneOf": [
329
+ {
330
+ "type": "number"
331
+ },
332
+ {
333
+ "type": "string",
334
+ "pattern": "^[0-9]+$"
335
+ }
336
+ ]
337
+ },
338
+ "callbackToken": {
339
+ "type": "string",
340
+ "minLength": 1,
341
+ "x-sensitive": true
342
+ },
343
+ "callbackAesKey": {
344
+ "type": "string",
345
+ "minLength": 1,
346
+ "x-sensitive": true
347
+ },
348
+ "webhookPath": {
349
+ "type": "string",
350
+ "default": "/wecom/callback"
351
+ },
352
+ "outboundProxy": {
353
+ "type": "string",
354
+ "description": "可选:该账户专用 WeCom 出站 API 代理(覆盖 channels.wecom.outboundProxy)"
355
+ },
356
+ "allowFrom": {
357
+ "type": "array",
358
+ "description": "可选:该账户专用发送者允许列表(覆盖 channels.wecom.allowFrom)",
359
+ "items": {
360
+ "type": "string",
361
+ "minLength": 1
362
+ }
363
+ },
364
+ "allowFromRejectMessage": {
365
+ "type": "string",
366
+ "description": "可选:该账户发送者未授权时的拒绝文案(覆盖 channels.wecom.allowFromRejectMessage)"
367
+ }
368
+ },
369
+ "required": [
370
+ "corpId",
371
+ "corpSecret",
372
+ "agentId"
373
+ ]
374
+ }
375
+ }
376
+ }
377
+ },
378
+ "uiHints": {
379
+ "corpSecret": {
380
+ "sensitive": true
381
+ },
382
+ "callbackToken": {
383
+ "sensitive": true
384
+ },
385
+ "callbackAesKey": {
386
+ "sensitive": true
387
+ },
388
+ "bot.token": {
389
+ "sensitive": true
390
+ },
391
+ "bot.encodingAesKey": {
392
+ "sensitive": true
393
+ },
394
+ "voiceTranscription.apiKey": {
395
+ "sensitive": true
396
+ }
397
+ },
398
+ "channel": {
399
+ "id": "wecom",
400
+ "label": "WeCom",
401
+ "selectionLabel": "WeCom (企业微信自建应用)",
402
+ "docsPath": "/channels/wecom",
403
+ "docsLabel": "wecom",
404
+ "blurb": "Enterprise WeChat internal app via callback + send API.",
405
+ "order": 80,
406
+ "aliases": [
407
+ "wework",
408
+ "qiwei",
409
+ "wxwork"
410
+ ]
411
+ }
412
+ }
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "@dingxiang-me/openclaw-wechat",
3
+ "version": "0.4.9",
4
+ "type": "module",
5
+ "description": "WeCom (企业微信) channel plugin for OpenClaw (自建应用回调 + 发送 API).",
6
+ "license": "MIT",
7
+ "exports": "./src/index.js",
8
+ "publishConfig": {
9
+ "access": "public"
10
+ },
11
+ "files": [
12
+ "src/",
13
+ "openclaw.plugin.json",
14
+ "README.md",
15
+ "CHANGELOG.md",
16
+ "LICENSE",
17
+ "docs/channels/wecom.md"
18
+ ],
19
+ "openclaw": {
20
+ "extensions": [
21
+ "./src/index.js"
22
+ ],
23
+ "channel": {
24
+ "id": "wecom",
25
+ "label": "WeCom",
26
+ "selectionLabel": "WeCom (企业微信自建应用)",
27
+ "docsPath": "/channels/wecom",
28
+ "docsLabel": "wecom",
29
+ "blurb": "Enterprise WeChat internal app via callback + send API.",
30
+ "order": 80,
31
+ "aliases": [
32
+ "wework",
33
+ "qiwei",
34
+ "wxwork"
35
+ ]
36
+ }
37
+ },
38
+ "scripts": {
39
+ "lint": "npm run test:syntax",
40
+ "test:syntax": "node -c src/index.js",
41
+ "test": "npm run test:syntax && node --test tests/*.test.mjs",
42
+ "wecom:selfcheck": "node ./scripts/wecom-selfcheck.mjs",
43
+ "wecom:smoke": "bash ./scripts/wecom-smoke.sh"
44
+ },
45
+ "dependencies": {
46
+ "fast-xml-parser": "^5.3.5",
47
+ "undici": "^7.22.0"
48
+ }
49
+ }