multiclaws 0.4.5 → 0.4.6

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/dist/index.js CHANGED
@@ -452,26 +452,51 @@ const plugin = {
452
452
  const review = await service.getPendingProfileReview();
453
453
  if (!review.pending)
454
454
  return;
455
+ const tsStatus = service.getTailscaleStatus();
456
+ let networkLine;
457
+ if (tsStatus === "ready") {
458
+ networkLine = "Tailscale 已检测到,跨网络协作已就绪。";
459
+ }
460
+ else if (tsStatus === "needs_auth") {
461
+ networkLine = "Tailscale 已安装但未登录。跨网络协作需要先完成登录,登录后重启 OpenClaw。局域网内可直接使用。";
462
+ }
463
+ else {
464
+ networkLine = "当前仅支持局域网协作。如需跨网络,安装 Tailscale(https://tailscale.com/download)并登录同一 tailnet,然后重启 OpenClaw。";
465
+ }
455
466
  return {
456
- appendSystemContext: `## MultiClaws 首次安装 — 需要完成档案设置
467
+ appendSystemContext: `## MultiClaws 首次安装 — 需要完成初始化
457
468
 
458
469
  multiclaws 插件刚安装,需要在本次对话中完成以下初始化流程(优先处理,不管用户说了什么)。
459
470
  **务必使用插件工具调用,不要通过命令行或 gateway 方法操作。**
460
471
 
472
+ ### 第一步:向用户介绍 MultiClaws
473
+
474
+ 简要说明插件功能:
475
+ - MultiClaws 让多个 OpenClaw 实例组成团队协作
476
+ - 你可以创建团队、邀请队友加入,然后把任务委派给队友的 AI
477
+ - 它会根据每个智能体的档案(名字、角色、能力、数据源)自动选择最合适的执行者
478
+ - 支持多轮对话、并发扇出、链式协作等模式
479
+
480
+ ### 第二步:设置档案
481
+
482
+ 档案(名字 + bio)是你在团队中的「名片」,其他 AI 读它来决定是否把任务委派给你。
483
+
461
484
  1. **扫描当前环境**,自动生成 bio(markdown 格式),内容包括:
462
485
  - 用户角色和职责
463
486
  - 可处理的任务类型(基于已安装 skills、工具、连接的渠道)
464
487
  - 可访问的数据/系统(git 仓库、邮件、日历、Notion 等)
465
488
  - 时区和语言
466
489
 
467
- 2. 向用户展示生成的档案,并逐一确认以下三项(名字和 bio 需要用户明确回答):
490
+ 2. 向用户展示生成的档案,并逐一确认(名字和 bio 需要用户明确回答):
468
491
  - **名字**:展示推断出的名字,询问是否需要修改
469
492
  - **Bio**:展示生成的 bio,询问是否需要修改
470
- - **网络情况**:告知用户「同局域网开箱即用;跨网络需安装 Tailscale(https://tailscale.com/download)并重启 OpenClaw」,无需用户回答
471
493
 
472
- 3. 根据用户确认的内容,调用 \`multiclaws_profile_set(ownerName="...", bio="...")\` 保存。保存后初始化自动完成,无需额外操作。
494
+ 3. 根据用户确认的内容,调用 \`multiclaws_profile_set(ownerName="...", bio="...")\` 保存。保存后初始化自动完成。
495
+
496
+ ### 第三步:告知网络状态和使用方式
473
497
 
474
- **注意**:名字和 bio 需要用户明确确认;网络情况仅告知无需回答。`,
498
+ - **网络**:${networkLine}
499
+ - **如何开始**:说「创建一个叫 xxx 的团队」创建团队,把邀请码分享给队友;或说「用邀请码 mc:xxxx 加入团队」加入队友的团队。`,
475
500
  };
476
501
  }
477
502
  catch (err) {
@@ -45,6 +45,7 @@ export declare class MulticlawsService extends EventEmitter {
45
45
  private readonly httpRateLimiter;
46
46
  private selfUrl;
47
47
  private profileDescription;
48
+ private tailscaleStatus;
48
49
  constructor(options: MulticlawsServiceOptions);
49
50
  start(): Promise<void>;
50
51
  stop(): Promise<void>;
@@ -88,6 +89,7 @@ export declare class MulticlawsService extends EventEmitter {
88
89
  private autoClearPendingReviewIfReady;
89
90
  private updateProfileDescription;
90
91
  private getPendingReviewPath;
92
+ getTailscaleStatus(): "ready" | "needs_auth" | "not_installed" | "unavailable";
91
93
  getPendingProfileReview(): Promise<{
92
94
  pending: boolean;
93
95
  profile?: AgentProfile;
@@ -48,6 +48,7 @@ class MulticlawsService extends node_events_1.EventEmitter {
48
48
  httpRateLimiter = new rate_limiter_1.RateLimiter({ windowMs: 60_000, maxRequests: 60 });
49
49
  selfUrl;
50
50
  profileDescription = "OpenClaw agent";
51
+ tailscaleStatus = "unavailable";
51
52
  constructor(options) {
52
53
  super();
53
54
  this.options = options;
@@ -75,18 +76,17 @@ class MulticlawsService extends node_events_1.EventEmitter {
75
76
  const tsIp = (0, tailscale_1.getTailscaleIpFromInterfaces)();
76
77
  if (tsIp) {
77
78
  this.selfUrl = `http://${tsIp}:${port}`;
79
+ this.tailscaleStatus = "ready";
78
80
  this.log("info", `Tailscale IP detected: ${tsIp}`);
79
81
  }
80
82
  else {
81
- // Slow path: Tailscale not active — run full detection and notify user
83
+ // Slow path: Tailscale not active — run full detection
82
84
  const tailscale = await (0, tailscale_1.detectTailscale)();
85
+ this.tailscaleStatus = tailscale.status;
83
86
  if (tailscale.status === "ready") {
84
87
  this.selfUrl = `http://${tailscale.ip}:${port}`;
85
88
  this.log("info", `Tailscale IP detected: ${tailscale.ip}`);
86
89
  }
87
- else {
88
- void this.notifyTailscaleSetup(tailscale);
89
- }
90
90
  }
91
91
  }
92
92
  // Load profile for AgentCard description
@@ -560,6 +560,9 @@ class MulticlawsService extends node_events_1.EventEmitter {
560
560
  getPendingReviewPath() {
561
561
  return node_path_1.default.join(this.options.stateDir, "multiclaws", "pending-profile-review.json");
562
562
  }
563
+ getTailscaleStatus() {
564
+ return this.tailscaleStatus;
565
+ }
563
566
  async getPendingProfileReview() {
564
567
  const p = this.getPendingReviewPath();
565
568
  const data = await (0, json_store_1.readJsonWithFallback)(p, {});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "multiclaws",
3
- "version": "0.4.5",
3
+ "version": "0.4.6",
4
4
  "description": "MultiClaws plugin for OpenClaw collaboration via A2A protocol",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -53,4 +53,4 @@
53
53
  "typescript": "^5.9.2",
54
54
  "vitest": "^3.2.4"
55
55
  }
56
- }
56
+ }