multiclaws 0.4.36 → 0.4.38
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 +39 -39
- package/README.zh-CN.md +39 -39
- package/dist/gateway/handlers.js +17 -0
- package/dist/index.js +89 -45
- package/dist/infra/version.d.ts +1 -0
- package/dist/infra/version.js +19 -0
- package/dist/service/a2a-adapter.d.ts +27 -4
- package/dist/service/a2a-adapter.js +239 -30
- package/dist/service/multiclaws-service.d.ts +7 -0
- package/dist/service/multiclaws-service.js +84 -20
- package/openclaw.plugin.json +47 -47
- package/package.json +56 -56
- package/skills/meeting-scheduler/SKILL.md +175 -0
- package/skills/multiclaws/SKILL.md +218 -218
package/README.md
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
# MultiClaws
|
|
2
|
-
|
|
3
|
-
Multi-agent collaboration plugin for [OpenClaw](https://openclaw.ai). Connect multiple OpenClaw instances into a team and delegate tasks between them using the [A2A protocol](https://google.github.io/A2A/).
|
|
4
|
-
|
|
5
|
-
[中文文档](README.zh-CN.md)
|
|
6
|
-
|
|
7
|
-
## Installation
|
|
8
|
-
|
|
9
|
-
Just tell your AI:
|
|
10
|
-
|
|
11
|
-
> Run `openclaw plugins install multiclaws` and tell me what it can do.
|
|
12
|
-
|
|
13
|
-
Your AI handles the rest — installation, configuration, and profile setup — no manual steps required.
|
|
14
|
-
|
|
15
|
-
## Usage
|
|
16
|
-
|
|
17
|
-
Everything works through natural language:
|
|
18
|
-
|
|
19
|
-
- **"Create a team called my-team"** — creates a team and generates an invite code
|
|
20
|
-
- **"Join team with invite code mc:xxxxx"** — join a teammate's team
|
|
21
|
-
- **"Ask Bob to summarize the latest report"** — delegate a task to a teammate's AI
|
|
22
|
-
- **"Show all agents"** — list team members and their capabilities
|
|
23
|
-
|
|
24
|
-
## How It Works
|
|
25
|
-
|
|
26
|
-
MultiClaws enables multiple OpenClaw instances to collaborate as a team. Each instance acts as both a client (delegating tasks) and a server (receiving tasks from others). Tasks are executed by the remote AI and results are returned directly.
|
|
27
|
-
|
|
28
|
-
Works out of the box on the same local network. Cross-network collaboration is also supported.
|
|
29
|
-
|
|
30
|
-
## Documentation
|
|
31
|
-
|
|
32
|
-
See [SKILL.md](skills/multiclaws/SKILL.md) for full details.
|
|
33
|
-
|
|
34
|
-
## Development
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
npm install
|
|
38
|
-
npm run build
|
|
39
|
-
```
|
|
1
|
+
# MultiClaws
|
|
2
|
+
|
|
3
|
+
Multi-agent collaboration plugin for [OpenClaw](https://openclaw.ai). Connect multiple OpenClaw instances into a team and delegate tasks between them using the [A2A protocol](https://google.github.io/A2A/).
|
|
4
|
+
|
|
5
|
+
[中文文档](README.zh-CN.md)
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
Just tell your AI:
|
|
10
|
+
|
|
11
|
+
> Run `openclaw plugins install multiclaws` and tell me what it can do.
|
|
12
|
+
|
|
13
|
+
Your AI handles the rest — installation, configuration, and profile setup — no manual steps required.
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
Everything works through natural language:
|
|
18
|
+
|
|
19
|
+
- **"Create a team called my-team"** — creates a team and generates an invite code
|
|
20
|
+
- **"Join team with invite code mc:xxxxx"** — join a teammate's team
|
|
21
|
+
- **"Ask Bob to summarize the latest report"** — delegate a task to a teammate's AI
|
|
22
|
+
- **"Show all agents"** — list team members and their capabilities
|
|
23
|
+
|
|
24
|
+
## How It Works
|
|
25
|
+
|
|
26
|
+
MultiClaws enables multiple OpenClaw instances to collaborate as a team. Each instance acts as both a client (delegating tasks) and a server (receiving tasks from others). Tasks are executed by the remote AI and results are returned directly.
|
|
27
|
+
|
|
28
|
+
Works out of the box on the same local network. Cross-network collaboration is also supported.
|
|
29
|
+
|
|
30
|
+
## Documentation
|
|
31
|
+
|
|
32
|
+
See [SKILL.md](skills/multiclaws/SKILL.md) for full details.
|
|
33
|
+
|
|
34
|
+
## Development
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npm install
|
|
38
|
+
npm run build
|
|
39
|
+
```
|
package/README.zh-CN.md
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
# MultiClaws
|
|
2
|
-
|
|
3
|
-
[OpenClaw](https://openclaw.ai) 多智能体协作插件。将多个 OpenClaw 实例组成团队,通过 [A2A 协议](https://google.github.io/A2A/) 互相委派任务。
|
|
4
|
-
|
|
5
|
-
[English](README.md)
|
|
6
|
-
|
|
7
|
-
## 安装
|
|
8
|
-
|
|
9
|
-
对你的 AI 说:
|
|
10
|
-
|
|
11
|
-
> 请运行 `openclaw plugins install multiclaws`,安装完成后告诉我这个插件能做什么
|
|
12
|
-
|
|
13
|
-
AI 会自动完成安装、配置和档案生成,无需手动修改任何文件。
|
|
14
|
-
|
|
15
|
-
## 使用
|
|
16
|
-
|
|
17
|
-
一切通过自然语言完成:
|
|
18
|
-
|
|
19
|
-
- **「创建一个叫 my-team 的团队」** — 创建团队并获取邀请码
|
|
20
|
-
- **「用邀请码 mc:xxxxx 加入团队」** — 加入队友的团队
|
|
21
|
-
- **「让 Bob 总结一下最新报告」** — 把任务委派给队友的 AI
|
|
22
|
-
- **「显示所有智能体」** — 查看团队成员及其能力
|
|
23
|
-
|
|
24
|
-
## 工作原理
|
|
25
|
-
|
|
26
|
-
MultiClaws 让多个 OpenClaw 实例作为一个团队协作。每个实例既可以作为客户端(委派任务),也可以作为服务端(接收他人任务)。任务由远端 AI 执行,结果直接返回。
|
|
27
|
-
|
|
28
|
-
同局域网开箱即用,也支持跨网络协作。
|
|
29
|
-
|
|
30
|
-
## 详细文档
|
|
31
|
-
|
|
32
|
-
见 [SKILL.md](skills/multiclaws/SKILL.md)。
|
|
33
|
-
|
|
34
|
-
## 开发
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
npm install
|
|
38
|
-
npm run build
|
|
39
|
-
```
|
|
1
|
+
# MultiClaws
|
|
2
|
+
|
|
3
|
+
[OpenClaw](https://openclaw.ai) 多智能体协作插件。将多个 OpenClaw 实例组成团队,通过 [A2A 协议](https://google.github.io/A2A/) 互相委派任务。
|
|
4
|
+
|
|
5
|
+
[English](README.md)
|
|
6
|
+
|
|
7
|
+
## 安装
|
|
8
|
+
|
|
9
|
+
对你的 AI 说:
|
|
10
|
+
|
|
11
|
+
> 请运行 `openclaw plugins install multiclaws`,安装完成后告诉我这个插件能做什么
|
|
12
|
+
|
|
13
|
+
AI 会自动完成安装、配置和档案生成,无需手动修改任何文件。
|
|
14
|
+
|
|
15
|
+
## 使用
|
|
16
|
+
|
|
17
|
+
一切通过自然语言完成:
|
|
18
|
+
|
|
19
|
+
- **「创建一个叫 my-team 的团队」** — 创建团队并获取邀请码
|
|
20
|
+
- **「用邀请码 mc:xxxxx 加入团队」** — 加入队友的团队
|
|
21
|
+
- **「让 Bob 总结一下最新报告」** — 把任务委派给队友的 AI
|
|
22
|
+
- **「显示所有智能体」** — 查看团队成员及其能力
|
|
23
|
+
|
|
24
|
+
## 工作原理
|
|
25
|
+
|
|
26
|
+
MultiClaws 让多个 OpenClaw 实例作为一个团队协作。每个实例既可以作为客户端(委派任务),也可以作为服务端(接收他人任务)。任务由远端 AI 执行,结果直接返回。
|
|
27
|
+
|
|
28
|
+
同局域网开箱即用,也支持跨网络协作。
|
|
29
|
+
|
|
30
|
+
## 详细文档
|
|
31
|
+
|
|
32
|
+
见 [SKILL.md](skills/multiclaws/SKILL.md)。
|
|
33
|
+
|
|
34
|
+
## 开发
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npm install
|
|
38
|
+
npm run build
|
|
39
|
+
```
|
package/dist/gateway/handlers.js
CHANGED
|
@@ -13,6 +13,10 @@ const taskDelegateSchema = zod_1.z.object({
|
|
|
13
13
|
task: nonEmptyString,
|
|
14
14
|
});
|
|
15
15
|
const taskStatusSchema = zod_1.z.object({ taskId: nonEmptyString });
|
|
16
|
+
const taskRespondSchema = zod_1.z.object({
|
|
17
|
+
taskId: nonEmptyString,
|
|
18
|
+
approved: zod_1.z.boolean(),
|
|
19
|
+
});
|
|
16
20
|
const profileSetSchema = zod_1.z.object({
|
|
17
21
|
ownerName: zod_1.z.string().trim().optional(),
|
|
18
22
|
bio: zod_1.z.string().optional(),
|
|
@@ -86,6 +90,19 @@ function createGatewayHandlers(getService, logger) {
|
|
|
86
90
|
safeHandle(respond, "task_delegate_failed", error);
|
|
87
91
|
}
|
|
88
92
|
},
|
|
93
|
+
"multiclaws.task.respond": async ({ params, respond }) => {
|
|
94
|
+
log("debug", `task.respond(taskId=${params?.taskId}, approved=${params?.approved})`);
|
|
95
|
+
try {
|
|
96
|
+
const parsed = taskRespondSchema.parse(params);
|
|
97
|
+
const service = getService();
|
|
98
|
+
const resolved = service.respondToTask(parsed.taskId, parsed.approved);
|
|
99
|
+
respond(true, { resolved, approved: parsed.approved });
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
log("error", `task.respond failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
103
|
+
safeHandle(respond, "task_respond_failed", error);
|
|
104
|
+
}
|
|
105
|
+
},
|
|
89
106
|
"multiclaws.task.status": async ({ params, respond }) => {
|
|
90
107
|
log("debug", `task.status(taskId=${params?.taskId})`);
|
|
91
108
|
try {
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@ const handlers_1 = require("./gateway/handlers");
|
|
|
4
4
|
const multiclaws_service_1 = require("./service/multiclaws-service");
|
|
5
5
|
const logger_1 = require("./infra/logger");
|
|
6
6
|
const telemetry_1 = require("./infra/telemetry");
|
|
7
|
+
const version_1 = require("./infra/version");
|
|
7
8
|
/** Default FRP tunnel config for demo/testing */
|
|
8
9
|
const DEFAULT_TUNNEL = {
|
|
9
10
|
type: "frp",
|
|
@@ -140,9 +141,10 @@ function createTools(getService, logger) {
|
|
|
140
141
|
};
|
|
141
142
|
const multiclawsDelegate = {
|
|
142
143
|
name: "multiclaws_delegate",
|
|
143
|
-
description: "Delegate a task to a remote A2A agent. " +
|
|
144
|
-
"
|
|
145
|
-
"
|
|
144
|
+
description: "Delegate a task to a remote A2A agent and wait for the result inline. " +
|
|
145
|
+
"Sends the task synchronously via A2A and returns the output directly in the current session. " +
|
|
146
|
+
"For long-running tasks this may take several minutes. " +
|
|
147
|
+
"Do NOT use multiclaws_delegate_send directly — use this tool instead.",
|
|
146
148
|
parameters: {
|
|
147
149
|
type: "object",
|
|
148
150
|
additionalProperties: false,
|
|
@@ -160,8 +162,13 @@ function createTools(getService, logger) {
|
|
|
160
162
|
const task = typeof args.task === "string" ? args.task.trim() : "";
|
|
161
163
|
if (!agentUrl || !task)
|
|
162
164
|
throw new Error("agentUrl and task are required");
|
|
163
|
-
const result = await service.
|
|
164
|
-
|
|
165
|
+
const result = await service.delegateTaskSync({ agentUrl, task });
|
|
166
|
+
const summary = result.output
|
|
167
|
+
? result.output
|
|
168
|
+
: result.error
|
|
169
|
+
? `任务失败:${result.error}`
|
|
170
|
+
: `任务状态:${result.status}`;
|
|
171
|
+
return textResult(summary, result);
|
|
165
172
|
}
|
|
166
173
|
catch (err) {
|
|
167
174
|
log("error", `tool:multiclaws_delegate failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
@@ -172,8 +179,8 @@ function createTools(getService, logger) {
|
|
|
172
179
|
const multiclawsDelegateSend = {
|
|
173
180
|
name: "multiclaws_delegate_send",
|
|
174
181
|
description: "Send a task to a remote A2A agent and wait for the result synchronously. " +
|
|
175
|
-
"
|
|
176
|
-
"
|
|
182
|
+
"Low-level primitive used by sub-agents or advanced orchestration flows. " +
|
|
183
|
+
"In most cases use multiclaws_delegate instead, which handles this automatically.",
|
|
177
184
|
parameters: {
|
|
178
185
|
type: "object",
|
|
179
186
|
additionalProperties: false,
|
|
@@ -263,6 +270,42 @@ function createTools(getService, logger) {
|
|
|
263
270
|
}
|
|
264
271
|
},
|
|
265
272
|
};
|
|
273
|
+
const multiclawsTaskRespond = {
|
|
274
|
+
name: "multiclaws_task_respond",
|
|
275
|
+
description: "Approve or reject a pending incoming delegated task that requires human authorization. " +
|
|
276
|
+
"Call with approved=true to allow execution, approved=false to reject. " +
|
|
277
|
+
"Use this when the user responds to an approval request for a risky incoming task.",
|
|
278
|
+
parameters: {
|
|
279
|
+
type: "object",
|
|
280
|
+
additionalProperties: false,
|
|
281
|
+
properties: {
|
|
282
|
+
taskId: { type: "string", description: "The taskId from the approval request." },
|
|
283
|
+
approved: { type: "boolean", description: "true to approve, false to reject." },
|
|
284
|
+
},
|
|
285
|
+
required: ["taskId", "approved"],
|
|
286
|
+
},
|
|
287
|
+
execute: async (_toolCallId, args) => {
|
|
288
|
+
const taskId = typeof args.taskId === "string" ? args.taskId.trim() : "";
|
|
289
|
+
const approved = typeof args.approved === "boolean" ? args.approved : false;
|
|
290
|
+
log("info", `tool:multiclaws_task_respond(taskId=${taskId}, approved=${approved})`);
|
|
291
|
+
try {
|
|
292
|
+
const service = requireService(getService());
|
|
293
|
+
if (!taskId)
|
|
294
|
+
throw new Error("taskId is required");
|
|
295
|
+
const resolved = service.respondToTask(taskId, approved);
|
|
296
|
+
if (!resolved) {
|
|
297
|
+
return textResult(`未找到任务 ${taskId} 的待审批记录,可能已超时或不存在。`);
|
|
298
|
+
}
|
|
299
|
+
return textResult(approved
|
|
300
|
+
? `✅ 已授权任务 ${taskId},执行中…`
|
|
301
|
+
: `❌ 已拒绝任务 ${taskId}。`);
|
|
302
|
+
}
|
|
303
|
+
catch (err) {
|
|
304
|
+
log("error", `tool:multiclaws_task_respond failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
305
|
+
throw err;
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
};
|
|
266
309
|
const multiclawsTaskStatus = {
|
|
267
310
|
name: "multiclaws_task_status",
|
|
268
311
|
description: "Check the status of a delegated task.",
|
|
@@ -501,6 +544,7 @@ function createTools(getService, logger) {
|
|
|
501
544
|
multiclawsDelegateSend,
|
|
502
545
|
multiclawsA2ACallback,
|
|
503
546
|
multiclawsNotify,
|
|
547
|
+
multiclawsTaskRespond,
|
|
504
548
|
multiclawsTaskStatus,
|
|
505
549
|
multiclawsTeamCreate,
|
|
506
550
|
multiclawsTeamJoin,
|
|
@@ -515,7 +559,7 @@ function createTools(getService, logger) {
|
|
|
515
559
|
const plugin = {
|
|
516
560
|
id: "multiclaws",
|
|
517
561
|
name: "MultiClaws",
|
|
518
|
-
version:
|
|
562
|
+
version: version_1.PLUGIN_VERSION,
|
|
519
563
|
register(api) {
|
|
520
564
|
const config = readConfig(api);
|
|
521
565
|
(0, telemetry_1.initializeTelemetry)({ enableConsoleExporter: config.telemetry?.consoleExporter });
|
|
@@ -539,7 +583,7 @@ const plugin = {
|
|
|
539
583
|
if (gw) {
|
|
540
584
|
const tools = (gw.tools ?? {});
|
|
541
585
|
const allow = Array.isArray(tools.allow) ? tools.allow : [];
|
|
542
|
-
const adapterRequired = ["sessions_spawn", "sessions_history", "message", "chat.send"];
|
|
586
|
+
const adapterRequired = ["sessions_spawn", "sessions_list", "sessions_send", "sessions_history", "message", "chat.send"];
|
|
543
587
|
const defaultA2AExecutionTools = ["exec", "read", "write", "edit", "process"];
|
|
544
588
|
const pluginConf = api.pluginConfig ?? {};
|
|
545
589
|
const a2aExecTools = Array.isArray(pluginConf.a2aAllowedTools)
|
|
@@ -625,16 +669,16 @@ const plugin = {
|
|
|
625
669
|
api.on("gateway_stop", () => {
|
|
626
670
|
structured.logger.info("[multiclaws] gateway_stop observed");
|
|
627
671
|
});
|
|
628
|
-
// Collect notification targets from incoming messages
|
|
672
|
+
// Collect notification targets from incoming messages.
|
|
673
|
+
// WebChat is intentionally excluded here: it's registered via
|
|
674
|
+
// before_prompt_build (type="web") using sessions_send, which correctly
|
|
675
|
+
// injects messages into the active session. Registering it here too would
|
|
676
|
+
// cause duplicate notifications.
|
|
629
677
|
api.on("message_received", (_event, ctx) => {
|
|
630
678
|
if (!service || !ctx.channelId)
|
|
631
679
|
return;
|
|
632
|
-
if (ctx.channelId
|
|
633
|
-
//
|
|
634
|
-
service.addNotificationTarget(`webchat:${ctx.conversationId}`, { type: "channel", conversationId: ctx.conversationId });
|
|
635
|
-
}
|
|
636
|
-
else if (ctx.channelId !== "webchat" && ctx.conversationId) {
|
|
637
|
-
// External channels (Telegram, etc.)
|
|
680
|
+
if (ctx.channelId !== "webchat" && ctx.conversationId) {
|
|
681
|
+
// External channels only (Telegram, Discord, etc.)
|
|
638
682
|
service.addNotificationTarget(`${ctx.channelId}:${ctx.conversationId}`, { type: "channel", conversationId: ctx.conversationId });
|
|
639
683
|
}
|
|
640
684
|
});
|
|
@@ -654,35 +698,35 @@ const plugin = {
|
|
|
654
698
|
if (!review.pending)
|
|
655
699
|
return;
|
|
656
700
|
return {
|
|
657
|
-
appendSystemContext: `## MultiClaws 首次安装 — 需要完成档案设置
|
|
658
|
-
|
|
659
|
-
multiclaws 插件刚安装,需要在本次对话中完成以下初始化流程(优先处理,不管用户说了什么):
|
|
660
|
-
|
|
661
|
-
1. **确认用户名**(需要用户明确回答):
|
|
662
|
-
- 询问用户希望使用什么名字
|
|
663
|
-
- 这个名字会以「{名字} 的 OpenClaw」格式展示给团队其他成员
|
|
664
|
-
- 例如用户叫「小明」,则其他成员看到的是「小明 的 OpenClaw」
|
|
665
|
-
|
|
666
|
-
2. **自动生成 bio**(无需用户确认,直接生成并保存):
|
|
667
|
-
扫描当前环境,生成详细的 bio(markdown 格式)。bio 是给其他 AI 智能体看的,用来判断这个智能体能做什么任务、能访问什么数据。必须准确反映实际能力,具体检查:
|
|
668
|
-
|
|
669
|
-
- **已安装的工具(tools)**:列出所有可用的工具名称,说明能执行哪些类型的操作(如文件读写、代码执行、网络请求等)
|
|
670
|
-
- **已安装的 skills**:列出 skill 名称和功能描述
|
|
671
|
-
- **已连接的渠道(channels)**:检查是否连接了 Telegram、Discord、Gmail、Slack、微信等,列出具体渠道名称
|
|
672
|
-
- **已安装的插件(plugins)**:列出所有已加载的插件及其主要功能
|
|
673
|
-
- **工作区内容**:检查当前工作目录(pwd)下的项目结构,包括:
|
|
674
|
-
- git 仓库信息(仓库名、分支)
|
|
675
|
-
- 主要编程语言和框架
|
|
676
|
-
- 项目名称和用途(从 README 或 package.json 推断)
|
|
677
|
-
- **可访问的数据源**:检查是否有日历(Google Calendar 等)、邮件(Gmail 等)、Notion、数据库、API 等数据访问能力
|
|
678
|
-
- **系统信息**:时区、操作系统、语言偏好
|
|
679
|
-
|
|
680
|
-
3. 用户确认名字后,立即调用 \`multiclaws_profile_set(ownerName="确认后的名字", bio="生成的bio")\` 保存。
|
|
681
|
-
|
|
682
|
-
4. 调用 \`multiclaws_profile_clear_pending_review()\` 完成初始化。
|
|
683
|
-
|
|
684
|
-
5. **网络情况告知**(无需用户回答):告知用户「所有实例通过 FRP 隧道通信,需在插件配置中设置 tunnel 字段(包含 frps 服务器地址、端口、token 和可用端口范围),frpc 会自动下载安装」
|
|
685
|
-
|
|
701
|
+
appendSystemContext: `## MultiClaws 首次安装 — 需要完成档案设置
|
|
702
|
+
|
|
703
|
+
multiclaws 插件刚安装,需要在本次对话中完成以下初始化流程(优先处理,不管用户说了什么):
|
|
704
|
+
|
|
705
|
+
1. **确认用户名**(需要用户明确回答):
|
|
706
|
+
- 询问用户希望使用什么名字
|
|
707
|
+
- 这个名字会以「{名字} 的 OpenClaw」格式展示给团队其他成员
|
|
708
|
+
- 例如用户叫「小明」,则其他成员看到的是「小明 的 OpenClaw」
|
|
709
|
+
|
|
710
|
+
2. **自动生成 bio**(无需用户确认,直接生成并保存):
|
|
711
|
+
扫描当前环境,生成详细的 bio(markdown 格式)。bio 是给其他 AI 智能体看的,用来判断这个智能体能做什么任务、能访问什么数据。必须准确反映实际能力,具体检查:
|
|
712
|
+
|
|
713
|
+
- **已安装的工具(tools)**:列出所有可用的工具名称,说明能执行哪些类型的操作(如文件读写、代码执行、网络请求等)
|
|
714
|
+
- **已安装的 skills**:列出 skill 名称和功能描述
|
|
715
|
+
- **已连接的渠道(channels)**:检查是否连接了 Telegram、Discord、Gmail、Slack、微信等,列出具体渠道名称
|
|
716
|
+
- **已安装的插件(plugins)**:列出所有已加载的插件及其主要功能
|
|
717
|
+
- **工作区内容**:检查当前工作目录(pwd)下的项目结构,包括:
|
|
718
|
+
- git 仓库信息(仓库名、分支)
|
|
719
|
+
- 主要编程语言和框架
|
|
720
|
+
- 项目名称和用途(从 README 或 package.json 推断)
|
|
721
|
+
- **可访问的数据源**:检查是否有日历(Google Calendar 等)、邮件(Gmail 等)、Notion、数据库、API 等数据访问能力
|
|
722
|
+
- **系统信息**:时区、操作系统、语言偏好
|
|
723
|
+
|
|
724
|
+
3. 用户确认名字后,立即调用 \`multiclaws_profile_set(ownerName="确认后的名字", bio="生成的bio")\` 保存。
|
|
725
|
+
|
|
726
|
+
4. 调用 \`multiclaws_profile_clear_pending_review()\` 完成初始化。
|
|
727
|
+
|
|
728
|
+
5. **网络情况告知**(无需用户回答):告知用户「所有实例通过 FRP 隧道通信,需在插件配置中设置 tunnel 字段(包含 frps 服务器地址、端口、token 和可用端口范围),frpc 会自动下载安装」
|
|
729
|
+
|
|
686
730
|
**注意**:只有名字需要用户明确确认;bio 自动生成直接保存无需确认;网络情况仅告知无需回答。`,
|
|
687
731
|
};
|
|
688
732
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PLUGIN_VERSION: string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.PLUGIN_VERSION = void 0;
|
|
7
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
9
|
+
function readPackageVersion() {
|
|
10
|
+
try {
|
|
11
|
+
const pkgPath = node_path_1.default.resolve(__dirname, "..", "..", "package.json");
|
|
12
|
+
const pkg = JSON.parse(node_fs_1.default.readFileSync(pkgPath, "utf-8"));
|
|
13
|
+
return pkg.version ?? "0.0.0";
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
return "0.0.0";
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.PLUGIN_VERSION = readPackageVersion();
|
|
@@ -7,6 +7,8 @@ export type A2AAdapterOptions = {
|
|
|
7
7
|
taskTracker: TaskTracker;
|
|
8
8
|
cwd?: string;
|
|
9
9
|
getNotificationTargets?: () => ReadonlyMap<string, NotificationTarget>;
|
|
10
|
+
/** Called when a session is discovered via fallback; allows service to cache it for future use. */
|
|
11
|
+
registerDiscoveredTarget?: (sessionKey: string) => void;
|
|
10
12
|
logger: {
|
|
11
13
|
info: (msg: string) => void;
|
|
12
14
|
warn: (msg: string) => void;
|
|
@@ -18,18 +20,23 @@ export type A2AAdapterOptions = {
|
|
|
18
20
|
*
|
|
19
21
|
* When a remote agent sends a task via A2A `message/send`,
|
|
20
22
|
* this executor:
|
|
21
|
-
* 1.
|
|
22
|
-
* 2.
|
|
23
|
-
* 3.
|
|
24
|
-
*
|
|
23
|
+
* 1. Classifies the task risk (safe vs risky)
|
|
24
|
+
* 2. Notifies the local human owner
|
|
25
|
+
* 3. For risky tasks: waits for explicit human approval
|
|
26
|
+
* For safe tasks: executes immediately
|
|
27
|
+
* 4. Calls OpenClaw's `sessions_spawn` (run mode) to start execution
|
|
28
|
+
* 5. Waits for the sub-agent to call back via `multiclaws_a2a_callback`
|
|
29
|
+
* 6. Returns the final result as a Message
|
|
25
30
|
*/
|
|
26
31
|
export declare class OpenClawAgentExecutor implements AgentExecutor {
|
|
27
32
|
private gatewayConfig;
|
|
28
33
|
private readonly taskTracker;
|
|
29
34
|
private readonly getNotificationTargets;
|
|
35
|
+
private readonly registerDiscoveredTarget;
|
|
30
36
|
private readonly logger;
|
|
31
37
|
private readonly cwd;
|
|
32
38
|
private readonly pendingCallbacks;
|
|
39
|
+
private readonly pendingApprovals;
|
|
33
40
|
constructor(options: A2AAdapterOptions);
|
|
34
41
|
execute(context: RequestContext, eventBus: ExecutionEventBus): Promise<void>;
|
|
35
42
|
/**
|
|
@@ -37,6 +44,11 @@ export declare class OpenClawAgentExecutor implements AgentExecutor {
|
|
|
37
44
|
* Returns true if a pending callback was found and resolved.
|
|
38
45
|
*/
|
|
39
46
|
resolveCallback(taskId: string, result: string): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Called when the local human owner approves or rejects a pending risky task.
|
|
49
|
+
* Returns true if a pending approval was found.
|
|
50
|
+
*/
|
|
51
|
+
resolveApproval(taskId: string, approved: boolean): boolean;
|
|
40
52
|
cancelTask(taskId: string, eventBus: ExecutionEventBus): Promise<void>;
|
|
41
53
|
updateGatewayConfig(config: GatewayConfig): void;
|
|
42
54
|
/**
|
|
@@ -44,6 +56,17 @@ export declare class OpenClawAgentExecutor implements AgentExecutor {
|
|
|
44
56
|
* or rejects on timeout.
|
|
45
57
|
*/
|
|
46
58
|
private createCallback;
|
|
59
|
+
/**
|
|
60
|
+
* Create a pending approval that resolves when the human owner responds,
|
|
61
|
+
* or rejects on timeout or cancellation.
|
|
62
|
+
*/
|
|
63
|
+
private createApprovalCallback;
|
|
64
|
+
/**
|
|
65
|
+
* Discover the most recently active non-internal session via sessions_list.
|
|
66
|
+
* Used as fallback when no notification targets have been registered yet
|
|
67
|
+
* (e.g. right after a gateway restart before the user sends their first message).
|
|
68
|
+
*/
|
|
69
|
+
private discoverActiveSession;
|
|
47
70
|
/** Send a notification to all known targets. Individual failures are silently ignored. */
|
|
48
71
|
private notifyUser;
|
|
49
72
|
private publishMessage;
|