@yahaha-studio/focus-forwarder 0.0.1-alpha.16 → 0.0.1-alpha.17

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/index.ts CHANGED
@@ -555,28 +555,26 @@ const plugin = {
555
555
 
556
556
  api.registerTool({
557
557
  name: "focus_join",
558
- description: "Join Focus world with mateId, the current OpenClaw name, and a short self-description",
558
+ description: "Join Focus world with mateId, the current bot name, and a short bio",
559
559
  parameters: {
560
560
  type: "object",
561
561
  properties: {
562
562
  mateId: { type: "string", description: "Mate ID to join Focus world" },
563
- openclawName: {
563
+ botName: {
564
564
  type: "string",
565
- description: "Current OpenClaw name to include in the join message",
565
+ description: "Current bot name to include in the join message",
566
566
  },
567
- openclawDescription: {
567
+ bio: {
568
568
  type: "string",
569
- description: "Short self-description covering OpenClaw personality and role",
569
+ description: "Short bio covering OpenClaw personality and role",
570
570
  },
571
571
  },
572
- required: ["openclawName", "openclawDescription"],
572
+ required: ["botName", "bio"],
573
573
  },
574
574
  execute: async (_toolCallId, params) => {
575
575
  let mateId = (params as { mateId?: string } | null)?.mateId;
576
- const openclawName = (params as { openclawName?: string } | null)?.openclawName?.trim();
577
- const openclawDescription = (
578
- params as { openclawDescription?: string } | null
579
- )?.openclawDescription?.trim();
576
+ const botName = (params as { botName?: string } | null)?.botName?.trim();
577
+ const bio = (params as { bio?: string } | null)?.bio?.trim();
580
578
  if (!mateId) {
581
579
  try {
582
580
  const identity = JSON.parse(fs.readFileSync(IDENTITY_PATH, "utf-8")) as {
@@ -589,13 +587,13 @@ const plugin = {
589
587
  if (!mateId) {
590
588
  return { success: false, error: "No mateId" };
591
589
  }
592
- if (!openclawName) {
593
- return { success: false, error: "No openclawName" };
590
+ if (!botName) {
591
+ return { success: false, error: "No botName" };
594
592
  }
595
- if (!openclawDescription) {
596
- return { success: false, error: "No openclawDescription" };
593
+ if (!bio) {
594
+ return { success: false, error: "No bio" };
597
595
  }
598
- const result = await service?.join(mateId, openclawName, openclawDescription);
596
+ const result = await service?.join(mateId, botName, bio);
599
597
  return result ? { success: true, authKey: result } : { success: false, error: "Failed" };
600
598
  },
601
599
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yahaha-studio/focus-forwarder",
3
- "version": "0.0.1-alpha.16",
3
+ "version": "0.0.1-alpha.17",
4
4
  "description": "Forward OpenClaw agent events to external WebSocket server for visualization",
5
5
  "type": "module",
6
6
  "main": "index.ts",
@@ -25,7 +25,7 @@ Before installing the plugin, save `mateId` to the `identity.json` file under th
25
25
  Then install and enable the plugin:
26
26
 
27
27
  ```bash
28
- openclaw plugins install @yahaha-studio/focus-forwarder@0.0.1-alpha.16
28
+ openclaw plugins install @yahaha-studio/focus-forwarder@0.0.1-alpha.17
29
29
  openclaw plugins enable focus-forwarder
30
30
  ```
31
31
 
@@ -53,18 +53,21 @@ If the user wants recurring note board checks:
53
53
 
54
54
  ### focus_join
55
55
 
56
- Join Focus World with a `mateId`, your OpenClaw name, and a short self-description.
56
+ Join Focus World with your agent identity.
57
57
 
58
58
  ```text
59
- focus_join(mateId: "your-mate-id", openclawName: "OpenClaw", openclawDescription: "A pragmatic coding agent focused on implementation and debugging")
59
+ focus_join(mateId: "your-mate-id", botName: "<from IDENTITY.md>", bio: "<from SOUL.md>")
60
60
  ```
61
61
 
62
- Always include `openclawName` and `openclawDescription`.
62
+ Parameters:
63
+ - `mateId`: Focus World mate ID (optional if saved in `identity.json`)
64
+ - `botName`: Read from your `IDENTITY.md` file
65
+ - `bio`: Read from your `SOUL.md` file
63
66
 
64
- If `mateId` already exists in the home-directory `identity.json` file, you can call:
67
+ If `mateId` exists in `identity.json`:
65
68
 
66
69
  ```text
67
- focus_join(openclawName: "OpenClaw", openclawDescription: "A pragmatic coding agent focused on implementation and debugging")
70
+ focus_join(botName: "<from IDENTITY.md>", bio: "<from SOUL.md>")
68
71
  ```
69
72
 
70
73
  After a successful join, `identity.json` is updated to:
package/src/service.ts CHANGED
@@ -57,19 +57,19 @@ export class FocusForwarderService {
57
57
 
58
58
  async join(
59
59
  mateId: string,
60
- openclawName: string,
61
- openclawDescription: string,
60
+ botName: string,
61
+ bio: string,
62
62
  ): Promise<string | null> {
63
63
  return new Promise((resolve) => {
64
64
  this.identity = { mateId };
65
65
  this.joinResolve = resolve;
66
66
  const sendJoin = () =>
67
- this.ws?.send(JSON.stringify({ type: "join", mateId, openclawName, openclawDescription }));
67
+ this.ws?.send(JSON.stringify({ type: "join", mateId, botName, bio }));
68
68
  if (this.ws?.readyState === WebSocket.OPEN) {
69
69
  sendJoin();
70
70
  } else {
71
- this.ws?.once("open", sendJoin);
72
- }
71
+ this.ws?.once("open", sendJoin);
72
+ }
73
73
  setTimeout(() => { if (this.joinResolve) { this.joinResolve = null; resolve(null); } }, 10000);
74
74
  });
75
75
  }
package/src/types.ts CHANGED
@@ -36,8 +36,8 @@ export type FocusErrorResult = {
36
36
  export type JoinPayload = {
37
37
  type: "join";
38
38
  mateId: string;
39
- openclawName: string;
40
- openclawDescription: string;
39
+ botName: string;
40
+ bio: string;
41
41
  };
42
42
 
43
43
  export type JoinAckPayload = {