@yahaha-studio/kichi-forwarder 0.0.1-alpha.49 → 0.0.1-alpha.50
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 +108 -133
- package/package.json +1 -1
- package/skills/kichi-forwarder/SKILL.md +60 -279
- package/skills/kichi-forwarder/references/install.md +42 -61
- package/src/config.ts +15 -4
- package/src/service.ts +345 -233
- package/src/types.ts +12 -5
- package/config/album-config.json +0 -509
|
@@ -10,136 +10,107 @@ Sync OpenClaw status to Kichi World and operate Kichi note boards through websoc
|
|
|
10
10
|
|
|
11
11
|
## Skill Files (Absolute URLs)
|
|
12
12
|
|
|
13
|
-
If this skill is loaded from a remote URL
|
|
13
|
+
If this skill is loaded from a remote URL before local installation, use these files:
|
|
14
14
|
|
|
15
15
|
- `SKILL.md`: `https://xiaoxinshi001.github.io/yahaha_focus_forwarder_alpha/SKILL.md`
|
|
16
16
|
- `install.md`: `https://xiaoxinshi001.github.io/yahaha_focus_forwarder_alpha/references/install.md`
|
|
17
17
|
- `error.md`: `https://xiaoxinshi001.github.io/yahaha_focus_forwarder_alpha/references/error.md`
|
|
18
18
|
- `heartbeat.md`: `https://xiaoxinshi001.github.io/yahaha_focus_forwarder_alpha/references/heartbeat.md`
|
|
19
19
|
|
|
20
|
+
## Environment Resolution
|
|
21
|
+
|
|
22
|
+
Resolve environment before installation, join, or manual environment switching:
|
|
23
|
+
|
|
24
|
+
- If the user does not specify any environment, use production (`prod`).
|
|
25
|
+
- `test environment` or `playtest` means `dev`.
|
|
26
|
+
- `local environment` or `local` means `local`.
|
|
27
|
+
- If multiple environment signals appear in the same request, stop and ask the user to clarify.
|
|
28
|
+
|
|
29
|
+
## Runtime State
|
|
30
|
+
|
|
31
|
+
Runtime data lives under the user home directory:
|
|
32
|
+
|
|
33
|
+
- `state.json`: stores `currentEnv` and `llmRuntimeEnabled`
|
|
34
|
+
- `env/<env>/identity.json`: stores environment-specific `avatarId` and `authKey`
|
|
35
|
+
|
|
20
36
|
## Remote URL Join Command (Mandatory Flow)
|
|
21
37
|
|
|
22
|
-
When user instruction is:
|
|
38
|
+
When user instruction is like:
|
|
23
39
|
|
|
24
|
-
`Read https://xiaoxinshi001.github.io/yahaha_focus_forwarder_alpha/SKILL.md
|
|
40
|
+
`Read https://xiaoxinshi001.github.io/yahaha_focus_forwarder_alpha/SKILL.md and connect me to Kichi World with AvatarId: <id>`
|
|
25
41
|
|
|
26
42
|
run this exact sequence without skipping steps:
|
|
27
43
|
|
|
28
44
|
1. Read `install.md` and `heartbeat.md` from the absolute URLs above before any tool call.
|
|
29
45
|
2. Parse `AvatarId` from user text (`AvatarId`/`avatarId`, case-insensitive).
|
|
30
|
-
3.
|
|
31
|
-
4. Ensure
|
|
46
|
+
3. Resolve the target environment using the rules above.
|
|
47
|
+
4. Ensure the plugin is installed and enabled.
|
|
32
48
|
5. Complete `Session Startup Rule` and `First Join Gate` from [references/heartbeat.md](references/heartbeat.md).
|
|
33
49
|
6. Call `kichi_status`.
|
|
34
|
-
7. If
|
|
35
|
-
8.
|
|
36
|
-
9.
|
|
37
|
-
|
|
38
|
-
## Setup and Troubleshooting References
|
|
39
|
-
|
|
40
|
-
- Install/enable flow, `identity.json`, and plugin data files: [references/install.md](references/install.md)
|
|
41
|
-
- Common install failures and fixes: [references/error.md](references/error.md)
|
|
50
|
+
7. If the current environment does not match the target environment, call `kichi_switch_env`.
|
|
51
|
+
8. If `authKey` is missing, call `kichi_join` using parsed `AvatarId`, `botName`, `bio`, and `tags`.
|
|
52
|
+
9. Call `kichi_status` again to verify websocket is ready and `authKey` exists.
|
|
53
|
+
10. Do not report setup or join success unless join checks and heartbeat checks are complete.
|
|
42
54
|
|
|
43
55
|
## Installation Completion Checks
|
|
44
56
|
|
|
45
57
|
Treat these as required completion checks for plugin setup:
|
|
46
58
|
|
|
47
|
-
1.
|
|
48
|
-
2. `
|
|
59
|
+
1. The plugin is installed and enabled.
|
|
60
|
+
2. `state.json` exists with valid `currentEnv` and `llmRuntimeEnabled`.
|
|
49
61
|
3. Workspace `HEARTBEAT.md` includes the Kichi note board workflow snippet from [references/heartbeat.md](references/heartbeat.md).
|
|
50
|
-
4. Tools are callable
|
|
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).
|
|
62
|
+
4. Tools are callable, for example `kichi_status`.
|
|
65
63
|
|
|
66
64
|
## LLM Runtime
|
|
67
65
|
|
|
68
|
-
|
|
66
|
+
`llmRuntimeEnabled` lives in `state.json`.
|
|
67
|
+
|
|
68
|
+
- When `true`, sync status uses LLM-driven prompts and may consume extra tokens.
|
|
69
|
+
- When `false`, sync uses fixed English text.
|
|
69
70
|
|
|
70
71
|
## Tool Selection Flow
|
|
71
72
|
|
|
72
|
-
Use this order unless user asks for a different explicit action:
|
|
73
|
+
Use this order unless the user asks for a different explicit action:
|
|
73
74
|
|
|
74
|
-
1. If connection
|
|
75
|
-
2. If
|
|
76
|
-
3. If `authKey`
|
|
77
|
-
4.
|
|
78
|
-
5. Use `
|
|
75
|
+
1. If connection or identity is unknown, call `kichi_status` first.
|
|
76
|
+
2. If the request implies `local` or `dev` and the current environment is wrong, call `kichi_switch_env`.
|
|
77
|
+
3. If no `authKey` is available, call `kichi_join`.
|
|
78
|
+
4. If `authKey` exists but websocket is not open, call `kichi_rejoin` or wait for automatic reconnect and rejoin.
|
|
79
|
+
5. Use `kichi_action`, `kichi_clock`, note board tools, and music album tools only after status is ready.
|
|
79
80
|
|
|
80
81
|
## Tools
|
|
81
82
|
|
|
82
83
|
### kichi_join
|
|
83
84
|
|
|
84
|
-
Join Kichi World:
|
|
85
|
-
|
|
86
85
|
```text
|
|
87
86
|
kichi_join(avatarId: "your-avatar-id", botName: "<from IDENTITY.md>", bio: "<from SOUL.md>", tags: ["calm", "focused", "curious"])
|
|
88
87
|
```
|
|
89
88
|
|
|
90
89
|
- `botName`: required
|
|
91
90
|
- `bio`: required
|
|
92
|
-
- `avatarId`: optional. If omitted, tool reads `avatarId` from `identity.json`. If missing, call fails.
|
|
93
|
-
- `tags`: optional string list.
|
|
94
|
-
|
|
95
|
-
On success, `identity.json` contains:
|
|
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`.
|
|
107
|
-
|
|
108
|
-
```text
|
|
109
|
-
kichi_leave()
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
When user asks to call `kichi_leave`:
|
|
91
|
+
- `avatarId`: optional. If omitted, the tool reads `avatarId` from the current environment's `identity.json`. If missing, the call fails.
|
|
92
|
+
- `tags`: optional string list. Empty strings are ignored and duplicates are removed. If omitted, the join payload sends `[]`.
|
|
113
93
|
|
|
114
|
-
|
|
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:
|
|
94
|
+
### kichi_switch_env
|
|
122
95
|
|
|
123
96
|
```text
|
|
124
|
-
|
|
97
|
+
kichi_switch_env(env: "dev")
|
|
125
98
|
```
|
|
126
99
|
|
|
127
|
-
|
|
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.
|
|
100
|
+
- `env`: required, must be `local`, `dev`, or `prod`
|
|
101
|
+
- This reloads the environment-specific `identity.json` and reconnects the websocket immediately.
|
|
132
102
|
|
|
133
103
|
### kichi_status
|
|
134
104
|
|
|
135
|
-
Read current Kichi connection status:
|
|
136
|
-
|
|
137
105
|
```text
|
|
138
106
|
kichi_status()
|
|
139
107
|
```
|
|
140
108
|
|
|
141
109
|
Use this to confirm:
|
|
142
110
|
|
|
111
|
+
- current environment
|
|
112
|
+
- websocket URL
|
|
113
|
+
- environment-specific identity file path
|
|
143
114
|
- websocket state
|
|
144
115
|
- whether `avatarId` is present
|
|
145
116
|
- whether `authKey` is present
|
|
@@ -147,227 +118,37 @@ Use this to confirm:
|
|
|
147
118
|
|
|
148
119
|
### kichi_action
|
|
149
120
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
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:
|
|
238
|
-
|
|
239
|
-
```text
|
|
240
|
-
kichi_query_status()
|
|
241
|
-
```
|
|
242
|
-
|
|
243
|
-
Optional:
|
|
244
|
-
|
|
245
|
-
```text
|
|
246
|
-
kichi_query_status(requestId: "trace-id")
|
|
247
|
-
```
|
|
248
|
-
|
|
249
|
-
Current response includes:
|
|
250
|
-
|
|
251
|
-
- quota/status fields: `dailyLimit`, `remaining`, `isAvatarInScene`, `environmentWeather`, `environmentTime`, `errorCode`, `errorMessage`
|
|
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`
|
|
257
|
-
|
|
258
|
-
After query:
|
|
259
|
-
|
|
260
|
-
1. Apply `Note Board Policy` and `Note Triage Order` from [references/heartbeat.md](references/heartbeat.md) before deciding whether to post.
|
|
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.
|
|
121
|
+
`action` must match the static action list bundled with the plugin package for the selected pose.
|
|
122
|
+
|
|
123
|
+
The current action lists are injected into prompt context before the model chooses `kichi_action`.
|
|
268
124
|
|
|
269
125
|
### kichi_music_album_create
|
|
270
126
|
|
|
271
|
-
Create one custom music album playlist for Kichi:
|
|
272
|
-
|
|
273
127
|
```text
|
|
274
128
|
kichi_music_album_create(albumTitle: "Deep Focus Mix", musicTitles: ["Calm Time", "Surrounded by Silence"])
|
|
275
129
|
```
|
|
276
130
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
- `albumTitle`: required, custom title from user instruction
|
|
280
|
-
- `musicTitles`: required, variable-length list of track names
|
|
131
|
+
- `albumTitle`: required
|
|
132
|
+
- `musicTitles`: required
|
|
281
133
|
- `requestId`: optional
|
|
282
134
|
|
|
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).
|
|
135
|
+
`musicTitles` must use exact track names injected into the tool schema from the static config bundled with the plugin package.
|
|
327
136
|
|
|
328
137
|
## Music Album Policy
|
|
329
138
|
|
|
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
139
|
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.
|
|
140
|
+
2. Playlist length is flexible, but avoid empty or repetitive selections.
|
|
141
|
+
3. Select tracks from the exact names injected into the tool schema.
|
|
142
|
+
4. Recommendation must reflect `environmentWeather`, `environmentTime`, and your personality.
|
|
354
143
|
|
|
355
144
|
## Files
|
|
356
145
|
|
|
357
|
-
Plugin
|
|
146
|
+
Plugin runtime directory:
|
|
358
147
|
|
|
359
148
|
- Linux/macOS: `~/.openclaw/kichi-world/`
|
|
360
149
|
- Windows: `%USERPROFILE%\.openclaw\kichi-world\`
|
|
361
150
|
|
|
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
|
|
151
|
+
Runtime files:
|
|
370
152
|
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
3. Heartbeat behavior is controlled by OpenClaw heartbeat config + workspace `HEARTBEAT.md`.
|
|
153
|
+
- `state.json`
|
|
154
|
+
- `env/<env>/identity.json`
|
|
@@ -1,96 +1,77 @@
|
|
|
1
|
-
|
|
1
|
+
# Install
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Resolve Environment First
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
- Windows: `%USERPROFILE%\.openclaw\kichi-world\identity.json`
|
|
5
|
+
Resolve environment before installation, join, or manual switching:
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
```
|
|
7
|
+
- If the user does not specify any environment, use production (`prod`).
|
|
8
|
+
- `test environment` or `playtest` means `dev`.
|
|
9
|
+
- `local environment` or `local` means `local`.
|
|
10
|
+
- If the request contains conflicting environment signals, stop and ask for clarification.
|
|
13
11
|
|
|
14
|
-
|
|
12
|
+
## Runtime Files
|
|
15
13
|
|
|
16
|
-
|
|
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.
|
|
14
|
+
Persist runtime state to `state.json`:
|
|
21
15
|
|
|
22
|
-
|
|
16
|
+
- Linux/macOS: `~/.openclaw/kichi-world/state.json`
|
|
17
|
+
- Windows: `%USERPROFILE%\.openclaw\kichi-world\state.json`
|
|
23
18
|
|
|
24
|
-
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"currentEnv": "prod",
|
|
22
|
+
"llmRuntimeEnabled": true
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
- Windows: `%USERPROFILE%\.openclaw\kichi-world\kichi-runtime-config.json`
|
|
26
|
+
Save `avatarId` to the environment-specific `identity.json` before using `kichi_join`:
|
|
28
27
|
|
|
29
|
-
|
|
28
|
+
- Linux/macOS: `~/.openclaw/kichi-world/env/<env>/identity.json`
|
|
29
|
+
- Windows: `%USERPROFILE%\.openclaw\kichi-world\env\<env>\identity.json`
|
|
30
30
|
|
|
31
31
|
```json
|
|
32
32
|
{
|
|
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
|
-
}
|
|
33
|
+
"avatarId": "your-avatar-id"
|
|
40
34
|
}
|
|
41
35
|
```
|
|
42
36
|
|
|
43
|
-
|
|
37
|
+
## Install
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
openclaw plugins install @yahaha-studio/kichi-forwarder@latest
|
|
41
|
+
```
|
|
44
42
|
|
|
45
43
|
## Join Kichi World Command Path (Non-skippable)
|
|
46
44
|
|
|
47
|
-
If user asks:
|
|
45
|
+
If the user asks:
|
|
48
46
|
|
|
49
|
-
`Read https://xiaoxinshi001.github.io/yahaha_focus_forwarder_alpha/SKILL.md
|
|
47
|
+
`Read https://xiaoxinshi001.github.io/yahaha_focus_forwarder_alpha/SKILL.md and connect me to Kichi World with AvatarId: <id>`
|
|
50
48
|
|
|
51
49
|
execute in this fixed order:
|
|
52
50
|
|
|
53
|
-
1.
|
|
54
|
-
2. Ensure
|
|
51
|
+
1. Resolve the environment and write `state.json`.
|
|
52
|
+
2. Ensure plugin is installed and enabled.
|
|
55
53
|
3. Complete `Session Startup Rule` and `First Join Gate` from [heartbeat.md](heartbeat.md).
|
|
56
54
|
4. Call `kichi_status`.
|
|
57
|
-
5. If
|
|
58
|
-
6.
|
|
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:
|
|
55
|
+
5. If the current runtime environment does not match the requested one, call `kichi_switch_env`.
|
|
56
|
+
6. If `authKey` is missing, call `kichi_join` with provided `AvatarId`, `botName`, `bio`, and `tags`.
|
|
57
|
+
7. Call `kichi_status` again and confirm connection and auth state.
|
|
63
58
|
|
|
64
|
-
|
|
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`).
|
|
59
|
+
## Required Post-install Integration
|
|
67
60
|
|
|
68
|
-
|
|
61
|
+
1. Ensure `state.json` is persisted with valid `currentEnv` and `llmRuntimeEnabled`.
|
|
62
|
+
2. Add the Kichi note board workflow snippet to workspace `HEARTBEAT.md` as described in [heartbeat.md](heartbeat.md).
|
|
63
|
+
3. Verify tools are callable, for example with `kichi_status`.
|
|
69
64
|
|
|
70
|
-
|
|
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.
|
|
75
|
-
|
|
76
|
-
If the registry install cannot be resolved, install from source:
|
|
77
|
-
|
|
78
|
-
```bash
|
|
79
|
-
git clone https://github.com/XiaoxinShi001/yahaha_focus_forwarder_alpha
|
|
80
|
-
cd yahaha_focus_forwarder_alpha
|
|
81
|
-
openclaw plugins install .
|
|
82
|
-
```
|
|
65
|
+
This plugin does not edit workspace files automatically. Do not claim plugin-side auto-write of `HEARTBEAT.md`.
|
|
83
66
|
|
|
84
67
|
## Files
|
|
85
68
|
|
|
86
|
-
Plugin
|
|
69
|
+
Plugin runtime directory:
|
|
87
70
|
|
|
88
71
|
- Linux/macOS: `~/.openclaw/kichi-world/`
|
|
89
72
|
- Windows: `%USERPROFILE%\.openclaw\kichi-world\`
|
|
90
73
|
|
|
91
|
-
|
|
74
|
+
Runtime files:
|
|
92
75
|
|
|
93
|
-
- `
|
|
94
|
-
- `
|
|
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
|
|
76
|
+
- `state.json`
|
|
77
|
+
- `env/<env>/identity.json`
|
package/src/config.ts
CHANGED
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
import type { KichiForwarderConfig } from "./types.js";
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const FIXED_CONFIG: KichiForwarderConfig = {
|
|
4
|
+
defaultEnv: "prod",
|
|
5
|
+
envs: {
|
|
6
|
+
local: {
|
|
7
|
+
wsUrl: "ws://127.0.0.1:48870/ws/openclaw",
|
|
8
|
+
},
|
|
9
|
+
dev: {
|
|
10
|
+
wsUrl: "ws://43.106.148.251:48870/ws/openclaw",
|
|
11
|
+
},
|
|
12
|
+
prod: {
|
|
13
|
+
wsUrl: "wss://focus.yahaha.com:48870/ws/openclaw",
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
};
|
|
4
17
|
|
|
5
18
|
export function parse(_value: unknown): KichiForwarderConfig {
|
|
6
|
-
return
|
|
7
|
-
wsUrl: FIXED_WS_URL,
|
|
8
|
-
};
|
|
19
|
+
return FIXED_CONFIG;
|
|
9
20
|
}
|