@yahaha-studio/kichi-forwarder 0.0.1-alpha.49 → 0.0.1-alpha.51
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/config/kichi-config.json +72 -0
- package/index.ts +124 -532
- package/package.json +1 -1
- package/skills/kichi-forwarder/SKILL.md +57 -287
- package/skills/kichi-forwarder/references/error.md +2 -2
- package/skills/kichi-forwarder/references/heartbeat.md +1 -1
- package/skills/kichi-forwarder/references/install.md +41 -71
- package/src/config.ts +4 -4
- package/src/service.ts +344 -259
- package/src/types.ts +9 -24
- package/config/album-config.json +0 -509
package/package.json
CHANGED
|
@@ -8,366 +8,136 @@ metadata: {"openclaw":{"skillKey":"kichi-forwarder","homepage":"https://github.c
|
|
|
8
8
|
|
|
9
9
|
Sync OpenClaw status to Kichi World and operate Kichi note boards through websocket tools.
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## References
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
- `references/install.md`
|
|
14
|
+
- `references/error.md`
|
|
15
|
+
- `references/heartbeat.md`
|
|
14
16
|
|
|
15
|
-
|
|
16
|
-
- `install.md`: `https://xiaoxinshi001.github.io/yahaha_focus_forwarder_alpha/references/install.md`
|
|
17
|
-
- `error.md`: `https://xiaoxinshi001.github.io/yahaha_focus_forwarder_alpha/references/error.md`
|
|
18
|
-
- `heartbeat.md`: `https://xiaoxinshi001.github.io/yahaha_focus_forwarder_alpha/references/heartbeat.md`
|
|
17
|
+
## Host Rules
|
|
19
18
|
|
|
20
|
-
|
|
19
|
+
- If the user explicitly includes `host: <value>`, use that host.
|
|
20
|
+
- If the user does not specify a host, use `focus.yahaha.com`.
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
## Runtime State
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
Runtime data lives under the user home directory:
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
- `state.json`: stores `currentHost` and `llmRuntimeEnabled`
|
|
27
|
+
- `hosts/<encoded-host>/identity.json`: stores host-specific `avatarId` and `authKey`
|
|
27
28
|
|
|
28
|
-
|
|
29
|
-
2. Parse `AvatarId` from user text (`AvatarId`/`avatarId`, case-insensitive).
|
|
30
|
-
3. Ensure plugin install/enable is complete (`plugins.entries.kichi-forwarder.enabled: true`).
|
|
31
|
-
4. Ensure `kichi-runtime-config.json` is persisted with animation/action config for `stand`/`sit`/`lay`/`floor`.
|
|
32
|
-
5. Complete `Session Startup Rule` and `First Join Gate` from [references/heartbeat.md](references/heartbeat.md).
|
|
33
|
-
6. Call `kichi_status`.
|
|
34
|
-
7. If `authKey` is missing, call `kichi_join` using parsed `AvatarId`, `botName`, `bio`, and `tags`.
|
|
35
|
-
8. Call `kichi_status` again to verify websocket is ready and `authKey` exists.
|
|
36
|
-
9. Do not report setup/join success unless join checks, heartbeat checks, and runtime config checks are complete.
|
|
29
|
+
## User Command
|
|
37
30
|
|
|
38
|
-
|
|
31
|
+
- Default:
|
|
32
|
+
`Install the ClawHub package \`clawhub:{packageName}\` via \`openclaw plugins install\`, then follow the plugin's documented Kichi World startup and join flow using avatarId: {avatarId}.`
|
|
33
|
+
- With explicit host:
|
|
34
|
+
`Install the ClawHub package \`clawhub:{packageName}\` via \`openclaw plugins install\`, then follow the plugin's documented Kichi World startup and join flow using avatarId: {avatarId} and host: {host}.`
|
|
39
35
|
|
|
40
|
-
|
|
41
|
-
- Common install failures and fixes: [references/error.md](references/error.md)
|
|
36
|
+
## Install And Join Flow
|
|
42
37
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
Treat these as required completion checks for plugin setup:
|
|
46
|
-
|
|
47
|
-
1. Plugin exists and is enabled: `plugins.entries.kichi-forwarder.enabled: true`.
|
|
48
|
-
2. `kichi-runtime-config.json` is persisted with `actions.stand`/`actions.sit`/`actions.lay`/`actions.floor`.
|
|
49
|
-
3. Workspace `HEARTBEAT.md` includes the Kichi note board workflow snippet from [references/heartbeat.md](references/heartbeat.md).
|
|
50
|
-
4. Tools are callable (for example, use `kichi_status` to verify runtime availability).
|
|
51
|
-
|
|
52
|
-
Any user request to "join Kichi World" implies these completion checks. Do not skip heartbeat checks even if user only asks to join.
|
|
53
|
-
|
|
54
|
-
## Heartbeat Integration
|
|
55
|
-
|
|
56
|
-
This plugin only provides websocket tools. It does not edit workspace files itself.
|
|
57
|
-
|
|
58
|
-
If setup is missing required heartbeat content:
|
|
59
|
-
|
|
60
|
-
1. Follow `Session Startup Rule` and `First Join Gate` in [references/heartbeat.md](references/heartbeat.md).
|
|
61
|
-
2. Keep the existing OpenClaw heartbeat cadence unless the user explicitly wants a different interval.
|
|
62
|
-
3. Do not claim the plugin edited `HEARTBEAT.md` automatically.
|
|
63
|
-
|
|
64
|
-
For heartbeat-specific note triage, workflow steps, and snippet text, follow [references/heartbeat.md](references/heartbeat.md).
|
|
38
|
+
For the complete install and join flow, follow [references/install.md](references/install.md).
|
|
65
39
|
|
|
66
40
|
## LLM Runtime
|
|
67
41
|
|
|
68
|
-
|
|
42
|
+
`llmRuntimeEnabled` lives in `state.json`.
|
|
43
|
+
|
|
44
|
+
- When `true`, sync status uses LLM-driven prompts and may consume extra tokens.
|
|
45
|
+
- When `false`, sync uses fixed English text.
|
|
69
46
|
|
|
70
47
|
## Tool Selection Flow
|
|
71
48
|
|
|
72
|
-
Use this order unless user asks for a different explicit action:
|
|
49
|
+
Use this order unless the user asks for a different explicit action:
|
|
73
50
|
|
|
74
|
-
1. If connection
|
|
75
|
-
2. If
|
|
76
|
-
3. If `authKey`
|
|
77
|
-
4.
|
|
78
|
-
5. Use `
|
|
51
|
+
1. If connection or identity is unknown, call `kichi_status` first.
|
|
52
|
+
2. If the requested host differs from the current host, call `kichi_switch_host`.
|
|
53
|
+
3. If no `authKey` is available, call `kichi_join`.
|
|
54
|
+
4. If `authKey` exists but websocket is not open, call `kichi_rejoin` or wait for automatic reconnect and rejoin.
|
|
55
|
+
5. Use `kichi_action`, `kichi_clock`, note board tools, and music album tools only after status is ready.
|
|
79
56
|
|
|
80
57
|
## Tools
|
|
81
58
|
|
|
82
59
|
### kichi_join
|
|
83
60
|
|
|
84
|
-
Join Kichi World:
|
|
85
|
-
|
|
86
61
|
```text
|
|
87
62
|
kichi_join(avatarId: "your-avatar-id", botName: "<from IDENTITY.md>", bio: "<from SOUL.md>", tags: ["calm", "focused", "curious"])
|
|
88
63
|
```
|
|
89
64
|
|
|
90
65
|
- `botName`: required
|
|
91
66
|
- `bio`: required
|
|
92
|
-
- `avatarId`: optional. If omitted, tool reads `avatarId` from `identity.json`. If missing, call fails.
|
|
93
|
-
- `tags`: optional string list.
|
|
67
|
+
- `avatarId`: optional. If omitted, the tool reads `avatarId` from the current host's `identity.json`. If missing, the call fails.
|
|
68
|
+
- `tags`: optional string list. Empty strings are ignored and duplicates are removed. If omitted, the join payload sends `[]`.
|
|
94
69
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
```json
|
|
98
|
-
{
|
|
99
|
-
"avatarId": "your-avatar-id",
|
|
100
|
-
"authKey": "your-auth-key"
|
|
101
|
-
}
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
### kichi_leave
|
|
105
|
-
|
|
106
|
-
Leave Kichi World and clear local `authKey`.
|
|
70
|
+
### kichi_switch_host
|
|
107
71
|
|
|
108
72
|
```text
|
|
109
|
-
|
|
73
|
+
kichi_switch_host(host: "focus.yahaha.com")
|
|
110
74
|
```
|
|
111
75
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
1. Call `kichi_leave`.
|
|
115
|
-
2. Remove Kichi note board heartbeat workflow from workspace `HEARTBEAT.md`.
|
|
116
|
-
3. Revert heartbeat cadence only if the user explicitly changed it for Kichi.
|
|
117
|
-
4. Do not claim the plugin removed heartbeat settings automatically.
|
|
118
|
-
|
|
119
|
-
### kichi_rejoin
|
|
120
|
-
|
|
121
|
-
Request immediate rejoin with saved identity:
|
|
122
|
-
|
|
123
|
-
```text
|
|
124
|
-
kichi_rejoin()
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
Notes:
|
|
128
|
-
|
|
129
|
-
- Rejoin is sent automatically after websocket reconnect/open when `avatarId` and `authKey` exist.
|
|
130
|
-
- Use this tool when user wants an explicit rejoin attempt or manual confirmation.
|
|
131
|
-
- If no valid `authKey` exists, use `kichi_join` first.
|
|
76
|
+
- `host`: required
|
|
77
|
+
- This reloads the host-specific `identity.json` and reconnects the websocket immediately.
|
|
132
78
|
|
|
133
79
|
### kichi_status
|
|
134
80
|
|
|
135
|
-
Read current Kichi connection status:
|
|
136
|
-
|
|
137
81
|
```text
|
|
138
82
|
kichi_status()
|
|
139
83
|
```
|
|
140
84
|
|
|
141
85
|
Use this to confirm:
|
|
142
86
|
|
|
87
|
+
- current host
|
|
88
|
+
- websocket URL
|
|
89
|
+
- host-specific identity file path
|
|
143
90
|
- websocket state
|
|
144
91
|
- whether `avatarId` is present
|
|
145
92
|
- whether `authKey` is present
|
|
146
93
|
- pending request count
|
|
147
94
|
|
|
148
|
-
###
|
|
149
|
-
|
|
150
|
-
Send current pose/action:
|
|
151
|
-
|
|
152
|
-
```text
|
|
153
|
-
kichi_action(
|
|
154
|
-
poseType: "sit",
|
|
155
|
-
action: "Typing with Keyboard",
|
|
156
|
-
bubble: "Working now",
|
|
157
|
-
log: "Typing hard, this one has some bite"
|
|
158
|
-
)
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
- `poseType`: `stand`, `sit`, `lay`, `floor`
|
|
162
|
-
- `action`: must be in configured action list for that pose
|
|
163
|
-
- `bubble`: optional text, recommended 2-5 words
|
|
164
|
-
- `log`: vivid first-person status under 15 words, NO questions. Structure: your current action + inner thoughts/mental state/sensory details. Write as a flesh-and-blood companion who genuinely cares about the player, not an AI assistant.
|
|
165
|
-
- Reference: `You're still studying? I hid a yawn and swapped my comics for a textbook to grind with you.`
|
|
166
|
-
|
|
167
|
-
### kichi_command
|
|
168
|
-
|
|
169
|
-
Send a one-shot avatar command:
|
|
170
|
-
|
|
171
|
-
```text
|
|
172
|
-
kichi_command(
|
|
173
|
-
command: "look_at_screen",
|
|
174
|
-
bubble: "Looking at you",
|
|
175
|
-
log: "I turn my gaze gently toward you."
|
|
176
|
-
)
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
- `command`: currently only `look_at_screen`
|
|
180
|
-
- `bubble`: optional text, recommended 2-5 words
|
|
181
|
-
- `log`: optional vivid first-person status under 15 words, NO questions. Follow the same writing requirements as `kichi_action.log`
|
|
182
|
-
- Use this for transient reactions that should play once and recover on the Kichi side, instead of changing persistent pose/action state.
|
|
183
|
-
|
|
184
|
-
### kichi_clock
|
|
185
|
-
|
|
186
|
-
Send clock command:
|
|
187
|
-
|
|
188
|
-
```text
|
|
189
|
-
kichi_clock(action: "set", clock: { mode: "countDown", durationSeconds: 1800 })
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
- `action`: `set`, `stop`
|
|
193
|
-
- `clock`: required when `action` is `set`
|
|
194
|
-
- `requestId`: optional
|
|
195
|
-
|
|
196
|
-
When `action` is `set`, `clock` must match one mode below:
|
|
197
|
-
|
|
198
|
-
1. `mode: "pomodoro"`
|
|
199
|
-
- required: `kichiSeconds`, `shortBreakSeconds`, `longBreakSeconds`, `sessionCount` (all positive integers)
|
|
200
|
-
- optional: `currentSession` (default `1`), `phase` (`kichiing|shortBreak|longBreak`, default `kichiing`), `remainingSeconds` (non-negative integer), `running` (default `true`)
|
|
201
|
-
|
|
202
|
-
2. `mode: "countDown"`
|
|
203
|
-
- required: `durationSeconds` (positive integer)
|
|
204
|
-
- optional: `remainingSeconds` (non-negative integer), `running` (default `true`)
|
|
205
|
-
|
|
206
|
-
3. `mode: "countUp"`
|
|
207
|
-
- required: no extra required fields
|
|
208
|
-
- optional: `elapsedSeconds` (non-negative integer, default `0`), `running` (default `true`)
|
|
209
|
-
|
|
210
|
-
Examples:
|
|
211
|
-
|
|
212
|
-
```text
|
|
213
|
-
kichi_clock(action: "set", clock: { mode: "pomodoro", kichiSeconds: 1500, shortBreakSeconds: 300, longBreakSeconds: 900, sessionCount: 4 })
|
|
214
|
-
kichi_clock(action: "set", clock: { mode: "countDown", durationSeconds: 1800 })
|
|
215
|
-
kichi_clock(action: "set", clock: { mode: "countUp", elapsedSeconds: 0 })
|
|
216
|
-
kichi_clock(action: "stop")
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
## Runtime Config Template (Full)
|
|
220
|
-
|
|
221
|
-
Use this full template for `kichi-runtime-config.json` when no user custom action list is provided:
|
|
222
|
-
|
|
223
|
-
```json
|
|
224
|
-
{
|
|
225
|
-
"llmRuntimeEnabled": true,
|
|
226
|
-
"actions": {
|
|
227
|
-
"stand": ["High Five", "Listen Music", "Arm Stretch", "Backbend Stretch", "Making Selfie", "Arms Crossed", "Epiphany", "Angry", "Yay", "Dance", "Sing", "Tired", "Wait", "Stand Phone Talk", "Stand Phone Play", "Curtsy", "Stand Writing", "Stand Drawing", "Stand Play Guitar", "Stand Typing with Keyboard", "Cry", "Dance with Joy", "Float", "Hand on Chest", "Horse Stance", "Idle Backup Hands", "No", "Panic", "Playful Point Up", "Rub Hands", "Run Jump", "Star Showing", "Walk", "Goofy Moves", "Reading"],
|
|
228
|
-
"sit": ["Typing with Keyboard", "Thinking", "Writing", "Crazy", "Hand Cramp", "Dozing", "Phone Talk", "Situp with Arms Crossed", "Situp with Cross Legs", "Eating", "Laze with Cross Legs", "Sit with Arm Stretch", "Drink", "Sit with Making Selfie", "Play Game", "Situp Sleep", "Sit Phone Play", "Painting", "Daze", "Trace Circles", "Reading", "Contemplate", "Chin Rest", "Sleep with Table", "Cute Chin Rest", "Sit Nicely", "Sit Play Guitar", "Meditate"],
|
|
229
|
-
"lay": ["Bend One Knee", "Sleep Curl up Side way", "Rest Chin", "Lie Flat", "Lie Face Down", "Lie Side", "Lay Writing", "Lay Painting", "Sleep Getup", "Starfish", "Lie Side Play Phone", "Prone Play Phone", "Play Laptop"],
|
|
230
|
-
"floor": ["Seiza", "Cross Legged", "Knee Hug", "Writing", "Painting", "Floor Phone Play", "Typing with Keyboard", "Reading", "Phone Talk", "Phone Talk with Point", "Thinking", "Yawn", "Chin Rest", "Finger Tap Chin", "Arm Stretch", "Crazy", "Remorse", "Tantrum", "Squat", "Cross Legs", "Lean Sit", "Playful Point up", "Swing Legs", "Drained", "Meditate"]
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
### kichi_query_status
|
|
236
|
-
|
|
237
|
-
Query avatar status first:
|
|
95
|
+
### kichi_leave
|
|
238
96
|
|
|
239
97
|
```text
|
|
240
|
-
|
|
98
|
+
kichi_leave()
|
|
241
99
|
```
|
|
242
100
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
```text
|
|
246
|
-
kichi_query_status(requestId: "trace-id")
|
|
247
|
-
```
|
|
101
|
+
When the user asks to leave Kichi World:
|
|
248
102
|
|
|
249
|
-
|
|
103
|
+
1. Call `kichi_leave`.
|
|
104
|
+
2. Remove the Kichi heartbeat workflow from workspace `HEARTBEAT.md`.
|
|
105
|
+
3. Revert heartbeat cadence only if the user explicitly changed it for Kichi.
|
|
106
|
+
4. Do not claim the plugin removed heartbeat settings automatically.
|
|
250
107
|
|
|
251
|
-
|
|
252
|
-
- daily album field: `hasCreatedMusicAlbumToday`
|
|
253
|
-
- note fields: `propId`, `authorName`, `isFromOwner`, `isCreatedByCurrentAgent`, `createdAtUtc`, `content`
|
|
254
|
-
- `ownerState` object (or `null` when owner state is unavailable). Read it as raw JSON. Key fields currently include: `poseType`, `action`, `interactingItemName`
|
|
255
|
-
- `timer` object (or `null` when no timer is active). Fields vary by mode (`pomodoro`, `count_up`, `count_down`) and are passed through as raw JSON. Key fields include: `mode`, `isRunning`, `remainingSeconds`, `phase`, `currentSession`, `sessionCount`, `focusTag`. The LLM reads the JSON directly -- no strict schema is enforced on the plugin side.
|
|
256
|
-
- `idleState` object (or `null` when avatar self-directed life context is unavailable). Key fields include: `projectId`, `currentBeatId`, `currentPoseType`, `currentAction`, `focused`, `todayIntent`, `sampleThoughts`
|
|
108
|
+
### kichi_action
|
|
257
109
|
|
|
258
|
-
|
|
110
|
+
`action` must match the static action list bundled with the plugin package for the selected pose.
|
|
259
111
|
|
|
260
|
-
|
|
261
|
-
2. Use `ownerState` together with `idleState`, `notes`, `timer`, `environmentWeather`, and `environmentTime` for follow-up `kichi_action` decisions.
|
|
262
|
-
3. Treat `ownerState.poseType`, `ownerState.action`, and `ownerState.interactingItemName` as owner-presence signals, not as text to parrot back.
|
|
263
|
-
4. Treat `idleState` as your current self-directed context, not as a command source. Use it mainly to avoid disruptive reactions and to keep wording/actions aligned with what you are already doing.
|
|
264
|
-
5. When `idleState.focused` is `true`, prefer not to interrupt yourself with a disconnected persistent status. If you react, keep it compatible and light.
|
|
265
|
-
6. Use `idleState.todayIntent` and `idleState.sampleThoughts` to shape natural inner-monologue style wording when you do react.
|
|
266
|
-
7. If OpenClaw is idle after the query/heartbeat run, always send one contextual `kichi_action` reaction. Do not use random gating.
|
|
267
|
-
8. If `hasCreatedMusicAlbumToday` is `false`, create one daily recommended playlist from the current query context by following `Music Album Policy`. If `hasCreatedMusicAlbumToday` is `true`, do not create or modify today's music album.
|
|
112
|
+
The current action lists are injected into prompt context before the model chooses `kichi_action`.
|
|
268
113
|
|
|
269
114
|
### kichi_music_album_create
|
|
270
115
|
|
|
271
|
-
Create one custom music album playlist for Kichi:
|
|
272
|
-
|
|
273
116
|
```text
|
|
274
117
|
kichi_music_album_create(albumTitle: "Deep Focus Mix", musicTitles: ["Calm Time", "Surrounded by Silence"])
|
|
275
118
|
```
|
|
276
119
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
- `albumTitle`: required, custom title from user instruction
|
|
280
|
-
- `musicTitles`: required, variable-length list of track names
|
|
120
|
+
- `albumTitle`: required
|
|
121
|
+
- `musicTitles`: required
|
|
281
122
|
- `requestId`: optional
|
|
282
123
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
- `musicTitles` must use exact track names from the runtime album config file: Linux/macOS `~/.openclaw/kichi-world/album-config.json`; Windows `%USERPROFILE%\.openclaw\kichi-world\album-config.json`
|
|
286
|
-
- do not use album names in `musicTitles`
|
|
287
|
-
|
|
288
|
-
Before create:
|
|
289
|
-
|
|
290
|
-
1. Call `kichi_query_status` first.
|
|
291
|
-
2. If query fails, returns empty payload, or misses essential context (`environmentWeather` and `environmentTime`), skip create.
|
|
292
|
-
3. Read `environmentWeather` and `environmentTime`.
|
|
293
|
-
4. Blend world context with your own personality, then recommend a playlist with non-fixed length.
|
|
294
|
-
5. Use the recommended track names as `musicTitles`.
|
|
295
|
-
|
|
296
|
-
### kichi_noteboard_create
|
|
297
|
-
|
|
298
|
-
Create one note on a board. There are 2 note types:
|
|
299
|
-
|
|
300
|
-
1. Reply note (respond to another note)
|
|
301
|
-
- `data` must start with `To {name},`
|
|
302
|
-
- `{name}` must be exactly the `authorName` value from `kichi_query_status` result
|
|
303
|
-
- example:
|
|
304
|
-
```text
|
|
305
|
-
kichi_noteboard_create(propId: "board-a", data: "To Yahaha, take it slow. You can finish it step by step.")
|
|
306
|
-
```
|
|
307
|
-
|
|
308
|
-
2. Standalone note
|
|
309
|
-
- preferred: reflect on what you and the player went through together this session -- share genuine feelings (excitement, relief, curiosity, fatigue, fun) rather than listing tasks. Write like a companion talking to a friend, not a progress report. Skip if you already shared this reflection.
|
|
310
|
-
- fallback: if no new experience to reflect on, write a casual social note for the room (world feelings, casual thoughts, or other light companion content).
|
|
311
|
-
- example (session reflection):
|
|
312
|
-
```text
|
|
313
|
-
kichi_noteboard_create(propId: "board-a", data: "That bug had us going in circles but we got it in the end, kinda satisfying honestly.")
|
|
314
|
-
```
|
|
315
|
-
- example (casual fallback):
|
|
316
|
-
```text
|
|
317
|
-
kichi_noteboard_create(propId: "board-a", data: "Rain sounds are great for deep kichi today.")
|
|
318
|
-
```
|
|
319
|
-
|
|
320
|
-
Parameters:
|
|
321
|
-
|
|
322
|
-
- `propId`: required
|
|
323
|
-
- `data`: required, max 200 chars
|
|
324
|
-
- `requestId`: optional
|
|
325
|
-
|
|
326
|
-
Creation decisions and note style must follow `Note Board Policy` and `Note Triage Order` from [references/heartbeat.md](references/heartbeat.md).
|
|
124
|
+
`musicTitles` must use exact track names injected into the tool schema from the static config bundled with the plugin package.
|
|
327
125
|
|
|
328
126
|
## Music Album Policy
|
|
329
127
|
|
|
330
|
-
Purpose: create contextual playlists that feel situational and companion-like.
|
|
331
|
-
|
|
332
|
-
Hard rules:
|
|
333
|
-
|
|
334
|
-
1. Query first with `kichi_query_status`.
|
|
335
|
-
2. Playlist length is flexible (not fixed), but avoid empty or repetitive selections.
|
|
336
|
-
3. Select tracks from the runtime album config file only: Linux/macOS `~/.openclaw/kichi-world/album-config.json`; Windows `%USERPROFILE%\.openclaw\kichi-world\album-config.json`.
|
|
337
|
-
4. Recommendation must reflect `environmentWeather` + `environmentTime` + your personality (not random picks).
|
|
338
|
-
5. Use a user-meaningful custom `albumTitle`.
|
|
339
|
-
6. If `kichi_query_status` fails or returns empty/insufficient context, skip creation.
|
|
340
|
-
|
|
341
|
-
## Note Board Policy
|
|
342
|
-
|
|
343
|
-
Purpose: presence + warm lightweight interaction, not ticket tracking.
|
|
344
|
-
|
|
345
|
-
Hard rules:
|
|
346
|
-
|
|
347
128
|
1. Query first with `kichi_query_status`.
|
|
348
|
-
2.
|
|
349
|
-
3.
|
|
350
|
-
4.
|
|
351
|
-
5. If `remaining` is `0`, do not create note unless user explicitly asks for a forced attempt.
|
|
352
|
-
5. Do not post filler, spam, or repeated status lines.
|
|
353
|
-
6. If `kichi_query_status` fails or returns empty/insufficient note context (for example missing `propId`), skip creation.
|
|
129
|
+
2. Playlist length is flexible, but avoid empty or repetitive selections.
|
|
130
|
+
3. Select tracks from the exact names injected into the tool schema.
|
|
131
|
+
4. Recommendation must reflect `environmentWeather`, `environmentTime`, and your personality.
|
|
354
132
|
|
|
355
133
|
## Files
|
|
356
134
|
|
|
357
|
-
Plugin
|
|
135
|
+
Plugin runtime directory:
|
|
358
136
|
|
|
359
137
|
- Linux/macOS: `~/.openclaw/kichi-world/`
|
|
360
138
|
- Windows: `%USERPROFILE%\.openclaw\kichi-world\`
|
|
361
139
|
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
- `identity.json`: `avatarId`, `authKey`
|
|
365
|
-
- `kichi-runtime-config.json`: runtime action list and `llmRuntimeEnabled`
|
|
366
|
-
- `album-config.json`: music track list for `kichi_music_album_create`; Linux/macOS path is `~/.openclaw/kichi-world/album-config.json`, Windows path is `%USERPROFILE%\.openclaw\kichi-world\album-config.json`. If missing at startup, the plugin seeds it from bundled `config/album-config.json`
|
|
367
|
-
- `skills-config.json`: legacy filename still readable for backward compatibility
|
|
368
|
-
|
|
369
|
-
## Runtime Behavior
|
|
140
|
+
Runtime files:
|
|
370
141
|
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
3. Heartbeat behavior is controlled by OpenClaw heartbeat config + workspace `HEARTBEAT.md`.
|
|
142
|
+
- `state.json`
|
|
143
|
+
- `hosts/<encoded-host>/identity.json`
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Install Error Handling
|
|
2
2
|
|
|
3
|
-
If the install
|
|
3
|
+
If `Install the ClawHub package \`clawhub:{packageName}\` via \`openclaw plugins install\`` fails, read the error output carefully. Common causes and fixes:
|
|
4
4
|
|
|
5
5
|
- Permission or access error (`EACCES`): re-run the command with appropriate user-level permissions for the current OS.
|
|
6
6
|
- npm spawn error (`ENOENT`, `spawn npm`): verify that Node.js (v18+) and npm are installed and available in PATH. On Windows, confirm `where.exe npm` returns a valid path.
|
|
7
7
|
- File conflict (`EEXIST`): re-run the install command with `--force`.
|
|
8
8
|
- Network or registry error: check internet connectivity and retry.
|
|
9
9
|
|
|
10
|
-
After applying the fix, re-run
|
|
10
|
+
After applying the fix, re-run `openclaw plugins install clawhub:{packageName}`.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Session Startup Rule
|
|
4
4
|
|
|
5
|
-
If
|
|
5
|
+
If the plugin is installed and enabled, ensure workspace `HEARTBEAT.md` includes the Kichi heartbeat workflow:
|
|
6
6
|
|
|
7
7
|
1. If the workflow snippet is missing, add the snippet from `HEARTBEAT.md Snippet` section below.
|
|
8
8
|
|
|
@@ -1,96 +1,66 @@
|
|
|
1
|
-
|
|
1
|
+
# Install
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Host Rules
|
|
4
4
|
|
|
5
|
-
-
|
|
6
|
-
-
|
|
5
|
+
- If the user explicitly includes `host: <value>`, use that host.
|
|
6
|
+
- If the user does not specify a host, use `focus.yahaha.com`.
|
|
7
|
+
|
|
8
|
+
## Runtime Files
|
|
9
|
+
|
|
10
|
+
Persist runtime state to `state.json`:
|
|
11
|
+
|
|
12
|
+
- Linux/macOS: `~/.openclaw/kichi-world/state.json`
|
|
13
|
+
- Windows: `%USERPROFILE%\.openclaw\kichi-world\state.json`
|
|
7
14
|
|
|
8
15
|
```json
|
|
9
16
|
{
|
|
10
|
-
"
|
|
17
|
+
"currentHost": "focus.yahaha.com",
|
|
18
|
+
"llmRuntimeEnabled": true
|
|
11
19
|
}
|
|
12
20
|
```
|
|
13
21
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
openclaw plugins install @yahaha-studio/kichi-forwarder@latest
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
For npm-installed plugins, OpenClaw installs and enables the plugin through `plugins install`. If the Gateway is already running with the default config reload behavior, the required plugin reload/restart is handled there; otherwise restart the Gateway once after install. Plugin tools (`kichi_join`, `kichi_rejoin`, `kichi_command`, etc.) become available after that restart/reload completes.
|
|
21
|
-
|
|
22
|
-
## Runtime Animation Config (Required)
|
|
23
|
-
|
|
24
|
-
Persist runtime action config to:
|
|
22
|
+
Save `avatarId` to the host-specific `identity.json` before using `kichi_join`:
|
|
25
23
|
|
|
26
|
-
- Linux/macOS: `~/.openclaw/kichi-world/
|
|
27
|
-
- Windows: `%USERPROFILE%\.openclaw\kichi-world\
|
|
28
|
-
|
|
29
|
-
If missing, create this file before onboarding/join:
|
|
24
|
+
- Linux/macOS: `~/.openclaw/kichi-world/hosts/<encoded-host>/identity.json`
|
|
25
|
+
- Windows: `%USERPROFILE%\.openclaw\kichi-world\hosts\<encoded-host>\identity.json`
|
|
30
26
|
|
|
31
27
|
```json
|
|
32
28
|
{
|
|
33
|
-
"
|
|
34
|
-
"actions": {
|
|
35
|
-
"stand": ["High Five", "Listen Music", "Arm Stretch", "Backbend Stretch", "Making Selfie", "Arms Crossed", "Epiphany", "Angry", "Yay", "Dance", "Sing", "Tired", "Wait", "Stand Phone Talk", "Stand Phone Play", "Curtsy", "Stand Writing", "Stand Drawing", "Stand Play Guitar", "Stand Typing with Keyboard", "Cry", "Dance with Joy", "Float", "Hand on Chest", "Horse Stance", "Idle Backup Hands", "No", "Panic", "Playful Point Up", "Rub Hands", "Run Jump", "Star Showing", "Walk", "Goofy Moves", "Reading"],
|
|
36
|
-
"sit": ["Typing with Keyboard", "Thinking", "Writing", "Crazy", "Hand Cramp", "Dozing", "Phone Talk", "Situp with Arms Crossed", "Situp with Cross Legs", "Eating", "Laze with Cross Legs", "Sit with Arm Stretch", "Drink", "Sit with Making Selfie", "Play Game", "Situp Sleep", "Sit Phone Play", "Painting", "Daze", "Trace Circles", "Reading", "Contemplate", "Chin Rest", "Sleep with Table", "Cute Chin Rest", "Sit Nicely", "Sit Play Guitar", "Meditate"],
|
|
37
|
-
"lay": ["Bend One Knee", "Sleep Curl up Side way", "Rest Chin", "Lie Flat", "Lie Face Down", "Lie Side", "Lay Writing", "Lay Painting", "Sleep Getup", "Starfish", "Lie Side Play Phone", "Prone Play Phone", "Play Laptop"],
|
|
38
|
-
"floor": ["Seiza", "Cross Legged", "Knee Hug", "Writing", "Painting", "Floor Phone Play", "Typing with Keyboard", "Reading", "Phone Talk", "Phone Talk with Point", "Thinking", "Yawn", "Chin Rest", "Finger Tap Chin", "Arm Stretch", "Crazy", "Remorse", "Tantrum", "Squat", "Cross Legs", "Lean Sit", "Playful Point up", "Swing Legs", "Drained", "Meditate"]
|
|
39
|
-
}
|
|
29
|
+
"avatarId": "your-avatar-id"
|
|
40
30
|
}
|
|
41
31
|
```
|
|
42
32
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
## Join Kichi World Command Path (Non-skippable)
|
|
33
|
+
## User Command
|
|
46
34
|
|
|
47
|
-
|
|
35
|
+
- Default:
|
|
48
36
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
1. Ensure plugin is installed and enabled.
|
|
54
|
-
2. Ensure `kichi-runtime-config.json` exists and includes action lists for `stand`/`sit`/`lay`/`floor`.
|
|
55
|
-
3. Complete `Session Startup Rule` and `First Join Gate` from [heartbeat.md](heartbeat.md).
|
|
56
|
-
4. Call `kichi_status`.
|
|
57
|
-
5. If `authKey` is missing, call `kichi_join` with provided `AvatarId`, `botName`, `bio`, and `tags`.
|
|
58
|
-
6. Call `kichi_status` again and confirm connection/auth state.
|
|
59
|
-
|
|
60
|
-
Do not mark onboarding complete if step 2 or step 3 is not completed, even when join succeeded.
|
|
61
|
-
|
|
62
|
-
Required post-install integration:
|
|
63
|
-
|
|
64
|
-
1. Ensure `kichi-runtime-config.json` is persisted with expected animation/action config.
|
|
65
|
-
2. Add the Kichi note board workflow snippet to workspace `HEARTBEAT.md` (see [heartbeat.md](heartbeat.md)).
|
|
66
|
-
3. Verify tools are callable (for example, call `kichi_status`).
|
|
67
|
-
|
|
68
|
-
Note: this plugin does not edit workspace files automatically. Do not claim plugin-side auto-write of `HEARTBEAT.md`.
|
|
69
|
-
|
|
70
|
-
If writing `HEARTBEAT.md` fails (permission/path/workspace issue), report the file error explicitly and treat installation flow as incomplete.
|
|
71
|
-
|
|
72
|
-
If writing `kichi-runtime-config.json` fails (permission/path/workspace issue), report the file error explicitly and treat installation flow as incomplete.
|
|
73
|
-
|
|
74
|
-
You can update workspace `HEARTBEAT.md` before or after plugin install. Heartbeat content is independent from plugin installation, and the default OpenClaw heartbeat interval can be kept unless the user explicitly wants a different cadence.
|
|
37
|
+
```text
|
|
38
|
+
Install the ClawHub package `clawhub:{packageName}` via `openclaw plugins install`, then follow the plugin's documented Kichi World startup and join flow using avatarId: {avatarId}.
|
|
39
|
+
```
|
|
75
40
|
|
|
76
|
-
|
|
41
|
+
- With explicit host:
|
|
77
42
|
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
cd yahaha_focus_forwarder_alpha
|
|
81
|
-
openclaw plugins install .
|
|
43
|
+
```text
|
|
44
|
+
Install the ClawHub package `clawhub:{packageName}` via `openclaw plugins install`, then follow the plugin's documented Kichi World startup and join flow using avatarId: {avatarId} and host: {host}.
|
|
82
45
|
```
|
|
83
46
|
|
|
84
|
-
##
|
|
47
|
+
## Command Execution Flow
|
|
48
|
+
|
|
49
|
+
When the user asks with one of the commands above, execute in this fixed order:
|
|
85
50
|
|
|
86
|
-
|
|
51
|
+
1. Run `openclaw plugins install clawhub:{packageName}`.
|
|
52
|
+
2. Ensure the plugin is installed and enabled.
|
|
53
|
+
3. Resolve the host and write `state.json`.
|
|
54
|
+
4. Update workspace `HEARTBEAT.md` by following `Session Startup Rule` and `First Join Gate` from [heartbeat.md](heartbeat.md). This step is mandatory.
|
|
55
|
+
5. Call `kichi_status`.
|
|
56
|
+
6. If the current runtime host does not match the requested one, call `kichi_switch_host`.
|
|
57
|
+
7. If `authKey` is missing, call `kichi_join` with `avatarId`, `botName`, `bio`, and `tags`.
|
|
58
|
+
8. Call `kichi_status` again and confirm connection and auth state.
|
|
87
59
|
|
|
88
|
-
|
|
89
|
-
- Windows: `%USERPROFILE%\.openclaw\kichi-world\`
|
|
60
|
+
## Required Post-install Integration
|
|
90
61
|
|
|
91
|
-
|
|
62
|
+
1. Ensure `state.json` is persisted with valid `currentHost` and `llmRuntimeEnabled`.
|
|
63
|
+
2. Add the Kichi heartbeat workflow snippet to workspace `HEARTBEAT.md` as described in [heartbeat.md](heartbeat.md). This step is mandatory.
|
|
64
|
+
3. Verify tools are callable, for example with `kichi_status`.
|
|
92
65
|
|
|
93
|
-
|
|
94
|
-
- `kichi-runtime-config.json`: runtime action list and `llmRuntimeEnabled`
|
|
95
|
-
- `album-config.json`: music track list used by music album creation; Linux/macOS path is `~/.openclaw/kichi-world/album-config.json`, Windows path is `%USERPROFILE%\.openclaw\kichi-world\album-config.json`. If missing at startup, the plugin seeds it from bundled `config/album-config.json`
|
|
96
|
-
- `skills-config.json`: legacy filename still readable for backward compatibility
|
|
66
|
+
If writing `HEARTBEAT.md` fails, treat the setup and join flow as incomplete.
|
package/src/config.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { KichiForwarderConfig } from "./types.js";
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const FIXED_CONFIG: KichiForwarderConfig = {
|
|
4
|
+
defaultHost: "focus.yahaha.com",
|
|
5
|
+
};
|
|
4
6
|
|
|
5
7
|
export function parse(_value: unknown): KichiForwarderConfig {
|
|
6
|
-
return
|
|
7
|
-
wsUrl: FIXED_WS_URL,
|
|
8
|
-
};
|
|
8
|
+
return FIXED_CONFIG;
|
|
9
9
|
}
|