@core-workspace/infoflow-openclaw-plugin 2026.3.8

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.
@@ -0,0 +1,138 @@
1
+ {
2
+ "id": "infoflow",
3
+ "channels": ["infoflow"],
4
+ "skills": ["./skills"],
5
+ "configSchema": {
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "properties": {
9
+ "apiHost": { "type": "string" },
10
+ "enabled": { "type": "boolean" },
11
+ "name": { "type": "string" },
12
+ "checkToken": { "type": "string" },
13
+ "encodingAESKey": { "type": "string" },
14
+ "appKey": { "type": "string" },
15
+ "appSecret": { "type": "string" },
16
+ "connectionMode": {
17
+ "type": "string",
18
+ "enum": ["webhook", "websocket"],
19
+ "default": "webhook",
20
+ "description": "消息接收方式:webhook(HTTP 回调)或 websocket(长连接)"
21
+ },
22
+ "wsGateway": {
23
+ "type": "string",
24
+ "description": "WebSocket Gateway 域名(仅 websocket 模式使用)"
25
+ },
26
+ "robotName": { "type": "string" },
27
+ "appAgentId": {
28
+ "type": "number",
29
+ "description": "如流企业后台的应用ID,私聊消息撤回依赖此字段"
30
+ },
31
+ "dmPolicy": { "type": "string", "enum": ["open", "pairing", "allowlist"] },
32
+ "allowFrom": { "type": "array", "items": { "type": "string" } },
33
+ "groupPolicy": { "type": "string", "enum": ["open", "allowlist", "disabled"] },
34
+ "groupAllowFrom": { "type": "array", "items": { "type": "string" } },
35
+ "requireMention": { "type": "boolean" },
36
+ "replyMode": {
37
+ "type": "string",
38
+ "enum": ["ignore", "record", "mention-only", "mention-and-watch", "proactive"],
39
+ "default": "mention-and-watch"
40
+ },
41
+ "followUp": { "type": "boolean", "default": true },
42
+ "followUpWindow": { "type": "number", "default": 300 },
43
+ "watchMentions": { "type": "array", "items": { "type": "string" } },
44
+ "watchRegex": { "type": "string" },
45
+ "groups": {
46
+ "type": "object",
47
+ "additionalProperties": {
48
+ "type": "object",
49
+ "properties": {
50
+ "replyMode": {
51
+ "type": "string",
52
+ "enum": ["ignore", "record", "mention-only", "mention-and-watch", "proactive"]
53
+ },
54
+ "watchMentions": { "type": "array", "items": { "type": "string" } },
55
+ "watchRegex": { "type": "string" },
56
+ "followUp": { "type": "boolean" },
57
+ "followUpWindow": { "type": "number" },
58
+ "systemPrompt": { "type": "string" }
59
+ },
60
+ "additionalProperties": false
61
+ }
62
+ },
63
+ "accounts": {
64
+ "type": "object",
65
+ "additionalProperties": {
66
+ "type": "object",
67
+ "properties": {
68
+ "enabled": { "type": "boolean" },
69
+ "name": { "type": "string" },
70
+ "checkToken": { "type": "string" },
71
+ "encodingAESKey": { "type": "string" },
72
+ "appKey": { "type": "string" },
73
+ "appSecret": { "type": "string" },
74
+ "connectionMode": {
75
+ "type": "string",
76
+ "enum": ["webhook", "websocket"],
77
+ "default": "webhook"
78
+ },
79
+ "wsGateway": { "type": "string" },
80
+ "robotName": { "type": "string" },
81
+ "appAgentId": {
82
+ "type": "number",
83
+ "description": "如流企业后台的应用ID,私聊消息撤回依赖此字段"
84
+ },
85
+ "dmPolicy": { "type": "string", "enum": ["open", "pairing", "allowlist"] },
86
+ "allowFrom": { "type": "array", "items": { "type": "string" } },
87
+ "groupPolicy": { "type": "string", "enum": ["open", "allowlist", "disabled"] },
88
+ "groupAllowFrom": { "type": "array", "items": { "type": "string" } },
89
+ "requireMention": { "type": "boolean" },
90
+ "replyMode": {
91
+ "type": "string",
92
+ "enum": ["ignore", "record", "mention-only", "mention-and-watch", "proactive"]
93
+ },
94
+ "followUp": { "type": "boolean" },
95
+ "followUpWindow": { "type": "number" },
96
+ "watchMentions": { "type": "array", "items": { "type": "string" } },
97
+ "watchRegex": { "type": "string" },
98
+ "groups": {
99
+ "type": "object",
100
+ "additionalProperties": {
101
+ "type": "object",
102
+ "properties": {
103
+ "replyMode": {
104
+ "type": "string",
105
+ "enum": ["ignore", "record", "mention-only", "mention-and-watch", "proactive"]
106
+ },
107
+ "watchMentions": { "type": "array", "items": { "type": "string" } },
108
+ "watchRegex": { "type": "string" },
109
+ "followUp": { "type": "boolean" },
110
+ "followUpWindow": { "type": "number" },
111
+ "systemPrompt": { "type": "string" }
112
+ },
113
+ "additionalProperties": false
114
+ }
115
+ }
116
+ }
117
+ }
118
+ },
119
+ "defaultAccount": { "type": "string" },
120
+ "processingHint": {
121
+ "type": "boolean",
122
+ "default": true,
123
+ "description": "响应超时后发送\"⏳ 处理中...\"提示"
124
+ },
125
+ "processingHintDelay": {
126
+ "type": "number",
127
+ "default": 5,
128
+ "description": "发送处理中提示前的等待秒数,设为 0 则立即发送"
129
+ },
130
+ "messageFormat": {
131
+ "type": "string",
132
+ "enum": ["text", "markdown"],
133
+ "default": "text",
134
+ "description": "群聊消息格式:text(纯文本)或 markdown(富文本,不支持引用回复)"
135
+ }
136
+ }
137
+ }
138
+ }
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@core-workspace/infoflow-openclaw-plugin",
3
+ "version": "2026.3.8",
4
+ "description": "OpenClaw Infoflow (如流) channel plugin for Baidu enterprise messaging",
5
+ "type": "module",
6
+ "main": "index.ts",
7
+ "license": "MIT",
8
+ "keywords": [
9
+ "openclaw",
10
+ "openclaw-plugin",
11
+ "infoflow",
12
+ "baidu",
13
+ "chatbot",
14
+ "ai-agent",
15
+ "enterprise-messaging"
16
+ ],
17
+ "peerDependencies": {
18
+ "openclaw": ">=2026.3.2"
19
+ },
20
+ "dependencies": {
21
+ "@core-workspace/infoflow-sdk-nodejs": "^0.1.1"
22
+ },
23
+ "openclaw": {
24
+ "extensions": [
25
+ "./index.ts"
26
+ ],
27
+ "channel": {
28
+ "id": "infoflow",
29
+ "label": "Infoflow",
30
+ "selectionLabel": "Infoflow (如流)",
31
+ "docsPath": "/channels/infoflow",
32
+ "blurb": "Baidu Infoflow messaging platform.",
33
+ "order": 40
34
+ },
35
+ "install": {
36
+ "npmSpec": "@core-workspace/infoflow-openclaw-plugin",
37
+ "defaultChoice": "npm"
38
+ }
39
+ }
40
+ }
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env bash
2
+ # 部署 openclaw_infoflow 插件到本地 OpenClaw 并重启 gateway
3
+
4
+ set -e
5
+
6
+ PLUGIN_DIR="$HOME/.openclaw/extensions/infoflow"
7
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
8
+ PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
9
+
10
+ echo "==> 同步插件文件到 $PLUGIN_DIR"
11
+ mkdir -p "$PLUGIN_DIR"
12
+ rsync -av --delete "$PROJECT_DIR/" "$PLUGIN_DIR/" \
13
+ --exclude node_modules \
14
+ --exclude dist \
15
+ --exclude .git \
16
+ --exclude scripts
17
+
18
+ echo "==> 安装依赖"
19
+ cd "$PLUGIN_DIR" && npm install --silent
20
+
21
+ echo "==> 重启 OpenClaw gateway"
22
+ pkill -f "openclaw" 2>/dev/null || true
23
+ sleep 1
24
+ nohup openclaw gateway > /tmp/openclaw.log 2>&1 &
25
+ sleep 2
26
+
27
+ echo "==> 检查启动状态"
28
+ if pgrep -f "openclaw" > /dev/null; then
29
+ echo "✓ gateway 已启动(PID: $(pgrep -f openclaw | head -1))"
30
+ echo " 日志: tail -f /tmp/openclaw.log"
31
+ else
32
+ echo "✗ gateway 启动失败,查看日志: cat /tmp/openclaw.log"
33
+ exit 1
34
+ fi
@@ -0,0 +1,88 @@
1
+ ---
2
+ name: infoflow-dev
3
+ description: 如流(Infoflow)机器人开发指南。包含如流 API 参考、消息格式、鉴权机制、OpenClaw 插件架构和配置说明。当用户需要:(1) 开发如流机器人或 OpenClaw infoflow 插件,(2) 查询如流消息 API 格式(发消息/撤回/AT/图片),(3) 了解如流配置参数(dmPolicy/groupPolicy/replyMode 等),(4) 调试如流相关问题时使用此 skill。触发场景:「如流怎么发群消息」「infoflow 插件配置」「如流 AT 消息格式」「replyMode 怎么用」「如流鉴权」。
4
+ ---
5
+
6
+ # 如流(Infoflow)开发指南
7
+
8
+ ## 核心资料
9
+
10
+ - **完整 API 参考**:[references/api.md](references/api.md)
11
+ - 消息格式(TEXT/MD/AT/LINK/IMAGE)
12
+ - 发私聊/群消息 API
13
+ - 消息撤回 API
14
+ - 鉴权(Token 获取,Bearer- 格式)
15
+ - Webhook 解密、限流规则、错误码
16
+
17
+ ## 关键速查
18
+
19
+ ### 鉴权格式
20
+ ```
21
+ Authorization: Bearer-<token> ← 注意是连字符,不是空格
22
+ ```
23
+
24
+ ### 发群消息端点
25
+ ```
26
+ POST http://apiin.im.baidu.com/api/v1/robot/msg/groupmsgsend
27
+ ```
28
+
29
+ ### 发私聊端点
30
+ ```
31
+ POST http://apiin.im.baidu.com/api/v1/app/message/send
32
+ ```
33
+
34
+ ### 消息类型
35
+ | 类型 | 说明 |
36
+ |------|------|
37
+ | TEXT | 纯文本 |
38
+ | MD | Markdown |
39
+ | AT | @提及(atall/atuserids) |
40
+ | LINK | 链接(仅群聊,必须单独发送) |
41
+ | IMAGE | 图片 base64(仅群聊,必须单独发送) |
42
+
43
+ > LINK 和 IMAGE 必须单独发送,不能和 TEXT/MD 混在同一请求。
44
+
45
+ ### 大整数精度
46
+ messageid / msgseqid 超过 JS Number 精度(> 2^53),必须用字符串处理或手动拼 JSON:
47
+ ```typescript
48
+ const bodyStr = `{"groupId":${groupId},"messageid":${messageid},"msgseqid":${msgseqid}}`;
49
+ ```
50
+
51
+ ## OpenClaw 插件配置速查
52
+
53
+ ### 访问控制
54
+ | 字段 | 可选值 | 说明 |
55
+ |------|--------|------|
56
+ | `dmPolicy` | `open` / `pairing` / `allowlist` | 私聊策略 |
57
+ | `groupPolicy` | `open` / `allowlist` / `disabled` | 群聊策略 |
58
+ | `allowFrom` | string[] | 私聊白名单(uuapName) |
59
+ | `groupAllowFrom` | string[] | 群聊白名单(群 ID 字符串) |
60
+
61
+ ### 回复行为
62
+ | 字段 | 说明 |
63
+ |------|------|
64
+ | `replyMode` | `ignore` / `record` / `mention-only` / `mention-and-watch` / `proactive` |
65
+ | `watchMentions` | 监控被 @ 的人,代为回复 |
66
+ | `watchRegex` | 正则匹配消息内容触发回复 |
67
+ | `followUp` | 回复后继续监听跟进问题(默认 true) |
68
+ | `followUpWindow` | 跟进窗口秒数(默认 300) |
69
+
70
+ ### 消息格式
71
+ | 字段 | 说明 |
72
+ |------|------|
73
+ | `messageFormat` | `text`(默认)或 `markdown`(群聊,不支持 replyTo) |
74
+ | `processingHint` | 处理中提示(默认 true) |
75
+ | `processingHintDelay` | 提示延迟秒数(默认 5) |
76
+
77
+ ## 调试建议
78
+
79
+ ```bash
80
+ # 查看最新日志
81
+ tail -200 ~/.openclaw/logs/gateway.log | grep -E "(infoflow|ERROR)"
82
+
83
+ # 部署插件
84
+ rsync -av --exclude='.git' --exclude='node_modules' . ~/.openclaw/extensions/infoflow/
85
+ openclaw gateway restart
86
+ ```
87
+
88
+ 遇到问题先查 [references/api.md](references/api.md) 确认请求格式和错误码。