test-youdu-openclaw-plugin 2026.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.
- package/README.md +90 -0
- package/dist/cert/cacert-2026-03-19.pem +3669 -0
- package/dist/index.cjs.js +27135 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.esm.js +27106 -0
- package/dist/src/channel.d.ts +6 -0
- package/dist/src/const.d.ts +34 -0
- package/dist/src/dm-policy.d.ts +29 -0
- package/dist/src/group-policy.d.ts +30 -0
- package/dist/src/media.d.ts +64 -0
- package/dist/src/message-sender.d.ts +18 -0
- package/dist/src/monitor.d.ts +48 -0
- package/dist/src/onboarding.d.ts +4 -0
- package/dist/src/openclaw-compat.d.ts +53 -0
- package/dist/src/runtime.d.ts +6 -0
- package/dist/src/sdk/types.d.ts +78 -0
- package/dist/src/sdk/ws-client.d.ts +21 -0
- package/dist/src/sdk/ws-manager.d.ts +63 -0
- package/dist/src/sdk/ws-utils.d.ts +42 -0
- package/dist/src/state-manager.d.ts +60 -0
- package/dist/src/utils.d.ts +60 -0
- package/openclaw.plugin.json +12 -0
- package/package.json +52 -0
- package/skills/youdu-send-media/SKILL.md +68 -0
package/README.md
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# YouDu OpenClaw Plugin
|
|
2
|
+
|
|
3
|
+
有度机器人接入插件,基于 WebSocket 长连接实现消息收发。
|
|
4
|
+
|
|
5
|
+
## 功能特性
|
|
6
|
+
|
|
7
|
+
- 🔗 WebSocket 长连接 — 基于 wss 建立持久连接(可通过配置自定义)
|
|
8
|
+
- 🔐 自动认证 — 连接建立后自动发送认证帧(bot_id + secret)
|
|
9
|
+
- 💓 心跳保活 — 自动维护心跳,连续未收到 ack 时自动判定连接异常
|
|
10
|
+
- 🔄 断线重连 — 指数退避重连策略(1s → 2s → 4s → ... → 30s 上限)
|
|
11
|
+
- 📨 消息转发 — 自动接收有度消息并转发给 OpenClaw,将 OpenClaw 回复回传有度
|
|
12
|
+
|
|
13
|
+
## 安装
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# 本地安装
|
|
17
|
+
cd openclaw-plugin
|
|
18
|
+
npm install
|
|
19
|
+
npm run build
|
|
20
|
+
|
|
21
|
+
# 在 OpenClaw 中启用
|
|
22
|
+
openclaw plugins install ./openclaw-plugin
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## 配置
|
|
26
|
+
|
|
27
|
+
##### 1.交互式设置
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
openclaw_channels_add
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
按照提示输入你的 机器人的 ID 、secret和服务器地址
|
|
34
|
+
|
|
35
|
+
##### 2.CLI 快速设置
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
openclaw config set channels.youdu.botId <YOUR_BOT_ID>
|
|
39
|
+
openclaw config set channels.youdu.secret <YOUR_BOT_SECRET>
|
|
40
|
+
openclaw config set channels.youdu.enabled true
|
|
41
|
+
openclaw confgi set channels.youdu.dmPolicy pairing
|
|
42
|
+
openclaw gateway restart
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### 配置项说明
|
|
46
|
+
|
|
47
|
+
| 配置路径 | 说明 | 选项 | 默认值 |
|
|
48
|
+
| ------------------------------- | -------------- | ------------------------------------- | ------- |
|
|
49
|
+
| `channels.youdu.botId` | 有度机器人 ID | — | — |
|
|
50
|
+
| `channels.youdu.secret` | 有度机器人密钥 | — | — |
|
|
51
|
+
| `channels.youdu.enabled` | 启用频道 | true / false | false |
|
|
52
|
+
| `channels.youdu.websocketUrl` | WebSocket 地址 | — | — |
|
|
53
|
+
| `channels.youdu.dmPolicy` | 私聊访问策略 | pairing / open / allowlist / disabled | pairing |
|
|
54
|
+
| `channels.youdu.allowFrom` | 私聊允许列表 | — | [] |
|
|
55
|
+
| `channels.youdu.groupPolicy` | 群聊访问策略 | open / allowlist / disabled | open |
|
|
56
|
+
| `channels.youdu.groupAllowFrom` | 群聊允许列表 | — | [] |
|
|
57
|
+
|
|
58
|
+
## 使用
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
# 重启 OpenClaw 使配置生效
|
|
62
|
+
openclaw gateway restart
|
|
63
|
+
|
|
64
|
+
# 查看状态
|
|
65
|
+
openclaw status
|
|
66
|
+
|
|
67
|
+
# 查看频道状态
|
|
68
|
+
openclaw channels status youdu
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## 消息处理流程
|
|
72
|
+
|
|
73
|
+
1. 插件通过 WebSocket 连接到有度服务
|
|
74
|
+
2. 认证成功后,监听来自有度的消息
|
|
75
|
+
3. 收到消息后,解析并转发给 OpenClaw 核心处理
|
|
76
|
+
4. OpenClaw 处理完成后,通过 WebSocket 将回复发送回有度服务
|
|
77
|
+
|
|
78
|
+
## 开发
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
# 开发模式(监听文件变化自动构建)
|
|
82
|
+
npm run dev
|
|
83
|
+
|
|
84
|
+
# 生产构建
|
|
85
|
+
npm run build
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## License
|
|
89
|
+
|
|
90
|
+
MIT
|