@insta-dev01/intclaw 1.0.10 → 1.1.0

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.
Files changed (49) hide show
  1. package/LICENSE +1 -1
  2. package/README.en.md +424 -0
  3. package/README.md +365 -164
  4. package/index.ts +28 -0
  5. package/openclaw.plugin.json +12 -41
  6. package/package.json +69 -40
  7. package/src/channel.ts +557 -0
  8. package/src/config/accounts.ts +230 -0
  9. package/src/config/schema.ts +144 -0
  10. package/src/core/connection.ts +733 -0
  11. package/src/core/message-handler.ts +1268 -0
  12. package/src/core/provider.ts +106 -0
  13. package/src/core/state.ts +54 -0
  14. package/src/directory.ts +95 -0
  15. package/src/gateway-methods.ts +237 -0
  16. package/src/onboarding.ts +387 -0
  17. package/src/policy.ts +19 -0
  18. package/src/probe.ts +213 -0
  19. package/src/reply-dispatcher.ts +674 -0
  20. package/src/runtime.ts +7 -0
  21. package/src/sdk/helpers.ts +317 -0
  22. package/src/sdk/types.ts +515 -0
  23. package/src/secret-input.ts +19 -0
  24. package/src/services/media/audio.ts +54 -0
  25. package/src/services/media/chunk-upload.ts +293 -0
  26. package/src/services/media/common.ts +154 -0
  27. package/src/services/media/file.ts +70 -0
  28. package/src/services/media/image.ts +67 -0
  29. package/src/services/media/index.ts +10 -0
  30. package/src/services/media/video.ts +162 -0
  31. package/src/services/media.ts +1134 -0
  32. package/src/services/messaging/index.ts +16 -0
  33. package/src/services/messaging/send.ts +137 -0
  34. package/src/services/messaging.ts +800 -0
  35. package/src/targets.ts +45 -0
  36. package/src/types/index.ts +52 -0
  37. package/src/utils/agent.ts +63 -0
  38. package/src/utils/async.ts +51 -0
  39. package/src/utils/constants.ts +9 -0
  40. package/src/utils/http-client.ts +84 -0
  41. package/src/utils/index.ts +8 -0
  42. package/src/utils/logger.ts +78 -0
  43. package/src/utils/session.ts +118 -0
  44. package/src/utils/token.ts +94 -0
  45. package/src/utils/utils-legacy.ts +506 -0
  46. package/.env.example +0 -11
  47. package/skills/intclaw_matrix/SKILL.md +0 -20
  48. package/src/channel/intclaw_channel.js +0 -155
  49. package/src/index.js +0 -23
package/README.md CHANGED
@@ -1,234 +1,435 @@
1
- # @insta-dev01/intclaw
1
+ <div align="center">
2
+ <img alt="IntClaw" src="docs/images/intclaw.svg" width="72" height="72" />
3
+ <h1>IntClaw OpenClaw 官方连接器</h1>
4
+ <p>将IntClaw机器人连接到 OpenClaw Gateway,支持 AI Card 流式响应和会话管理</p>
5
+
6
+ <p>
7
+ <a href="README.en.md">English</a> •
8
+ <a href="CHANGELOG.md">更新日志</a>
9
+ </p>
10
+ </div>
2
11
 
3
- OpenClaw plugin for IntClaw services - provides WebSocket-based channel integration connecting OpenClaw to:
12
+ ---
4
13
 
5
- - IntClaw Community Platform (引态社区平台)
6
- - IntClaw Message Channel (引态消息通道)
7
- - IntClaw Agent Collaboration Engine (引态智能体协作引擎)
8
- - IntClaw Claw Hub Services (引态 Claw Hub 服务)
14
+ ## 📋 目录
9
15
 
