oomi-ai 0.2.17 → 0.2.18

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.
Files changed (47) hide show
  1. package/README.md +237 -202
  2. package/agent_instructions.md +209 -186
  3. package/bin/oomi-ai.js +3989 -3460
  4. package/bin/sessionBridgeState.js +78 -78
  5. package/lib/channelPluginClient.js +119 -0
  6. package/lib/personaApiClient.js +221 -0
  7. package/lib/personaJobExecutor.js +115 -0
  8. package/lib/personaJobPoller.js +112 -0
  9. package/lib/personaRuntimeProcess.js +152 -0
  10. package/lib/scaffold.js +108 -0
  11. package/lib/template.js +45 -0
  12. package/openclaw.extension.js +602 -602
  13. package/openclaw.plugin.json +17 -17
  14. package/package.json +67 -65
  15. package/skills/oomi/SKILL.md +191 -191
  16. package/skills/oomi/agent_instructions.md +80 -80
  17. package/skills/oomi/config.json +2 -2
  18. package/skills/oomi/scripts/get_avatar_capabilities.py +40 -40
  19. package/skills/oomi/scripts/get_data.py +49 -49
  20. package/skills/oomi/scripts/install_agent_instructions.py +78 -78
  21. package/skills/oomi/scripts/send_goal.py +53 -53
  22. package/skills/oomi/scripts/sync.py +46 -46
  23. package/skills/oomi/setup.py +41 -41
  24. package/templates/persona-app/.env.example +8 -0
  25. package/templates/persona-app/README.md +35 -0
  26. package/templates/persona-app/eslint.config.js +28 -0
  27. package/templates/persona-app/index.html +18 -0
  28. package/templates/persona-app/oomi.runtime.json +13 -0
  29. package/templates/persona-app/package.json +42 -0
  30. package/templates/persona-app/persona/brief.md +14 -0
  31. package/templates/persona-app/persona.json +14 -0
  32. package/templates/persona-app/public/manifest.webmanifest +8 -0
  33. package/templates/persona-app/public/oomi.health.json +6 -0
  34. package/templates/persona-app/src/App.css +180 -0
  35. package/templates/persona-app/src/App.tsx +14 -0
  36. package/templates/persona-app/src/index.css +32 -0
  37. package/templates/persona-app/src/main.tsx +10 -0
  38. package/templates/persona-app/src/pages/HomePage.tsx +73 -0
  39. package/templates/persona-app/src/pages/ScenePage.tsx +18 -0
  40. package/templates/persona-app/src/persona/config.ts +6 -0
  41. package/templates/persona-app/src/persona/notes.ts +5 -0
  42. package/templates/persona-app/src/vite-env.d.ts +3 -0
  43. package/templates/persona-app/template.json +13 -0
  44. package/templates/persona-app/tsconfig.app.json +23 -0
  45. package/templates/persona-app/tsconfig.json +7 -0
  46. package/templates/persona-app/tsconfig.node.json +21 -0
  47. package/templates/persona-app/vite.config.ts +18 -0
