@youdu/openclaw-youdu 2026.3.25

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Xinda Jiuzhou Youdu
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,83 @@
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
+ ##### 1.在 OpenClaw 中安装插件
16
+ ```bash
17
+ openclaw plugins install @youdu/openclaw-youdu
18
+ ```
19
+
20
+ ## 配置
21
+
22
+ ##### 1.交互式设置
23
+
24
+ ```
25
+ openclaw channels add
26
+ ```
27
+
28
+ 选择有度插件,按照提示输入你的 机器人的 ID 、secret和服务器地址,其他配置项默认值即可使用
29
+ 配置完成后,重启 OpenClaw 使配置生效
30
+
31
+ ```
32
+ openclaw gateway restart
33
+ ```
34
+
35
+ 第一次连接的时候需要配对码,给对应机器人发送一条消息后,会返回一个配对码
36
+ 复制最后的指令到 OpenClaw 中执行
37
+
38
+ ```
39
+ openclaw pairing approve youdu 你的配对码
40
+ ```
41
+
42
+ ##### 2.CLI 快速设置
43
+
44
+ ```
45
+ openclaw channels add --channel youdu --token <YOUR_BOT_ID> --private-key <YOUR_BOT_SECRET> --url <YOUR_HOST> && openclaw config set channels.youdu.dmPolicy allowlist && openclaw config set channels.youdu.allowFrom "['<YOUR_ACCOUNT>']"
46
+
47
+ openclaw gateway restart
48
+ ```
49
+
50
+ ### 配置项说明
51
+
52
+ | 配置路径 | 说明 | 选项 | 默认值 |
53
+ | ------------------------------- | -------------- | ------------------------------------- | ------- |
54
+ | `channels.youdu.botId` | 有度机器人 ID | — | — |
55
+ | `channels.youdu.secret` | 有度机器人密钥 | — | — |
56
+ | `channels.youdu.enabled` | 启用频道 | true / false | false |
57
+ | `channels.youdu.websocketUrl` | WebSocket 地址 | — | — |
58
+ | `channels.youdu.dmPolicy` | 私聊访问策略 | pairing / open / allowlist / disabled | pairing |
59
+ | `channels.youdu.allowFrom` | 私聊允许列表 | — | [] |
60
+
61
+ ## 使用
62
+
63
+ ```bash
64
+ # 重启 OpenClaw 使配置生效
65
+ openclaw gateway restart
66
+
67
+ # 查看状态
68
+ openclaw status
69
+
70
+ # 查看频道状态
71
+ openclaw channels status youdu
72
+ ```
73
+
74
+ ## 消息处理流程
75
+
76
+ 1. 插件通过 WebSocket 连接到有度服务
77
+ 2. 认证成功后,监听来自有度的消息
78
+ 3. 收到消息后,解析并转发给 OpenClaw 核心处理
79
+ 4. OpenClaw 处理完成后,通过 WebSocket 将回复发送回有度服务
80
+
81
+ ## License
82
+
83
+ MIT