dlinkclaw-openclaw 1.0.0 → 1.0.2

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 CHANGED
@@ -1,15 +1,78 @@
1
- # dlinkclaw-openclaw
2
-
3
- ### 特别提示
4
- 内部调试中
5
-
6
- #### 介绍
7
- openclaw channel 中继,实现内外自由连接,让openclaw部署在家或公司里.
8
-
9
- ### DLinkClaw-Openclaw插件安装步骤
10
- - openclaw plugins install npm:dlinkclaw-openclaw
11
- - openclaw channels add --channel dlink
12
- - openclaw configure
13
-
14
- #### 使用说明
15
- - 整理中...
1
+ # dlinkclaw-openclaw
2
+
3
+ **DLinkClaw(朵联统一 AI 工作台)的 OpenClaw 接入通道插件**
4
+
5
+ DLinkClaw 朵联统一 AI 工作台是一款企业级即时通讯 + 多智能体协作客户端,支持机器人、群组、语音、文件等多形态消息互通。本插件作为 **OpenClaw 的 channel 中继**,将你的 OpenClaw 网关安全地接入 DLinkClaw —— 让部署在家或公司内网的 OpenClaw 通过朵联工作台随时随地使用,实现内外自由连接。
6
+
7
+ ---
8
+
9
+ ## 界面一览
10
+
11
+ ![DLinkClaw 朵联统一 AI 工作台](./docs/screenshot.jpg)
12
+
13
+ > 截图:DLinkClaw 客户端 —— 左侧机器人/群组会话列表、中间多智能体对话区、右侧工作区/自动化面板。
14
+
15
+ ---
16
+
17
+ ## 特性
18
+
19
+ - **多 OpenClaw 实例**:可同时接入多个 OpenClaw 网关,每个实例独立部署、独立账号,工作台内自由切换。
20
+ - **多 DSH 实例**:同样支持接入多个 DSH(DeepSeek)实例,与 OpenClaw 实例统一管理。
21
+ - **更多 Agent 实例**:单个实例可暴露任意数量的 Agent(技术专家、研究员、文案专员、小红书助手等),在工作台中以机器人形式呈现。
22
+ - **单聊 / 群聊**:支持与机器人一对一对话,也可拉入群组协作,群内多 Agent 可互相调用。
23
+ - **双向中继**:OpenClaw 的回复、主动出站消息经 MQTT 中继到 DLinkClaw 客户端;客户端消息实时推送到 OpenClaw 会话。
24
+ - **扩展能力**:内置语音合成 / 语音转写等扩展能力(`ext_capabilities`),开箱即用。
25
+ - **安全接入**:AES 签名认证 + MQTT 加密通道,内网部署无需暴露公网端口。
26
+
27
+ > 更多多实例、多 Agent 的能力与配置方式,请到**官网了解**:https://dlinkclaw.com
28
+
29
+ ---
30
+
31
+ ## 客户端下载
32
+
33
+ 使用本插件需要 **DLinkClaw(朵联统一 AI 工作台)客户端**:
34
+
35
+ 👉 **下载地址:https://dlinkclaw.com**
36
+
37
+ ---
38
+
39
+ ## 插件安装(OpenClaw 侧)
40
+
41
+ ```bash
42
+ # 1. 安装插件
43
+ openclaw plugins install npm:dlinkclaw-openclaw
44
+
45
+ # 2. 添加 dlink 通道
46
+ openclaw channels add --channel dlink
47
+
48
+ # 3. 配置(填入朵联 apiKey / secret / baseUrl)
49
+ openclaw configure
50
+ ```
51
+
52
+ 安装完成后,在 DLinkClaw 客户端中即可看到接入的 OpenClaw 机器人并开始对话。
53
+
54
+ ---
55
+
56
+ ## 配置说明
57
+
58
+ | 配置项 | 说明 |
59
+ | --- | --- |
60
+ | `apiKey` | 朵联平台分配的 apiKey |
61
+ | `secret` | 朵联签名密钥(AES 加密通信用)|
62
+ | `baseUrl` | 朵联服务回调 URL |
63
+ | `accountId` | 账号标识,默认 `default` |
64
+ | `mediaMaxMb` | 媒体大小上限(MB),默认 100 |
65
+
66
+ ---
67
+
68
+ ## 使用说明
69
+
70
+ 1. 在 DLinkClaw 客户端登录并进入 **机器人** 列表。
71
+ 2. 添加/打开接入的 OpenClaw Agent 即可开始对话。
72
+ 3. 需要模型切换、上下文占用率等高级能力,请确保 OpenClaw 网关运行正常。
73
+
74
+ ---
75
+
76
+ ## 许可
77
+
78
+ [MIT](./LICENSE)
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dlinkclaw-openclaw",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "DLinkClaw OpenClaw channel plugin — 朵联 OpenClaw 接入通道",
5
5
  "keywords": [
6
6
  "DLinkClaw",
@@ -35,7 +35,8 @@
35
35
  "skills",
36
36
  "ext_capabilities",
37
37
  "openclaw.plugin.json",
38
- "README.md"
38
+ "README.md",
39
+ "docs"
39
40
  ],
