@core-workspace/infoflow-openclaw-plugin 2026.3.36 → 2026.4.10
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 +56 -22
- package/dist/index.cjs +45821 -0
- package/openclaw.plugin.json +647 -140
- package/package.json +23 -10
- package/CHANGELOG.md +0 -21
- package/docs/architecture-data-flow.md +0 -429
- package/docs/architecture.md +0 -423
- package/docs/dev-guide.md +0 -611
- package/docs/qa-feature-list.md +0 -413
- package/index.ts +0 -53
- package/publish.sh +0 -221
- package/scripts/deploy.sh +0 -34
- package/scripts/npm-tools/README.md +0 -70
- package/scripts/npm-tools/cli.js +0 -262
- package/scripts/npm-tools/package.json +0 -21
- package/skills/infoflow-dev/SKILL.md +0 -88
- package/skills/infoflow-dev/references/api.md +0 -413
- package/src/adapter/inbound/webhook-parser.ts +0 -433
- package/src/adapter/inbound/ws-receiver.ts +0 -268
- package/src/adapter/outbound/reply-dispatcher.ts +0 -274
- package/src/adapter/outbound/target-resolver.ts +0 -109
- package/src/channel/accounts.ts +0 -184
- package/src/channel/channel.ts +0 -365
- package/src/channel/media.ts +0 -373
- package/src/channel/monitor.ts +0 -184
- package/src/channel/outbound.ts +0 -942
- package/src/commands/changelog.ts +0 -53
- package/src/commands/doctor.ts +0 -391
- package/src/commands/logs.ts +0 -212
- package/src/events.ts +0 -62
- package/src/handler/message-handler.ts +0 -796
- package/src/logging.ts +0 -123
- package/src/runtime.ts +0 -14
- package/src/security/dm-policy.ts +0 -80
- package/src/security/group-policy.ts +0 -273
- package/src/tools/actions/index.ts +0 -456
- package/src/tools/hooks/index.ts +0 -82
- package/src/tools/index.ts +0 -277
- package/src/types.ts +0 -293
- package/src/utils/store/message-store.ts +0 -295
- package/src/utils/token-adapter.ts +0 -90
package/README.md
CHANGED
|
@@ -168,10 +168,8 @@ openclaw directory groups infoflow
|
|
|
168
168
|
groupAllowFrom: ["12345678"], // 群聊白名单(群ID字符串),groupPolicy="allowlist" 时生效
|
|
169
169
|
|
|
170
170
|
// ── 群聊回复行为 ───────────────────────────────────────
|
|
171
|
-
replyMode: "mention-
|
|
171
|
+
replyMode: "mention-only", // "ignore" / "record" / "mention-only"
|
|
172
172
|
requireMention: false, // 是否强制要求 @ 机器人才触发
|
|
173
|
-
watchMentions: ["alice"], // 监控指定人被 @,机器人代为判断是否回答
|
|
174
|
-
watchRegex: "故障|告警", // 群消息命中正则时触发
|
|
175
173
|
followUp: true, // 机器人回复后时间窗口内免 @ 追问
|
|
176
174
|
followUpWindow: 300, // 跟进时间窗口(秒)
|
|
177
175
|
|
|
@@ -190,7 +188,7 @@ openclaw directory groups infoflow
|
|
|
190
188
|
// ── 群级别覆盖 ────────────────────────────────────────
|
|
191
189
|
groups: {
|
|
192
190
|
"12345678": {
|
|
193
|
-
replyMode: "
|
|
191
|
+
replyMode: "mention-only",
|
|
194
192
|
groupSessionMode: "user", // 此群按群+人拆分会话
|
|
195
193
|
systemPrompt: "你是该群的专属助手,回答要简洁。",
|
|
196
194
|
},
|
|
@@ -246,7 +244,7 @@ https://your-domain/webhook/infoflow
|
|
|
246
244
|
| `appKey` | `string` | ✅ | — | 应用 Key,从如流企业后台获取 |
|
|
247
245
|
| `appSecret` | `string` | ✅ | — | 应用 Secret,从如流企业后台获取 |
|
|
248
246
|
| `appAgentId` | `number` | — | — | 企业后台"应用ID"(数字),私聊消息撤回需要此字段 |
|
|
249
|
-
| `robotName` | `string` | — | — | 机器人在群里的显示名称,用于检测消息中的 @ 提及。**未配置时无法识别 @机器人,`mention-only`
|
|
247
|
+
| `robotName` | `string` | — | — | 机器人在群里的显示名称,用于检测消息中的 @ 提及。**未配置时无法识别 @机器人,`mention-only` 模式将退化为对所有群消息触发** |
|
|
250
248
|
| `connectionMode` | `string` | — | `"webhook"` | 消息接收方式:`"webhook"` 如流主动推送;`"websocket"` 插件主动长连接 |
|
|
251
249
|
| `wsGateway` | `string` | — | `"infoflow-open-gateway.baidu.com"` | WebSocket 网关域名,仅 `websocket` 模式使用 |
|
|
252
250
|
| `enabled` | `boolean` | — | `true` | 是否启用该插件 |
|
|
@@ -265,12 +263,10 @@ https://your-domain/webhook/infoflow
|
|
|
265
263
|
|
|
266
264
|
| 字段 | 类型 | 必填 | 默认值 | 说明 |
|
|
267
265
|
|------|------|:----:|--------|------|
|
|
268
|
-
| `replyMode` | `string` | — | `"mention-
|
|
266
|
+
| `replyMode` | `string` | — | `"mention-only"` | 群聊回复策略:`ignore`(丢弃)/ `record`(仅记录)/ `mention-only`(仅被@时) |
|
|
269
267
|
| `groupSessionMode` | `string` | — | `"group"` | 群聊会话拆分模式:`"group"` = 按群拆分;`"user"` = 按群+人拆分 |
|
|
270
268
|
| `followUp` | `boolean` | — | `true` | 机器人回复后,时间窗口内自动识别追问,无需再次 @ |
|
|
271
269
|
| `followUpWindow` | `number` | — | `300` | 跟进时间窗口(秒) |
|
|
272
|
-
| `watchMentions` | `string[]` | — | `[]` | 监控指定人员被 @,机器人作为其助手代为判断是否回答,填写 uuapName |
|
|
273
|
-
| `watchRegex` | `string` | — | — | JavaScript 正则表达式,群消息内容命中时触发回复 |
|
|
274
270
|
|
|
275
271
|
#### 消息格式
|
|
276
272
|
|
|
@@ -298,8 +294,6 @@ https://your-domain/webhook/infoflow
|
|
|
298
294
|
|------|------|------|
|
|
299
295
|
| `replyMode` | `string` | 覆盖该群的回复策略 |
|
|
300
296
|
| `groupSessionMode` | `string` | 覆盖该群的会话拆分模式:`"group"` = 按群拆分;`"user"` = 按群+人拆分 |
|
|
301
|
-
| `watchMentions` | `string[]` | 覆盖该群监控的人员列表 |
|
|
302
|
-
| `watchRegex` | `string` | 覆盖该群的正则匹配规则 |
|
|
303
297
|
| `followUp` | `boolean` | 覆盖该群的跟进开关 |
|
|
304
298
|
| `followUpWindow` | `number` | 覆盖该群的跟进时间窗口(秒) |
|
|
305
299
|
| `systemPrompt` | `string` | 该群专属系统提示词,覆盖全局 Agent 的 system prompt |
|
|
@@ -484,6 +478,50 @@ tail -200 ~/.openclaw/logs/gateway.log | grep "sendInfoflowMessage"
|
|
|
484
478
|
| `messageId` | string | — | 撤回指定消息 ID(优先于 count) |
|
|
485
479
|
| `accountId` | string | — | 多账号时指定账号 ID |
|
|
486
480
|
|
|
481
|
+
#### `infoflow_emoji_reply` — 表情回复
|
|
482
|
+
|
|
483
|
+
为如流消息添加或移除表情回复,支持 146 种表情(d01-d146)。
|
|
484
|
+
|
|
485
|
+
| 参数 | 类型 | 必填 | 说明 |
|
|
486
|
+
|------|------|------|------|
|
|
487
|
+
| `messageId` | string | ✅ | 要添加表情回复的消息 ID |
|
|
488
|
+
| `msgId2` | string | ✅ | 消息的 msgId2(辅助 ID) |
|
|
489
|
+
| `chatType` | 2 \| 7 | ✅ | 聊天类型:2 = 群聊,7 = 私聊 |
|
|
490
|
+
| `chatId` | number | — | 群聊 ID(仅群聊时需要) |
|
|
491
|
+
| `fromUid` | string | — | 消息发送者 ID(私聊时自动从会话上下文提取) |
|
|
492
|
+
| `emojiId` | string | ✅ | 表情 ID,如 d135(敲键盘)、d101(收到)、d48(赞) |
|
|
493
|
+
| `action` | "add" \| "remove" | ✅ | 操作类型:add = 添加表情,remove = 移除表情 |
|
|
494
|
+
| `accountId` | string | — | 多账号时指定账号 ID |
|
|
495
|
+
|
|
496
|
+
**常用表情**:
|
|
497
|
+
- 确认:d101(收到)、d105(搞定)、d48(赞)
|
|
498
|
+
- 情绪:d01(微笑)、d02(大笑)、d71(爱心)
|
|
499
|
+
- 工作:d135(敲键盘)、d118(优秀)、d124(编码中)
|
|
500
|
+
|
|
501
|
+
**主动使用场景**(LLM 会在以下情况主动添加表情):
|
|
502
|
+
1. **长任务开始时**:执行耗时任务前,先用 d101(收到)或 d124(编码中)快速响应
|
|
503
|
+
2. **出错/失败时**:处理失败或遇到错误,用 d19(衰)或 d32(委屈)表达歉意
|
|
504
|
+
3. **理解/确认时**:收到用户指令后,用 d101(收到)或 d47(OK)确认理解
|
|
505
|
+
4. **用户表扬时**:用户说"厉害"、"棒"、"谢谢"、"牛"等夸赞词,用 d13(害羞)、d01(微笑)或 d71(爱心)回应
|
|
506
|
+
5. **幽默/轻松时**:对话轻松愉快,用 d03(哈哈)、d07(偷笑)或 d15(调皮)增加趣味
|
|
507
|
+
|
|
508
|
+
#### `infoflow_list_emojis` — 查询表情列表
|
|
509
|
+
|
|
510
|
+
查询如流支持的所有表情或指定类别的表情。
|
|
511
|
+
|
|
512
|
+
| 参数 | 类型 | 必填 | 说明 |
|
|
513
|
+
|------|------|------|------|
|
|
514
|
+
| `category` | string | — | 表情类别,默认为 "all"(全部表情) |
|
|
515
|
+
|
|
516
|
+
**可用类别**:
|
|
517
|
+
- `all`:全部 146 种表情
|
|
518
|
+
- `confirm`:确认类(收到、搞定、OK 等)
|
|
519
|
+
- `emotion`:情绪类(微笑、大笑、爱心等)
|
|
520
|
+
- `work`:工作类(敲键盘、优秀、编码中等)
|
|
521
|
+
- `status`:状态类(工作中、会议中、休息中等)
|
|
522
|
+
- `gesture`:手势类(赞、握手、胜利等)
|
|
523
|
+
- `symbol`:符号类(爱心、月亮、太阳等)
|
|
524
|
+
|
|
487
525
|
### 添加自定义 Tool
|
|
488
526
|
|
|
489
527
|
在 `src/tools/` 下新建文件,在 `src/tools/index.ts` 的 `registerInfoflowTools` 中注册:
|
|
@@ -619,7 +657,7 @@ description: Skill 描述,说明何时触发(这是触发机制,写清楚
|
|
|
619
657
|
```bash
|
|
620
658
|
tail -200 ~/.openclaw/logs/gateway.log | grep "webhook"
|
|
621
659
|
```
|
|
622
|
-
3. 检查 `robotName` 是否与如流后台机器人显示名一致(影响 @mention 检测)。**注意:不配置 `robotName` 时,`mention-only`
|
|
660
|
+
3. 检查 `robotName` 是否与如流后台机器人显示名一致(影响 @mention 检测)。**注意:不配置 `robotName` 时,`mention-only` 模式将退化为对所有群消息触发,而非完全不触发**
|
|
623
661
|
4. 检查 `groupPolicy` 是否允许该群
|
|
624
662
|
5. 在如流中发送 `/infoflow-doctor` 进行自检
|
|
625
663
|
|
|
@@ -769,7 +807,7 @@ For more options (access control, group policies, message format, etc.) see [Con
|
|
|
769
807
|
// ── Connection ────────────────────────────────────────
|
|
770
808
|
enabled: true,
|
|
771
809
|
apiHost: "https://api.im.baidu.com", // required
|
|
772
|
-
connectionMode: "websocket", // "
|
|
810
|
+
connectionMode: "websocket", // "websocket" (default) or "webhook"
|
|
773
811
|
wsGateway: "infoflow-open-gateway.baidu.com", // websocket mode only
|
|
774
812
|
checkToken: "your-check-token", // required
|
|
775
813
|
encodingAESKey: "your-encoding-aes-key", // required
|
|
@@ -785,10 +823,8 @@ For more options (access control, group policies, message format, etc.) see [Con
|
|
|
785
823
|
groupAllowFrom: ["12345678"], // Group whitelist (group ID string), used when groupPolicy="allowlist"
|
|
786
824
|
|
|
787
825
|
// ── Reply Behavior ────────────────────────────────────
|
|
788
|
-
replyMode: "mention-
|
|
826
|
+
replyMode: "mention-only", // "ignore" / "record" / "mention-only"
|
|
789
827
|
requireMention: false,
|
|
790
|
-
watchMentions: ["alice"], // act as assistant when these users are @mentioned
|
|
791
|
-
watchRegex: "incident|alert", // trigger on regex match in group messages
|
|
792
828
|
followUp: true, // allow follow-up questions without re-mentioning
|
|
793
829
|
followUpWindow: 300, // follow-up window in seconds
|
|
794
830
|
|
|
@@ -807,7 +843,7 @@ For more options (access control, group policies, message format, etc.) see [Con
|
|
|
807
843
|
// ── Per-group Overrides ───────────────────────────────
|
|
808
844
|
groups: {
|
|
809
845
|
"12345678": {
|
|
810
|
-
replyMode: "
|
|
846
|
+
replyMode: "mention-only",
|
|
811
847
|
systemPrompt: "You are the dedicated assistant for this group.",
|
|
812
848
|
},
|
|
813
849
|
},
|
|
@@ -852,7 +888,7 @@ https://your-domain/webhook/infoflow
|
|
|
852
888
|
| `appKey` | `string` | ✅ | — | App Key from Infoflow enterprise console |
|
|
853
889
|
| `appSecret` | `string` | ✅ | — | App Secret from Infoflow enterprise console |
|
|
854
890
|
| `appAgentId` | `number` | — | — | App Agent ID (numeric); required for private message recall |
|
|
855
|
-
| `robotName` | `string` | — | — | Bot display name in groups, used for @mention detection. **Without this, `mention-only`
|
|
891
|
+
| `robotName` | `string` | — | — | Bot display name in groups, used for @mention detection. **Without this, `mention-only` mode falls back to triggering on every message** |
|
|
856
892
|
| `connectionMode` | `string` | — | `"webhook"` | `"webhook"` (Infoflow pushes to your server) or `"websocket"` (plugin connects to Infoflow) |
|
|
857
893
|
| `wsGateway` | `string` | — | `"infoflow-open-gateway.baidu.com"` | WebSocket gateway hostname, only used in `websocket` mode |
|
|
858
894
|
| `enabled` | `boolean` | — | `true` | Whether to enable the plugin |
|
|
@@ -871,11 +907,9 @@ https://your-domain/webhook/infoflow
|
|
|
871
907
|
|
|
872
908
|
| Field | Type | Required | Default | Description |
|
|
873
909
|
|-------|------|:--------:|---------|-------------|
|
|
874
|
-
| `replyMode` | `string` | — | `"mention-
|
|
910
|
+
| `replyMode` | `string` | — | `"mention-only"` | `ignore` (discard) / `record` (save only) / `mention-only` (when @mentioned) |
|
|
875
911
|
| `followUp` | `boolean` | — | `true` | Auto-detect follow-up questions after bot replies (no @ needed) |
|
|
876
912
|
| `followUpWindow` | `number` | — | `300` | Follow-up window in seconds |
|
|
877
|
-
| `watchMentions` | `string[]` | — | `[]` | Watch these users; bot acts as assistant when they are @mentioned |
|
|
878
|
-
| `watchRegex` | `string` | — | — | JavaScript regex; trigger reply when group message content matches |
|
|
879
913
|
|
|
880
914
|
#### Message Format
|
|
881
915
|
|
|
@@ -895,7 +929,7 @@ https://your-domain/webhook/infoflow
|
|
|
895
929
|
| `defaultAccount` | `string` | — | Default account ID |
|
|
896
930
|
| `groups` | `object` | — | Per-group overrides; key = group ID (numeric string) |
|
|
897
931
|
|
|
898
|
-
Per-group fields: `replyMode`, `
|
|
932
|
+
Per-group fields: `replyMode`, `followUp`, `followUpWindow`, `systemPrompt`
|
|
899
933
|
|
|
900
934
|
**Priority**: per-group > account-level > top-level defaults
|
|
901
935
|
|
|
@@ -1056,7 +1090,7 @@ Declare the skill path in `openclaw.plugin.json`:
|
|
|
1056
1090
|
|
|
1057
1091
|
1. Check `replyMode` — confirm the group is allowed to trigger
|
|
1058
1092
|
2. Check logs for incoming webhook requests
|
|
1059
|
-
3. Verify `robotName` matches the bot's display name in Infoflow (affects @mention detection). **Note: without `robotName`, `mention-only`
|
|
1093
|
+
3. Verify `robotName` matches the bot's display name in Infoflow (affects @mention detection). **Note: without `robotName`, `mention-only` mode falls back to triggering on every message**
|
|
1060
1094
|
4. Check `groupPolicy` allows the group
|
|
1061
1095
|
5. Send `/infoflow-doctor` in Infoflow to run self-checks
|
|
1062
1096
|
|