@chbo297/infoflow 2026.3.2 → 2026.3.6
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 +426 -15
- package/index.ts +6 -1
- package/openclaw.plugin.json +14 -2
- package/package.json +2 -2
- package/src/accounts.ts +3 -0
- package/src/actions.ts +350 -4
- package/src/bot.ts +357 -14
- package/src/channel.ts +64 -23
- package/src/infoflow-req-parse.ts +0 -1
- package/src/media.ts +367 -0
- package/src/monitor.ts +1 -1
- package/src/reply-dispatcher.ts +157 -67
- package/src/send.ts +497 -57
- package/src/sent-message-store.ts +238 -0
- package/src/types.ts +27 -2
package/README.md
CHANGED
|
@@ -1,20 +1,43 @@
|
|
|
1
|
-
#
|
|
1
|
+
[中文](#中文) | [English](#english)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
---
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
<a id="中文"></a>
|
|
6
|
+
|
|
7
|
+
# @chbo297/infoflow
|
|
8
|
+
|
|
9
|
+
百度如流 (Infoflow) 企业消息平台 — OpenClaw 频道插件。
|
|
10
|
+
|
|
11
|
+
## 特性
|
|
12
|
+
|
|
13
|
+
- **私聊 & 群聊**消息接收与回复
|
|
14
|
+
- 群内 **@机器人** 检测,被 @提及 时自动回复
|
|
15
|
+
- **watchMentions(关注提及)**:监控指定人员被 @ 时,机器人作为其助手判断是否代为回复
|
|
16
|
+
- **followUp(跟进回复)**:机器人回复后,在时间窗口内智能判断后续消息是否为追问,无需再次 @
|
|
17
|
+
- 五种 **replyMode(回复模式)**:从完全忽略到主动参与,灵活控制群内行为
|
|
18
|
+
- **按群独立配置**:每个群可设置不同的回复策略和系统提示词
|
|
19
|
+
- **多账号支持**:一个实例管理多个如流机器人
|
|
20
|
+
- **Agent 主动/定时发送**:LLM Agent 可主动或定时发送私聊消息、往群里发消息,支持 @指定用户或 @全员
|
|
21
|
+
|
|
22
|
+
## 安装
|
|
23
|
+
|
|
24
|
+
### 通过 npm
|
|
6
25
|
|
|
7
26
|
```bash
|
|
8
27
|
openclaw plugins install @chbo297/infoflow
|
|
9
28
|
```
|
|
10
29
|
|
|
11
|
-
|
|
30
|
+
### 本地安装
|
|
12
31
|
|
|
13
32
|
```bash
|
|
14
33
|
openclaw plugins install ./path/to/openclaw-infoflow
|
|
15
34
|
```
|
|
16
35
|
|
|
17
|
-
##
|
|
36
|
+
## 环境要求
|
|
37
|
+
|
|
38
|
+
- OpenClaw **>= 2026.3.2**
|
|
39
|
+
|
|
40
|
+
## 快速开始
|
|
18
41
|
|
|
19
42
|
```json5
|
|
20
43
|
{
|
|
@@ -26,34 +49,144 @@ openclaw plugins install ./path/to/openclaw-infoflow
|
|
|
26
49
|
encodingAESKey: "your-encoding-aes-key",
|
|
27
50
|
appKey: "your-app-key",
|
|
28
51
|
appSecret: "your-app-secret",
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
52
|
+
robotName: "MyBot", // 必填:用于群内 @提及 检测
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Webhook 地址
|
|
59
|
+
|
|
60
|
+
将如流机器人的 webhook URL 配置为:
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
https://your-domain/webhook/infoflow
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
修改配置后需重启网关。
|
|
67
|
+
|
|
68
|
+
## 回复模式 (replyMode)
|
|
69
|
+
|
|
70
|
+
通过 `replyMode` 控制机器人在群聊中的参与程度,默认值为 `mention-and-watch`。
|
|
71
|
+
|
|
72
|
+
| 模式 | 行为 |
|
|
73
|
+
|------|------|
|
|
74
|
+
| `ignore` | 丢弃消息,不保存、不思考、不回复 |
|
|
75
|
+
| `record` | 仅保存到会话历史,不思考、不回复 |
|
|
76
|
+
| `mention-only` | 仅在机器人被 @提及 时回复 |
|
|
77
|
+
| `mention-and-watch` | 机器人被 @、或被关注的人被 @、或在跟进窗口内时回复 **(默认)** |
|
|
78
|
+
| `proactive` | 始终参与思考,可能主动回复所有消息 |
|
|
79
|
+
|
|
80
|
+
## 关注提及 (watchMentions)
|
|
81
|
+
|
|
82
|
+
配置需要关注的人员列表。当群内有人 @提及 列表中的人时,机器人作为其助手判断是否能代为回答。
|
|
83
|
+
|
|
84
|
+
```json5
|
|
85
|
+
{
|
|
86
|
+
channels: {
|
|
87
|
+
infoflow: {
|
|
88
|
+
watchMentions: ["alice01", "bob02"],
|
|
89
|
+
// 需配合 replyMode 为 "mention-and-watch" 或 "proactive"
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**匹配优先级**:`userid` > `robotid`(数字)> 显示名称
|
|
96
|
+
|
|
97
|
+
**行为**:
|
|
98
|
+
- 机器人通过 LLM 判断是否有能力代为回答
|
|
99
|
+
- 如果有把握 → 直接回复
|
|
100
|
+
- 如果无法帮助 → 静默不回复
|
|
101
|
+
|
|
102
|
+
## 跟进回复 (followUp)
|
|
103
|
+
|
|
104
|
+
机器人回复后,在 `followUpWindow` 时间窗口内(默认 300 秒),后续消息即使没有 @机器人 也会触发智能判断:
|
|
105
|
+
|
|
106
|
+
- 如果是同一话题的追问 → 继续回复
|
|
107
|
+
- 如果是无关的新话题 → 静默不回复
|
|
108
|
+
|
|
109
|
+
```json5
|
|
110
|
+
{
|
|
111
|
+
channels: {
|
|
112
|
+
infoflow: {
|
|
113
|
+
followUp: true, // 默认 true
|
|
114
|
+
followUpWindow: 300, // 秒,默认 300
|
|
33
115
|
},
|
|
34
116
|
},
|
|
35
117
|
}
|
|
36
118
|
```
|
|
37
119
|
|
|
38
|
-
##
|
|
120
|
+
## 按群配置 (groups)
|
|
121
|
+
|
|
122
|
+
可以为每个群设置独立的回复策略,覆盖全局默认值。
|
|
123
|
+
|
|
124
|
+
```json5
|
|
125
|
+
{
|
|
126
|
+
channels: {
|
|
127
|
+
infoflow: {
|
|
128
|
+
replyMode: "mention-and-watch", // 全局默认
|
|
129
|
+
groups: {
|
|
130
|
+
"123456": {
|
|
131
|
+
replyMode: "mention-and-watch",
|
|
132
|
+
watchMentions: ["team-lead01"],
|
|
133
|
+
followUp: true,
|
|
134
|
+
followUpWindow: 600,
|
|
135
|
+
systemPrompt: "你是这个项目组的技术助手。",
|
|
136
|
+
},
|
|
137
|
+
"789012": {
|
|
138
|
+
replyMode: "record", // 此群仅记录不回复
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
}
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
**配置优先级**:群级别 > 账号级别 > 顶层默认值
|
|
147
|
+
|
|
148
|
+
## 访问控制
|
|
149
|
+
|
|
150
|
+
### 私聊策略 (dmPolicy)
|
|
151
|
+
|
|
152
|
+
| 值 | 说明 |
|
|
153
|
+
|---|------|
|
|
154
|
+
| `open` | 允许所有用户私聊(默认) |
|
|
155
|
+
| `pairing` | 需配对确认 |
|
|
156
|
+
| `allowlist` | 仅允许 `allowFrom` 列表中的用户 |
|
|
157
|
+
|
|
158
|
+
### 群聊策略 (groupPolicy)
|
|
159
|
+
|
|
160
|
+
| 值 | 说明 |
|
|
161
|
+
|---|------|
|
|
162
|
+
| `open` | 允许所有群触发(默认) |
|
|
163
|
+
| `allowlist` | 仅允许 `groupAllowFrom` 列表中的群 |
|
|
164
|
+
| `disabled` | 禁用群聊 |
|
|
165
|
+
|
|
166
|
+
## 多账号支持
|
|
39
167
|
|
|
40
168
|
```json5
|
|
41
169
|
{
|
|
42
170
|
channels: {
|
|
43
171
|
infoflow: {
|
|
44
172
|
enabled: true,
|
|
173
|
+
replyMode: "mention-and-watch", // 所有账号的默认值
|
|
45
174
|
accounts: {
|
|
46
175
|
work: {
|
|
47
176
|
checkToken: "token-1",
|
|
48
177
|
encodingAESKey: "key-1",
|
|
49
178
|
appKey: "app-key-1",
|
|
50
179
|
appSecret: "secret-1",
|
|
180
|
+
robotName: "WorkBot",
|
|
181
|
+
replyMode: "mention-and-watch",
|
|
182
|
+
watchMentions: ["manager01"],
|
|
51
183
|
},
|
|
52
184
|
personal: {
|
|
53
185
|
checkToken: "token-2",
|
|
54
186
|
encodingAESKey: "key-2",
|
|
55
187
|
appKey: "app-key-2",
|
|
56
188
|
appSecret: "secret-2",
|
|
189
|
+
robotName: "PersonalBot",
|
|
57
190
|
},
|
|
58
191
|
},
|
|
59
192
|
defaultAccount: "work",
|
|
@@ -62,17 +195,295 @@ openclaw plugins install ./path/to/openclaw-infoflow
|
|
|
62
195
|
}
|
|
63
196
|
```
|
|
64
197
|
|
|
65
|
-
##
|
|
198
|
+
## 完整配置参考
|
|
199
|
+
|
|
200
|
+
| 字段 | 类型 | 默认值 | 说明 |
|
|
201
|
+
|------|------|--------|------|
|
|
202
|
+
| `enabled` | `boolean` | `true` | 是否启用 |
|
|
203
|
+
| `apiHost` | `string` | — | 如流 API 地址 |
|
|
204
|
+
| `checkToken` | `string` | — | 验证 token **(必填)** |
|
|
205
|
+
| `encodingAESKey` | `string` | — | 消息加密密钥 **(必填)** |
|
|
206
|
+
| `appKey` | `string` | — | 应用 Key **(必填)** |
|
|
207
|
+
| `appSecret` | `string` | — | 应用 Secret **(必填)** |
|
|
208
|
+
| `robotName` | `string` | — | 机器人名称,用于 @提及 检测 |
|
|
209
|
+
| `replyMode` | `string` | `"mention-and-watch"` | 回复模式 |
|
|
210
|
+
| `followUp` | `boolean` | `true` | 是否启用跟进回复 |
|
|
211
|
+
| `followUpWindow` | `number` | `300` | 跟进窗口(秒) |
|
|
212
|
+
| `watchMentions` | `string[]` | `[]` | 关注提及的人员列表 |
|
|
213
|
+
| `dmPolicy` | `string` | `"open"` | 私聊策略 |
|
|
214
|
+
| `allowFrom` | `string[]` | `[]` | 私聊白名单 |
|
|
215
|
+
| `groupPolicy` | `string` | `"open"` | 群聊策略 |
|
|
216
|
+
| `groupAllowFrom` | `string[]` | `[]` | 群聊白名单 |
|
|
217
|
+
| `groups` | `object` | — | 按群配置,key 为群 ID |
|
|
218
|
+
| `accounts` | `object` | — | 多账号配置 |
|
|
219
|
+
| `defaultAccount` | `string` | — | 默认账号 ID |
|
|
220
|
+
|
|
221
|
+
### groups.\<groupId\> 子字段
|
|
222
|
+
|
|
223
|
+
| 字段 | 类型 | 说明 |
|
|
224
|
+
|------|------|------|
|
|
225
|
+
| `replyMode` | `string` | 覆盖该群的回复模式 |
|
|
226
|
+
| `watchMentions` | `string[]` | 覆盖该群的关注列表 |
|
|
227
|
+
| `followUp` | `boolean` | 覆盖该群的跟进开关 |
|
|
228
|
+
| `followUpWindow` | `number` | 覆盖该群的跟进窗口 |
|
|
229
|
+
| `systemPrompt` | `string` | 该群专属系统提示词 |
|
|
230
|
+
|
|
231
|
+
## Agent 主动发送 (Actions)
|
|
232
|
+
|
|
233
|
+
LLM Agent 可通过 `send` action 主动发送消息:
|
|
234
|
+
|
|
235
|
+
| 参数 | 类型 | 说明 |
|
|
236
|
+
|------|------|------|
|
|
237
|
+
| `to` | `string` | **必填**。目标:用户名(私聊)或 `group:<groupId>`(群聊) |
|
|
238
|
+
| `message` | `string` | 消息文本内容 |
|
|
239
|
+
| `atAll` | `boolean` | 群消息中 @所有人 |
|
|
240
|
+
| `mentionUserIds` | `string` | 群消息中 @指定用户,逗号分隔 |
|
|
241
|
+
| `media` | `string` | 附带链接 URL |
|
|
242
|
+
|
|
243
|
+
## 许可证
|
|
244
|
+
|
|
245
|
+
MIT
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
<a id="english"></a>
|
|
250
|
+
|
|
251
|
+
# @chbo297/infoflow
|
|
252
|
+
|
|
253
|
+
Baidu Infoflow (如流) enterprise messaging platform — OpenClaw channel plugin.
|
|
254
|
+
|
|
255
|
+
## Features
|
|
256
|
+
|
|
257
|
+
- **Direct & group** message receiving and replying
|
|
258
|
+
- **@mention detection** in groups — auto-reply when the bot is @mentioned
|
|
259
|
+
- **watchMentions**: monitor specified people; when they are @mentioned, the bot acts as their assistant and decides whether to reply on their behalf
|
|
260
|
+
- **followUp**: after the bot replies, intelligently judge whether subsequent messages are follow-up questions within a time window — no need to @mention again
|
|
261
|
+
- Five **replyMode** levels: from fully ignoring to proactively engaging, flexibly control group behavior
|
|
262
|
+
- **Per-group config**: each group can have its own reply strategy and system prompt
|
|
263
|
+
- **Multi-account support**: manage multiple Infoflow bots from a single instance
|
|
264
|
+
- **Agent-initiated / scheduled sending**: LLM Agent can proactively or on a schedule send DMs, post messages to groups, @specific users, or @all members
|
|
265
|
+
|
|
266
|
+
## Install
|
|
267
|
+
|
|
268
|
+
### Via npm
|
|
269
|
+
|
|
270
|
+
```bash
|
|
271
|
+
openclaw plugins install @chbo297/infoflow
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
### Local checkout
|
|
275
|
+
|
|
276
|
+
```bash
|
|
277
|
+
openclaw plugins install ./path/to/openclaw-infoflow
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
## Requirements
|
|
281
|
+
|
|
282
|
+
- OpenClaw **>= 2026.3.2**
|
|
283
|
+
|
|
284
|
+
## Quick Start
|
|
285
|
+
|
|
286
|
+
```json5
|
|
287
|
+
{
|
|
288
|
+
channels: {
|
|
289
|
+
infoflow: {
|
|
290
|
+
enabled: true,
|
|
291
|
+
apiHost: "https://apiin.im.baidu.com",
|
|
292
|
+
checkToken: "your-check-token",
|
|
293
|
+
encodingAESKey: "your-encoding-aes-key",
|
|
294
|
+
appKey: "your-app-key",
|
|
295
|
+
appSecret: "your-app-secret",
|
|
296
|
+
robotName: "MyBot", // used for @mention detection in groups
|
|
297
|
+
},
|
|
298
|
+
},
|
|
299
|
+
}
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
### Webhook URL
|
|
66
303
|
|
|
67
304
|
Configure your Infoflow bot webhook URL to:
|
|
68
|
-
|
|
305
|
+
|
|
306
|
+
```
|
|
307
|
+
https://your-domain/webhook/infoflow
|
|
308
|
+
```
|
|
69
309
|
|
|
70
310
|
Restart the gateway after config changes.
|
|
71
311
|
|
|
72
|
-
##
|
|
312
|
+
## Reply Modes (replyMode)
|
|
313
|
+
|
|
314
|
+
Control how the bot participates in group chats via `replyMode`. Default: `mention-and-watch`.
|
|
315
|
+
|
|
316
|
+
| Mode | Behavior |
|
|
317
|
+
|------|----------|
|
|
318
|
+
| `ignore` | Discard messages — no saving, no thinking, no reply |
|
|
319
|
+
| `record` | Save to session history only — no thinking, no reply |
|
|
320
|
+
| `mention-only` | Reply only when the bot is directly @mentioned |
|
|
321
|
+
| `mention-and-watch` | Reply when bot is @mentioned, a watched person is @mentioned, or within follow-up window **(default)** |
|
|
322
|
+
| `proactive` | Always think and potentially reply to all messages |
|
|
323
|
+
|
|
324
|
+
## Watch Mentions (watchMentions)
|
|
325
|
+
|
|
326
|
+
Configure a list of people to watch. When someone in the group @mentions a person on this list, the bot acts as their assistant and decides whether to answer on their behalf.
|
|
327
|
+
|
|
328
|
+
```json5
|
|
329
|
+
{
|
|
330
|
+
channels: {
|
|
331
|
+
infoflow: {
|
|
332
|
+
watchMentions: ["alice01", "bob02"],
|
|
333
|
+
// Requires replyMode "mention-and-watch" or "proactive"
|
|
334
|
+
},
|
|
335
|
+
},
|
|
336
|
+
}
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
**Matching priority**: `userid` > `robotid` (numeric) > display name
|
|
340
|
+
|
|
341
|
+
**Behavior**:
|
|
342
|
+
- The bot uses LLM to judge whether it can answer on behalf
|
|
343
|
+
- Confident it can help → replies directly
|
|
344
|
+
- Cannot help → stays silent (NO_REPLY)
|
|
345
|
+
|
|
346
|
+
## Follow-Up (followUp)
|
|
347
|
+
|
|
348
|
+
After the bot replies, any subsequent message within the `followUpWindow` (default 300 seconds) triggers intelligent judgment — even without @mentioning the bot:
|
|
349
|
+
|
|
350
|
+
- Same topic / follow-up question → continue replying
|
|
351
|
+
- Unrelated new topic → stay silent
|
|
352
|
+
|
|
353
|
+
```json5
|
|
354
|
+
{
|
|
355
|
+
channels: {
|
|
356
|
+
infoflow: {
|
|
357
|
+
followUp: true, // Default: true
|
|
358
|
+
followUpWindow: 300, // Seconds, default: 300
|
|
359
|
+
},
|
|
360
|
+
},
|
|
361
|
+
}
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
## Per-Group Config (groups)
|
|
365
|
+
|
|
366
|
+
Set independent reply strategies for each group, overriding the global defaults.
|
|
367
|
+
|
|
368
|
+
```json5
|
|
369
|
+
{
|
|
370
|
+
channels: {
|
|
371
|
+
infoflow: {
|
|
372
|
+
replyMode: "mention-only", // Global default
|
|
373
|
+
groups: {
|
|
374
|
+
"123456": {
|
|
375
|
+
replyMode: "mention-and-watch",
|
|
376
|
+
watchMentions: ["team-lead01"],
|
|
377
|
+
followUp: true,
|
|
378
|
+
followUpWindow: 600,
|
|
379
|
+
systemPrompt: "You are the tech assistant for this project team.",
|
|
380
|
+
},
|
|
381
|
+
"789012": {
|
|
382
|
+
replyMode: "record", // This group records only, no replies
|
|
383
|
+
},
|
|
384
|
+
},
|
|
385
|
+
},
|
|
386
|
+
},
|
|
387
|
+
}
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
**Config priority**: group-level > account-level > top-level defaults
|
|
391
|
+
|
|
392
|
+
## Access Control
|
|
393
|
+
|
|
394
|
+
### DM Policy (dmPolicy)
|
|
395
|
+
|
|
396
|
+
| Value | Description |
|
|
397
|
+
|-------|-------------|
|
|
398
|
+
| `open` | Allow all users to DM (default) |
|
|
399
|
+
| `pairing` | Require pairing confirmation |
|
|
400
|
+
| `allowlist` | Only allow users in `allowFrom` list |
|
|
401
|
+
|
|
402
|
+
### Group Policy (groupPolicy)
|
|
403
|
+
|
|
404
|
+
| Value | Description |
|
|
405
|
+
|-------|-------------|
|
|
406
|
+
| `open` | Allow all groups to trigger the bot (default) |
|
|
407
|
+
| `allowlist` | Only allow groups in `groupAllowFrom` list |
|
|
408
|
+
| `disabled` | Disable group messaging |
|
|
409
|
+
|
|
410
|
+
## Multi-Account
|
|
411
|
+
|
|
412
|
+
```json5
|
|
413
|
+
{
|
|
414
|
+
channels: {
|
|
415
|
+
infoflow: {
|
|
416
|
+
enabled: true,
|
|
417
|
+
replyMode: "mention-only", // Default for all accounts
|
|
418
|
+
accounts: {
|
|
419
|
+
work: {
|
|
420
|
+
checkToken: "token-1",
|
|
421
|
+
encodingAESKey: "key-1",
|
|
422
|
+
appKey: "app-key-1",
|
|
423
|
+
appSecret: "secret-1",
|
|
424
|
+
robotName: "WorkBot",
|
|
425
|
+
replyMode: "mention-and-watch",
|
|
426
|
+
watchMentions: ["manager01"],
|
|
427
|
+
},
|
|
428
|
+
personal: {
|
|
429
|
+
checkToken: "token-2",
|
|
430
|
+
encodingAESKey: "key-2",
|
|
431
|
+
appKey: "app-key-2",
|
|
432
|
+
appSecret: "secret-2",
|
|
433
|
+
robotName: "PersonalBot",
|
|
434
|
+
},
|
|
435
|
+
},
|
|
436
|
+
defaultAccount: "work",
|
|
437
|
+
},
|
|
438
|
+
},
|
|
439
|
+
}
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
## Full Config Reference
|
|
443
|
+
|
|
444
|
+
| Field | Type | Default | Description |
|
|
445
|
+
|-------|------|---------|-------------|
|
|
446
|
+
| `enabled` | `boolean` | `true` | Enable/disable the channel |
|
|
447
|
+
| `apiHost` | `string` | — | Infoflow API base URL |
|
|
448
|
+
| `checkToken` | `string` | — | Verification token **(required)** |
|
|
449
|
+
| `encodingAESKey` | `string` | — | AES encryption key **(required)** |
|
|
450
|
+
| `appKey` | `string` | — | Application key **(required)** |
|
|
451
|
+
| `appSecret` | `string` | — | Application secret **(required)** |
|
|
452
|
+
| `robotName` | `string` | — | Bot name for @mention detection |
|
|
453
|
+
| `replyMode` | `string` | `"mention-and-watch"` | Reply mode |
|
|
454
|
+
| `followUp` | `boolean` | `true` | Enable follow-up replies |
|
|
455
|
+
| `followUpWindow` | `number` | `300` | Follow-up window (seconds) |
|
|
456
|
+
| `watchMentions` | `string[]` | `[]` | List of people to watch for @mentions |
|
|
457
|
+
| `dmPolicy` | `string` | `"open"` | DM access policy |
|
|
458
|
+
| `allowFrom` | `string[]` | `[]` | DM allowlist |
|
|
459
|
+
| `groupPolicy` | `string` | `"open"` | Group access policy |
|
|
460
|
+
| `groupAllowFrom` | `string[]` | `[]` | Group allowlist |
|
|
461
|
+
| `groups` | `object` | — | Per-group config, keyed by group ID |
|
|
462
|
+
| `accounts` | `object` | — | Multi-account config |
|
|
463
|
+
| `defaultAccount` | `string` | — | Default account ID |
|
|
464
|
+
|
|
465
|
+
### groups.\<groupId\> fields
|
|
466
|
+
|
|
467
|
+
| Field | Type | Description |
|
|
468
|
+
|-------|------|-------------|
|
|
469
|
+
| `replyMode` | `string` | Override reply mode for this group |
|
|
470
|
+
| `watchMentions` | `string[]` | Override watch list for this group |
|
|
471
|
+
| `followUp` | `boolean` | Override follow-up toggle for this group |
|
|
472
|
+
| `followUpWindow` | `number` | Override follow-up window for this group |
|
|
473
|
+
| `systemPrompt` | `string` | Custom system prompt for this group |
|
|
474
|
+
|
|
475
|
+
## Actions (Agent-Initiated Sending)
|
|
476
|
+
|
|
477
|
+
LLM Agent can proactively send messages via the `send` action:
|
|
73
478
|
|
|
74
|
-
|
|
479
|
+
| Parameter | Type | Description |
|
|
480
|
+
|-----------|------|-------------|
|
|
481
|
+
| `to` | `string` | **Required**. Target: username (DM) or `group:<groupId>` (group) |
|
|
482
|
+
| `message` | `string` | Message text content |
|
|
483
|
+
| `atAll` | `boolean` | @all members in group messages |
|
|
484
|
+
| `mentionUserIds` | `string` | @specific users in group, comma-separated |
|
|
485
|
+
| `media` | `string` | Attached link URL |
|
|
75
486
|
|
|
76
487
|
## License
|
|
77
488
|
|
|
78
|
-
MIT
|
|
489
|
+
MIT
|
package/index.ts
CHANGED
|
@@ -11,7 +11,12 @@ const plugin = {
|
|
|
11
11
|
register(api: OpenClawPluginApi) {
|
|
12
12
|
setInfoflowRuntime(api.runtime);
|
|
13
13
|
api.registerChannel({ plugin: infoflowPlugin });
|
|
14
|
-
api.
|
|
14
|
+
api.registerHttpRoute({
|
|
15
|
+
path: "/webhook/infoflow",
|
|
16
|
+
auth: "plugin",
|
|
17
|
+
match: "exact",
|
|
18
|
+
handler: handleInfoflowWebhookRequest,
|
|
19
|
+
});
|
|
15
20
|
},
|
|
16
21
|
};
|
|
17
22
|
|
package/openclaw.plugin.json
CHANGED
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
"appKey": { "type": "string" },
|
|
14
14
|
"appSecret": { "type": "string" },
|
|
15
15
|
"robotName": { "type": "string" },
|
|
16
|
+
"appAgentId": {
|
|
17
|
+
"type": "number",
|
|
18
|
+
"description": "如流企业后台的应用ID,私聊消息撤回依赖此字段"
|
|
19
|
+
},
|
|
16
20
|
"dmPolicy": { "type": "string", "enum": ["open", "pairing", "allowlist"] },
|
|
17
21
|
"allowFrom": { "type": "array", "items": { "type": "string" } },
|
|
18
22
|
"groupPolicy": { "type": "string", "enum": ["open", "allowlist", "disabled"] },
|
|
@@ -26,6 +30,7 @@
|
|
|
26
30
|
"followUp": { "type": "boolean", "default": true },
|
|
27
31
|
"followUpWindow": { "type": "number", "default": 300 },
|
|
28
32
|
"watchMentions": { "type": "array", "items": { "type": "string" } },
|
|
33
|
+
"thinkingIndicator": { "type": "boolean", "default": true },
|
|
29
34
|
"groups": {
|
|
30
35
|
"type": "object",
|
|
31
36
|
"additionalProperties": {
|
|
@@ -38,7 +43,8 @@
|
|
|
38
43
|
"watchMentions": { "type": "array", "items": { "type": "string" } },
|
|
39
44
|
"followUp": { "type": "boolean" },
|
|
40
45
|
"followUpWindow": { "type": "number" },
|
|
41
|
-
"systemPrompt": { "type": "string" }
|
|
46
|
+
"systemPrompt": { "type": "string" },
|
|
47
|
+
"thinkingIndicator": { "type": "boolean" }
|
|
42
48
|
},
|
|
43
49
|
"additionalProperties": false
|
|
44
50
|
}
|
|
@@ -55,6 +61,10 @@
|
|
|
55
61
|
"appKey": { "type": "string" },
|
|
56
62
|
"appSecret": { "type": "string" },
|
|
57
63
|
"robotName": { "type": "string" },
|
|
64
|
+
"appAgentId": {
|
|
65
|
+
"type": "number",
|
|
66
|
+
"description": "如流企业后台的应用ID,私聊消息撤回依赖此字段"
|
|
67
|
+
},
|
|
58
68
|
"dmPolicy": { "type": "string", "enum": ["open", "pairing", "allowlist"] },
|
|
59
69
|
"allowFrom": { "type": "array", "items": { "type": "string" } },
|
|
60
70
|
"groupPolicy": { "type": "string", "enum": ["open", "allowlist", "disabled"] },
|
|
@@ -67,6 +77,7 @@
|
|
|
67
77
|
"followUp": { "type": "boolean" },
|
|
68
78
|
"followUpWindow": { "type": "number" },
|
|
69
79
|
"watchMentions": { "type": "array", "items": { "type": "string" } },
|
|
80
|
+
"thinkingIndicator": { "type": "boolean" },
|
|
70
81
|
"groups": {
|
|
71
82
|
"type": "object",
|
|
72
83
|
"additionalProperties": {
|
|
@@ -79,7 +90,8 @@
|
|
|
79
90
|
"watchMentions": { "type": "array", "items": { "type": "string" } },
|
|
80
91
|
"followUp": { "type": "boolean" },
|
|
81
92
|
"followUpWindow": { "type": "number" },
|
|
82
|
-
"systemPrompt": { "type": "string" }
|
|
93
|
+
"systemPrompt": { "type": "string" },
|
|
94
|
+
"thinkingIndicator": { "type": "boolean" }
|
|
83
95
|
},
|
|
84
96
|
"additionalProperties": false
|
|
85
97
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chbo297/infoflow",
|
|
3
|
-
"version": "2026.3.
|
|
3
|
+
"version": "2026.3.6",
|
|
4
4
|
"description": "OpenClaw Infoflow (如流) channel plugin for Baidu enterprise messaging",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.ts",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"url": "https://github.com/chbo297/openclaw-infoflow"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
|
-
"openclaw": ">=2026.2
|
|
22
|
+
"openclaw": ">=2026.3.2"
|
|
23
23
|
},
|
|
24
24
|
"openclaw": {
|
|
25
25
|
"extensions": [
|
package/src/accounts.ts
CHANGED
|
@@ -71,6 +71,7 @@ function mergeInfoflowAccountConfig(
|
|
|
71
71
|
robotName?: string;
|
|
72
72
|
requireMention?: boolean;
|
|
73
73
|
watchMentions?: string[];
|
|
74
|
+
appAgentId?: number;
|
|
74
75
|
} {
|
|
75
76
|
const raw = getChannelSection(cfg) ?? {};
|
|
76
77
|
const { accounts: _ignored, defaultAccount: _ignored2, ...base } = raw;
|
|
@@ -86,6 +87,7 @@ function mergeInfoflowAccountConfig(
|
|
|
86
87
|
robotName?: string;
|
|
87
88
|
requireMention?: boolean;
|
|
88
89
|
watchMentions?: string[];
|
|
90
|
+
appAgentId?: number;
|
|
89
91
|
};
|
|
90
92
|
}
|
|
91
93
|
|
|
@@ -129,6 +131,7 @@ export function resolveInfoflowAccount(params: {
|
|
|
129
131
|
robotName: merged.robotName?.trim() || undefined,
|
|
130
132
|
requireMention: merged.requireMention,
|
|
131
133
|
watchMentions: merged.watchMentions,
|
|
134
|
+
appAgentId: merged.appAgentId,
|
|
132
135
|
},
|
|
133
136
|
};
|
|
134
137
|
}
|