@dingtalk-real-ai/dingtalk-connector 0.8.7 → 0.8.9
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 +63 -0
- package/README.en.md +59 -4
- package/README.md +59 -4
- package/docs/DEAP_AGENT_GUIDE.en.md +115 -0
- package/docs/DEAP_AGENT_GUIDE.md +115 -0
- package/docs/images/image-5.png +0 -0
- package/docs/images/image-6.png +0 -0
- package/docs/images/image-7.png +0 -0
- package/openclaw.plugin.json +2 -7
- package/package.json +8 -4
- package/src/channel.ts +48 -52
- package/src/config/schema.ts +8 -4
- package/src/core/connection.ts +44 -1
- package/src/core/message-handler.ts +468 -75
- package/src/core/provider.ts +4 -0
- package/src/onboarding.ts +27 -61
- package/src/reply-dispatcher.ts +112 -172
- package/src/sdk/types.ts +0 -2
- package/src/services/media/chunk-upload.ts +3 -2
- package/src/services/media/common.ts +2 -1
- package/src/services/media/image.ts +33 -27
- package/src/services/media.ts +37 -34
- package/src/services/messaging.ts +22 -2
- package/src/utils/constants.ts +0 -3
- package/src/utils/session.ts +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,69 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.8.9] - 2026-03-31
|
|
9
|
+
|
|
10
|
+
### 新增 / Added
|
|
11
|
+
- ✨ **引用消息完整解析** - 新增 `extractQuotedMsgText` 递归解析引用消息(最多 3 层嵌套),支持 text、richText、picture、video、audio、file、markdown、interactiveCard 等消息类型,自动提取引用中的媒体附件和链接
|
|
12
|
+
**Quoted message full parsing** - Added recursive quoted message parsing (up to 3 levels) with media attachment and URL extraction
|
|
13
|
+
|
|
14
|
+
- ✨ **新增配置项 asyncMode / ackText / endpoint / debug** - `configSchema` 新增四个配置字段
|
|
15
|
+
**New config options** - Added `asyncMode`, `ackText`, `endpoint`, `debug` to configSchema
|
|
16
|
+
|
|
17
|
+
- ✨ **普通消息本地图片后处理** - `sendNormalToUser` 和 `sendNormalToGroup` 新增本地图片上传后处理,发送普通消息时自动替换本地图片路径为 media_id
|
|
18
|
+
**Local image post-processing for normal messages** - Added automatic local image upload and replacement in `sendNormalToUser` and `sendNormalToGroup`
|
|
19
|
+
|
|
20
|
+
### 修复 / Fixes
|
|
21
|
+
- 🐛 **macOS LaunchAgent 环境 WebSocket 连接失败** - 修复 macOS LaunchAgent/daemon 环境下 fd 0/1/2 无效(EBADF)导致 TCP 连接创建失败的问题
|
|
22
|
+
**WebSocket connection failure on macOS LaunchAgent** - Fixed EBADF errors on macOS LaunchAgent environments by redirecting invalid file descriptors to `/dev/null`
|
|
23
|
+
|
|
24
|
+
- 🐛 **AI Card 流式关闭竞争条件** - 修复 `closeStreaming` 被 `onIdle` 和 `onError` 同时触发时的竞争条件,采用 snapshot 模式防止并发崩溃
|
|
25
|
+
**AI Card streaming close race condition** - Fixed race condition in `closeStreaming` using snapshot pattern to prevent concurrent crashes
|
|
26
|
+
|
|
27
|
+
- 🐛 **FormData CJS 互操作问题** - 将 `form-data` 从动态 import 改为静态 import,修复 jiti/ESM 环境下 `.default` 偶发为 undefined 的问题
|
|
28
|
+
**FormData CJS interop issue** - Changed `form-data` from dynamic to static import, fixing intermittent `.default` undefined errors in jiti/ESM
|
|
29
|
+
|
|
30
|
+
- 🐛 **纯文本图片路径误转换** - 禁用纯文本中本地图片路径自动转换为图片语法的行为,避免影响用户展示路径文本的场景
|
|
31
|
+
**Bare image path false conversion** - Disabled automatic conversion of bare local image paths to image syntax
|
|
32
|
+
|
|
33
|
+
### 改进 / Improvements
|
|
34
|
+
- ✅ **Zod Schema 拆分兼容 Web UI** - 将 `DingtalkConfigSchema` 拆分为 `DingtalkConfigBaseSchema` 和带 `superRefine` 的完整 Schema,解决 JSON Schema 生成兼容性问题
|
|
35
|
+
**Zod Schema split for Web UI compatibility** - Split schema to fix `buildChannelConfigSchema` JSON Schema generation
|
|
36
|
+
|
|
37
|
+
- ✅ **configSchema 类型简化** - 将 `clientId`、`clientSecret` 等字段从 `oneOf` 联合类型简化为单一 `string` 类型
|
|
38
|
+
**configSchema type simplification** - Simplified JSON Schema from `oneOf` union types to single `string` type
|
|
39
|
+
|
|
40
|
+
- ✅ **reply-dispatcher logger 统一** - 替换手动构建的 log 对象为 `createLoggerFromConfig`
|
|
41
|
+
**reply-dispatcher logger unification** - Replaced manual log object with `createLoggerFromConfig`
|
|
42
|
+
|
|
43
|
+
- ✅ **锁定 axios 版本到 1.6.0** - 避免自动升级引入不兼容变更
|
|
44
|
+
**Pin axios to 1.6.0** - Prevent automatic upgrades from introducing incompatible changes
|
|
45
|
+
|
|
46
|
+
## [0.8.8] - 2026-03-29
|
|
47
|
+
|
|
48
|
+
### 修复 / Fixes
|
|
49
|
+
- 🐛 **多 block 流式响应产生多条独立气泡** ([#369](https://github.com/DingTalk-Real-AI/dingtalk-openclaw-connector/issues/369)) - 重构 `startStreaming` 并发控制逻辑,从 `isCreatingCard` 布尔标志改为 `cardCreationPromise`,彻底消除多 block 响应场景下每个 block 新建独立 AI Card 气泡的问题
|
|
50
|
+
**Multi-block streaming response creates multiple bubbles** - Refactored `startStreaming` concurrency control from boolean flag to `cardCreationPromise`, eliminating independent AI Card bubbles per block in multi-block responses
|
|
51
|
+
|
|
52
|
+
- 🐛 **Web UI Connected / Last inbound 显示 n/a** - 新增 `onStatusChange` 回调在连接建立/断开/收到消息时上报状态字段;补全 `buildSessionContext` 中 `conversationId` 和 `groupSubject` 字段透传
|
|
53
|
+
**Web UI shows n/a for Connected and Last inbound** - Added `onStatusChange` callback to report status fields on connection events; fixed `buildSessionContext` field passthrough
|
|
54
|
+
|
|
55
|
+
- 🐛 **AI Card 函数调用参数错误** - 修复 `reply-dispatcher.ts` 中 `createAICardForTarget`、`streamAICard`、`finishAICard` 参数从 `params.runtime` 改为 `account.config/log`
|
|
56
|
+
**AI Card function call parameter error** - Fixed parameters in `reply-dispatcher.ts` from `params.runtime` to `account.config/log`
|
|
57
|
+
|
|
58
|
+
- 🐛 **sendFileProactive 参数错误导致文件发送失败** - 修复 `processFileMarkers` 和 `processRawMediaPaths` 错误传入 `downloadUrl`,改为正确的 `cleanMediaId`
|
|
59
|
+
**File sending failure due to wrong sendFileProactive parameter** - Fixed incorrect `downloadUrl` parameter, now correctly uses `cleanMediaId`
|
|
60
|
+
|
|
61
|
+
- 🐛 **纯多账号配置下 probe 被跳过** ([#381](https://github.com/DingTalk-Real-AI/dingtalk-openclaw-connector/issues/381)) - `getStatus()` 改用 `resolveDingtalkAccount()` 统一获取账号信息,修复纯多账号配置下状态显示不准确的问题
|
|
62
|
+
**Probe skipped in pure multi-account config** - `getStatus()` now uses `resolveDingtalkAccount()` for unified account resolution
|
|
63
|
+
|
|
64
|
+
### 改进 / Improvements
|
|
65
|
+
- ✅ **音频时长提取安全性改进** ([#134](https://github.com/DingTalk-Real-AI/dingtalk-openclaw-connector/issues/134)) - `extractAudioDuration` 改用 `fluent-ffmpeg` 的 `ffprobe` API,消除安全扫描误报
|
|
66
|
+
**Audio duration extraction security improvement** - Changed to `fluent-ffmpeg` `ffprobe` API, eliminating security scan false positives
|
|
67
|
+
|
|
68
|
+
- ✅ **SDK 接口迁移** - `onboarding.ts` 类型引用迁移到新版 `ChannelSetupWizardAdapter`,导入路径更新为 `openclaw/plugin-sdk/setup`
|
|
69
|
+
**SDK interface migration** - Migrated to `ChannelSetupWizardAdapter` and updated import path to `openclaw/plugin-sdk/setup`
|
|
70
|
+
|
|
8
71
|
## [0.8.7] - 2026-03-26
|
|
9
72
|
|
|
10
73
|
### 修复 / Fixes
|
package/README.en.md
CHANGED
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
- [Configuration](#configuration)
|
|
20
20
|
- [Troubleshooting](#troubleshooting)
|
|
21
21
|
- [Advanced Topics](#advanced-topics)
|
|
22
|
+
- [DingTalk DEAP Agent Integration](docs/DEAP_AGENT_GUIDE.en.md)
|
|
22
23
|
- [License](#license)
|
|
23
24
|
|
|
24
25
|
---
|
|
@@ -61,19 +62,67 @@ Whenever you see `~/.openclaw/openclaw.json` below, it is equivalent to the abov
|
|
|
61
62
|
|
|
62
63
|
### Step 1: Install the Plugin
|
|
63
64
|
|
|
65
|
+
#### Method A: Install via npm (Recommended)
|
|
66
|
+
|
|
64
67
|
```bash
|
|
65
|
-
# Recommended: Install from npm
|
|
66
68
|
openclaw plugins install @dingtalk-real-ai/dingtalk-connector
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
#### Method B: Install from Local Source
|
|
72
|
+
|
|
73
|
+
If you want to develop or modify the plugin, clone the repository first:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# 1. Clone the plugin repository
|
|
77
|
+
git clone https://github.com/DingTalk-Real-AI/dingtalk-openclaw-connector.git
|
|
78
|
+
cd dingtalk-openclaw-connector
|
|
79
|
+
|
|
80
|
+
# 2. Install dependencies (required)
|
|
81
|
+
npm install
|
|
82
|
+
|
|
83
|
+
# 3. Install in link mode (changes take effect immediately)
|
|
84
|
+
openclaw plugins install -l .
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
#### Method C: Manual Installation
|
|
88
|
+
|
|
89
|
+
1. Download or copy this repository to `~/.openclaw/extensions/dingtalk-connector`.
|
|
90
|
+
2. Make sure it contains `index.ts`, `openclaw.plugin.json`, and `package.json`.
|
|
91
|
+
3. Run `npm install` in that directory to install dependencies.
|
|
92
|
+
|
|
93
|
+
#### Method D: China Mainland Installation (npm Mirror)
|
|
94
|
+
|
|
95
|
+
If `openclaw plugins install` gets stuck at `Installing plugin dependencies...` or fails with `npm install failed` due to network issues in China, you can specify a mirror registry for that install:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
NPM_CONFIG_REGISTRY=https://registry.npmmirror.com openclaw plugins install @dingtalk-real-ai/dingtalk-connector
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
If the plugin is in a partially installed state (e.g., the extension directory exists but dependencies are incomplete), you can manually reinstall dependencies:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
cd ~/.openclaw/extensions/dingtalk-connector
|
|
105
|
+
rm -rf node_modules package-lock.json
|
|
106
|
+
NPM_CONFIG_REGISTRY=https://registry.npmmirror.com npm install
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
To make the mirror permanent, set the default npm registry:
|
|
67
110
|
|
|
68
|
-
|
|
69
|
-
|
|
111
|
+
```bash
|
|
112
|
+
npm config set registry https://registry.npmmirror.com
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Or add to `~/.npmrc`:
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
registry=https://registry.npmmirror.com
|
|
70
119
|
```
|
|
71
120
|
|
|
72
121
|
**Verify installation**:
|
|
73
122
|
```bash
|
|
74
123
|
openclaw plugins list
|
|
75
124
|
```
|
|
76
|
-
You should see `✓ DingTalk Channel (v0.8.
|
|
125
|
+
You should see `✓ DingTalk Channel (v0.8.6) - loaded`
|
|
77
126
|
|
|
78
127
|
---
|
|
79
128
|
|
|
@@ -412,6 +461,12 @@ dingtalk-openclaw-connector/
|
|
|
412
461
|
|
|
413
462
|
---
|
|
414
463
|
|
|
464
|
+
## DingTalk DEAP Agent Integration
|
|
465
|
+
|
|
466
|
+
Connect DingTalk DEAP Agent with OpenClaw Gateway to enable natural language-driven local device operations. See **[DingTalk DEAP Agent Integration Guide](docs/DEAP_AGENT_GUIDE.en.md)** for details.
|
|
467
|
+
|
|
468
|
+
---
|
|
469
|
+
|
|
415
470
|
## License
|
|
416
471
|
|
|
417
472
|
[MIT](LICENSE)
|
package/README.md
CHANGED
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
- [配置说明](#配置说明)
|
|
20
20
|
- [常见问题](#常见问题)
|
|
21
21
|
- [进阶主题](#进阶主题)
|
|
22
|
+
- [钉钉 DEAP Agent 集成](docs/DEAP_AGENT_GUIDE.md)
|
|
22
23
|
- [许可证](#许可证)
|
|
23
24
|
|
|
24
25
|
---
|
|
@@ -93,19 +94,67 @@ yarn global add openclaw@latest
|
|
|
93
94
|
|
|
94
95
|
### 步骤 1:安装插件
|
|
95
96
|
|
|
97
|
+
#### 方法 A:通过 npm 包安装(推荐)
|
|
98
|
+
|
|
96
99
|
```bash
|
|
97
|
-
# 推荐:从 npm 安装
|
|
98
100
|
openclaw plugins install @dingtalk-real-ai/dingtalk-connector
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
#### 方法 B:通过本地源码安装
|
|
104
|
+
|
|
105
|
+
如果你想对插件进行二次开发,可以先克隆仓库:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
# 1. 克隆插件仓库
|
|
109
|
+
git clone https://github.com/DingTalk-Real-AI/dingtalk-openclaw-connector.git
|
|
110
|
+
cd dingtalk-openclaw-connector
|
|
111
|
+
|
|
112
|
+
# 2. 安装依赖(必需)
|
|
113
|
+
npm install
|
|
114
|
+
|
|
115
|
+
# 3. 以链接模式安装(方便修改代码后实时生效)
|
|
116
|
+
openclaw plugins install -l .
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
#### 方法 C:手动安装
|
|
120
|
+
|
|
121
|
+
1. 将本仓库下载或复制到 `~/.openclaw/extensions/dingtalk-connector`。
|
|
122
|
+
2. 确保包含 `index.ts`、`openclaw.plugin.json` 和 `package.json`。
|
|
123
|
+
3. 在该目录下运行 `npm install` 安装依赖。
|
|
124
|
+
|
|
125
|
+
#### 方法 D:国内网络环境安装(npm 镜像源)
|
|
126
|
+
|
|
127
|
+
如果你在国内网络环境下执行 `openclaw plugins install` 时卡在 `Installing plugin dependencies...` 或出现 `npm install failed`,可临时为该次安装指定镜像源:
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
NPM_CONFIG_REGISTRY=https://registry.npmmirror.com openclaw plugins install @dingtalk-real-ai/dingtalk-connector
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
如果插件已处于半安装状态(例如扩展目录存在但依赖未装全),可进入插件目录手动补装依赖:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
cd ~/.openclaw/extensions/dingtalk-connector
|
|
137
|
+
rm -rf node_modules package-lock.json
|
|
138
|
+
NPM_CONFIG_REGISTRY=https://registry.npmmirror.com npm install
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
如果希望长期生效,可设置 npm 默认镜像:
|
|
99
142
|
|
|
100
|
-
|
|
101
|
-
|
|
143
|
+
```bash
|
|
144
|
+
npm config set registry https://registry.npmmirror.com
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
或写入 `~/.npmrc`:
|
|
148
|
+
|
|
149
|
+
```
|
|
150
|
+
registry=https://registry.npmmirror.com
|
|
102
151
|
```
|
|
103
152
|
|
|
104
153
|
**验证安装**:
|
|
105
154
|
```bash
|
|
106
155
|
openclaw plugins list
|
|
107
156
|
```
|
|
108
|
-
你应该看到 `✓ DingTalk Channel (v0.8.
|
|
157
|
+
你应该看到 `✓ DingTalk Channel (v0.8.6) - loaded`
|
|
109
158
|
|
|
110
159
|
---
|
|
111
160
|
|
|
@@ -455,6 +504,12 @@ dingtalk-openclaw-connector/
|
|
|
455
504
|
|
|
456
505
|
---
|
|
457
506
|
|
|
507
|
+
## 钉钉 DEAP Agent 集成
|
|
508
|
+
|
|
509
|
+
通过钉钉 DEAP Agent 与 OpenClaw Gateway 连接,实现自然语言驱动的本地设备操作能力。详见 **[钉钉 DEAP Agent 集成指南](docs/DEAP_AGENT_GUIDE.md)**。
|
|
510
|
+
|
|
511
|
+
---
|
|
512
|
+
|
|
458
513
|
## 许可证
|
|
459
514
|
|
|
460
515
|
[MIT](LICENSE)
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# DingTalk DEAP Agent Integration
|
|
2
|
+
|
|
3
|
+
> [中文版](DEAP_AGENT_GUIDE.md)
|
|
4
|
+
|
|
5
|
+
Connect DingTalk [DEAP](https://deap.dingtalk.com) Agent with [OpenClaw](https://openclaw.ai) Gateway to enable natural language-driven local device operations.
|
|
6
|
+
|
|
7
|
+
## Key Features
|
|
8
|
+
|
|
9
|
+
- ✅ **Natural Language Interaction** - Users type natural language commands in the DingTalk chat (e.g., "Find PDF files on my desktop"), and the Agent automatically parses and executes the corresponding operations
|
|
10
|
+
- ✅ **NAT Traversal** - Designed for local devices without public IPs, establishing a stable communication tunnel between local and cloud environments via the Connector client
|
|
11
|
+
- ✅ **Cross-Platform Support** - Provides native binaries for Windows, macOS, and Linux, ensuring smooth operation across all platforms
|
|
12
|
+
|
|
13
|
+
## System Architecture
|
|
14
|
+
|
|
15
|
+
This solution uses a layered architecture with three core components:
|
|
16
|
+
|
|
17
|
+
1. **OpenClaw Gateway** - Deployed on the local device, provides a standardized HTTP interface for receiving and processing operation commands from the cloud, leveraging the OpenClaw engine to execute tasks
|
|
18
|
+
2. **DingTalk OpenClaw Connector** - Runs locally, building a communication tunnel between local and cloud environments to solve the problem of local devices without public IPs
|
|
19
|
+
3. **DingTalk DEAP MCP** - An extension module for the DEAP Agent, responsible for forwarding user natural language requests to the OpenClaw Gateway via the cloud tunnel
|
|
20
|
+
|
|
21
|
+
```mermaid
|
|
22
|
+
graph LR
|
|
23
|
+
subgraph "DingTalk App"
|
|
24
|
+
A["User chats with Agent"] --> B["DEAP Agent"]
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
subgraph "Local Environment"
|
|
28
|
+
D["DingTalk OpenClaw Connector"] --> C["OpenClaw Gateway"]
|
|
29
|
+
C --> E["PC Operation Execution"]
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
B -.-> D
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Implementation Guide
|
|
36
|
+
|
|
37
|
+
### Step 1: Set Up the Local Environment
|
|
38
|
+
|
|
39
|
+
Ensure the OpenClaw Gateway is installed and running on your local device. The default address is `127.0.0.1:18789`:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
openclaw gateway start
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
#### Configure Gateway Parameters
|
|
46
|
+
|
|
47
|
+
1. Visit the [Configuration Page](http://127.0.0.1:18789/config)
|
|
48
|
+
2. In the **Overview**, set the Gateway Token and save it securely:
|
|
49
|
+

|
|
50
|
+
3. Switch to **Infrastructure** and enable the `OpenAI Chat Completions Endpoint`:
|
|
51
|
+

|
|
52
|
+
|
|
53
|
+
4. Click the `Save` button in the top-right corner to save your configuration
|
|
54
|
+
|
|
55
|
+
### Step 2: Obtain Required Parameters
|
|
56
|
+
|
|
57
|
+
#### Get corpId
|
|
58
|
+
|
|
59
|
+
Log in to the [DingTalk Developer Platform](https://open-dev.dingtalk.com) to find your enterprise CorpId:
|
|
60
|
+
|
|
61
|
+
<img width="864" height="450" alt="Get corpId from DingTalk Developer Platform" src="https://github.com/user-attachments/assets/18ec9830-2d43-489a-a73f-530972685225" />
|
|
62
|
+
|
|
63
|
+
#### Get apiKey
|
|
64
|
+
|
|
65
|
+
Log in to the [DingTalk DEAP Platform](https://deap.dingtalk.com), navigate to **Security & Permissions** → **API-Key Management** to create a new API Key:
|
|
66
|
+
|
|
67
|
+
<img width="1222" height="545" alt="DingTalk DEAP Platform API-Key Management" src="https://github.com/user-attachments/assets/dfe29984-4432-49c1-8226-0f9b60fbb5bc" />
|
|
68
|
+
|
|
69
|
+
### Step 3: Start the Connector Client
|
|
70
|
+
|
|
71
|
+
1. Download the installer for your operating system from the [Releases](https://github.com/hoskii/dingtalk-openclaw-connector/releases/tag/v0.0.1) page
|
|
72
|
+
2. Extract and run the Connector in the corresponding directory (macOS example):
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
unzip connector-mac.zip
|
|
76
|
+
./connector-darwin -deapCorpId YOUR_CORP_ID -deapApiKey YOUR_API_KEY
|
|
77
|
+
```
|
|
78
|
+

|
|
79
|
+
|
|
80
|
+
### Step 4: Configure the DEAP Agent
|
|
81
|
+
|
|
82
|
+
1. Log in to the [DingTalk DEAP Platform](https://deap.dingtalk.com) and create a new agent:
|
|
83
|
+
|
|
84
|
+
<img width="2444" height="1486" alt="Create New Agent" src="https://github.com/user-attachments/assets/0b7f0855-f991-4aeb-b6e6-7576346b4477" />
|
|
85
|
+
|
|
86
|
+
2. In the skill management page, search for and integrate the OpenClaw skill:
|
|
87
|
+
|
|
88
|
+
<img width="3430" height="1732" alt="Add OpenClaw Skill" src="https://github.com/user-attachments/assets/d44f0038-f863-4c1f-afa7-b774d875e4ba" />
|
|
89
|
+
|
|
90
|
+
3. Configure skill parameters:
|
|
91
|
+
|
|
92
|
+
| Parameter | Source | Description |
|
|
93
|
+
| ------------ | ---------- | -------------------------------------------------------------------------------------- |
|
|
94
|
+
| apikey | From Step 2 | DEAP Platform API Key |
|
|
95
|
+
| apihost | Default | Typically `127.0.0.1:18789`. On Windows, you may need to use `localhost:18789` instead |
|
|
96
|
+
| gatewayToken | From Step 1 | Gateway authentication token |
|
|
97
|
+
|
|
98
|
+
<img width="3426" height="1752" alt="Configure OpenClaw Skill Parameters" src="https://github.com/user-attachments/assets/bc725789-382f-41b5-bbdb-ba8f29923d5c" />
|
|
99
|
+
|
|
100
|
+
Note that OpenClaw is an MCP, so you also need to configure its trigger rules. The MCP will only be invoked when the rules are satisfied:
|
|
101
|
+
<img width="1088" height="526" alt="image" src="https://github.com/user-attachments/assets/8b0b6f6d-70ff-4edc-b674-7a24126aadfa" />
|
|
102
|
+
|
|
103
|
+
4. Publish the Agent:
|
|
104
|
+
|
|
105
|
+
<img width="3416" height="1762" alt="Publish Agent" src="https://github.com/user-attachments/assets/3f8c3fdb-5f2b-4a4b-8896-35202e713bf3" />
|
|
106
|
+
|
|
107
|
+
### Step 5: Start Using
|
|
108
|
+
|
|
109
|
+
1. Search for and find your Agent in the DingTalk App:
|
|
110
|
+
|
|
111
|
+
<img width="1260" height="436" alt="Search for Agent" src="https://github.com/user-attachments/assets/30feff80-1b28-4274-830b-7045aed14980" />
|
|
112
|
+
|
|
113
|
+
2. Start your natural language conversation:
|
|
114
|
+
|
|
115
|
+
<img width="1896" height="1240" alt="Chat with Agent" src="https://github.com/user-attachments/assets/2a80aab8-3fbf-4d18-beea-770577cb1a40" />
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# 钉钉 DEAP Agent 集成
|
|
2
|
+
|
|
3
|
+
> [English Version](DEAP_AGENT_GUIDE.en.md)
|
|
4
|
+
|
|
5
|
+
通过将钉钉 [DEAP](https://deap.dingtalk.com) Agent 与 [OpenClaw](https://openclaw.ai) Gateway 连接,实现自然语言驱动的本地设备操作能力。
|
|
6
|
+
|
|
7
|
+
## 核心功能
|
|
8
|
+
|
|
9
|
+
- ✅ **自然语言交互** - 用户在钉钉对话框中输入自然语言指令(如"帮我查找桌面上的 PDF 文件"),Agent 将自动解析并执行相应操作
|
|
10
|
+
- ✅ **内网穿透机制** - 专为本地设备无公网 IP 场景设计,通过 Connector 客户端建立稳定的内外网通信隧道
|
|
11
|
+
- ✅ **跨平台兼容** - 提供 Windows、macOS 和 Linux 系统的原生二进制执行文件,确保各平台下的顺畅运行
|
|
12
|
+
|
|
13
|
+
## 系统架构
|
|
14
|
+
|
|
15
|
+
该方案采用分层架构模式,包含三个核心组件:
|
|
16
|
+
|
|
17
|
+
1. **OpenClaw Gateway** - 部署于本地设备,提供标准化 HTTP 接口,负责接收并处理来自云端的操作指令,调动 OpenClaw 引擎执行具体任务
|
|
18
|
+
2. **DingTalk OpenClaw Connector** - 运行于本地环境,构建本地与云端的通信隧道,解决内网设备无公网 IP 的问题
|
|
19
|
+
3. **DingTalk DEAP MCP** - 作为 DEAP Agent 的扩展能力模块,负责将用户自然语言请求经由云端隧道转发至 OpenClaw Gateway
|
|
20
|
+
|
|
21
|
+
```mermaid
|
|
22
|
+
graph LR
|
|
23
|
+
subgraph "钉钉 App"
|
|
24
|
+
A["用户与 Agent 对话"] --> B["DEAP Agent"]
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
subgraph "本地环境"
|
|
28
|
+
D["DingTalk OpenClaw Connector"] --> C["OpenClaw Gateway"]
|
|
29
|
+
C --> E["PC 操作执行"]
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
B -.-> D
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## 实施指南
|
|
36
|
+
|
|
37
|
+
### 第一步:部署本地环境
|
|
38
|
+
|
|
39
|
+
确认本地设备已成功安装并启动 OpenClaw Gateway,默认监听地址为 `127.0.0.1:18789`:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
openclaw gateway start
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
#### 配置 Gateway 参数
|
|
46
|
+
|
|
47
|
+
1. 访问 [配置页面](http://127.0.0.1:18789/config)
|
|
48
|
+
2. 在 **概览** 中设置 Gateway Token 并妥善保存:
|
|
49
|
+

|
|
50
|
+
3. 切换至 **基础设施**,启用 `OpenAI Chat Completions Endpoint` 功能:
|
|
51
|
+

|
|
52
|
+
|
|
53
|
+
4. 点击右上角 `Save` 按钮完成配置保存
|
|
54
|
+
|
|
55
|
+
### 第二步:获取必要参数
|
|
56
|
+
|
|
57
|
+
#### 获取 corpId
|
|
58
|
+
|
|
59
|
+
登录 [钉钉开发者平台](https://open-dev.dingtalk.com) 查看企业 CorpId:
|
|
60
|
+
|
|
61
|
+
<img width="864" height="450" alt="钉钉开发者平台获取 corpId" src="https://github.com/user-attachments/assets/18ec9830-2d43-489a-a73f-530972685225" />
|
|
62
|
+
|
|
63
|
+
#### 获取 apiKey
|
|
64
|
+
|
|
65
|
+
登录 [钉钉 DEAP 平台](https://deap.dingtalk.com),在 **安全与权限** → **API-Key 管理** 页面创建新的 API Key:
|
|
66
|
+
|
|
67
|
+
<img width="1222" height="545" alt="钉钉 DEAP 平台 API-Key 管理" src="https://github.com/user-attachments/assets/dfe29984-4432-49c1-8226-0f9b60fbb5bc" />
|
|
68
|
+
|
|
69
|
+
### 第三步:启动 Connector 客户端
|
|
70
|
+
|
|
71
|
+
1. 从 [Releases](https://github.com/hoskii/dingtalk-openclaw-connector/releases/tag/v0.0.1) 页面下载适配您操作系统的安装包
|
|
72
|
+
2. 解压后在对应目录运行 Connector(以 macOS 为例):
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
unzip connector-mac.zip
|
|
76
|
+
./connector-darwin -deapCorpId YOUR_CORP_ID -deapApiKey YOUR_API_KEY
|
|
77
|
+
```
|
|
78
|
+

|
|
79
|
+
|
|
80
|
+
### 第四步:配置 DEAP Agent
|
|
81
|
+
|
|
82
|
+
1. 登录 [钉钉 DEAP 平台](https://deap.dingtalk.com),创建新的智能体:
|
|
83
|
+
|
|
84
|
+
<img width="2444" height="1486" alt="新建智能体界面" src="https://github.com/user-attachments/assets/0b7f0855-f991-4aeb-b6e6-7576346b4477" />
|
|
85
|
+
|
|
86
|
+
2. 在技能管理页面,搜索并集成 OpenClaw 技能:
|
|
87
|
+
|
|
88
|
+
<img width="3430" height="1732" alt="添加 OpenClaw 技能" src="https://github.com/user-attachments/assets/d44f0038-f863-4c1f-afa7-b774d875e4ba" />
|
|
89
|
+
|
|
90
|
+
3. 配置技能参数:
|
|
91
|
+
|
|
92
|
+
| 参数 | 来源 | 说明 |
|
|
93
|
+
| ------------ | ---------- | -------------------------------------------------------------------------------------- |
|
|
94
|
+
| apikey | 第二步获取 | DEAP 平台 API Key |
|
|
95
|
+
| apihost | 默认值 | 通常为 `127.0.0.1:18789`,在Windows环境下可能需要配置为 `localhost:18789` 才能正常工作 |
|
|
96
|
+
| gatewayToken | 第一步获取 | Gateway 配置的认证令牌 |
|
|
97
|
+
|
|
98
|
+
<img width="3426" height="1752" alt="配置 OpenClaw 技能参数" src="https://github.com/user-attachments/assets/bc725789-382f-41b5-bbdb-ba8f29923d5c" />
|
|
99
|
+
|
|
100
|
+
注意 OpenClaw 属于一个MCP,还需要配置他的触发规则,满足规则的情况下才会使用这个MCP:
|
|
101
|
+
<img width="1088" height="526" alt="image" src="https://github.com/user-attachments/assets/8b0b6f6d-70ff-4edc-b674-7a24126aadfa" />
|
|
102
|
+
|
|
103
|
+
4. 发布 Agent:
|
|
104
|
+
|
|
105
|
+
<img width="3416" height="1762" alt="发布 Agent" src="https://github.com/user-attachments/assets/3f8c3fdb-5f2b-4a4b-8896-35202e713bf3" />
|
|
106
|
+
|
|
107
|
+
### 第五步:开始使用
|
|
108
|
+
|
|
109
|
+
1. 在钉钉 App 中搜索并找到您创建的 Agent:
|
|
110
|
+
|
|
111
|
+
<img width="1260" height="436" alt="搜索 Agent" src="https://github.com/user-attachments/assets/30feff80-1b28-4274-830b-7045aed14980" />
|
|
112
|
+
|
|
113
|
+
2. 开始自然语言对话体验:
|
|
114
|
+
|
|
115
|
+
<img width="1896" height="1240" alt="与 Agent 对话" src="https://github.com/user-attachments/assets/2a80aab8-3fbf-4d18-beea-770577cb1a40" />
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/openclaw.plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "dingtalk-connector",
|
|
3
3
|
"name": "DingTalk Channel",
|
|
4
|
-
"version": "0.8.
|
|
4
|
+
"version": "0.8.9",
|
|
5
5
|
"description": "DingTalk (钉钉) messaging channel via Stream mode with AI Card streaming",
|
|
6
6
|
"author": "DingTalk Real Team",
|
|
7
7
|
"main": "index.ts",
|
|
@@ -11,11 +11,6 @@
|
|
|
11
11
|
"configSchema": {
|
|
12
12
|
"type": "object",
|
|
13
13
|
"additionalProperties": false,
|
|
14
|
-
"properties": {
|
|
15
|
-
"enabled": {
|
|
16
|
-
"type": "boolean",
|
|
17
|
-
"default": true
|
|
18
|
-
}
|
|
19
|
-
}
|
|
14
|
+
"properties": {}
|
|
20
15
|
}
|
|
21
16
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dingtalk-real-ai/dingtalk-connector",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.9",
|
|
4
4
|
"description": "DingTalk (钉钉) channel connector — Stream mode with AI Card streaming",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -44,18 +44,22 @@
|
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@ffmpeg-installer/ffmpeg": "^1.1.0",
|
|
48
|
-
"@ffprobe-installer/ffprobe": "^2.1.2",
|
|
49
47
|
"axios": "^1.6.0",
|
|
50
48
|
"dingtalk-stream": "2.1.4",
|
|
51
49
|
"fluent-ffmpeg": "^2.1.3",
|
|
52
50
|
"form-data": "^4.0.0",
|
|
53
51
|
"mammoth": "^1.8.0",
|
|
54
|
-
"openclaw": "^2026.3.23-2",
|
|
55
52
|
"pako": "^2.1.0",
|
|
56
53
|
"pdf-parse": "^1.1.1",
|
|
57
54
|
"zod": "^3.22.0"
|
|
58
55
|
},
|
|
56
|
+
"peerDependencies": {
|
|
57
|
+
"openclaw": "^2026.3.23-2"
|
|
58
|
+
},
|
|
59
|
+
"optionalDependencies": {
|
|
60
|
+
"@ffmpeg-installer/ffmpeg": "^1.1.0",
|
|
61
|
+
"@ffprobe-installer/ffprobe": "^2.1.2"
|
|
62
|
+
},
|
|
59
63
|
"devDependencies": {
|
|
60
64
|
"@types/node": "^20.19.37",
|
|
61
65
|
"@vitest/coverage-v8": "^2.0.0",
|