@yahaha-studio/focus-forwarder 0.0.1-alpha.0 → 0.0.1-alpha.1
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/package.json +1 -1
- package/skills/focus-forwarder/SKILL.md +19 -5
- package/src/service.ts +17 -2
package/package.json
CHANGED
|
@@ -10,14 +10,22 @@ Sync your working status to Focus virtual world, and perform actions on command.
|
|
|
10
10
|
|
|
11
11
|
## Plugin Setup
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Before installing the plugin, save `userId` to `~/.openclaw/focus-world/identity.json`:
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{
|
|
17
|
+
"userId": "your-user-id"
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Then install and enable the plugin:
|
|
14
22
|
|
|
15
23
|
```bash
|
|
16
|
-
openclaw plugins install @yahaha-studio/focus-forwarder@0.0.
|
|
24
|
+
openclaw plugins install @yahaha-studio/focus-forwarder@0.0.1-alpha.1
|
|
17
25
|
openclaw plugins enable focus-forwarder
|
|
18
26
|
```
|
|
19
27
|
|
|
20
|
-
Manual step required: restart OpenClaw after enabling the plugin.
|
|
28
|
+
Manual step required: restart OpenClaw after enabling the plugin (user must do this manually).
|
|
21
29
|
|
|
22
30
|
## Tools
|
|
23
31
|
|
|
@@ -29,7 +37,13 @@ Join Focus World with a userId.
|
|
|
29
37
|
focus_join(userId: "your-user-id")
|
|
30
38
|
```
|
|
31
39
|
|
|
32
|
-
|
|
40
|
+
If `userId` already exists in `~/.openclaw/focus-world/identity.json`, you can call:
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
focus_join()
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
`authKey` is automatically saved to `~/.openclaw/focus-world/identity.json`.
|
|
33
47
|
|
|
34
48
|
### focus_leave
|
|
35
49
|
|
|
@@ -128,7 +142,7 @@ User says: "Lie flat"
|
|
|
128
142
|
|
|
129
143
|
## Files
|
|
130
144
|
|
|
131
|
-
- `~/.openclaw/focus-world/identity.json` - userId and authKey (managed by plugin)
|
|
145
|
+
- `~/.openclaw/focus-world/identity.json` - userId (bootstrap) and authKey (managed by plugin)
|
|
132
146
|
- `~/.openclaw/focus-world/skills-config.json` - actions and fallbacks config
|
|
133
147
|
|
|
134
148
|
## Skills Config
|
package/src/service.ts
CHANGED
|
@@ -112,9 +112,24 @@ export class FocusForwarderService {
|
|
|
112
112
|
this.logger.info("AuthKey cleared");
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
sendStatus(
|
|
115
|
+
sendStatus(poseType: string, action: string, bubble: string, log: string): void {
|
|
116
116
|
if (!this.identity?.authKey || this.ws?.readyState !== WebSocket.OPEN) return;
|
|
117
|
-
|
|
117
|
+
// Build actions object with the active pose
|
|
118
|
+
const actions = {
|
|
119
|
+
stand: poseType === "stand" ? action : "",
|
|
120
|
+
sit: poseType === "sit" ? action : "",
|
|
121
|
+
lay: poseType === "lay" ? action : "",
|
|
122
|
+
floor: poseType === "floor" ? action : "",
|
|
123
|
+
};
|
|
124
|
+
this.ws.send(JSON.stringify({
|
|
125
|
+
type: "status",
|
|
126
|
+
userId: this.identity.userId,
|
|
127
|
+
authKey: this.identity.authKey,
|
|
128
|
+
poseType,
|
|
129
|
+
actions,
|
|
130
|
+
bubble,
|
|
131
|
+
log
|
|
132
|
+
}));
|
|
118
133
|
}
|
|
119
134
|
|
|
120
135
|
isConnected(): boolean { return this.ws?.readyState === WebSocket.OPEN && !!this.identity?.authKey; }
|