@jeik/dingtalk-connector 0.8.21-fix1
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/CHANGELOG.md +686 -0
- package/LICENSE +21 -0
- package/README.en.md +181 -0
- package/README.md +221 -0
- package/bin/dingtalk-connector.js +858 -0
- package/bin/wizard-config.mjs +110 -0
- package/dist/accounts-BAzdqkAV.mjs +268 -0
- package/dist/accounts-BQptOmgB.mjs +2 -0
- package/dist/chunk-upload-BBQgGtcZ.mjs +193 -0
- package/dist/chunk-upload-DaLXXZH3.mjs +2 -0
- package/dist/common-C8pYKU_y.mjs +2 -0
- package/dist/common-Dt9n6fQN.mjs +101 -0
- package/dist/connection-DHHFFNQJ.mjs +423 -0
- package/dist/entry-bundled.d.mts +16 -0
- package/dist/entry-bundled.mjs +31 -0
- package/dist/game-xiyou-CqHt-6Q1.mjs +4271 -0
- package/dist/gateway-methods-C4tcgI7P.mjs +771 -0
- package/dist/gateway-methods-Ci31A3vg.mjs +2 -0
- package/dist/http-client-CpnJHB89.mjs +2 -0
- package/dist/http-client-DFWZgO1n.mjs +33 -0
- package/dist/index.d.mts +193 -0
- package/dist/index.mjs +45 -0
- package/dist/logger-BmJkQkm1.mjs +2 -0
- package/dist/logger-mZ9OSbmD.mjs +58 -0
- package/dist/media-C_SVin7s.mjs +2 -0
- package/dist/media-cz72EVS3.mjs +509 -0
- package/dist/message-handler-DESzFFDc.mjs +1971 -0
- package/dist/messaging-B6l1sRvX.mjs +1044 -0
- package/dist/runtime-DUgpo5zC.mjs +1422 -0
- package/dist/session-DJ4jYqPv.mjs +114 -0
- package/dist/utils-Bjh4r_qS.mjs +4 -0
- package/dist/utils-CIfI_3Jh.mjs +63 -0
- package/dist/utils-legacy-CALCPP1t.mjs +230 -0
- package/dist/utils-legacy-CFYDBM4r.mjs +3 -0
- package/docs/DEAP_AGENT_GUIDE.en.md +115 -0
- package/docs/DEAP_AGENT_GUIDE.md +115 -0
- package/docs/DINGTALK_MANUAL_SETUP.md +50 -0
- package/docs/MULTI_AGENT_SETUP.md +306 -0
- package/docs/RELEASE_NOTES_V0.7.10.md +40 -0
- package/docs/RELEASE_NOTES_V0.7.2.md +143 -0
- package/docs/RELEASE_NOTES_V0.7.3.md +149 -0
- package/docs/RELEASE_NOTES_V0.7.4.md +206 -0
- package/docs/RELEASE_NOTES_V0.7.5.md +267 -0
- package/docs/RELEASE_NOTES_V0.7.6.md +219 -0
- package/docs/RELEASE_NOTES_V0.7.7.md +122 -0
- package/docs/RELEASE_NOTES_V0.7.8.md +101 -0
- package/docs/RELEASE_NOTES_V0.7.9.md +65 -0
- package/docs/RELEASE_NOTES_V0.8.0.md +53 -0
- package/docs/RELEASE_NOTES_V0.8.1.md +47 -0
- package/docs/RELEASE_NOTES_V0.8.10.md +49 -0
- package/docs/RELEASE_NOTES_V0.8.11.md +51 -0
- package/docs/RELEASE_NOTES_V0.8.12.md +63 -0
- package/docs/RELEASE_NOTES_V0.8.13-beta.0.md +69 -0
- package/docs/RELEASE_NOTES_V0.8.13.md +62 -0
- package/docs/RELEASE_NOTES_V0.8.14.md +86 -0
- package/docs/RELEASE_NOTES_V0.8.16.md +40 -0
- package/docs/RELEASE_NOTES_V0.8.17.md +87 -0
- package/docs/RELEASE_NOTES_V0.8.18.md +64 -0
- package/docs/RELEASE_NOTES_V0.8.19.md +62 -0
- package/docs/RELEASE_NOTES_V0.8.2.md +55 -0
- package/docs/RELEASE_NOTES_V0.8.20.md +49 -0
- package/docs/RELEASE_NOTES_V0.8.3.md +63 -0
- package/docs/RELEASE_NOTES_V0.8.4.md +45 -0
- package/docs/RELEASE_NOTES_V0.8.7.md +49 -0
- package/docs/RELEASE_NOTES_V0.8.8.md +63 -0
- package/docs/RELEASE_NOTES_V0.8.9.md +81 -0
- package/docs/RELEASE_NOTES_v0.7.0.md +142 -0
- package/docs/RELEASE_NOTES_v0.7.1.md +74 -0
- package/docs/TROUBLESHOOTING.md +122 -0
- package/index.ts +77 -0
- package/openclaw.plugin.json +551 -0
- package/package.json +147 -0
- package/skills/dingtalk-channel-rules/SKILL.md +91 -0
- package/skills/dingtalk-troubleshoot/SKILL.md +93 -0
- package/skills/dws-cli/SKILL.md +129 -0
- package/skills/dws-cli/references/error-codes.md +95 -0
- package/skills/dws-cli/references/field-rules.md +105 -0
- package/skills/dws-cli/references/global-reference.md +104 -0
- package/skills/dws-cli/references/intent-guide.md +114 -0
- package/skills/dws-cli/references/products/aitable.md +452 -0
- package/skills/dws-cli/references/products/attendance.md +93 -0
- package/skills/dws-cli/references/products/calendar.md +217 -0
- package/skills/dws-cli/references/products/chat.md +292 -0
- package/skills/dws-cli/references/products/contact.md +108 -0
- package/skills/dws-cli/references/products/ding.md +57 -0
- package/skills/dws-cli/references/products/report.md +162 -0
- package/skills/dws-cli/references/products/simple.md +128 -0
- package/skills/dws-cli/references/products/todo.md +138 -0
- package/skills/dws-cli/references/products/workbench.md +39 -0
- package/skills/dws-cli/references/recovery-guide.md +94 -0
- package/src/channel.ts +588 -0
- package/src/config/accounts.ts +242 -0
- package/src/config/schema.ts +180 -0
- package/src/core/connection.ts +741 -0
- package/src/core/message-handler.ts +1788 -0
- package/src/core/provider.ts +111 -0
- package/src/core/state.ts +54 -0
- package/src/device-auth-config.ts +14 -0
- package/src/device-auth.ts +197 -0
- package/src/directory.ts +95 -0
- package/src/docs.ts +293 -0
- package/src/game-xiyou/achievement-engine.ts +252 -0
- package/src/game-xiyou/bounty-system.ts +315 -0
- package/src/game-xiyou/commands.ts +223 -0
- package/src/game-xiyou/drop-engine.ts +241 -0
- package/src/game-xiyou/encounter-system.ts +135 -0
- package/src/game-xiyou/escape-engine.ts +164 -0
- package/src/game-xiyou/exp-calculator.ts +139 -0
- package/src/game-xiyou/index.ts +479 -0
- package/src/game-xiyou/level-system.ts +91 -0
- package/src/game-xiyou/monster-pool.ts +180 -0
- package/src/game-xiyou/pity-counter.ts +114 -0
- package/src/game-xiyou/random-event-engine.ts +648 -0
- package/src/game-xiyou/renderer.ts +679 -0
- package/src/game-xiyou/storage.ts +218 -0
- package/src/game-xiyou/treasure-system.ts +105 -0
- package/src/game-xiyou/types.ts +582 -0
- package/src/game-xiyou/uid-resolver.ts +49 -0
- package/src/gateway-methods.ts +740 -0
- package/src/onboarding.ts +553 -0
- package/src/policy.ts +32 -0
- package/src/probe.ts +210 -0
- package/src/reply-dispatcher.ts +874 -0
- package/src/runtime.ts +32 -0
- package/src/sdk/helpers.ts +322 -0
- package/src/sdk/types.ts +519 -0
- package/src/secret-input.ts +19 -0
- package/src/services/media/audio.ts +54 -0
- package/src/services/media/chunk-upload.ts +296 -0
- package/src/services/media/common.ts +155 -0
- package/src/services/media/file.ts +75 -0
- package/src/services/media/image.ts +81 -0
- package/src/services/media/index.ts +10 -0
- package/src/services/media/video.ts +162 -0
- package/src/services/media.ts +1143 -0
- package/src/services/messaging/card.ts +604 -0
- package/src/services/messaging/index.ts +18 -0
- package/src/services/messaging/mentions.ts +267 -0
- package/src/services/messaging/send.ts +141 -0
- package/src/services/messaging.ts +1191 -0
- package/src/services/reply-markers.ts +55 -0
- package/src/targets.ts +45 -0
- package/src/types/index.ts +59 -0
- package/src/types/pdf-parse.d.ts +3 -0
- package/src/utils/agent.ts +63 -0
- package/src/utils/async.ts +51 -0
- package/src/utils/constants.ts +27 -0
- package/src/utils/http-client.ts +38 -0
- package/src/utils/index.ts +8 -0
- package/src/utils/logger.ts +78 -0
- package/src/utils/session.ts +147 -0
- package/src/utils/token.ts +93 -0
- package/src/utils/utils-legacy.ts +454 -0
- package/tsconfig.json +20 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# 钉钉手动创建与手动配置流程
|
|
2
|
+
|
|
3
|
+
当一键扫码授权不可用、扫码失败,或你希望手动控制配置时,可使用本流程。
|
|
4
|
+
|
|
5
|
+
## 1) 手动创建钉钉机器人
|
|
6
|
+
|
|
7
|
+
### 1.1 创建应用
|
|
8
|
+
|
|
9
|
+
1. 访问 [钉钉开放平台](https://open-dev.dingtalk.com/)
|
|
10
|
+
2. 点击 **"应用开发"**
|
|
11
|
+
|
|
12
|
+

|
|
13
|
+
|
|
14
|
+
### 1.2 添加机器人能力
|
|
15
|
+
|
|
16
|
+
1. 在应用详情页,点击一键创建 OpenClaw 机器人应用
|
|
17
|
+
|
|
18
|
+

|
|
19
|
+
|
|
20
|
+
### 1.3 获取凭证
|
|
21
|
+
|
|
22
|
+
1. 完成创建并获取 **"凭证与基础信息"**
|
|
23
|
+
2. 复制你的 **AppKey**(Client ID)
|
|
24
|
+
3. 复制你的 **AppSecret**(Client Secret)
|
|
25
|
+
|
|
26
|
+

|
|
27
|
+

|
|
28
|
+
|
|
29
|
+
> ⚠️ **重要**:`clientId` 和 `clientSecret` 是机器人的唯一凭证,请合理保存。
|
|
30
|
+
|
|
31
|
+
## 2) 手动配置 OpenClaw
|
|
32
|
+
|
|
33
|
+
编辑配置文件:
|
|
34
|
+
|
|
35
|
+
- macOS / Linux:`~/.openclaw/openclaw.json`
|
|
36
|
+
- Windows:`C:\Users\<你的用户名>\.openclaw\openclaw.json`
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"channels": {
|
|
41
|
+
"dingtalk-connector": {
|
|
42
|
+
"enabled": true,
|
|
43
|
+
"clientId": "dingxxxxxxxxx",
|
|
44
|
+
"clientSecret": "your_app_secret"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
> 💡 **提示**:如果文件已有内容,在 `channels` 节点下添加 `dingtalk-connector` 部分即可。
|
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
# Connector 插件配置多 Agent — 辅助文档 2.0
|
|
2
|
+
|
|
3
|
+
> [dingtalk-connector GitHub 官网](https://github.com/DingTalk-Real-AI/dingtalk-openclaw-connector)
|
|
4
|
+
|
|
5
|
+
## 一、实操:从零配置多 Agent
|
|
6
|
+
|
|
7
|
+
### 前提条件
|
|
8
|
+
|
|
9
|
+
- OpenClaw 已安装且正常运行(`openclaw -v` ≥ 2026.4.9)
|
|
10
|
+
- 已有一个可用的钉钉机器人(作为第一个 Agent)
|
|
11
|
+
|
|
12
|
+
### Step 1:在钉钉开放平台创建新机器人
|
|
13
|
+
|
|
14
|
+
[手动创建机器人](https://github.com/DingTalk-Real-AI/dingtalk-openclaw-connector/blob/main/docs/DINGTALK_MANUAL_SETUP.md)
|
|
15
|
+
|
|
16
|
+
### Step 2:创建 Agent 配置目录
|
|
17
|
+
|
|
18
|
+
每个 Agent 需要一个独立的配置目录,里面放 `agent.md` 文件定义 Agent 的人格和能力。
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
# 创建 Agent 目录
|
|
22
|
+
mkdir -p ~/.openclaw/agents/dev-agent/agent
|
|
23
|
+
|
|
24
|
+
# 写入 systemPrompt(这是 Agent 的"人格定义")
|
|
25
|
+
cat > ~/.openclaw/agents/dev-agent/agent/agent.md << 'EOF'
|
|
26
|
+
你是一个开发助手,擅长代码审查、技术方案设计和 Bug 排查。
|
|
27
|
+
回复时请在第一行加上标识:🔵 [Dev Agent]
|
|
28
|
+
EOF
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
> 💡 **建议**:给每个 Agent 的 systemPrompt 加上明显不同的标识(如 emoji + 名称),方便测试时一眼区分回复来自哪个 Agent。
|
|
32
|
+
|
|
33
|
+
### Step 3:编辑 openclaw.json
|
|
34
|
+
|
|
35
|
+
编辑 `~/.openclaw/openclaw.json`,需要修改三个部分:
|
|
36
|
+
|
|
37
|
+
#### 3.1 注册 Agent(agents.list)
|
|
38
|
+
|
|
39
|
+
```jsonc
|
|
40
|
+
"agents": {
|
|
41
|
+
"list": [
|
|
42
|
+
{ "id": "main" },
|
|
43
|
+
{
|
|
44
|
+
"id": "dev-agent",
|
|
45
|
+
"name": "开发助手",
|
|
46
|
+
"agentDir": "/Users/你的用户名/.openclaw/agents/dev-agent/agent"
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
#### 3.2 注册机器人账号(channels.dingtalk-connector.accounts)
|
|
53
|
+
|
|
54
|
+
将**所有机器人**都放到 `accounts` 里,每个 key 是你自定义的账号名:
|
|
55
|
+
|
|
56
|
+
```jsonc
|
|
57
|
+
"channels": {
|
|
58
|
+
"dingtalk-connector": {
|
|
59
|
+
"enabled": true,
|
|
60
|
+
"accounts": {
|
|
61
|
+
"main-bot": {
|
|
62
|
+
"enabled": true,
|
|
63
|
+
"name": "主机器人",
|
|
64
|
+
"clientId": "原有机器人的AppKey",
|
|
65
|
+
"clientSecret": "原有机器人的AppSecret"
|
|
66
|
+
},
|
|
67
|
+
"dev-bot": {
|
|
68
|
+
"enabled": true,
|
|
69
|
+
"name": "开发助手机器人",
|
|
70
|
+
"clientId": "新机器人的AppKey(Step 1 获取)",
|
|
71
|
+
"clientSecret": "新机器人的AppSecret(Step 1 获取)"
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
> **关于顶层 `clientId` / `clientSecret` 是否保留:**
|
|
79
|
+
>
|
|
80
|
+
> - **单机器人场景(未配置 `accounts`)**:**必须保留**。框架直接读取顶层凭证启动唯一的机器人,这是最简配置。
|
|
81
|
+
> - **多机器人场景(已配置 `accounts`)**:**建议删除**。一旦配置了 `accounts`,框架**只会启动 `accounts` 里列出的机器人**,顶层凭证不再作为独立账号启动。如果某个 account 省略了 `clientId`/`clientSecret`,会从顶层继承(fallback),但这容易造成误解("为什么删了 account 里的凭证还能连上?")。**推荐做法**:每个 account 都写明自己的凭证,删除顶层的 `clientId`/`clientSecret`,避免歧义。
|
|
82
|
+
>
|
|
83
|
+
> ⚠️ **重要**:一旦配置了 `accounts`,原来顶层的 `clientId`/`clientSecret` 不再自动作为独立账号启动,必须也放进 `accounts` 里才会被启动。
|
|
84
|
+
|
|
85
|
+
#### 3.3 绑定机器人到 Agent(bindings)
|
|
86
|
+
|
|
87
|
+
通过 `accountId` 将每个机器人绑定到对应的 Agent:
|
|
88
|
+
|
|
89
|
+
```jsonc
|
|
90
|
+
"bindings": [
|
|
91
|
+
{
|
|
92
|
+
"agentId": "main",
|
|
93
|
+
"match": {
|
|
94
|
+
"channel": "dingtalk-connector",
|
|
95
|
+
"accountId": "main-bot"
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"agentId": "dev-agent",
|
|
100
|
+
"match": {
|
|
101
|
+
"channel": "dingtalk-connector",
|
|
102
|
+
"accountId": "dev-bot"
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
]
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**效果**:`main-bot` 收到的所有消息(无论群聊还是单聊)都路由到 `main` Agent,`dev-bot` 收到的所有消息都路由到 `dev-agent`。
|
|
109
|
+
|
|
110
|
+
### Step 4:重启 OpenClaw
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
openclaw gateway restart
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Step 5:验证
|
|
117
|
+
|
|
118
|
+
查看启动日志,确认两个机器人都成功连接:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
tail -f ~/.openclaw/logs/gateway.log | grep dingtalk
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
应该看到:
|
|
125
|
+
|
|
126
|
+
```plaintext
|
|
127
|
+
[dingtalk-connector] starting dingtalk-connector[dev-bot] (mode: stream, ...)
|
|
128
|
+
[dingtalk-connector] starting dingtalk-connector[main-bot] (mode: stream, ...)
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
如果看到 `auto-restart attempt` 或 `Authentication failed (401)`,说明 clientId/clientSecret 不正确或机器人未开启 Stream 模式,请回到 Step 1 检查。
|
|
132
|
+
|
|
133
|
+
### Step 6:测试
|
|
134
|
+
|
|
135
|
+
将两个机器人都拉入同一个群聊,分别 @它们发消息:
|
|
136
|
+
|
|
137
|
+
| 操作 | 预期结果 |
|
|
138
|
+
| --- | --- |
|
|
139
|
+
| @主机器人 "你是谁" | 回复来自 main Agent |
|
|
140
|
+
| @开发助手机器人 "你是谁" | 回复带 🔵 [Dev Agent] 标识 |
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## 二、完整配置示例
|
|
145
|
+
|
|
146
|
+
以下是一个包含 3 个机器人 × 3 个 Agent 的完整配置:
|
|
147
|
+
|
|
148
|
+
```jsonc
|
|
149
|
+
{
|
|
150
|
+
"agents": {
|
|
151
|
+
"defaults": {
|
|
152
|
+
"model": { "primary": "bailian/qwen3.5-plus" }
|
|
153
|
+
},
|
|
154
|
+
"list": [
|
|
155
|
+
{ "id": "main" },
|
|
156
|
+
{
|
|
157
|
+
"id": "dev-agent",
|
|
158
|
+
"name": "开发助手",
|
|
159
|
+
"agentDir": "~/.openclaw/agents/dev-agent/agent"
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"id": "pm-agent",
|
|
163
|
+
"name": "项目经理",
|
|
164
|
+
"agentDir": "~/.openclaw/agents/pm-agent/agent"
|
|
165
|
+
}
|
|
166
|
+
]
|
|
167
|
+
},
|
|
168
|
+
"channels": {
|
|
169
|
+
"dingtalk-connector": {
|
|
170
|
+
"enabled": true,
|
|
171
|
+
"accounts": {
|
|
172
|
+
"main-bot": {
|
|
173
|
+
"enabled": true,
|
|
174
|
+
"name": "通用助手",
|
|
175
|
+
"clientId": "ding_main_appkey",
|
|
176
|
+
"clientSecret": "main_app_secret"
|
|
177
|
+
},
|
|
178
|
+
"dev-bot": {
|
|
179
|
+
"enabled": true,
|
|
180
|
+
"name": "开发助手机器人",
|
|
181
|
+
"clientId": "ding_dev_appkey",
|
|
182
|
+
"clientSecret": "dev_app_secret"
|
|
183
|
+
},
|
|
184
|
+
"pm-bot": {
|
|
185
|
+
"enabled": true,
|
|
186
|
+
"name": "项目经理机器人",
|
|
187
|
+
"clientId": "ding_pm_appkey",
|
|
188
|
+
"clientSecret": "pm_app_secret"
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
"bindings": [
|
|
194
|
+
{ "agentId": "main", "match": { "channel": "dingtalk-connector", "accountId": "main-bot" } },
|
|
195
|
+
{ "agentId": "dev-agent", "match": { "channel": "dingtalk-connector", "accountId": "dev-bot" } },
|
|
196
|
+
{ "agentId": "pm-agent", "match": { "channel": "dingtalk-connector", "accountId": "pm-bot" } }
|
|
197
|
+
]
|
|
198
|
+
}
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## 三、协作模式:多 Agent 信息接力
|
|
204
|
+
|
|
205
|
+
当多个 Agent 在同一个群里时,它们可以通过**钉钉文档**进行异步协作——Agent A 写入文档,Agent B 读取文档,实现"信息接力"。
|
|
206
|
+
|
|
207
|
+
### 3.1 协作工具
|
|
208
|
+
|
|
209
|
+
| 工具 | 作用 |
|
|
210
|
+
| --- | --- |
|
|
211
|
+
| `docs.create` | 创建协作文档(协作起点) |
|
|
212
|
+
| `docs.append` | 追加处理进度或中间产物 |
|
|
213
|
+
| `docs.read` | 读取协作文档的最新内容 |
|
|
214
|
+
|
|
215
|
+
### 3.2 协作场景示例
|
|
216
|
+
|
|
217
|
+
```plaintext
|
|
218
|
+
用户 @项目经理机器人:"帮我整理一下本周的需求清单"
|
|
219
|
+
└─ pm-agent 调用 docs.create 创建《本周需求清单.md》
|
|
220
|
+
└─ pm-agent 在群里回复文档链接
|
|
221
|
+
|
|
222
|
+
用户 @开发助手机器人:"看看需求清单,给出技术方案"
|
|
223
|
+
└─ dev-agent 调用 docs.read 读取需求清单
|
|
224
|
+
└─ dev-agent 调用 docs.append 追加技术方案
|
|
225
|
+
└─ dev-agent 在群里回复方案摘要
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### 3.3 跨 Agent 消息推送
|
|
229
|
+
|
|
230
|
+
通过 Gateway Methods,一个 Agent 可以主动向其他群/用户发送消息:
|
|
231
|
+
|
|
232
|
+
```plaintext
|
|
233
|
+
运维 Agent 检测到异常
|
|
234
|
+
└─ 调用 gateway.call('dingtalk-connector.sendToGroup', { ... })
|
|
235
|
+
└─ 向"紧急处理群"发送报警
|
|
236
|
+
└─ 该群的值班 Agent 自动接收并开始处理
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
## 四、每个 Account 的独立配置
|
|
242
|
+
|
|
243
|
+
每个 account 可以独立覆盖以下配置(不配则继承顶层默认值):
|
|
244
|
+
|
|
245
|
+
| 配置项 | 说明 | 示例 |
|
|
246
|
+
| --- | --- | --- |
|
|
247
|
+
| `dmPolicy` | 单聊策略 | `"open"` / `"allowlist"` |
|
|
248
|
+
| `groupPolicy` | 群聊策略 | `"open"` / `"allowlist"` / `"disabled"` |
|
|
249
|
+
| `requireMention` | 群聊是否需要 @机器人 | `true` / `false` |
|
|
250
|
+
| `systemPrompt` | 系统提示词 | `"你是一个代码专家"` |
|
|
251
|
+
| `asyncMode` | 异步模式 | `true` / `false` |
|
|
252
|
+
| `groupSessionScope` | 群聊会话隔离 | `"group"` / `"group_sender"` |
|
|
253
|
+
|
|
254
|
+
示例:让 dev-bot 在群聊中不需要 @就能响应:
|
|
255
|
+
|
|
256
|
+
```jsonc
|
|
257
|
+
"accounts": {
|
|
258
|
+
"dev-bot": {
|
|
259
|
+
"clientId": "...",
|
|
260
|
+
"clientSecret": "...",
|
|
261
|
+
"requireMention": false
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
## 五、常见问题
|
|
269
|
+
|
|
270
|
+
### Q1:机器人连接失败,日志显示 `Authentication failed (401)`
|
|
271
|
+
|
|
272
|
+
**原因**:clientId 或 clientSecret 不正确,或机器人未开启 Stream 模式。
|
|
273
|
+
|
|
274
|
+
**解决**:
|
|
275
|
+
|
|
276
|
+
1. 去钉钉开放平台确认 AppKey/AppSecret 是否正确
|
|
277
|
+
2. 确认消息接收模式是 **Stream 模式**
|
|
278
|
+
3. 确认机器人已**发布上线**(不是"开发中"状态)
|
|
279
|
+
|
|
280
|
+
### Q2:配置了 accounts 后,原来的机器人不工作了
|
|
281
|
+
|
|
282
|
+
**原因**:一旦配置了 `accounts`,框架只启动 `accounts` 里的机器人。顶层的 clientId/clientSecret 变成了基础默认值,不再作为独立账号启动。
|
|
283
|
+
|
|
284
|
+
**解决**:把原来的机器人也加到 `accounts` 里。
|
|
285
|
+
|
|
286
|
+
### Q3:同一个群里两个机器人,怎么确保消息不会路由错?
|
|
287
|
+
|
|
288
|
+
**原理**:每个机器人维护独立的 WebSocket 连接。用户 @机器人A 时,只有机器人A 收到消息(accountId = A 的 key),bindings 中 `accountId` 匹配确保路由到正确的 Agent。两个机器人之间完全隔离,不会串。
|
|
289
|
+
|
|
290
|
+
### Q4:如何获取群聊的 conversationId(CID)?
|
|
291
|
+
|
|
292
|
+
在群聊中 @任意已连接的机器人,发送任意消息。开启 `debug: true` 后,从日志中可以看到:
|
|
293
|
+
|
|
294
|
+
```plaintext
|
|
295
|
+
处理消息: accountId=xxx, data= { "conversationId": "cidXXXXX", ... }
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
或者直接在群里问机器人"当前群的 conversationId 是什么"。
|
|
299
|
+
|
|
300
|
+
---
|
|
301
|
+
|
|
302
|
+
## 六、后续的改进方向
|
|
303
|
+
|
|
304
|
+
后续将优化为**通过命令行的形式配置多 Agent**,而**非用户自己去改相应的配置文件**。
|
|
305
|
+
|
|
306
|
+
connector 优化 ing,后续将提供更简便的多 Agent 配置方式,有问题请提 [Issue](https://github.com/DingTalk-Real-AI/dingtalk-openclaw-connector/issues) 😍
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Release Notes - v0.7.10
|
|
2
|
+
|
|
3
|
+
## ✨ 功能与体验改进 / Features & Improvements
|
|
4
|
+
|
|
5
|
+
- **WebSocket 心跳重连机制优化 / WebSocket Reconnection**
|
|
6
|
+
WebSocket 会持续尝试重连,保留指数退避策略(1s → 2s → 4s → 8s → 16s → 30s),避免雪崩效应。重连成功后重置计数器,下次失败从 1 秒开始退避。
|
|
7
|
+
Removed maximum reconnection attempt limit, implemented infinite reconnection mechanism. WebSocket will continuously attempt to reconnect without giving up. Exponential backoff strategy retained (1s → 2s → 4s → 8s → 16s → 30s) to avoid avalanche effect. Counter resets on successful reconnection, starting from 1 second on next failure.
|
|
8
|
+
|
|
9
|
+
- **配置简化 / Configuration Simplification**
|
|
10
|
+
从 `SocketManagerConfig` 中移除 `maxReconnectAttempts` 配置项,简化配置复杂度。
|
|
11
|
+
Removed `maxReconnectAttempts` configuration from `SocketManagerConfig`, simplifying configuration complexity.
|
|
12
|
+
|
|
13
|
+
- **日志输出优化 / Log Output Optimization**
|
|
14
|
+
更新重连日志格式,移除最大次数显示(从 "尝试 X/5" 改为 "尝试 X"),更清晰地展示重连进度。
|
|
15
|
+
Updated reconnection log format, removed maximum attempt display (from "attempt X/5" to "attempt X"), providing clearer reconnection progress.
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## 📥 安装升级 / Installation & Upgrade
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
# 通过 npm 安装最新版本 / Install latest version via npm
|
|
22
|
+
openclaw plugins install @dingtalk-real-ai/dingtalk-connector
|
|
23
|
+
|
|
24
|
+
# 或升级现有版本 / Or upgrade existing version
|
|
25
|
+
openclaw plugins update dingtalk-connector
|
|
26
|
+
|
|
27
|
+
# 通过 Git 安装 / Install via Git
|
|
28
|
+
openclaw plugins install https://github.com/DingTalk-Real-AI/dingtalk-openclaw-connector.git
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## 🔗 相关链接 / Related Links
|
|
32
|
+
|
|
33
|
+
- [完整变更日志 / Full Changelog](https://github.com/DingTalk-Real-AI/dingtalk-openclaw-connector/blob/main/CHANGELOG.md)
|
|
34
|
+
- [使用文档 / Documentation](https://github.com/DingTalk-Real-AI/dingtalk-openclaw-connector/blob/main/README.md)
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
**发布日期 / Release Date**:2026-03-16
|
|
39
|
+
**版本号 / Version**:v0.7.10
|
|
40
|
+
**兼容性 / Compatibility**:OpenClaw Gateway 0.4.0+
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
# Release Notes - v0.7.2
|
|
2
|
+
|
|
3
|
+
## ✨ 功能增强版本 / Feature Enhancement Release
|
|
4
|
+
|
|
5
|
+
本次更新新增异步模式功能,并修复了多个关键问题,提升了连接器的稳定性和用户体验。
|
|
6
|
+
|
|
7
|
+
This update adds async mode functionality and fixes several critical issues, improving connector stability and user experience.
|
|
8
|
+
|
|
9
|
+
## ✨ 新增功能 / New Features
|
|
10
|
+
|
|
11
|
+
### 1. 异步模式 / Async Mode
|
|
12
|
+
|
|
13
|
+
**功能描述 / Feature Description**:立即回执用户消息,后台处理任务,然后主动推送最终结果作为独立消息
|
|
14
|
+
Immediately acknowledge user messages, process in background, then push the final result as a separate message
|
|
15
|
+
|
|
16
|
+
**使用场景 / Use Cases**:
|
|
17
|
+
- 处理耗时较长的任务(如文档分析、代码生成等)
|
|
18
|
+
Processing time-consuming tasks (e.g., document analysis, code generation)
|
|
19
|
+
- 需要给用户即时反馈的场景
|
|
20
|
+
Scenarios requiring immediate user feedback
|
|
21
|
+
- 希望将处理过程和结果分离的场景
|
|
22
|
+
Scenarios where separating processing and results is desired
|
|
23
|
+
|
|
24
|
+
**配置方式 / Configuration**:
|
|
25
|
+
|
|
26
|
+
```json5
|
|
27
|
+
{
|
|
28
|
+
"channels": {
|
|
29
|
+
"dingtalk-connector": {
|
|
30
|
+
"asyncMode": true, // 启用异步模式 / Enable async mode
|
|
31
|
+
"ackText": "🫡 任务已接收" // 可选:自定义回执消息 / Optional: Custom ack message
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**工作流程 / Workflow**:
|
|
38
|
+
1. **立即回执** - 用户发送消息后,连接器立即发送回执消息
|
|
39
|
+
**Immediate Acknowledgment** - Connector immediately sends acknowledgment message after user sends message
|
|
40
|
+
2. **后台处理** - 连接器在后台调用 Gateway 处理任务,支持文件附件和图片
|
|
41
|
+
**Background Processing** - Connector processes task in background via Gateway, supports file attachments and images
|
|
42
|
+
3. **推送结果** - 处理完成后,连接器主动推送最终结果作为独立消息
|
|
43
|
+
**Push Result** - After processing completes, connector proactively pushes final result as separate message
|
|
44
|
+
|
|
45
|
+
**影响范围 / Impact**:所有用户均可选择启用此功能,默认关闭,不影响现有使用方式
|
|
46
|
+
All users can optionally enable this feature. Default is off, does not affect existing usage.
|
|
47
|
+
|
|
48
|
+
## 🐛 修复 / Fixes
|
|
49
|
+
|
|
50
|
+
### 1. 异步模式下 Agent 路由问题修复 / Agent Routing Fix in Async Mode
|
|
51
|
+
|
|
52
|
+
**问题描述 / Issue Description**:异步模式下 `streamFromGateway` 调用时缺少 `accountId` 参数,导致会话路由到 undefined agent
|
|
53
|
+
In async mode, `streamFromGateway` was called without `accountId`, causing sessions to route to undefined agent
|
|
54
|
+
|
|
55
|
+
**修复内容 / Fix**:
|
|
56
|
+
- 修复 `streamFromGateway` 调用,正确传递 `accountId` 参数
|
|
57
|
+
Fixed `streamFromGateway` call to correctly pass `accountId` parameter
|
|
58
|
+
- 确保异步模式下 Agent 路由正常工作
|
|
59
|
+
Ensures Agent routing works correctly in async mode
|
|
60
|
+
|
|
61
|
+
**影响范围 / Impact**:影响使用异步模式的用户,修复后异步模式下的 Agent 路由将正常工作
|
|
62
|
+
Affects users using async mode. After the fix, Agent routing in async mode will work correctly.
|
|
63
|
+
|
|
64
|
+
### 2. 默认 Agent 路由修复 / Default Agent Routing Fix
|
|
65
|
+
|
|
66
|
+
**问题描述 / Issue Description**:当 `accountId` 为 `'default'` 时,仍然发送 `X-OpenClaw-Agent-Id` header,导致路由异常
|
|
67
|
+
When `accountId` is `'default'`, `X-OpenClaw-Agent-Id` header was still sent, causing routing issues
|
|
68
|
+
|
|
69
|
+
**修复内容 / Fix**:
|
|
70
|
+
- 当 `accountId` 为 `'default'` 时跳过 `X-OpenClaw-Agent-Id` header
|
|
71
|
+
Skip `X-OpenClaw-Agent-Id` header when `accountId` is `'default'`
|
|
72
|
+
- 让 gateway 路由到其配置的默认 agent
|
|
73
|
+
Let gateway route to its configured default agent
|
|
74
|
+
|
|
75
|
+
**影响范围 / Impact**:影响使用默认 Agent 配置的用户,修复后默认 Agent 路由将正常工作
|
|
76
|
+
Affects users with default Agent configuration. After the fix, default Agent routing will work correctly.
|
|
77
|
+
|
|
78
|
+
### 3. 异步模式内容处理修复 / Async Mode Content Fix
|
|
79
|
+
|
|
80
|
+
**问题描述 / Issue Description**:异步模式使用原始 `content.text`,未包含文件附件内容
|
|
81
|
+
Async mode used raw `content.text`, did not include file attachment content
|
|
82
|
+
|
|
83
|
+
**修复内容 / Fix**:
|
|
84
|
+
- 使用 `userContent`(包含文件附件)替代原始 `content.text`
|
|
85
|
+
Use `userContent` (includes file attachments) instead of raw `content.text`
|
|
86
|
+
- 确保文件附件内容正确传递给 Gateway
|
|
87
|
+
Ensures file attachment content is correctly passed to Gateway
|
|
88
|
+
|
|
89
|
+
**影响范围 / Impact**:影响使用异步模式且发送文件附件的用户,修复后文件附件将正确处理
|
|
90
|
+
Affects users using async mode and sending file attachments. After the fix, file attachments will be processed correctly.
|
|
91
|
+
|
|
92
|
+
### 4. 异步模式图片支持修复 / Async Mode Image Support Fix
|
|
93
|
+
|
|
94
|
+
**问题描述 / Issue Description**:异步模式下未将图片路径传递给 Gateway stream
|
|
95
|
+
Image paths were not passed to Gateway stream in async mode
|
|
96
|
+
|
|
97
|
+
**修复内容 / Fix**:
|
|
98
|
+
- 将 `imageLocalPaths` 传递给 gateway stream
|
|
99
|
+
Pass `imageLocalPaths` to gateway stream
|
|
100
|
+
- 确保图片在异步模式下正确处理
|
|
101
|
+
Ensures images are processed correctly in async mode
|
|
102
|
+
|
|
103
|
+
**影响范围 / Impact**:影响使用异步模式且发送图片的用户,修复后图片将正确处理
|
|
104
|
+
Affects users using async mode and sending images. After the fix, images will be processed correctly.
|
|
105
|
+
|
|
106
|
+
## 🔧 配置更新 / Configuration Updates
|
|
107
|
+
|
|
108
|
+
### 新增配置项 / New Configuration Options
|
|
109
|
+
|
|
110
|
+
- **`asyncMode`**(类型:`boolean`,默认:`false`)- 启用异步模式
|
|
111
|
+
**`asyncMode`** (type: `boolean`, default: `false`) - Enable async mode
|
|
112
|
+
- **`ackText`**(类型:`string`,默认:`'🫡 任务已接收,处理中...'`)- 自定义回执消息文本
|
|
113
|
+
**`ackText`** (type: `string`, default: `'🫡 任务已接收,处理中...'`) - Custom ack message text
|
|
114
|
+
|
|
115
|
+
## 📥 安装升级 / Installation & Upgrade
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
# 通过 npm 安装最新版本 / Install latest version via npm
|
|
119
|
+
openclaw plugins install @dingtalk-real-ai/dingtalk-connector
|
|
120
|
+
|
|
121
|
+
# 或升级现有版本 / Or upgrade existing version
|
|
122
|
+
openclaw plugins update dingtalk-connector
|
|
123
|
+
|
|
124
|
+
# 通过 Git 安装 / Install via Git
|
|
125
|
+
openclaw plugins install https://github.com/DingTalk-Real-AI/dingtalk-openclaw-connector.git
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## 🔗 相关链接 / Related Links
|
|
129
|
+
|
|
130
|
+
- [完整变更日志 / Full Changelog](https://github.com/DingTalk-Real-AI/dingtalk-openclaw-connector/blob/main/CHANGELOG.md)
|
|
131
|
+
- [使用文档 / Documentation](https://github.com/DingTalk-Real-AI/dingtalk-openclaw-connector/blob/main/README.md)
|
|
132
|
+
- [问题反馈 / Issue Feedback](https://github.com/DingTalk-Real-AI/dingtalk-openclaw-connector/issues)
|
|
133
|
+
|
|
134
|
+
## 🙏 致谢 / Acknowledgments
|
|
135
|
+
|
|
136
|
+
感谢所有贡献者和用户的支持与反馈!
|
|
137
|
+
Thanks to all contributors and users for their support and feedback!
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
**发布日期 / Release Date**:2026-03-05
|
|
142
|
+
**版本号 / Version**:v0.7.2
|
|
143
|
+
**兼容性 / Compatibility**:OpenClaw Gateway 0.4.0+
|