@@ -1,189 +1,189 @@
1
- # Oomi OpenClaw Operator Guide
2
-
3
- Use these instructions when you need to connect, repair, or verify an OpenClaw machine that should talk to Oomi.
4
-
5
- ## Primary Goal
6
-
7
- Get OpenClaw into a state where:
8
- - Oomi managed text chat works
9
- - Oomi device-backed voice can start cleanly
10
- - the bridge is supervised or restartable
11
- - the user never has to paste raw pair identifiers or gateway secrets manually when managed connect is available
12
-
13
- ## Standard Connect Flow
14
-
15
- If the user asks to connect OpenClaw to Oomi chat or voice:
16
-
17
- 1. Refresh bootstrap first:
18
- - `curl -fsSL https://www.oomi.ai/install.sh | bash`
19
- 2. Ensure `oomi-ai` is installed:
20
- - `pnpm add -g oomi-ai@latest`
21
- - fallback: `npm install -g oomi-ai@latest`
22
- 3. Pair the device without starting a legacy one-off flow:
23
- - `oomi openclaw pair --app-url https://www.oomi.ai --no-start`
24
- 4. Install the OpenClaw plugin:
25
- - `openclaw plugins install oomi-ai@latest`
26
- 5. Print the config block and secrets:
27
- - `oomi openclaw plugin --show-secrets --backend-url https://api.oomi.ai`
28
- 6. Apply the printed `channels.oomi.accounts.default` config.
29
- 7. Restart OpenClaw.
30
- 8. Start or repair the bridge:
31
- - `oomi openclaw bridge ensure --detach`
32
- - if stale: `oomi openclaw bridge restart --detach`
33
- - on macOS, prefer supervision: `oomi openclaw bridge service install`
34
-
35
- If the user provides a specific app URL, use it directly in the pair flow:
36
- - `oomi openclaw pair --app-url <URL> --no-start`
37
-
38
- ## Required User-Facing Result
39
-
40
- When pairing completes successfully, return this exact format:
41
- - `Oomi Connect Ready`
42
- - `Auth Link: ...`
43
-
44
- Do not add extra narrative before or after those lines.
45
- Do not ask the user to enter raw pair codes, gateway passwords, or nonce values manually.
46
-
47
- ## Runtime Checks
48
-
49
- Use these commands to inspect the installed machine:
50
-
51
- ```bash
52
- oomi openclaw bridge ps
53
- oomi openclaw bridge service status
54
- oomi openclaw status
55
- tail -f ~/.openclaw/logs/oomi-bridge-live.log
56
- tail -f ~/.openclaw/logs/gateway.log
57
- tail -f ~/.openclaw/logs/gateway.err.log
58
- ```
59
-
60
- Useful local files:
61
- - `~/.openclaw/oomi-bridge-status.json`
62
- - `~/.openclaw/logs/oomi-bridge-live.log`
63
- - `~/.openclaw/logs/gateway.log`
64
- - `~/.openclaw/logs/gateway.err.log`
65
- - `~/.openclaw/agents/main/sessions/*.jsonl`
66
-
67
- ## Healthy State
68
-
69
- Treat the machine as healthy when all of the following are true:
70
- - OpenClaw loads the `oomi-ai` plugin without duplicate-id conflicts
71
- - `channels.oomi.accounts.default` is populated with a valid `backendUrl` and `deviceToken`
72
- - the bridge shows `connected` after managed subscription is confirmed
73
- - text chat reaches the Oomi assistant
74
- - voice STT can produce `asr.final`
75
- - assistant replies can come back without the bridge dropping into `stopped`
76
-
77
- Bridge status meanings:
78
- - `starting`: bridge booting or waiting for managed subscription
79
- - `connected`: ready for managed chat and voice traffic
80
- - `reconnecting`: transport dropped and retry is scheduled
81
- - `degraded`: bridge caught a runtime fault but is still alive
82
- - `error`: startup/auth failure blocked useful operation
83
- - `stopped`: not running or intentionally stopped
84
-
85
- ## Troubleshooting
86
-
87
- ### Duplicate plugin id warning
88
-
89
- Symptom:
90
- - OpenClaw reports `duplicate plugin id detected`
91
-
92
- Action:
93
- - ensure only one active `oomi-ai` plugin install is discoverable
94
- - remove stale extension copies before reinstalling
95
-
96
- ### `invalid handshake: first request must be connect`
97
-
98
- Meaning:
99
- - a gateway request was sent before `connect` had been accepted
100
-
101
- Action:
102
- - update `oomi-ai`
103
- - restart the bridge
104
- - confirm only one bridge worker is running
105
-
106
- ### Device is linked but voice start still fails
107
-
108
- Meaning:
109
- - linked ownership is not enough; the device side still needs to be live
110
-
111
- Action:
112
- - confirm the device websocket is actually online
113
- - confirm the bridge is `connected`
114
- - restart the bridge if it is stuck in `reconnecting` or `degraded`
115
-
116
- ### STT works but the assistant does not reply
117
-
118
- Meaning:
119
- - the voice turn likely reached Oomi, but the managed gateway or OpenClaw run failed later
120
-
121
- Action:
122
- - inspect `gateway.log`, `gateway.err.log`, and the session JSONL
123
- - check for `network_error`, auth failures, or repeated bridge restarts
124
-
125
- ### Bridge keeps restarting with `reason: stopped`
126
-
127
- Action:
128
- - confirm the newest `oomi-ai` is installed
129
- - inspect `~/.openclaw/logs/oomi-bridge-live.log` for runtime exceptions
130
- - use supervised mode on macOS: `oomi openclaw bridge service install`
131
- - if the process is alive but faulted, expect `degraded` rather than an immediate hard stop on newer bridge builds
132
-
133
- ## Voice Notes
134
-
135
- Voice depends on the same Oomi plugin and bridge layer as managed chat.
136
- That means:
137
- - if plugin install or bridge health is wrong, voice replies will also fail
138
- - STT can succeed even when assistant reply delivery is broken later in the run
139
- - a `voice_session_*` failure should be investigated, but it should not automatically be treated as proof that all normal Oomi chat is down
140
-
141
- ### Hidden Speech Payload
142
-
143
- For managed voice turns, keep visible assistant chat text natural and user-facing.
144
- Do not put spoken-style tags like `[happy]`, `[sad]`, or `[excited]` into visible chat text.
145
-
146
- When the runtime supports it, voice turns may include a hidden speech sidecar on the assistant message:
147
-
148
- ```json
149
- {
150
- "metadata": {
151
- "spoken": {
152
- "text": "Speech-optimized text for TTS only.",
153
- "instructions": "Speak with upbeat, warm excitement and slightly rising intonation.",
154
- "style": {
155
- "emotion": "excited",
156
- "energy": "medium_high"
157
- }
158
- }
159
- }
160
- }
161
- ```
162
-
163
- Rules:
164
- - visible `content` remains the source of truth for Oomi chat rendering
165
- - for managed voice replies, include `metadata.spoken` when delivery benefits from cleaner phrasing or explicit speaking guidance
166
- - `metadata.spoken.text` is for backend TTS only
167
- - `metadata.spoken.language` should be one of the supported Qwen language values such as `English`
168
- - `metadata.spoken.segments` can carry bounded per-segment prosody for pace, pitch, volume, and pause timing
169
- - `metadata.spoken.instructions` should be natural-language guidance, not raw bracket tags
170
- - `metadata.spoken.style` is optional metadata for debugging/future mapping
171
- - if no hidden speech sidecar exists, Oomi falls back to speaking the visible assistant text
172
-
173
- Current plugin behavior:
174
- - if you provide `metadata.spoken`, the plugin preserves it unchanged
175
- - if you do not provide `metadata.spoken`, the plugin now synthesizes a bounded hidden fallback from visible assistant text for backend TTS
176
- - visible chat text is still never rewritten by the plugin
177
-
178
- ## Avatar Commands
179
-
180
- Before using avatar commands, call `get_avatar_capabilities` and prefer canonical values.
181
- Inline tags are stripped from user-visible text.
182
-
183
- Use inline tags like:
184
- - `[anim:Waving]`, `[anim:Walking]`, `[anim:Idle]`, `[anim:Sitting Idle]`
185
- - `[face:happy]`, `[face:sad]`, `[face:surprised]`, `[face:focused]`, `[face:gentle]`, `[face:thinking]`
186
- - `[gesture:nod]`, `[gesture:think]`, `[gesture:shrug]`, `[gesture:wave]`, `[gesture:bow]`
1
+ # Oomi OpenClaw Operator Guide
2
+
3
+ Use these instructions when you need to connect, repair, or verify an OpenClaw machine that should talk to Oomi.
4
+
5
+ ## Primary Goal
6
+
7
+ Get OpenClaw into a state where:
8
+ - Oomi managed text chat works
9
+ - Oomi device-backed voice can start cleanly
10
+ - the bridge is supervised or restartable
11
+ - the user never has to paste raw pair identifiers or gateway secrets manually when managed connect is available
12
+
13
+ ## Standard Connect Flow
14
+
15
+ If the user asks to connect OpenClaw to Oomi chat or voice:
16
+
17
+ 1. Refresh bootstrap first:
18
+ - `curl -fsSL https://www.oomi.ai/install.sh | bash`
19
+ 2. Ensure `oomi-ai` is installed:
20
+ - `pnpm add -g oomi-ai@latest`
21
+ - fallback: `npm install -g oomi-ai@latest`
22
+ 3. Pair the device without starting a legacy one-off flow:
23
+ - `oomi openclaw pair --app-url https://www.oomi.ai --no-start`
24
+ 4. Install the OpenClaw plugin:
25
+ - `openclaw plugins install oomi-ai@latest`
26
+ 5. Print the config block and secrets:
27
+ - `oomi openclaw plugin --show-secrets --backend-url https://api.oomi.ai`
28
+ 6. Apply the printed `channels.oomi.accounts.default` config.
29
+ 7. Restart OpenClaw.
30
+ 8. Start or repair the bridge:
31
+ - `oomi openclaw bridge ensure --detach`
32
+ - if stale: `oomi openclaw bridge restart --detach`
33
+ - on macOS, prefer supervision: `oomi openclaw bridge service install`
34
+
35
+ If the user provides a specific app URL, use it directly in the pair flow:
36
+ - `oomi openclaw pair --app-url <URL> --no-start`
37
+
38
+ ## Required User-Facing Result
39
+
40
+ When pairing completes successfully, return this exact format:
41
+ - `Oomi Connect Ready`
42
+ - `Auth Link: ...`
43
+
44
+ Do not add extra narrative before or after those lines.
45
+ Do not ask the user to enter raw pair codes, gateway passwords, or nonce values manually.
46
+
47
+ ## Runtime Checks
48
+
49
+ Use these commands to inspect the installed machine:
50
+
51
+ ```bash
52
+ oomi openclaw bridge ps
53
+ oomi openclaw bridge service status
54
+ oomi openclaw status
55
+ tail -f ~/.openclaw/logs/oomi-bridge-live.log
56
+ tail -f ~/.openclaw/logs/gateway.log
57
+ tail -f ~/.openclaw/logs/gateway.err.log
58
+ ```
59
+
60
+ Useful local files:
61
+ - `~/.openclaw/oomi-bridge-status.json`
62
+ - `~/.openclaw/logs/oomi-bridge-live.log`
63
+ - `~/.openclaw/logs/gateway.log`
64
+ - `~/.openclaw/logs/gateway.err.log`
65
+ - `~/.openclaw/agents/main/sessions/*.jsonl`
66
+
67
+ ## Healthy State
68
+
69
+ Treat the machine as healthy when all of the following are true:
70
+ - OpenClaw loads the `oomi-ai` plugin without duplicate-id conflicts
71
+ - `channels.oomi.accounts.default` is populated with a valid `backendUrl` and `deviceToken`
72
+ - the bridge shows `connected` after managed subscription is confirmed
73
+ - text chat reaches the Oomi assistant
74
+ - voice STT can produce `asr.final`
75
+ - assistant replies can come back without the bridge dropping into `stopped`
76
+
77
+ Bridge status meanings:
78
+ - `starting`: bridge booting or waiting for managed subscription
79
+ - `connected`: ready for managed chat and voice traffic
80
+ - `reconnecting`: transport dropped and retry is scheduled
81
+ - `degraded`: bridge caught a runtime fault but is still alive
82
+ - `error`: startup/auth failure blocked useful operation
83
+ - `stopped`: not running or intentionally stopped
84
+
85
+ ## Troubleshooting
86
+
87
+ ### Duplicate plugin id warning
88
+
89
+ Symptom:
90
+ - OpenClaw reports `duplicate plugin id detected`
91
+
92
+ Action:
93
+ - ensure only one active `oomi-ai` plugin install is discoverable
94
+ - remove stale extension copies before reinstalling
95
+
96
+ ### `invalid handshake: first request must be connect`
97
+
98
+ Meaning:
99
+ - a gateway request was sent before `connect` had been accepted
100
+
101
+ Action:
102
+ - update `oomi-ai`
103
+ - restart the bridge
104
+ - confirm only one bridge worker is running
105
+
106
+ ### Device is linked but voice start still fails
107
+
108
+ Meaning:
109
+ - linked ownership is not enough; the device side still needs to be live
110
+
111
+ Action:
112
+ - confirm the device websocket is actually online
113
+ - confirm the bridge is `connected`
114
+ - restart the bridge if it is stuck in `reconnecting` or `degraded`
115
+
116
+ ### STT works but the assistant does not reply
117
+
118
+ Meaning:
119
+ - the voice turn likely reached Oomi, but the managed gateway or OpenClaw run failed later
120
+
121
+ Action:
122
+ - inspect `gateway.log`, `gateway.err.log`, and the session JSONL
123
+ - check for `network_error`, auth failures, or repeated bridge restarts
124
+
125
+ ### Bridge keeps restarting with `reason: stopped`
126
+
127
+ Action:
128
+ - confirm the newest `oomi-ai` is installed
129
+ - inspect `~/.openclaw/logs/oomi-bridge-live.log` for runtime exceptions
130
+ - use supervised mode on macOS: `oomi openclaw bridge service install`
131
+ - if the process is alive but faulted, expect `degraded` rather than an immediate hard stop on newer bridge builds
132
+
133
+ ## Voice Notes
134
+
135
+ Voice depends on the same Oomi plugin and bridge layer as managed chat.
136
+ That means:
137
+ - if plugin install or bridge health is wrong, voice replies will also fail
138
+ - STT can succeed even when assistant reply delivery is broken later in the run
139
+ - a `voice_session_*` failure should be investigated, but it should not automatically be treated as proof that all normal Oomi chat is down
140
+
141
+ ### Hidden Speech Payload
142
+
143
+ For managed voice turns, keep visible assistant chat text natural and user-facing.
144
+ Do not put spoken-style tags like `[happy]`, `[sad]`, or `[excited]` into visible chat text.
145
+
146
+ When the runtime supports it, voice turns may include a hidden speech sidecar on the assistant message:
147
+
148
+ ```json
149
+ {
150
+ "metadata": {
151
+ "spoken": {
152
+ "text": "Speech-optimized text for TTS only.",
153
+ "instructions": "Speak with upbeat, warm excitement and slightly rising intonation.",
154
+ "style": {
155
+ "emotion": "excited",
156
+ "energy": "medium_high"
157
+ }
158
+ }
159
+ }
160
+ }
161
+ ```
162
+
163
+ Rules:
164
+ - visible `content` remains the source of truth for Oomi chat rendering
165
+ - for managed voice replies, include `metadata.spoken` when delivery benefits from cleaner phrasing or explicit speaking guidance
166
+ - `metadata.spoken.text` is for backend TTS only
167
+ - `metadata.spoken.language` should be one of the supported Qwen language values such as `English`
168
+ - `metadata.spoken.segments` can carry bounded per-segment prosody for pace, pitch, volume, and pause timing
169
+ - `metadata.spoken.instructions` should be natural-language guidance, not raw bracket tags
170
+ - `metadata.spoken.style` is optional metadata for debugging/future mapping
171
+ - if no hidden speech sidecar exists, Oomi falls back to speaking the visible assistant text
172
+
173
+ Current plugin behavior:
174
+ - if you provide `metadata.spoken`, the plugin preserves it unchanged
175
+ - if you do not provide `metadata.spoken`, the plugin now synthesizes a bounded hidden fallback from visible assistant text for backend TTS
176
+ - visible chat text is still never rewritten by the plugin
177
+
178
+ ## Avatar Commands
179
+
180
+ Before using avatar commands, call `get_avatar_capabilities` and prefer canonical values.
181
+ Inline tags are stripped from user-visible text.
182
+
183
+ Use inline tags like:
184
+ - `[anim:Waving]`, `[anim:Walking]`, `[anim:Idle]`, `[anim:Sitting Idle]`
185
+ - `[face:happy]`, `[face:sad]`, `[face:surprised]`, `[face:focused]`, `[face:gentle]`, `[face:thinking]`
186
+ - `[gesture:nod]`, `[gesture:think]`, `[gesture:shrug]`, `[gesture:wave]`, `[gesture:bow]`
187
187
  - `[look:camera]`, `[look:left]`, `[look:right]`, `[look:up]`, `[look:down]`