40
41
  "dependencies": {
41
42
  "axios": "^1.15.2",
@@ -439,21 +439,46 @@ export class ClawServices extends EventEmitter {
439
439
  }
440
440
  async handleAgentCreate(params) {
441
441
  const workspace_path = getOpenclawPath('workspace', params.id.toLowerCase().replace(/\s+/g, '-'));
442
+ const provider = params.provider ?? '';
443
+ // 2026-09-18:新版 agents.create 直接支持 model,这里一步写入(不再依赖 update 补写)
442
444
  const createParams = {
443
445
  name: params.id,
444
446
  workspace: workspace_path,
445
447
  emoji: params.emoji,
446
- avatar: (params.avatar && params.avatar.length > 0) ? this.options.baseUrl + params.avatar : undefined
447
- };
448
- const result = await this.client.createAgent(createParams);
449
- const provider = params.provider ?? '';
450
- const udpateParams = {
451
- agentId: result.agentId,
452
- name: params.name,
453
- workspace: workspace_path,
448
+ avatar: (params.avatar && params.avatar.length > 0) ? this.options.baseUrl + params.avatar : undefined,
454
449
  model: provider.length > 0 ? `${provider}/${params.model}` : params.model,
455
450
  };
456
- await this.client?.updateAgent(udpateParams);
451
+ const result = await this.client.createAgent(createParams);
452
+ // 2026-09-18 修复(石头哥报:首次点击创建失败,且 name 未写入 openclaw.json):
453
+ // agents.create 后网关是「异步热加载配置」的(日志:create 186ms 成功,紧跟的
454
+ // agents.update 报 agent "xiaoha" not found,1 秒后 config hot reload applied)。
455
+ // 这里改用「update 快速失败重试」:agents.update 对未就绪 agent 是 2ms 快速返回 not found
456
+ // (ws-client.send 在 WS 未连接时也快速抛错),不会挂起;热加载完成后下一次即成功。
457
+ // 避免原 waitAgentReady 用 listAgents 轮询导致客户端 loading 超时的问题。
458
+ const MAX_UPDATE_RETRY = 10;
459
+ const UPDATE_RETRY_MS = 500;
460
+ let nameWritten = false;
461
+ for (let i = 0; i < MAX_UPDATE_RETRY && !nameWritten; i++) {
462
+ try {
463
+ const up = await this.client.updateAgent({
464
+ agentId: result.agentId,
465
+ name: params.name,
466
+ workspace: workspace_path,
467
+ });
468
+ if (up?.ok) {
469
+ nameWritten = true;
470
+ }
471
+ }
472
+ catch {
473
+ // not found / WS 未连接 → 快速失败,等待热加载后重试
474
+ }
475
+ if (!nameWritten) {
476
+ await new Promise((r) => setTimeout(r, UPDATE_RETRY_MS));
477
+ }
478
+ }
479
+ if (!nameWritten) {
480
+ this.log(`⚠ agent ${result.agentId} 显示名写入超时(${MAX_UPDATE_RETRY * UPDATE_RETRY_MS}ms),可稍后在 openclaw.json 修改 name`, 'warn');
481
+ }
457
482
  const sessionKey = `agent:${params.agentId}:${this.options.channelId}:direct:${params.userId.toLowerCase()}`;
458
483
  await this.handleUpdateSessionModel({
459
484
  sessionKey,
@@ -74,6 +74,7 @@ export interface AgentCreateParams {
74
74
  workspace?: string;
75
75
  emoji?: string;
76
76
  avatar?: string;
77
+ model?: string;
77
78
  }
78
79
  export interface AgentCreateResponse {
79
80
  ok: boolean;
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dlinkclaw-openclaw",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "DLinkClaw OpenClaw channel plugin — 朵联 OpenClaw 接入通道",
5
5
  "keywords": [
6
6
  "DLinkClaw",
@@ -35,7 +35,8 @@
35
35
  "skills",
36
36
  "ext_capabilities",
37
37
  "openclaw.plugin.json",
38
- "README.md"
38
+ "README.md",
39
+ "docs"
39
40
  ],
40
41
  "dependencies": {
41
42
  "axios": "^1.15.2",
@@ -92,4 +93,4 @@
92
93
  "bugs": {
93
94
  "url": "https://github.com/dlinkclaw/dlinkclaw-openclaw-channel/issues"
94
95
  }
95
- }
96
+ }