10
- ## Overview
16
+ - [前置要求](#前置要求)
17
+ - [快速开始](#快速开始)
18
+ - [功能特性](#功能特性)
19
+ - [配置说明](#配置说明)
20
+ - [常见问题](#常见问题)
21
+ - [进阶主题](#进阶主题)
22
+ - [许可证](#许可证)
11
23
 
12
- This plugin implements a bidirectional WebSocket channel that:
13
- - Connects to IntClaw servers using WebSocket protocol
14
- - Authenticates via API Key/Token
15
- - Exchanges JSON-formatted messages
16
- - Supports both direct messages and group messages
17
- - Handles automatic reconnection on connection loss
24
+ ---
18
25
 
19
- ## Installation
26
+ ## 前置要求
27
+
28
+ 开始之前,请确保你已经:
29
+
30
+ > 本插件作为 OpenClaw Gateway 插件使用,一般无需你单独安装或管理 Node.js 运行时。
31
+
32
+ ### 1. OpenClaw Gateway
33
+
34
+ - **官方网站**:https://openclaw.ai/
35
+ - **安装说明**:按照官方指南安装 OpenClaw
36
+ - **验证安装**:
37
+ ```bash
38
+ openclaw gateway status
39
+ ```
40
+ 预期输出:`✓ Gateway is running on http://127.0.0.1:18789`
41
+
42
+ ### 2. IntClaw企业账号
43
+
44
+ - 你需要一个IntClaw企业账号来创建企业内部应用
45
+ - 官方网站:https://www.intclaw.com/
46
+
47
+ ---
48
+
49
+ ## 快速开始
50
+
51
+ > 💡 **目标**:5 分钟内让你的IntClaw机器人运行起来
52
+
53
+ ### 操作系统支持
54
+
55
+ - macOS / Linux:使用默认的 Shell 终端(zsh、bash 等)。
56
+ - Windows:
57
+ - 推荐使用 **PowerShell** 或 **Windows Terminal**。
58
+ - OpenClaw 配置文件路径默认为:`C:\Users\<你的用户名>\.openclaw\openclaw.json`。
59
+
60
+ 下文中出现的 `~/.openclaw/openclaw.json`,在 Windows 上等价于以上路径。
61
+
62
+ ### 步骤 1:安装插件
20
63
 
21
64
  ```bash
22
- # Install from npm
23
- openclaw plugins install @insta-dev01/intclaw
65
+ # 推荐:从 npm 安装
66
+ openclaw plugins install @intclaw-real-ai/intclaw-connector
24
67
 
25
- # Install from local directory (for development)
26
- openclaw plugins install /path/to/intclaw
68
+ # 或者:从 Git 安装
69
+ openclaw plugins install https://github.com/IntClaw-Real-AI/intclaw-openclaw-connector.git
70
+ ```
27
71
 
28
- # Install dependencies
29
- cd /path/to/intclaw
30
- pnpm install
72
+ **验证安装**:
73
+ ```bash
74
+ openclaw plugins list
31
75
  ```
76
+ 你应该看到 `✓ IntClaw Channel (v0.8.0) - loaded`
77
+
78
+ ---
79
+
80
+ ### 步骤 2:创建IntClaw机器人
81
+
82
+ #### 3.1 创建应用
83
+
84
+ 1. 访问 [IntClaw开放平台](https://open-dev.intclaw.com/)
85
+ 2. 点击 **"应用开发"**
86
+
87
+ ![创建应用](docs/images/image-1.png)
88
+
89
+ #### 3.2 添加机器人能力
90
+
91
+ 1. 在应用详情页,点击 一键创建OpenClaw机器人应用
92
+
93
+ ![创建OpenClaw机器人应用](docs/images/image-2.png)
94
+
95
+ #### 3.3 获取凭证
96
+
97
+ 1. 完成创建并获取 **"凭证与基础信息"**
98
+ 2. 复制你的 **AppKey**(Client ID)
99
+ 3. 复制你的 **AppSecret**(Client Secret)
100
+
101
+ ![完成创建](docs/images/image-3.png)
102
+
103
+ ![获取凭证](docs/images/image-4.png)
32
104
 
33
- ## Configuration
105
+ > ⚠️ **重要**:Client ID和 Client Secret是机器人的唯一凭证。请合理保存。
34
106
 
35
- ### Method 1: Interactive Setup Wizard (Recommended)
107
+ ---
36
108
 
37
- Run the setup wizard and follow the prompts:
109
+ ### 步骤 3:配置 OpenClaw
110
+
111
+ 你有三种方式配置连接器:
112
+
113
+ #### 方式 A:配置向导(推荐新手使用)
114
+
115
+ > 你可以直接复制粘贴下面的命令,在终端中运行配置向导。
38
116
 
39
117
  ```bash
40
118
  openclaw channels add
41
119
  ```
42
120
 
43
- Select **IntClaw** from the channel list, then enter:
44
- - **WebSocket Server URL**: Your IntClaw server WebSocket URL (e.g., `wss://api.intclaw.example.com/ws`)
45
- - **API Key**: Your API key for authentication
121
+ 选择 **"IntClaw (IntClaw)"**,然后按提示输入:
122
+ - `clientId`(AppKey)
123
+ - `clientSecret`(AppSecret)
46
124
 
47
- The wizard will guide you through additional optional settings like DM policy and group policy.
125
+ #### 方式 B:编辑配置文件
48
126
 
49
- ### Method 2: Configuration File
127
+ 编辑配置文件:
50
128
 
51
- Edit your OpenClaw config file at `~/.openclaw/openclaw.json`:
129
+ - macOS / Linux:`~/.openclaw/openclaw.json`
130
+ - Windows:`C:\Users\<你的用户名>\.openclaw\openclaw.json`
52
131
 
53
- ```json5
132
+ ```json
54
133
  {
55
- channels: {
56
- intclaw: {
57
- enabled: true,
58
- wsUrl: "wss://api.intclaw.example.com/ws",
59
- apiKey: "your-api-key-here",
60
- dmPolicy: "pairing",
61
- groupPolicy: "allowlist",
62
- },
63
- },
134
+ "channels": {
135
+ "intclaw-connector": {
136
+ "enabled": true,
137
+ "clientId": "dingxxxxxxxxx",
138
+ "clientSecret": "your_app_secret"
139
+ }
140
+ }
64
141
  }
65
142
  ```
66
143
 
67
- After editing, restart the gateway:
144
+ > 💡 **提示**:如果文件已有内容,在 `channels` 节点下添加 `intclaw-connector` 部分即可。
145
+
146
+ ---
147
+
148
+ ### 步骤 4:重启并测试
68
149
 
69
150
  ```bash
151
+ # 重启 OpenClaw Gateway
70
152
  openclaw gateway restart
153
+
154
+ # 实时查看日志
155
+ openclaw logs --follow
71
156
  ```
72
157
 
73
- ### Method 3: Environment Variables
158
+ **测试你的机器人**:
159
+ 1. 打开IntClaw App
160
+ 2. 在联系人列表中找到你的机器人
161
+ 3. 发送消息:`你好`
162
+ 4. 你应该在 10 秒内收到回复
74
163
 
75
- Set environment variables before starting OpenClaw:
164
+ ---
76
165
 
77
- ```bash
78
- export INTCLAW_WS_URL="wss://api.intclaw.example.com/ws"
79
- export INTCLAW_API_KEY="your-api-key-here"
80
- openclaw gateway
81
- ```
166
+ ## 功能特性
167
+
168
+ ### ✅ 核心功能
169
+
170
+ - **AI Card 流式响应** - 打字机效果,实时流式显示回复
171
+ - **会话管理** - 多轮对话,保持上下文
172
+ - **会话隔离** - 私聊、群聊、不同群之间会话独立
173
+ - **自动会话重置** - 30 分钟无活动后自动开启新会话
174
+ - **手动会话重置** - 发送 `/new` 或 `新会话` 清空对话历史
175
+ - **图片自动上传** - 本地图片路径自动上传到IntClaw
176
+ - **主动发送消息** - 程序化地向用户或群发送消息
177
+ - **富媒体接收** - 接收并处理 JPEG/PNG 图片,传递给视觉模型
178
+ - **文件附件提取** - 解析 .docx、.pdf、文本文件和二进制文件
179
+ - **音频消息支持** - 发送多种格式的音频消息(mp3、wav、amr、ogg)
180
+ - **IntClaw文档 API** - 创建、追加、搜索和列举IntClaw文档
181
+ - **多 Agent 路由** - 将多个机器人连接到不同的 Agent,实现专业化服务
182
+ - **Markdown 表格转换** - 自动将 Markdown 表格转换为IntClaw兼容格式
183
+ - **异步模式** - 立即确认消息,后台处理(可选)
184
+
185
+ ---
186
+
187
+ ## 配置说明
188
+
189
+ ### 基础配置
190
+
191
+ | 选项 | 环境变量 | 说明 |
192
+ |------|---------|------|
193
+ | `clientId` | — | IntClaw AppKey |
194
+ | `clientSecret` | — | IntClaw AppSecret |
195
+
196
+ ### 会话管理
197
+
198
+ | 选项 | 默认值 | 说明 |
199
+ |------|--------|------|
200
+ | `separateSessionByConversation` | `true` | 私聊/群聊分别维护会话 |
201
+ | `groupSessionScope` | `group` | 群聊会话范围:`group`(共享)或 `group_sender`(每人独立) |
202
+ | `sharedMemoryAcrossConversations` | `false` | 是否在不同会话间共享记忆 |
203
+
204
+ ### 会话路由策略(`pmpolicy` / `groupPolicy`)
205
+
206
+ 当前版本已支持会话路由/消息策略相关配置(包含 `pmpolicy`、`groupPolicy`),**无需删除**。如你在历史配置中已经设置了这些字段,可以继续保留并按需调整。
207
+
208
+ > 说明:不同版本/上游可能对字段命名有差异;本连接器侧同时支持并会按策略生效(如 `dmPolicy`/`groupPolicy` 的默认值为 `open`)。
209
+
210
+ ### 异步模式
211
+
212
+ | 选项 | 默认值 | 说明 |
213
+ |------|--------|------|
214
+ | `asyncMode` | `false` | 启用异步模式处理长时间任务 |
215
+ | `ackText` | `🫡 任务已接收,处理中...` | 确认消息文本 |
82
216
 
83
- **Note**: Configuration file values take precedence over environment variables.
84
217
 
85
- ### Full Configuration Options
218
+ ---
86
219
 
87
- | Option | Type | Description | Default |
88
- |--------|------|-------------|---------|
89
- | `enabled` | boolean | Enable/disable the channel | `true` |
90
- | `wsUrl` | string | WebSocket server URL | **Required** |
91
- | `apiKey` | string | API key for authentication | **Required** |
92
- | `reconnectInterval` | number | Reconnection interval (ms) | `5000` |
93
- | `dmPolicy` | string | DM policy (`pairing`, `allowlist`, `open`, `disabled`) | `pairing` |
94
- | `allowFrom` | array | DM allowlist (peer IDs) | - |
95
- | `groupPolicy` | string | Group policy (`allowlist`, `open`, `disabled`) | `allowlist` |
96
- | `groupAllowFrom` | array | Group allowlist (peer IDs) | - |
97
- | `groups` | object | Per-group configuration | - |
220
+ ## 常见问题
98
221
 
99
- ### Multi-Account Configuration
222
+ ### 机器人不回复
223
+
224
+ **症状**:机器人不回复消息
225
+
226
+ **解决方案**:
227
+ 1. 检查插件状态:`openclaw plugins list`
228
+ 2. 检查网关状态:`openclaw gateway status`
229
+ 3. 查看日志:`openclaw logs --follow`
230
+ 4. 确认应用已在IntClaw开放平台发布
231
+
232
+ ---
233
+
234
+ ### HTTP 401 错误
235
+
236
+ **症状**:错误信息显示 "401 Unauthorized"
237
+
238
+ **原因**:Gateway 认证失败
239
+
240
+ **解决方案**:
241
+
242
+ 升级到最新版本
243
+
244
+ ---
245
+
246
+ ### Stream 连接 400 错误
247
+
248
+ **症状**:日志显示 "Request failed with status code 400"
249
+
250
+ **常见原因**:
251
+
252
+ | 原因 | 解决方案 |
253
+ |------|----------|
254
+ | 应用未发布 | 前往IntClaw开放平台 → 版本管理 → 发布 |
255
+ | 凭证错误 | 检查 `clientId`/`clientSecret` 是否有拼写错误或多余空格 |
256
+ | 非 Stream 模式 | 确认机器人配置为 Stream 模式(不是 Webhook) |
257
+ | IP 白名单限制 | 检查应用是否设置了 IP 白名单 |
258
+
259
+ **验证步骤**:
260
+
261
+ 1. **检查应用状态**:
262
+ - 登录 [IntClaw开放平台](https://open-dev.intclaw.com/)
263
+ - 确认应用已发布
264
+ - 确认机器人已启用且为 Stream 模式
265
+
266
+ 2. **重新发布应用**:
267
+ - 修改任何配置后,必须点击 **保存** → **发布**
268
+
269
+ ---
270
+
271
+ ## 进阶主题
272
+
273
+ ### 多 Agent 配置
274
+
275
+ 配置多个机器人连接到不同的 Agent:
100
276
 
101
277
  ```json5
102
278
  {
103
- channels: {
104
- intclaw: {
105
- enabled: true,
106
- defaultAccount: "main",
107
- accounts: {
108
- main: {
109
- wsUrl: "wss://main.intclaw.example.com/ws",
110
- apiKey: "main-api-key",
111
- enabled: true,
112
- },
113
- secondary: {
114
- wsUrl: "wss://secondary.intclaw.example.com/ws",
115
- apiKey: "secondary-api-key",
116
- enabled: true,
117
- },
279
+ "agents": {
280
+ "list": [
281
+ {
282
+ "id": "ding-bot1",
283
+ "name": "IntClaw客服机器人",
284
+ "model": "your-model-config",
285
+ "workspace": "~/.openclaw/workspace-bot1",
286
+ "identity": {
287
+ "name": "客服小助手",
288
+ "theme": "专业客服",
289
+ "emoji": "🤝"
290
+ }
291
+ // 其他 agent 配置...
118
292
  },
119
- },
293
+ {
294
+ "id": "ding-bot2",
295
+ "name": "IntClaw技术支持机器人",
296
+ "model": "your-model-config",
297
+ "workspace": "~/.openclaw/workspace-bot2",
298
+ "identity": {
299
+ "name": "技术专家",
300
+ "theme": "技术支持",
301
+ "emoji": "🔧"
302
+ }
303
+ // 其他 agent 配置...
304
+ }
305
+ ]
120
306
  },
307
+ "channels": {
308
+ "intclaw-connector": {
309
+ "enabled": true,
310
+ "accounts": {
311
+ "bot1": {
312
+ "enabled": true,
313
+ "clientId": "ding_bot1_app_key",
314
+ "clientSecret": "bot1_secret"
315
+ },
316
+ "bot2": {
317
+ "enabled": true,
318
+ "clientId": "ding_bot2_app_key",
319
+ "clientSecret": "bot2_secret"
320
+ }
321
+ }
322
+ }
323
+ },
324
+ "bindings": [
325
+ {
326
+ "agentId": "ding-bot1",
327
+ "match": {
328
+ "channel": "intclaw-connector",
329
+ "accountId": "bot1"
330
+ }
331
+ },
332
+ {
333
+ "agentId": "ding-bot2",
334
+ "match": {
335
+ "channel": "intclaw-connector",
336
+ "accountId": "bot2"
337
+ }
338
+ }
339
+ ]
121
340
  }
122
341
  ```
123
342
 
124
- ## Message Protocol
343
+ 更多详情请参考 [OpenClaw 多 Agent 配置指南](https://gist.github.com/smallnest/c5c13482740fd179e40070e620f66a52)。
125
344
 
126
- ### Incoming Messages (IntClaw → OpenClaw)
345
+ ---
127
346
 
128
- ```json
129
- {
130
- "type": "incoming_message",
131
- "payload": {
132
- "id": "msg_1234567890",
133
- "accountId": "default",
134
- "peerId": "user_abc",
135
- "peerKind": "direct",
136
- "peerName": "Alice",
137
- "text": "Hello from IntClaw!",
138
- "timestamp": 1704067200000,
139
- "threadId": null,
140
- "replyToId": null
141
- }
142
- }
143
- ```
347
+ ### 会话命令
144
348
 
145
- ### Outgoing Messages (OpenClaw → IntClaw)
349
+ 用户可以发送以下命令清理对话历史,重新开始会话:
146
350
 
147
- ```json
148
- {
149
- "type": "outgoing_message",
150
- "payload": {
151
- "id": "intclaw_1704067200000_abc123",
152
- "accountId": "default",
153
- "peerId": "user_abc",
154
- "peerKind": "direct",
155
- "text": "Hello from OpenClaw!",
156
- "timestamp": 1704067200000,
157
- "threadId": null,
158
- "replyToId": null
159
- }
160
- }
161
- ```
351
+ - `/new`、`/reset`、`/clear`
352
+ - `新会话`、`重新开始`、`清空对话`
162
353
 
163
- ### Authentication Flow
354
+ ---
164
355
 
165
- 1. Client connects with API key in header
166
- 2. Client sends `auth_request`:
167
- ```json
168
- {
169
- "type": "auth_request",
170
- "apiKey": "your-api-key",
171
- "timestamp": 1704067200000
172
- }
173
- ```
174
- 3. Server responds with `auth_response`:
175
- ```json
176
- {
177
- "type": "auth_response",
178
- "success": true,
179
- "timestamp": 1704067200000
180
- }
181
- ```
356
+ ### IntClaw文档(Docs)与 MCP(`docs.*`)
182
357
 
183
- ## Development
358
+ IntClaw文档能力(`docs.*`,包含 `docs.create` / `docs.append` / `docs.search` / `docs.list` / `docs.read`)依赖 MCP(Model Context Protocol)提供底层 tool。你需要先在 OpenClaw 的 Gateway/Agent 侧启用对应的 MCP Server/Tool,然后上述 `docs.*` 才能正常工作。
184
359
 
185
- ### Requirements
360
+ - **获取 MCP Server/Tool**:可通过 [IntClaw MCP 市场](https://mcp.intclaw.com/) 安装启用(或你们团队维护的 MCP 市场);也可以选择同类的“IntClaw Docs Read / IntClaw Docs Reader”能力并接入到 OpenClaw。
361
+ - **配置位置**:通常在 **Gateway 或 Agent 的工具配置**中完成(而不是在连接器里)。
362
+ - **生效方式**:配置完成后重启 Gateway,并确认该 tool 已对目标 Agent 暴露。
186
363
 
187
- - Node.js 22.x+
188
- - pnpm 10.25.0+
364
+ 参考(OpenClaw 官方配置文档):
365
+ - `https://docs.openclaw.ai/configuration`
366
+ - `https://docs.openclaw.ai/gateway/configuration-reference`
189
367
 
190
- ### Project Structure
368
+ 从你的 Agent 中创建和管理IntClaw文档:
191
369
 
192
- ```
193
- intclaw-plugin/
194
- ├── openclaw.plugin.json # Plugin manifest
195
- ├── package.json # Node.js package config
196
- ├── src/
197
- │ ├── index.js # Plugin entry point
198
- │ └── channel/
199
- │ └── IntClawChannel.js # Channel implementation
200
- └── skills/ # Optional skills
370
+ ```javascript
371
+ // 创建文档
372
+ intclaw-connector.docs.create({
373
+ spaceId: "your-space-id",
374
+ title: "测试文档",
375
+ content: "# 测试内容"
376
+ })
377
+
378
+ // 追加内容
379
+ intclaw-connector.docs.append({
380
+ docId: "your-doc-id",
381
+ markdownContent: "\n## 追加的内容"
382
+ })
383
+
384
+ // 搜索文档
385
+ intclaw-connector.docs.search({
386
+ keyword: "搜索关键词"
387
+ })
388
+
389
+ // 列举文档
390
+ intclaw-connector.docs.list({
391
+ spaceId: "your-space-id"
392
+ })
201
393
  ```
202
394
 
203
- ### Running Locally
395
+ ---
204
396
 
205
- ```bash
206
- # Install dependencies
207
- pnpm install
397
+ ## 项目结构
208
398
 
209
- # The plugin will be loaded by OpenClaw gateway
210
- # No standalone run mode
399
+ ```
400
+ intclaw-openclaw-connector/
401
+ ├── src/
402
+ │ ├── core/ # Core connector logic
403
+ │ ├── services/ # IntClaw API services
404
+ │ ├── utils/ # Utility functions
405
+ │ └── types/ # TypeScript type definitions
406
+ ├── docs/
407
+ │ └── images/ # Documentation images
408
+ ├── openclaw.plugin.json # Plugin manifest
409
+ ├── package.json # npm dependencies
410
+ └── LICENSE
211
411
  ```
212
412
 
213
- ## Troubleshooting
413
+ ---
214
414
 
215
- ### Connection Issues
415
+ ## 依赖
216
416
 
217
- 1. Check WebSocket URL is correct and accessible
218
- 2. Verify API key is valid
219
- 3. Check firewall/network settings
220
- 4. Review logs: `openclaw logs --follow`
417
+ | | 用途 |
418
+ |----|------|
419
+ | `dingtalk-stream` | IntClaw Stream 协议客户端 |
420
+ | `axios` | HTTP 客户端 |
421
+ | `mammoth` | Word 文档(.docx)解析 |
422
+ | `pdf-parse` | PDF 文档解析 |
221
423
 
222
- ### Authentication Failures
424
+ ---
223
425
 
224
- 1. Verify API key matches server expectations
225
- 2. Check API key hasn't expired
226
- 3. Ensure API key has required permissions
426
+ ## 许可证
227
427
 
228
- ## License
428
+ [MIT](LICENSE)
229
429
 
230
- ISC
430
+ ---
231
431
 
232
- ## Development Guide
432
+ ## 支持
233
433
 
234
- - [OpenClaw Plugin Development Guide](Development%20Guide%20docs/)
434
+ - **问题反馈**:[GitHub Issues](https://github.com/IntClaw-Real-AI/intclaw-openclaw-connector/issues)
435
+ - **更新日志**:[CHANGELOG.md](CHANGELOG.md)
package/index.ts ADDED
@@ -0,0 +1,28 @@
1
+ /**
2
+ * IntClaw Connector Plugin for OpenClaw
3
+ *
4
+ * IntClaw企业内部机器人插件,使用 Stream 模式连接,支持 AI Card 流式响应。
5
+ * 已迁移到 OpenClaw SDK,支持多账号、安全策略等完整功能。
6
+ *
7
+ * Last updated: 2026-03-18 17:00:00
8
+ */
9
+
10
+ /**
11
+ * IntClaw Connector Plugin for OpenClaw
12
+ *
13
+ * 注意:本插件使用专用的 HTTP 客户端(见 src/utils/http-client.ts)
14
+ * 不会影响 OpenClaw Gateway 和其他插件的网络请求
15
+ */
16
+
17
+ import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
18
+ import { intclawPlugin } from "./src/channel.ts";
19
+ import { setIntclawRuntime } from "./src/runtime.ts";
20
+ import { registerGatewayMethods } from "./src/gateway-methods.ts";
21
+
22
+ export default function register(api: OpenClawPluginApi) {
23
+ setIntclawRuntime(api.runtime);
24
+ api.registerChannel({ plugin: intclawPlugin });
25
+
26
+ // 注册 Gateway Methods
27
+ registerGatewayMethods(api);
28
+ }