openclaw-plugin-wecom 0.2.3 → 0.2.4
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/README.md +37 -37
- package/README_ZH.md +85 -0
- package/package.json +2 -2
- package/README_EN.md +0 -85
package/README.md
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
# OpenClaw
|
|
1
|
+
# OpenClaw WeCom AI Bot Plugin
|
|
2
2
|
|
|
3
|
-
[简体中文](https://github.com/sunnoy/openclaw-plugin-wecom/blob/main/
|
|
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
4
|
|
|
5
|
-
`openclaw-plugin-wecom`
|
|
5
|
+
`openclaw-plugin-wecom` is an enterprise WeChat (WeCom) integration plugin specifically developed for the [OpenClaw](https://github.com/sunnoy/openclaw-plugin-wecom) framework. It allows you to seamlessly integrate powerful AI capabilities into WeCom with support for multiple advanced features.
|
|
6
6
|
|
|
7
|
-
## ✨
|
|
7
|
+
## ✨ Key Features
|
|
8
8
|
|
|
9
|
-
- 🌊
|
|
10
|
-
- 🤖
|
|
11
|
-
- 👥
|
|
12
|
-
- 🛠️
|
|
13
|
-
- 🔒
|
|
14
|
-
- ⚡
|
|
9
|
+
- 🌊 **Streaming Output**: Based on the latest WeCom AI Bot streaming mechanism for a smooth typing-like response experience.
|
|
10
|
+
- 🤖 **Dynamic Agent Management**: Automatically creates independent Agent instances for each direct message user and group chat. Each instance has its own workspace, configurations, and conversation history, ensuring data isolation and security.
|
|
11
|
+
- 👥 **Deep Group Chat Integration**: Supports group message parsing and precise triggering via @mentions.
|
|
12
|
+
- 🛠️ **Enhanced Commands**: Built-in support for common commands (e.g., `/new` for a new session, `/status` to check status) with command allowlist configuration.
|
|
13
|
+
- 🔒 **Security & Authentication**: Full support for WeCom message encryption/decryption, URL verification, and sender identity validation.
|
|
14
|
+
- ⚡ **High-Performance Async Processing**: Uses an asynchronous message processing architecture to ensure high responsiveness of the WeCom gateway even during long-running AI inference.
|
|
15
15
|
|
|
16
|
-
## 🚀
|
|
16
|
+
## 🚀 Quick Start
|
|
17
17
|
|
|
18
|
-
### 1.
|
|
18
|
+
### 1. Install Plugin
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
Run the following in your OpenClaw project directory:
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
23
|
npm install openclaw-plugin-wecom
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
### 2.
|
|
26
|
+
### 2. Configure Plugin
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
Add the plugin configuration to your OpenClaw configuration file (e.g., `config.json`):
|
|
29
29
|
|
|
30
30
|
```json
|
|
31
31
|
{
|
|
32
32
|
"channels": {
|
|
33
33
|
"wxwork": {
|
|
34
34
|
"enabled": true,
|
|
35
|
-
"token": "
|
|
36
|
-
"encodingAesKey": "
|
|
35
|
+
"token": "YOUR_TOKEN",
|
|
36
|
+
"encodingAesKey": "YOUR_ENCODING_AES_KEY",
|
|
37
37
|
"webhookPath": "/webhooks/wxwork",
|
|
38
38
|
"accounts": {
|
|
39
39
|
"default": {
|
|
@@ -53,33 +53,33 @@ npm install openclaw-plugin-wecom
|
|
|
53
53
|
}
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
-
### 3.
|
|
56
|
+
### 3. WeCom Admin Portal Setup
|
|
57
57
|
|
|
58
|
-
1.
|
|
59
|
-
2.
|
|
60
|
-
3.
|
|
58
|
+
1. Create an "AI Bot" in the WeCom management backend.
|
|
59
|
+
2. Set the "Message Receiving Configuration" URL to your service address (e.g., `https://your-domain.com/webhooks/wxwork`).
|
|
60
|
+
3. Fill in the corresponding Token and EncodingAESKey.
|
|
61
61
|
|
|
62
|
-
## 🛠️
|
|
62
|
+
## 🛠️ Command Support
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
The plugin has built-in handling for the following commands:
|
|
65
65
|
|
|
66
|
-
- `/new`:
|
|
67
|
-
- `/compact`:
|
|
68
|
-
- `/help`:
|
|
69
|
-
- `/status`:
|
|
66
|
+
- `/new`: Reset current conversation and start a new session.
|
|
67
|
+
- `/compact`: Compact session context, keeping key summaries to save tokens.
|
|
68
|
+
- `/help`: View help information.
|
|
69
|
+
- `/status`: View current Agent and plugin status.
|
|
70
70
|
|
|
71
|
-
## 📂
|
|
71
|
+
## 📂 Project Structure
|
|
72
72
|
|
|
73
|
-
- `index.js`:
|
|
74
|
-
- `webhook.js`:
|
|
75
|
-
- `dynamic-agent.js`:
|
|
76
|
-
- `stream-manager.js`:
|
|
77
|
-
- `crypto.js`:
|
|
73
|
+
- `index.js`: Plugin entry point, handling all core routing and lifecycle management.
|
|
74
|
+
- `webhook.js`: Handles WeCom HTTP communication, encryption/decryption, and message parsing.
|
|
75
|
+
- `dynamic-agent.js`: Dynamic Agent allocation logic.
|
|
76
|
+
- `stream-manager.js`: Manages the state and data partitioning of streaming responses.
|
|
77
|
+
- `crypto.js`: Implementation of WeCom encryption algorithms.
|
|
78
78
|
|
|
79
|
-
## 🤝
|
|
79
|
+
## 🤝 Contributing
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
We welcome contributions! If you find a bug or have suggestions for new features, please submit an Issue or Pull Request.
|
|
82
82
|
|
|
83
|
-
## 📄
|
|
83
|
+
## 📄 License
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
This project is licensed under the [ISC License](./LICENSE).
|
package/README_ZH.md
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
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/sunnoy/openclaw-plugin-wecom) 框架开发的企业微信(WeCom)集成插件。它允许你将强大的 AI 能力无缝接入企业微信,并支持多项高级功能。
|
|
6
|
+
|
|
7
|
+
## ✨ 核心特性
|
|
8
|
+
|
|
9
|
+
- 🌊 **流式输出 (Streaming)**: 基于企业微信最新的 AI 机器人流式分片机制,实现流畅的打字机式回复体验。
|
|
10
|
+
- 🤖 **动态 Agent 管理**: 自动为每位私聊用户和每个群聊创建独立的 Agent 实例。每个实例拥有独立的文件工作区、配置环境和对话上下文,确保数据隔离与安全。
|
|
11
|
+
- 👥 **群聊深度集成**: 支持群聊消息解析,可通过 @提及(At-mention)精准触发机器人响应。
|
|
12
|
+
- 🛠️ **指令增强**: 内置常用指令支持(如 `/new` 开启新会话、`/status` 查看状态等),并提供指令白名单配置功能。
|
|
13
|
+
- 🔒 **安全与认证**: 完整支持企业微信消息加解密、URL 验证及发送者身份校验。
|
|
14
|
+
- ⚡ **高性能异步处理**: 采用异步消息处理架构,确保即使在长耗时 AI 推理过程中,企业微信网关也能保持高响应性。
|
|
15
|
+
|
|
16
|
+
## 🚀 快速开始
|
|
17
|
+
|
|
18
|
+
### 1. 安装插件
|
|
19
|
+
|
|
20
|
+
在你的 OpenClaw 项目目录中运行:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm install openclaw-plugin-wecom
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### 2. 配置插件
|
|
27
|
+
|
|
28
|
+
在 OpenClaw 的配置文件(如 `config.json`)中添加插件配置:
|
|
29
|
+
|
|
30
|
+
```json
|
|
31
|
+
{
|
|
32
|
+
"channels": {
|
|
33
|
+
"wxwork": {
|
|
34
|
+
"enabled": true,
|
|
35
|
+
"token": "你的 Token",
|
|
36
|
+
"encodingAesKey": "你的 EncodingAESKey",
|
|
37
|
+
"webhookPath": "/webhooks/wxwork",
|
|
38
|
+
"accounts": {
|
|
39
|
+
"default": {
|
|
40
|
+
"allowFrom": ["*"]
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"commands": {
|
|
44
|
+
"enabled": true,
|
|
45
|
+
"allowlist": ["/new", "/status", "/help", "/compact"]
|
|
46
|
+
},
|
|
47
|
+
"dynamicAgent": {
|
|
48
|
+
"enabled": true,
|
|
49
|
+
"prefix": "wxwork-"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### 3. 企业微信后台设置
|
|
57
|
+
|
|
58
|
+
1. 在企业微信管理后台创建一个“智能机器人”。
|
|
59
|
+
2. 将机器人的“接收消息配置”中的 URL 设置为你的服务地址(例如:`https://your-domain.com/webhooks/wxwork`)。
|
|
60
|
+
3. 填入对应的 Token 和 EncodingAESKey。
|
|
61
|
+
|
|
62
|
+
## 🛠️ 指令支持
|
|
63
|
+
|
|
64
|
+
插件内置了对以下指令的处理:
|
|
65
|
+
|
|
66
|
+
- `/new`: 重置当前对话,开启全新会话。
|
|
67
|
+
- `/compact`: 压缩当前会话上下文,保留关键摘要以节省 Token。
|
|
68
|
+
- `/help`: 查看帮助信息。
|
|
69
|
+
- `/status`: 查看当前 Agent 及插件状态。
|
|
70
|
+
|
|
71
|
+
## 📂 项目结构
|
|
72
|
+
|
|
73
|
+
- `index.js`: 插件入口,处理所有核心路由与生命周期管理。
|
|
74
|
+
- `webhook.js`: 处理企业微信 HTTP 通信、加解密及消息解析。
|
|
75
|
+
- `dynamic-agent.js`: 动态 Agent 分配逻辑。
|
|
76
|
+
- `stream-manager.js`: 管理流式回复的状态与数据分片。
|
|
77
|
+
- `crypto.js`: 企业微信加密算法实现。
|
|
78
|
+
|
|
79
|
+
## 🤝 贡献规范
|
|
80
|
+
|
|
81
|
+
我们非常欢迎开发者参与贡献!如果你发现了 Bug 或有更好的功能建议,请提交 Issue 或 Pull Request。
|
|
82
|
+
|
|
83
|
+
## 📄 开源协议
|
|
84
|
+
|
|
85
|
+
本项目采用 [ISC License](./LICENSE) 协议。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openclaw-plugin-wecom",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "Enterprise WeChat AI Bot channel plugin for OpenClaw",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"dynamic-agent.js",
|
|
13
13
|
"logger.js",
|
|
14
14
|
"README.md",
|
|
15
|
-
"
|
|
15
|
+
"README_ZH.md",
|
|
16
16
|
"LICENSE",
|
|
17
17
|
"CONTRIBUTING.md",
|
|
18
18
|
"stream-manager.js",
|
package/README_EN.md
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
# OpenClaw WeCom AI Bot Plugin
|
|
2
|
-
|
|
3
|
-
[简体中文](https://github.com/sunnoy/openclaw-plugin-wecom/blob/main/README.md) | [English](https://github.com/sunnoy/openclaw-plugin-wecom/blob/main/README_EN.md)
|
|
4
|
-
|
|
5
|
-
`openclaw-plugin-wecom` is an enterprise WeChat (WeCom) integration plugin specifically developed for the [OpenClaw](https://github.com/sunnoy/openclaw-plugin-wecom) framework. It allows you to seamlessly integrate powerful AI capabilities into WeCom with support for multiple advanced features.
|
|
6
|
-
|
|
7
|
-
## ✨ Key Features
|
|
8
|
-
|
|
9
|
-
- 🌊 **Streaming Output**: Based on the latest WeCom AI Bot streaming mechanism for a smooth typing-like response experience.
|
|
10
|
-
- 🤖 **Dynamic Agent Management**: Automatically creates independent Agent instances for each direct message user and group chat. Each instance has its own workspace, configurations, and conversation history, ensuring data isolation and security.
|
|
11
|
-
- 👥 **Deep Group Chat Integration**: Supports group message parsing and precise triggering via @mentions.
|
|
12
|
-
- 🛠️ **Enhanced Commands**: Built-in support for common commands (e.g., `/new` for a new session, `/status` to check status) with command allowlist configuration.
|
|
13
|
-
- 🔒 **Security & Authentication**: Full support for WeCom message encryption/decryption, URL verification, and sender identity validation.
|
|
14
|
-
- ⚡ **High-Performance Async Processing**: Uses an asynchronous message processing architecture to ensure high responsiveness of the WeCom gateway even during long-running AI inference.
|
|
15
|
-
|
|
16
|
-
## 🚀 Quick Start
|
|
17
|
-
|
|
18
|
-
### 1. Install Plugin
|
|
19
|
-
|
|
20
|
-
Run the following in your OpenClaw project directory:
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
npm install openclaw-plugin-wecom
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
### 2. Configure Plugin
|
|
27
|
-
|
|
28
|
-
Add the plugin configuration to your OpenClaw configuration file (e.g., `config.json`):
|
|
29
|
-
|
|
30
|
-
```json
|
|
31
|
-
{
|
|
32
|
-
"channels": {
|
|
33
|
-
"wxwork": {
|
|
34
|
-
"enabled": true,
|
|
35
|
-
"token": "YOUR_TOKEN",
|
|
36
|
-
"encodingAesKey": "YOUR_ENCODING_AES_KEY",
|
|
37
|
-
"webhookPath": "/webhooks/wxwork",
|
|
38
|
-
"accounts": {
|
|
39
|
-
"default": {
|
|
40
|
-
"allowFrom": ["*"]
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
"commands": {
|
|
44
|
-
"enabled": true,
|
|
45
|
-
"allowlist": ["/new", "/status", "/help", "/compact"]
|
|
46
|
-
},
|
|
47
|
-
"dynamicAgent": {
|
|
48
|
-
"enabled": true,
|
|
49
|
-
"prefix": "wxwork-"
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
### 3. WeCom Admin Portal Setup
|
|
57
|
-
|
|
58
|
-
1. Create an "AI Bot" in the WeCom management backend.
|
|
59
|
-
2. Set the "Message Receiving Configuration" URL to your service address (e.g., `https://your-domain.com/webhooks/wxwork`).
|
|
60
|
-
3. Fill in the corresponding Token and EncodingAESKey.
|
|
61
|
-
|
|
62
|
-
## 🛠️ Command Support
|
|
63
|
-
|
|
64
|
-
The plugin has built-in handling for the following commands:
|
|
65
|
-
|
|
66
|
-
- `/new`: Reset current conversation and start a new session.
|
|
67
|
-
- `/compact`: Compact session context, keeping key summaries to save tokens.
|
|
68
|
-
- `/help`: View help information.
|
|
69
|
-
- `/status`: View current Agent and plugin status.
|
|
70
|
-
|
|
71
|
-
## 📂 Project Structure
|
|
72
|
-
|
|
73
|
-
- `index.js`: Plugin entry point, handling all core routing and lifecycle management.
|
|
74
|
-
- `webhook.js`: Handles WeCom HTTP communication, encryption/decryption, and message parsing.
|
|
75
|
-
- `dynamic-agent.js`: Dynamic Agent allocation logic.
|
|
76
|
-
- `stream-manager.js`: Manages the state and data partitioning of streaming responses.
|
|
77
|
-
- `crypto.js`: Implementation of WeCom encryption algorithms.
|
|
78
|
-
|
|
79
|
-
## 🤝 Contributing
|
|
80
|
-
|
|
81
|
-
We welcome contributions! If you find a bug or have suggestions for new features, please submit an Issue or Pull Request.
|
|
82
|
-
|
|
83
|
-
## 📄 License
|
|
84
|
-
|
|
85
|
-
This project is licensed under the [ISC License](./LICENSE).
|