188
188
 
189
189
  Aliases allowed if needed:
@@ -191,3 +191,26 @@ Aliases allowed if needed:
191
191
  - `walk -> Walking`
192
192
  - `idle -> Idle`
193
193
  - `sit` or `sitting -> Sitting Idle`
194
+
195
+ ## Persona App Generation
196
+
197
+ When generating a managed persona app for Oomi:
198
+
199
+ 1. Do not build the app shell from scratch.
200
+ 2. Always run `oomi personas scaffold <slug> --name "<name>" --description "<description>" --out <path>` first.
201
+ 3. Only customize persona-specific files inside `src/persona/` and `persona/` unless Oomi explicitly instructs otherwise.
202
+ 4. Preserve the scaffolded WebSpatial/Vite shell, `public/oomi.health.json`, `oomi.runtime.json`, and `public/manifest.webmanifest`.
203
+ 5. After customization, start the app and register the runtime with Oomi using the current runtime contract.
204
+
205
+ When executing a structured persona job from Oomi:
206
+
207
+ 1. Prefer `oomi persona-jobs execute --message-file <job.json>` when the backend has already produced a machine-readable job payload.
208
+ 2. That command is allowed to scaffold the app, install dependencies, start the local runtime, wait for the health document, register the runtime, and report job success or failure.
209
+ 3. Use the lower-level commands only for recovery or partial reruns:
210
+ - `oomi personas runtime-register <slug> --local-port 4789`
211
+ - `oomi personas heartbeat <slug> --local-port 4789`
212
+ - `oomi persona-jobs start <jobId>`
213
+ - `oomi persona-jobs succeed <jobId> --workspace-path <path> --local-port 4789`
214
+ - `oomi persona-jobs fail <jobId> --code <code> --message "<text>"`
215
+
216
+ When the Oomi bridge is running on the machine, queued persona jobs from Oomi are now polled and executed automatically through the filtered control-message lane. You should still use the explicit commands above for manual retries, recovery, or direct operator workflows.