multiclaws 0.4.8 → 0.4.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/README.md
CHANGED
|
@@ -1,36 +1,110 @@
|
|
|
1
1
|
# MultiClaws
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Multi-agent collaboration plugin for [OpenClaw](https://openclaw.ai). Connect multiple OpenClaw instances into a team so their AIs can delegate tasks to each other using the [A2A protocol](https://google.github.io/A2A/).
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[中文文档](README.zh-CN.md)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## The Core Idea
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Every OpenClaw instance is a gateway to data and systems that only *that machine* can reach — local files, logged-in accounts, connected devices, internal networks. MultiClaws connects these isolated islands so AI agents can collaborate across them.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
**The division of labor isn't about who is smarter. It's about who has the key.**
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
- Your laptop has your codebase and personal email
|
|
14
|
+
- Your colleague's machine has their Google Workspace and internal database access
|
|
15
|
+
- The office server has the production logs
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
None of these can reach the others directly. MultiClaws lets each agent do what only it can do, and routes the results back to whoever asked.
|
|
16
18
|
|
|
17
|
-
|
|
18
|
-
- **「用邀请码 mc:xxxxx 加入团队」** — 加入队友的团队
|
|
19
|
-
- **「让 Bob 总结一下最新报告」** — 把任务委派给队友的 AI
|
|
20
|
-
- **「显示所有智能体」** — 查看团队成员及其能力
|
|
19
|
+
## Two Core Features
|
|
21
20
|
|
|
22
|
-
|
|
21
|
+
### 1. Profiles Make Every OpenClaw Discoverable
|
|
23
22
|
|
|
24
|
-
|
|
23
|
+
Each OpenClaw instance has a profile — a bio written in plain text that describes what data and systems it can access. When your agent needs to get something done, it reads the team profiles and figures out who to ask. No manual routing, no hardcoded assignments.
|
|
25
24
|
|
|
26
|
-
|
|
25
|
+
The profile is what turns each OpenClaw into a callable unit for others. Your colleague writes "I have access to Google Workspace and the sales spreadsheets" in their bio — and your agent can now delegate Google Sheets tasks to them, without you configuring anything. Add a new teammate to the team, their profile appears, your agent starts routing tasks to them automatically.
|
|
27
26
|
|
|
28
|
-
|
|
27
|
+
Getting started takes one sentence to your AI. No config files, no YAML, no A2A protocol knowledge required. The profile is the only interface.
|
|
29
28
|
|
|
30
|
-
|
|
29
|
+
### 2. Collaborate by Who Has the Key, Not Who Is Better
|
|
30
|
+
|
|
31
|
+
Traditional task routing assumes you split work by skill: "this agent is good at data, that one is good at writing." That's the wrong model for distributed systems.
|
|
32
|
+
|
|
33
|
+
Each OpenClaw can only reach what its own machine can reach. The right question isn't *who is more capable* — it's *who has access*. MultiClaws routes tasks based on data ownership: your colleague's agent handles their Google Sheets because they're the only one logged in. The office server's agent handles production logs because it's the only one on that network.
|
|
34
|
+
|
|
35
|
+
**The profile bio is a declaration of access, not a resume.**
|
|
36
|
+
|
|
37
|
+
## Example
|
|
38
|
+
|
|
39
|
+
*Eric needs a monthly business review report.*
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
A (Eric's MacBook)
|
|
43
|
+
→ has: local git history, personal Telegram, own email
|
|
44
|
+
|
|
45
|
+
B (zxj's Windows PC)
|
|
46
|
+
→ has: Google Sheets with sales data (logged in as zxj)
|
|
47
|
+
|
|
48
|
+
C (ljl's machine)
|
|
49
|
+
→ has: internal OA system (browser already logged in), local MySQL
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Eric tells his AI: *"Generate this month's business review."*
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
A reads team profiles
|
|
56
|
+
→ B's bio: "access to Google Workspace, sales spreadsheets"
|
|
57
|
+
→ C's bio: "access to internal OA system and local database"
|
|
58
|
+
|
|
59
|
+
A delegates:
|
|
60
|
+
→ B: "pull this month's sales figures from Google Sheets"
|
|
61
|
+
→ C: "get project status and attendance from the OA system"
|
|
62
|
+
→ A: reads local git log for code activity
|
|
63
|
+
|
|
64
|
+
B uses its own Google credentials → returns sales data
|
|
65
|
+
C uses its own logged-in browser → returns OA data
|
|
66
|
+
A merges all three → generates the report
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
B can also delegate further. If B needs a chart generated and sees from the team profiles that D has that capability, B delegates to D autonomously — without A needing to orchestrate it.
|
|
70
|
+
|
|
71
|
+
**The profile bio describes what data and systems each instance can access.** That's how agents decide who to ask.
|
|
72
|
+
|
|
73
|
+
## Installation
|
|
74
|
+
|
|
75
|
+
Just tell your AI:
|
|
76
|
+
|
|
77
|
+
> Run `openclaw plugins install multiclaws` and tell me what it can do.
|
|
78
|
+
|
|
79
|
+
Your AI handles the rest — installation, configuration, and profile setup — no manual steps required.
|
|
80
|
+
|
|
81
|
+
## Usage
|
|
82
|
+
|
|
83
|
+
Everything works through natural language:
|
|
84
|
+
|
|
85
|
+
- **"Create a team called my-team"** — creates a team and generates an invite code
|
|
86
|
+
- **"Join team with invite code mc:xxxxx"** — join a teammate's team
|
|
87
|
+
- **"Ask Bob to pull the sales data"** — delegate a task to a teammate's AI
|
|
88
|
+
- **"Show all agents"** — list team members and their data access
|
|
89
|
+
|
|
90
|
+
## Roadmap
|
|
91
|
+
|
|
92
|
+
### Async Delegation
|
|
93
|
+
Currently, task delegation is synchronous — the delegating agent waits for the result before continuing. The next major version will support fire-and-forget delegation: dispatch multiple tasks to different agents simultaneously, receive results as push notifications, and aggregate them when all are ready. This enables true parallel execution across agents.
|
|
94
|
+
|
|
95
|
+
### Multi-turn Collaboration
|
|
96
|
+
Today each delegation is a single round-trip. Planned support for multi-turn sessions where agents can exchange follow-up messages within the same context — useful for tasks that require clarification, intermediate feedback, or iterative refinement between agents.
|
|
97
|
+
|
|
98
|
+
### Permissions
|
|
99
|
+
Currently any agent with a valid invite code can send tasks to your OpenClaw. A permission layer is planned: define which agents are allowed to delegate to you, what kinds of tasks they can request, and whether approval is required before execution.
|
|
100
|
+
|
|
101
|
+
## Documentation
|
|
102
|
+
|
|
103
|
+
See [SKILL.md](skills/multiclaws/SKILL.md) for full details.
|
|
104
|
+
|
|
105
|
+
## Development
|
|
31
106
|
|
|
32
107
|
```bash
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
pnpm test
|
|
108
|
+
npm install
|
|
109
|
+
npm run build
|
|
36
110
|
```
|
package/README.zh-CN.md
CHANGED
|
@@ -1,6 +1,74 @@
|
|
|
1
1
|
# MultiClaws
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[OpenClaw](https://openclaw.ai) 多智能体协作插件。将多个 OpenClaw 实例组成团队,通过 [A2A 协议](https://google.github.io/A2A/) 让各个 AI 互相委派任务。
|
|
4
|
+
|
|
5
|
+
[English](README.md)
|
|
6
|
+
|
|
7
|
+
## 核心理念
|
|
8
|
+
|
|
9
|
+
每个 OpenClaw 实例都是一扇门——只有*那台机器*才能打开的门:本地文件、已登录的账号、连接的设备、内部网络。MultiClaws 把这些孤立的数据孤岛连接起来,让 AI 跨越它们协作完成任务。
|
|
10
|
+
|
|
11
|
+
**分工的依据不是谁更擅长,而是谁有钥匙。**
|
|
12
|
+
|
|
13
|
+
- 你的电脑有你的代码仓库和个人邮件
|
|
14
|
+
- 同事的机器有他的 Google Workspace 和内部数据库权限
|
|
15
|
+
- 办公室服务器有生产日志
|
|
16
|
+
|
|
17
|
+
这些数据互相访问不到。MultiClaws 让每个 Agent 只做它能做的事,把结果汇总回发起方。
|
|
18
|
+
|
|
19
|
+
## 两个核心产品特色
|
|
20
|
+
|
|
21
|
+
### 一、档案让每个 OpenClaw 对外可发现
|
|
22
|
+
|
|
23
|
+
每个 OpenClaw 实例都有一个档案——一段纯文本的 bio,描述这台机器能访问哪些数据和系统。当你的 Agent 需要完成某件事时,它读取团队档案,自己判断找谁。无需手动路由,无需硬编码分配。
|
|
24
|
+
|
|
25
|
+
档案就是让每个 OpenClaw 对其他人可调用的接口。同事在 bio 里写"我可以访问 Google Workspace 和销售数据表格"——你的 Agent 就能把 Google Sheets 相关任务委派给他,不需要你做任何配置。新队友加入团队,档案出现,你的 Agent 自动开始向他路由任务。
|
|
26
|
+
|
|
27
|
+
上手只需要对 AI 说一句话,没有配置文件、没有 YAML、不需要了解 A2A 协议。档案是唯一的接口。
|
|
28
|
+
|
|
29
|
+
### 二、按"谁有钥匙"分工,而不是"谁更擅长"
|
|
30
|
+
|
|
31
|
+
传统的任务路由假设按能力分工:"这个 Agent 擅长数据,那个擅长写作。"对于分布式系统,这是错误的模型。
|
|
32
|
+
|
|
33
|
+
每个 OpenClaw 只能访问它所在机器能访问的东西。正确的问题不是*谁更有能力*,而是*谁有权限*。MultiClaws 按数据所有权路由任务:同事的 Agent 处理他们的 Google Sheets,因为只有他们登录了;办公室服务器的 Agent 处理生产日志,因为只有它在那个网络里。
|
|
34
|
+
|
|
35
|
+
**档案里的 bio 是访问权限的声明,不是简历。**
|
|
36
|
+
|
|
37
|
+
## 案例
|
|
38
|
+
|
|
39
|
+
*Eric 需要生成一份月度业务复盘报告。*
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
A(Eric 的 MacBook)
|
|
43
|
+
→ 有:本地 git 记录、个人 Telegram、自己的邮件
|
|
44
|
+
|
|
45
|
+
B(zxj 的 Windows 电脑)
|
|
46
|
+
→ 有:Google Sheets 销售数据(以 zxj 账号登录)
|
|
47
|
+
|
|
48
|
+
C(ljl 的机器)
|
|
49
|
+
→ 有:内部 OA 系统(浏览器已登录)、本地 MySQL
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Eric 对自己的 AI 说:"帮我生成本月复盘报告。"
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
A 读取团队档案
|
|
56
|
+
→ B 的 bio:"可访问 Google Workspace、销售数据表格"
|
|
57
|
+
→ C 的 bio:"可访问内部 OA 系统和本地数据库"
|
|
58
|
+
|
|
59
|
+
A 拆解任务:
|
|
60
|
+
→ 委派 B:"从 Google Sheets 拿本月销售数字"
|
|
61
|
+
→ 委派 C:"从 OA 系统查项目进度和出勤情况"
|
|
62
|
+
→ 自己读本地 git log 获取代码提交记录
|
|
63
|
+
|
|
64
|
+
B 用自己的 Google 凭据读取表格 → 返回数据
|
|
65
|
+
C 用自己已登录的浏览器抓取 OA → 返回数据
|
|
66
|
+
A 合并三份数据 → 生成报告
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
B 还可以进一步委派。如果 B 需要生成图表,看到团队档案里 D 有这个能力,B 会自主委派给 D——不需要 A 来调度。
|
|
70
|
+
|
|
71
|
+
**档案里的 bio 描述的是每个实例能访问什么数据和系统**,这就是 Agent 决定找谁的依据。
|
|
4
72
|
|
|
5
73
|
## 安装
|
|
6
74
|
|
|
@@ -16,12 +84,19 @@ AI 会自动完成安装、配置和档案生成,无需手动修改任何文
|
|
|
16
84
|
|
|
17
85
|
- **「创建一个叫 my-team 的团队」** — 创建团队并获取邀请码
|
|
18
86
|
- **「用邀请码 mc:xxxxx 加入团队」** — 加入队友的团队
|
|
19
|
-
- **「让 Bob
|
|
20
|
-
- **「显示所有智能体」** —
|
|
87
|
+
- **「让 Bob 去拿销售数据」** — 把任务委派给队友的 AI
|
|
88
|
+
- **「显示所有智能体」** — 查看团队成员及其数据访问权限
|
|
89
|
+
|
|
90
|
+
## 后续计划
|
|
91
|
+
|
|
92
|
+
### 异步委派
|
|
93
|
+
当前委派是同步的——发起方等待结果返回后才继续。下一个大版本将支持异步委派:同时向多个 Agent 派发任务,结果通过推送通知返回,全部完成后统一汇总。这将实现真正的跨 Agent 并行执行。
|
|
21
94
|
|
|
22
|
-
|
|
95
|
+
### 多轮协作
|
|
96
|
+
当前每次委派是单次请求-响应。计划支持多轮 Session:Agent 之间可以在同一上下文中来回交流,适用于需要补充信息、中间反馈或多轮迭代的任务。
|
|
23
97
|
|
|
24
|
-
|
|
98
|
+
### 权限管理
|
|
99
|
+
当前持有邀请码的任何 Agent 都可以向你的 OpenClaw 发送任务。计划添加权限层:定义哪些 Agent 可以委派任务给你、允许哪类任务、以及是否需要人工确认才能执行。
|
|
25
100
|
|
|
26
101
|
## 详细文档
|
|
27
102
|
|
|
@@ -30,7 +105,6 @@ AI 会自动完成安装、配置和档案生成,无需手动修改任何文
|
|
|
30
105
|
## 开发
|
|
31
106
|
|
|
32
107
|
```bash
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
pnpm test
|
|
108
|
+
npm install
|
|
109
|
+
npm run build
|
|
36
110
|
```
|
package/dist/index.js
CHANGED
|
@@ -392,7 +392,7 @@ multiclaws 插件刚安装,需要在本次对话中完成以下初始化流程
|
|
|
392
392
|
2. 向用户展示生成的档案,并逐一确认以下三项(名字和 bio 需要用户明确回答):
|
|
393
393
|
- **名字**:展示推断出的名字,询问是否需要修改
|
|
394
394
|
- **Bio**:展示生成的 bio,询问是否需要修改
|
|
395
|
-
- **网络情况**:告知用户「同局域网开箱即用;跨网络需安装 Tailscale
|
|
395
|
+
- **网络情况**:告知用户「同局域网开箱即用;跨网络需安装 Tailscale 并重启 OpenClaw,下载地址:https://tailscale.com/download」,无需用户回答
|
|
396
396
|
|
|
397
397
|
3. 根据用户对名字和 bio 的回答更新档案内容(如需修改),然后调用 \`multiclaws_profile_set(ownerName="...", bio="...")\` 保存。
|
|
398
398
|
|
|
@@ -110,8 +110,8 @@ class OpenClawAgentExecutor {
|
|
|
110
110
|
const gateway = this.gatewayConfig;
|
|
111
111
|
const startTime = Date.now();
|
|
112
112
|
let attempt = 0;
|
|
113
|
-
//
|
|
114
|
-
const pollDelays = [
|
|
113
|
+
// Start aggressive, max out at 500ms to minimize result latency
|
|
114
|
+
const pollDelays = [100, 200, 300, 500];
|
|
115
115
|
while (Date.now() - startTime < timeoutMs) {
|
|
116
116
|
const delay = pollDelays[Math.min(attempt, pollDelays.length - 1)];
|
|
117
117
|
await sleep(delay);
|
|
@@ -89,6 +89,11 @@ export declare class MulticlawsService extends EventEmitter {
|
|
|
89
89
|
private fetchMemberDescriptions;
|
|
90
90
|
private syncTeamToRegistry;
|
|
91
91
|
private createA2AClient;
|
|
92
|
+
/**
|
|
93
|
+
* Send a message using A2A streaming to minimize latency.
|
|
94
|
+
* Instead of a single blocking HTTP call, consume the SSE stream and
|
|
95
|
+
* return the final Task or Message as soon as B signals completion.
|
|
96
|
+
*/
|
|
92
97
|
private processTaskResult;
|
|
93
98
|
private extractArtifactText;
|
|
94
99
|
private notifyTailscaleSetup;
|
|
@@ -618,6 +618,11 @@ class MulticlawsService extends node_events_1.EventEmitter {
|
|
|
618
618
|
async createA2AClient(agent) {
|
|
619
619
|
return await this.clientFactory.createFromUrl(agent.url);
|
|
620
620
|
}
|
|
621
|
+
/**
|
|
622
|
+
* Send a message using A2A streaming to minimize latency.
|
|
623
|
+
* Instead of a single blocking HTTP call, consume the SSE stream and
|
|
624
|
+
* return the final Task or Message as soon as B signals completion.
|
|
625
|
+
*/
|
|
621
626
|
processTaskResult(trackId, result) {
|
|
622
627
|
if ("status" in result && result.status) {
|
|
623
628
|
const task = result;
|
package/package.json
CHANGED
|
@@ -23,7 +23,7 @@ MultiClaws 让多个 OpenClaw 实例通过 [A2A(Agent-to-Agent)](https://goo
|
|
|
23
23
|
2. 向用户展示生成的档案,并逐一确认以下三项:
|
|
24
24
|
- **名字**:展示推断出的名字,询问是否需要修改(需用户明确回答)
|
|
25
25
|
- **Bio**:展示生成的 bio,询问是否需要修改(需用户明确回答)
|
|
26
|
-
- **网络情况**:告知用户「同局域网开箱即用;跨网络需安装 Tailscale
|
|
26
|
+
- **网络情况**:告知用户「同局域网开箱即用;跨网络需安装 Tailscale 并重启 OpenClaw,下载地址:https://tailscale.com/download」,无需用户回答
|
|
27
27
|
|
|
28
28
|
3. 根据用户对名字和 bio 的回答更新内容后,调用 `multiclaws_profile_set(ownerName="...", bio="...")` 保存档案。
|
|
29
29
|
|