@sunnoy/wecom 1.0.0

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,25 @@
1
+ # 贡献指南
2
+
3
+ 感谢你对 OpenClaw 企业微信插件项目的关注!我们欢迎任何形式的贡献,包括修复 bug、改进文档、增加新功能或提出建议。
4
+
5
+ ## 如何贡献
6
+
7
+ 1. **Fork** 本仓库。
8
+ 2. **创建特性分支**: `git checkout -b feature/amazing-feature`
9
+ 3. **提交你的更改**: `git commit -m 'Add some amazing feature'`
10
+ 4. **推送到分支**: `git push origin feature/amazing-feature`
11
+ 5. **提交 Pull Request**。
12
+
13
+ ## 提交规范
14
+
15
+ - 请确保代码风格与项目现有风格保持一致。
16
+ - 提交信息请尽可能简明扼要,说明更改的原因。
17
+ - 如果你的更改涉及功能变更,请同步更新 `README.md`。
18
+
19
+ ## 问题反馈
20
+
21
+ 如果你在使用过程中遇到任何问题,请通过项目的 **Issues** 页面进行反馈,并提供尽可能详细的复现步骤。
22
+
23
+ ## 行为准则
24
+
25
+ 在参与本项目开发的过程中,请保持友善和相互尊重。
package/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ ISC License (ISC)
2
+
3
+ Copyright (c) 2026
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,284 @@
1
+ # OpenClaw WeCom (Enterprise WeChat) AI Bot Plugin
2
+
3
+ [English](https://github.com/sunnoy/openclaw-plugin-wecom/blob/main/README.md) | [简体中文](https://github.com/sunnoy/openclaw-plugin-wecom/blob/main/README_ZH.md)
4
+
5
+ `openclaw-plugin-wecom` is an Enterprise WeChat (WeCom) integration plugin developed for the [OpenClaw](https://github.com/openclaw/openclaw) framework. It enables seamless AI capabilities in Enterprise WeChat with advanced features.
6
+
7
+ ## ✨ Key Features
8
+
9
+ - 🌊 **Streaming Output**: Built on WeCom's latest AI bot streaming mechanism for smooth typewriter-style responses.
10
+ - 🤖 **Dynamic Agent Management**: Automatically creates isolated agents per direct message user or group chat, with independent workspaces and conversation contexts.
11
+ - 👥 **Deep Group Chat Integration**: Supports group message parsing with @mention triggering.
12
+ - 🖼️ **Image Support**: Automatic base64 encoding and sending of local images (screenshots, generated images) without requiring additional configuration.
13
+ - 🛠️ **Command Enhancement**: Built-in commands (e.g., `/new` for new sessions, `/status` for status) with allowlist configuration.
14
+ - 🔒 **Security & Authentication**: Full support for WeCom message encryption/decryption, URL verification, and sender validation.
15
+ - ⚡ **High-Performance Async Processing**: Asynchronous message architecture ensures responsive gateway even during long AI inference.
16
+
17
+ ## 📋 Prerequisites
18
+
19
+ - [OpenClaw](https://github.com/openclaw/openclaw) installed (version 2026.1.30+)
20
+ - Enterprise WeChat admin access to create intelligent robot applications
21
+ - Server address accessible from Enterprise WeChat (HTTP/HTTPS)
22
+
23
+ ## 🚀 Installation
24
+
25
+ ```bash
26
+ openclaw plugins install @sunnoy/wecom
27
+ ```
28
+
29
+ This command will automatically:
30
+ - Download the plugin from npm
31
+ - Install to `~/.openclaw/extensions/`
32
+ - Update your OpenClaw configuration
33
+ - Register the plugin
34
+
35
+ ## ⚙️ Configuration
36
+
37
+ Add to your OpenClaw configuration file (`~/.openclaw/openclaw.json`):
38
+
39
+ ```json
40
+ {
41
+ "plugins": {
42
+ "entries": {
43
+ "wecom": {
44
+ "enabled": true
45
+ }
46
+ }
47
+ },
48
+ "channels": {
49
+ "wecom": {
50
+ "enabled": true,
51
+ "token": "Your Token",
52
+ "encodingAesKey": "Your EncodingAESKey",
53
+ "commands": {
54
+ "enabled": true,
55
+ "allowlist": ["/new", "/status", "/help", "/compact"]
56
+ }
57
+ }
58
+ }
59
+ }
60
+ ```
61
+
62
+ ### Configuration Options
63
+
64
+ | Option | Type | Required | Description |
65
+ |--------|------|----------|-------------|
66
+ | `plugins.entries.wecom.enabled` | boolean | Yes | Enable the plugin |
67
+ | `channels.wecom.token` | string | Yes | WeCom bot Token |
68
+ | `channels.wecom.encodingAesKey` | string | Yes | WeCom message encryption key (43 chars) |
69
+ | `channels.wecom.commands.allowlist` | array | No | Command allowlist |
70
+
71
+ ## 🔌 Enterprise WeChat Configuration
72
+
73
+ 1. Log in to [Enterprise WeChat Admin Console](https://work.weixin.qq.com/)
74
+ 2. Navigate to "Application Management" → "Applications" → "Create Application" → Select "Intelligent Robot"
75
+ 3. Configure "Receive Messages":
76
+ - **URL**: `https://your-domain.com/webhooks/wecom`
77
+ - **Token**: Match `channels.wecom.token`
78
+ - **EncodingAESKey**: Match `channels.wecom.encodingAesKey`
79
+ 4. Save and enable message receiving
80
+
81
+ ## 🤖 Dynamic Agent Routing
82
+
83
+ The plugin implements per-user/per-group agent isolation:
84
+
85
+ ### How It Works
86
+
87
+ 1. When a WeCom message arrives, the plugin generates a deterministic `agentId`:
88
+ - **Direct Messages**: `wecom-dm-<userId>`
89
+ - **Group Chats**: `wecom-group-<chatId>`
90
+ 2. OpenClaw automatically creates/reuses the corresponding agent workspace
91
+ 3. Each user/group has independent conversation history and context
92
+
93
+ ### Advanced Configuration
94
+
95
+ Configure under `channels.wecom`:
96
+
97
+ ```json
98
+ {
99
+ "channels": {
100
+ "wecom": {
101
+ "dynamicAgents": {
102
+ "enabled": true
103
+ },
104
+ "dm": {
105
+ "createAgentOnFirstMessage": true
106
+ },
107
+ "groupChat": {
108
+ "enabled": true,
109
+ "requireMention": true
110
+ }
111
+ }
112
+ }
113
+ }
114
+ ```
115
+
116
+ | Option | Type | Default | Description |
117
+ |--------|------|---------|-------------|
118
+ | `dynamicAgents.enabled` | boolean | `true` | Enable dynamic agents |
119
+ | `dm.createAgentOnFirstMessage` | boolean | `true` | Use dynamic agents for DMs |
120
+ | `groupChat.enabled` | boolean | `true` | Enable group chat processing |
121
+ | `groupChat.requireMention` | boolean | `true` | Require @mention in groups |
122
+
123
+ ### Disable Dynamic Agents
124
+
125
+ To route all messages to the default agent:
126
+
127
+ ```json
128
+ {
129
+ "channels": {
130
+ "wecom": {
131
+ "dynamicAgents": { "enabled": false }
132
+ }
133
+ }
134
+ }
135
+ ```
136
+
137
+ ## 🛠️ Command Allowlist
138
+
139
+ Prevent regular users from executing sensitive Gateway management commands through WeCom messages.
140
+
141
+ ```json
142
+ {
143
+ "channels": {
144
+ "wecom": {
145
+ "commands": {
146
+ "enabled": true,
147
+ "allowlist": ["/new", "/status", "/help", "/compact"]
148
+ }
149
+ }
150
+ }
151
+ }
152
+ ```
153
+
154
+ ### Recommended Allowlist Commands
155
+
156
+ | Command | Description | Safety Level |
157
+ |---------|-------------|--------------|
158
+ | `/new` | Reset conversation, start new session | ✅ User-level |
159
+ | `/compact` | Compress current session context | ✅ User-level |
160
+ | `/help` | Show help information | ✅ User-level |
161
+ | `/status` | Show Agent status | ✅ User-level |
162
+
163
+ > ⚠️ **Security Note**: Do not add `/gateway`, `/plugins`, or other management commands to the allowlist to prevent regular users from gaining Gateway instance admin privileges.
164
+
165
+ ## ❓ FAQ
166
+
167
+ ### Q: What plugin ID should I use in the configuration file?
168
+
169
+ **A:** Use the **complete plugin ID** in `plugins.entries`:
170
+
171
+ ```json
172
+ {
173
+ "plugins": {
174
+ "entries": {
175
+ "wecom": { "enabled": true } // ✅ Correct
176
+ }
177
+ }
178
+ }
179
+ ```
180
+
181
+ **Do not** use the channel id:
182
+ ```json
183
+ {
184
+ "plugins": {
185
+ "entries": {
186
+ "wecom": { "enabled": true } // ❌ Incorrect
187
+ }
188
+ }
189
+ }
190
+ ```
191
+
192
+ ### Q: Why does `openclaw doctor` report warnings?
193
+
194
+ **A:** If you see configuration warnings, run:
195
+
196
+ ```bash
197
+ openclaw doctor --fix
198
+ ```
199
+
200
+ This will automatically fix common configuration issues.
201
+
202
+ ### Q: How does image sending work?
203
+
204
+ **A:** The plugin automatically handles images generated by OpenClaw (such as browser screenshots):
205
+
206
+ - **Local images** (from `~/.openclaw/media/`) are automatically encoded to base64 and sent via WeCom's `msg_item` API
207
+ - **Image constraints**: Max 2MB per image, supports JPG and PNG formats, up to 10 images per message
208
+ - **No configuration needed**: Works out of the box with tools like browser screenshot
209
+ - Images appear when the AI completes its response (streaming doesn't support incremental image sending)
210
+
211
+ **Example:**
212
+ ```
213
+ User: "Take a screenshot of GitHub homepage"
214
+ AI: [Takes screenshot] → Image displays properly in WeCom ✅
215
+ ```
216
+
217
+ If an image fails to process (size limit, invalid format), the text response will still be delivered and an error will be logged.
218
+
219
+ ### Q: How to configure auth token for public-facing OpenClaw with WeCom callbacks?
220
+
221
+ **A:** WeCom bot **does not need** OpenClaw's Gateway Auth Token.
222
+
223
+ - **Gateway Auth Token** (`gateway.auth.token`) is used for:
224
+ - WebUI access authentication
225
+ - WebSocket connection authentication
226
+ - CLI remote connection authentication
227
+
228
+ - **WeCom Webhook** (`/webhooks/wecom`) authentication:
229
+ - Uses WeCom's own signature verification (Token + EncodingAESKey)
230
+ - Does not require Gateway Auth Token
231
+ - OpenClaw plugin system automatically handles webhook routing
232
+
233
+ **Deployment suggestions:**
234
+ 1. If using a reverse proxy (e.g., Nginx), configure authentication exemption for `/webhooks/wecom` path
235
+ 2. Or expose the webhook endpoint on a separate port without Gateway Auth
236
+
237
+ ### Q: How to fix EncodingAESKey length validation failure?
238
+
239
+ **A:** Common causes and solutions:
240
+
241
+ 1. **Check configuration key name**: Ensure correct key name `encodingAesKey` (case-sensitive)
242
+ ```json
243
+ {
244
+ "channels": {
245
+ "wecom": {
246
+ "encodingAesKey": "..." // ✅ Correct
247
+ }
248
+ }
249
+ }
250
+ ```
251
+
252
+ 2. **Check key length**: EncodingAESKey must be exactly 43 characters
253
+ ```bash
254
+ # Check length
255
+ echo -n "your-key" | wc -c
256
+ ```
257
+
258
+ 3. **Check for extra spaces/newlines**: Ensure no leading/trailing whitespace in the key string
259
+
260
+ ## 📂 Project Structure
261
+
262
+ ```
263
+ openclaw-plugin-wecom/
264
+ ├── index.js # Plugin entry point
265
+ ├── webhook.js # WeCom HTTP communication handler
266
+ ├── dynamic-agent.js # Dynamic agent routing logic
267
+ ├── stream-manager.js # Streaming response manager
268
+ ├── crypto.js # WeCom encryption algorithms
269
+ ├── client.js # Client logic
270
+ ├── logger.js # Logging module
271
+ ├── utils.js # Utility functions
272
+ ├── package.json # npm package config
273
+ └── openclaw.plugin.json # OpenClaw plugin manifest
274
+ ```
275
+
276
+ ## 🤝 Contributing
277
+
278
+ We welcome contributions! Please submit Issues or Pull Requests for bugs or feature suggestions.
279
+
280
+ See [CONTRIBUTING.md](./CONTRIBUTING.md) for details.
281
+
282
+ ## 📄 License
283
+
284
+ This project is licensed under the [ISC License](./LICENSE).
package/README_ZH.md ADDED
@@ -0,0 +1,284 @@
1
+ # OpenClaw 企业微信 (WeCom) AI 机器人插件
2
+
3
+ [简体中文](https://github.com/sunnoy/openclaw-plugin-wecom/blob/main/README_ZH.md) | [English](https://github.com/sunnoy/openclaw-plugin-wecom/blob/main/README.md)
4
+
5
+ `openclaw-plugin-wecom` 是一个专为 [OpenClaw](https://github.com/openclaw/openclaw) 框架开发的企业微信(WeCom)集成插件。它允许你将强大的 AI 能力无缝接入企业微信,并支持多项高级功能。
6
+
7
+ ## ✨ 核心特性
8
+
9
+ - 🌊 **流式输出 (Streaming)**: 基于企业微信最新的 AI 机器人流式分片机制,实现流畅的打字机式回复体验。
10
+ - 🤖 **动态 Agent 管理**: 默认按"每个私聊用户 / 每个群聊"自动创建独立 Agent。每个 Agent 拥有独立的工作区与对话上下文,实现更强的数据隔离。
11
+ - 👥 **群聊深度集成**: 支持群聊消息解析,可通过 @提及(At-mention)精准触发机器人响应。
12
+ - 🖼️ **图片支持**: 自动将本地图片(截图、生成的图像)进行 base64 编码并发送,无需额外配置。
13
+ - 🛠️ **指令增强**: 内置常用指令支持(如 `/new` 开启新会话、`/status` 查看状态等),并提供指令白名单配置功能。
14
+ - 🔒 **安全与认证**: 完整支持企业微信消息加解密、URL 验证及发送者身份校验。
15
+ - ⚡ **高性能异步处理**: 采用异步消息处理架构,确保即使在长耗时 AI 推理过程中,企业微信网关也能保持高响应性。
16
+
17
+ ## 📋 前置要求
18
+
19
+ - 已安装 [OpenClaw](https://github.com/openclaw/openclaw) (版本 2026.1.30+)
20
+ - 企业微信管理后台权限,可创建智能机器人应用
21
+ - 可从企业微信访问的服务器地址(HTTP/HTTPS)
22
+
23
+ ## 🚀 安装
24
+
25
+ ```bash
26
+ openclaw plugins install @sunnoy/wecom
27
+ ```
28
+
29
+ 此命令会自动:
30
+ - 从 npm 下载插件
31
+ - 安装到 `~/.openclaw/extensions/` 目录
32
+ - 更新 OpenClaw 配置
33
+ - 注册插件
34
+
35
+ ## ⚙️ 配置
36
+
37
+ 在 OpenClaw 配置文件(`~/.openclaw/openclaw.json`)中添加:
38
+
39
+ ```json
40
+ {
41
+ "plugins": {
42
+ "entries": {
43
+ "wecom": {
44
+ "enabled": true
45
+ }
46
+ }
47
+ },
48
+ "channels": {
49
+ "wecom": {
50
+ "enabled": true,
51
+ "token": "你的 Token",
52
+ "encodingAesKey": "你的 EncodingAESKey",
53
+ "commands": {
54
+ "enabled": true,
55
+ "allowlist": ["/new", "/status", "/help", "/compact"]
56
+ }
57
+ }
58
+ }
59
+ }
60
+ ```
61
+
62
+ ### 配置说明
63
+
64
+ | 配置项 | 类型 | 必填 | 说明 |
65
+ |--------|------|------|------|
66
+ | `plugins.entries.wecom.enabled` | boolean | 是 | 启用插件 |
67
+ | `channels.wecom.token` | string | 是 | 企业微信机器人 Token |
68
+ | `channels.wecom.encodingAesKey` | string | 是 | 企业微信消息加密密钥(43 位) |
69
+ | `channels.wecom.commands.allowlist` | array | 否 | 允许的指令白名单 |
70
+
71
+ ## 🔌 企业微信后台配置
72
+
73
+ 1. 登录[企业微信管理后台](https://work.weixin.qq.com/)
74
+ 2. 进入"应用管理" → "应用" → "创建应用" → 选择"智能机器人"
75
+ 3. 在"接收消息配置"中设置:
76
+ - **URL**: `https://your-domain.com/webhooks/wecom`
77
+ - **Token**: 与 `channels.wecom.token` 一致
78
+ - **EncodingAESKey**: 与 `channels.wecom.encodingAesKey` 一致
79
+ 4. 保存配置并启用消息接收
80
+
81
+ ## 🤖 动态 Agent 路由
82
+
83
+ 本插件实现"按人/按群隔离"的 Agent 管理:
84
+
85
+ ### 工作原理
86
+
87
+ 1. 企业微信消息到达后,插件生成确定性的 `agentId`:
88
+ - **私聊**: `wecom-dm-<userId>`
89
+ - **群聊**: `wecom-group-<chatId>`
90
+ 2. OpenClaw 自动创建/复用对应的 Agent 工作区
91
+ 3. 每个用户/群聊拥有独立的对话历史和上下文
92
+
93
+ ### 高级配置
94
+
95
+ 配置在 `channels.wecom` 下:
96
+
97
+ ```json
98
+ {
99
+ "channels": {
100
+ "wecom": {
101
+ "dynamicAgents": {
102
+ "enabled": true
103
+ },
104
+ "dm": {
105
+ "createAgentOnFirstMessage": true
106
+ },
107
+ "groupChat": {
108
+ "enabled": true,
109
+ "requireMention": true
110
+ }
111
+ }
112
+ }
113
+ }
114
+ ```
115
+
116
+ | 配置项 | 类型 | 默认值 | 说明 |
117
+ |--------|------|--------|------|
118
+ | `dynamicAgents.enabled` | boolean | `true` | 是否启用动态 Agent |
119
+ | `dm.createAgentOnFirstMessage` | boolean | `true` | 私聊使用动态 Agent |
120
+ | `groupChat.enabled` | boolean | `true` | 启用群聊处理 |
121
+ | `groupChat.requireMention` | boolean | `true` | 群聊必须 @ 提及才响应 |
122
+
123
+ ### 禁用动态 Agent
124
+
125
+ 如果需要所有消息进入默认 Agent:
126
+
127
+ ```json
128
+ {
129
+ "channels": {
130
+ "wecom": {
131
+ "dynamicAgents": { "enabled": false }
132
+ }
133
+ }
134
+ }
135
+ ```
136
+
137
+ ## 🛠️ 指令白名单
138
+
139
+ 为防止普通用户通过企业微信消息执行敏感的 Gateway 管理指令,本插件支持**指令白名单**机制。
140
+
141
+ ```json
142
+ {
143
+ "channels": {
144
+ "wecom": {
145
+ "commands": {
146
+ "enabled": true,
147
+ "allowlist": ["/new", "/status", "/help", "/compact"]
148
+ }
149
+ }
150
+ }
151
+ }
152
+ ```
153
+
154
+ ### 推荐白名单指令
155
+
156
+ | 指令 | 说明 | 安全级别 |
157
+ |------|------|----------|
158
+ | `/new` | 重置当前对话,开启全新会话 | ✅ 用户级 |
159
+ | `/compact` | 压缩当前会话上下文 | ✅ 用户级 |
160
+ | `/help` | 查看帮助信息 | ✅ 用户级 |
161
+ | `/status` | 查看当前 Agent 状态 | ✅ 用户级 |
162
+
163
+ > ⚠️ **安全提示**:不要将 `/gateway`、`/plugins` 等管理指令添加到白名单,避免普通用户获得 Gateway 实例的管理权限。
164
+
165
+ ## ❓ 常见问题 (FAQ)
166
+
167
+ ### Q: 配置文件中的插件 ID 应该使用什么?
168
+
169
+ **A:** 在 `plugins.entries` 中,应该使用**完整的插件 ID**:
170
+
171
+ ```json
172
+ {
173
+ "plugins": {
174
+ "entries": {
175
+ "wecom": { "enabled": true } // ✅ 正确
176
+ }
177
+ }
178
+ }
179
+ ```
180
+
181
+ **不要**使用 channel id:
182
+ ```json
183
+ {
184
+ "plugins": {
185
+ "entries": {
186
+ "wecom": { "enabled": true } // ❌ 错误
187
+ }
188
+ }
189
+ }
190
+ ```
191
+
192
+ ### Q: 为什么 `openclaw doctor` 报告警告?
193
+
194
+ **A:** 如果看到配置警告,运行:
195
+
196
+ ```bash
197
+ openclaw doctor --fix
198
+ ```
199
+
200
+ 这会自动修复常见的配置问题。
201
+
202
+ ### Q: 图片发送是如何工作的?
203
+
204
+ **A:** 插件会自动处理 OpenClaw 生成的图片(如浏览器截图):
205
+
206
+ - **本地图片**(来自 `~/.openclaw/media/`)会自动进行 base64 编码,通过企业微信 `msg_item` API 发送
207
+ - **图片限制**:单张图片最大 2MB,支持 JPG 和 PNG 格式,每条消息最多 10 张图片
208
+ - **无需配置**:开箱即用,配合浏览器截图等工具自动生效
209
+ - 图片会在 AI 完成回复后显示(流式输出不支持增量发送图片)
210
+
211
+ **示例:**
212
+ ```
213
+ 用户:"帮我截个 GitHub 首页的图"
214
+ AI:[执行截图] → 图片在企业微信中正常显示 ✅
215
+ ```
216
+
217
+ 如果图片处理失败(超出大小限制、格式不支持等),文本回复仍会正常发送,错误信息会记录在日志中。
218
+
219
+ ### Q: OpenClaw 开放公网需要 auth token,企业微信回调如何配置?
220
+
221
+ **A:** 企业微信机器人**不需要**配置 OpenClaw 的 Gateway Auth Token。
222
+
223
+ - **Gateway Auth Token** (`gateway.auth.token`) 主要用于:
224
+ - WebUI 访问认证
225
+ - WebSocket 连接认证
226
+ - CLI 远程连接认证
227
+
228
+ - **企业微信 Webhook** (`/webhooks/wecom`) 的认证机制:
229
+ - 使用企业微信自己的签名验证(Token + EncodingAESKey)
230
+ - 不需要 Gateway Auth Token
231
+ - OpenClaw 插件系统会自动处理 webhook 路由
232
+
233
+ **部署建议:**
234
+ 1. 如果使用反向代理(如 Nginx),可以为 `/webhooks/wecom` 路径配置豁免认证
235
+ 2. 或者将 webhook 端点暴露在独立端口,不经过 Gateway Auth
236
+
237
+ ### Q: EncodingAESKey 长度验证失败怎么办?
238
+
239
+ **A:** 常见原因和解决方法:
240
+
241
+ 1. **检查配置键名**:确保使用正确的键名 `encodingAesKey`(注意大小写)
242
+ ```json
243
+ {
244
+ "channels": {
245
+ "wecom": {
246
+ "encodingAesKey": "..." // ✅ 正确
247
+ }
248
+ }
249
+ }
250
+ ```
251
+
252
+ 2. **检查密钥长度**:EncodingAESKey 必须是 43 位字符
253
+ ```bash
254
+ # 检查长度
255
+ echo -n "你的密钥" | wc -c
256
+ ```
257
+
258
+ 3. **检查是否有多余空格/换行**:确保密钥字符串前后没有空格或换行符
259
+
260
+ ## 📂 项目结构
261
+
262
+ ```
263
+ openclaw-plugin-wecom/
264
+ ├── index.js # 插件入口
265
+ ├── webhook.js # 企业微信 HTTP 通信处理
266
+ ├── dynamic-agent.js # 动态 Agent 分配逻辑
267
+ ├── stream-manager.js # 流式回复管理
268
+ ├── crypto.js # 企业微信加密算法
269
+ ├── client.js # 客户端逻辑
270
+ ├── logger.js # 日志模块
271
+ ├── utils.js # 工具函数
272
+ ├── package.json # npm 包配置
273
+ └── openclaw.plugin.json # OpenClaw 插件清单
274
+ ```
275
+
276
+ ## 🤝 贡献规范
277
+
278
+ 我们非常欢迎开发者参与贡献!如果你发现了 Bug 或有更好的功能建议,请提交 Issue 或 Pull Request。
279
+
280
+ 详见 [CONTRIBUTING.md](./CONTRIBUTING.md)
281
+
282
+ ## 📄 开源协议
283
+
284
+ 本项目采用 [ISC License](./LICENSE) 协议。