oomi-ai 0.2.17 → 0.2.19

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 +243 -200
  2. package/agent_instructions.md +214 -184
  3. package/bin/oomi-ai.js +4024 -3441
  4. package/bin/sessionBridgeState.js +78 -78
  5. package/lib/channelPluginClient.js +119 -0
  6. package/lib/personaApiClient.js +253 -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
package/README.md CHANGED
@@ -2,227 +2,270 @@
2
2
 
3
3
  OpenClaw channel plugin and bridge tooling for Oomi managed chat and voice.
4
4
 
5
- This package is for two audiences:
6
- - OpenClaw operators who need to connect a machine to Oomi and keep chat or voice healthy
7
- - Developers evaluating the plugin on npm and deciding whether it matches their OpenClaw + Oomi setup
8
-
9
- ## What This Package Ships
10
-
11
- The npm package contains two Oomi integration surfaces:
12
-
13
- 1. OpenClaw channel extension
14
- - File: `openclaw.extension.js`
15
- - Purpose: stable managed text transport through the Oomi backend channel API
16
- - This is the preferred integration surface for normal chat
17
-
18
- 2. Local bridge + CLI
19
- - Files: `bin/oomi-ai.js`, `bin/sessionBridgeState.js`
20
- - Purpose: pair a device, manage the OpenClaw bridge worker, and support managed gateway traffic needed by device-backed chat and voice
21
- - This is the part that deals with broker sockets, local gateway sessions, challenge auth, and bridge health
22
-
23
- In practical terms:
24
- - If you only need a clean managed chat channel, the extension is the main reason to install this package
25
- - If you need Oomi device-backed chat or voice on an OpenClaw machine, you also need the bridge tooling in this package
26
-
27
- ## When To Install It
28
-
29
- Install `oomi-ai` if all of the following are true:
30
- - you use OpenClaw
31
- - you want Oomi as a managed channel inside OpenClaw
32
- - you want device-backed Oomi chat, Oomi voice, or both
33
-
34
- Do not install it just to use the Oomi web app by itself.
35
-
36
- ## Install And Upgrade
37
-
38
- Global install:
39
-
40
- ```bash
41
- pnpm add -g oomi-ai@latest
42
- ```
43
-
44
- Fallback:
45
-
46
- ```bash
47
- npm install -g oomi-ai@latest
48
- ```
49
-
50
- Install the OpenClaw plugin:
51
-
52
- ```bash
53
- openclaw plugins install oomi-ai@latest
54
- ```
55
-
56
- Upgrade an existing machine:
57
-
58
- ```bash
59
- pnpm add -g oomi-ai@latest
60
- openclaw plugins install oomi-ai@latest
61
- ```
62
-
63
- ## Operator Quick Start
64
-
65
- The packaged operator instructions live in [agent_instructions.md](./agent_instructions.md).
66
- That is the primary reference for:
67
- - pairing a device
68
- - installing the plugin
69
- - configuring `channels.oomi.accounts.default`
70
- - running or supervising the bridge
71
- - checking whether the system is healthy
72
- - troubleshooting chat and voice failures
73
-
74
- Fast-path install flow:
75
-
76
- ```bash
77
- oomi openclaw pair --app-url https://www.oomi.ai --no-start
78
- openclaw plugins install oomi-ai@latest
79
- oomi openclaw plugin --show-secrets --backend-url https://api.oomi.ai
80
- ```
81
-
82
- Then apply the printed `channels.oomi.accounts.default` config and restart OpenClaw.
83
-
84
- ## Configuration
85
-
86
- OpenClaw channel config lives under:
5
+ ## Current Focus
87
6
 
88
- ```json
89
- {
90
- "channels": {
91
- "oomi": {
92
- "defaultAccountId": "default",
93
- "accounts": {
94
- "default": {
95
- "backendUrl": "https://api.oomi.ai",
96
- "deviceToken": "...",
97
- "defaultSessionKey": "agent:main:webchat:channel:oomi",
98
- "requestTimeoutMs": 15000
99
- }
100
- }
101
- }
102
- }
103
- }
104
- ```
105
-
106
- Required fields:
107
- - `backendUrl`
108
- - `deviceToken`
109
-
110
- Optional fields:
111
- - `defaultSessionKey`
112
- - `requestTimeoutMs`
7
+ `0.2.19` adds the first live persona automation lane:
8
+ - WebSpatial-based persona scaffolding for generated Oomi apps
9
+ - a high-level `oomi personas create-managed` command for agent-driven persona creation
10
+ - device-authenticated persona runtime registration and job callbacks
11
+ - automatic bridge-side polling for queued `persona_job` control messages
12
+ - end-to-end local persona startup from a structured orchestration payload
113
13
 
14
+ This package is for two audiences:
15
+ - OpenClaw operators who need to connect a machine to Oomi and keep chat or voice healthy
16
+ - Developers evaluating the plugin on npm and deciding whether it matches their OpenClaw + Oomi setup
17
+
18
+ ## What This Package Ships
19
+
20
+ The npm package contains two Oomi integration surfaces:
21
+
22
+ 1. OpenClaw channel extension
23
+ - File: `openclaw.extension.js`
24
+ - Purpose: stable managed text transport through the Oomi backend channel API
25
+ - This is the preferred integration surface for normal chat
26
+
27
+ 2. Local bridge + CLI
28
+ - Files: `bin/oomi-ai.js`, `bin/sessionBridgeState.js`
29
+ - Purpose: pair a device, manage the OpenClaw bridge worker, and support managed gateway traffic needed by device-backed chat and voice
30
+ - This is the part that deals with broker sockets, local gateway sessions, challenge auth, and bridge health
31
+
32
+ In practical terms:
33
+ - If you only need a clean managed chat channel, the extension is the main reason to install this package
34
+ - If you need Oomi device-backed chat or voice on an OpenClaw machine, you also need the bridge tooling in this package
35
+
36
+ ## When To Install It
37
+
38
+ Install `oomi-ai` if all of the following are true:
39
+ - you use OpenClaw
40
+ - you want Oomi as a managed channel inside OpenClaw
41
+ - you want device-backed Oomi chat, Oomi voice, or both
42
+
43
+ Do not install it just to use the Oomi web app by itself.
44
+
45
+ ## Install And Upgrade
46
+
47
+ Global install:
48
+
49
+ ```bash
50
+ pnpm add -g oomi-ai@latest
51
+ ```
52
+
53
+ Fallback:
54
+
55
+ ```bash
56
+ npm install -g oomi-ai@latest
57
+ ```
58
+
59
+ Install the OpenClaw plugin:
60
+
61
+ ```bash
62
+ openclaw plugins install oomi-ai@latest
63
+ ```
64
+
65
+ Upgrade an existing machine:
66
+
67
+ ```bash
68
+ pnpm add -g oomi-ai@latest
69
+ openclaw plugins install oomi-ai@latest
70
+ ```
71
+
72
+ ## Operator Quick Start
73
+
74
+ The packaged operator instructions live in [agent_instructions.md](./agent_instructions.md).
75
+ That is the primary reference for:
76
+ - pairing a device
77
+ - installing the plugin
78
+ - configuring `channels.oomi.accounts.default`
79
+ - running or supervising the bridge
80
+ - checking whether the system is healthy
81
+ - troubleshooting chat and voice failures
82
+
83
+ Fast-path install flow:
84
+
85
+ ```bash
86
+ oomi openclaw pair --app-url https://www.oomi.ai --no-start
87
+ openclaw plugins install oomi-ai@latest
88
+ oomi openclaw plugin --show-secrets --backend-url https://api.oomi.ai
89
+ ```
90
+
91
+ Then apply the printed `channels.oomi.accounts.default` config and restart OpenClaw.
92
+
93
+ ## Configuration
94
+
95
+ OpenClaw channel config lives under:
96
+
97
+ ```json
98
+ {
99
+ "channels": {
100
+ "oomi": {
101
+ "defaultAccountId": "default",
102
+ "accounts": {
103
+ "default": {
104
+ "backendUrl": "https://api.oomi.ai",
105
+ "deviceToken": "...",
106
+ "defaultSessionKey": "agent:main:webchat:channel:oomi",
107
+ "requestTimeoutMs": 15000
108
+ }
109
+ }
110
+ }
111
+ }
112
+ }
113
+ ```
114
+
115
+ Required fields:
116
+ - `backendUrl`
117
+ - `deviceToken`
118
+
119
+ Optional fields:
120
+ - `defaultSessionKey`
121
+ - `requestTimeoutMs`
122
+
114
123
  ## Runtime Model
115
124
 
116
125
  There are two runtime contracts worth understanding.
117
-
118
- ### Managed Text Chat
119
-
120
- Managed text chat uses the OpenClaw channel extension and the Oomi backend channel API.
121
- This path is the more stable contract and should be preferred when evaluating the plugin for normal chat.
122
-
123
- ### Device-Backed Chat And Voice
124
-
125
- Device-backed chat and voice use the local bridge.
126
- That bridge:
127
- - keeps a broker socket open to Oomi
128
- - opens local gateway sessions on demand
129
- - enforces `connect`-first request ordering
130
- - preserves or synthesizes `idempotencyKey` for `chat.send`
131
- - keeps voice-session faults from poisoning normal provider health where possible
132
-
133
- This is the part of the package most likely to matter when debugging voice turn failures.
134
-
126
+
127
+ ### Managed Text Chat
128
+
129
+ Managed text chat uses the OpenClaw channel extension and the Oomi backend channel API.
130
+ This path is the more stable contract and should be preferred when evaluating the plugin for normal chat.
131
+
132
+ ### Device-Backed Chat And Voice
133
+
134
+ Device-backed chat and voice use the local bridge.
135
+ That bridge:
136
+ - keeps a broker socket open to Oomi
137
+ - opens local gateway sessions on demand
138
+ - enforces `connect`-first request ordering
139
+ - preserves or synthesizes `idempotencyKey` for `chat.send`
140
+ - keeps voice-session faults from poisoning normal provider health where possible
141
+
142
+ This is the part of the package most likely to matter when debugging voice turn failures.
143
+
135
144
  For managed voice replies, the extension also preserves an explicit hidden `metadata.spoken` sidecar when upstream provides one.
136
145
  If upstream does not provide one, the extension now synthesizes a bounded hidden fallback from the visible assistant text so backend TTS can speak a cleaner and more varied version without changing user-visible chat.
137
146
 
138
- ## Bridge Health States
139
-
140
- The bridge status file is written locally and should roughly be interpreted as:
141
- - `starting`: process booting or waiting for managed subscription
142
- - `connected`: broker connected and managed subscription confirmed
143
- - `reconnecting`: broker or gateway transport dropped and reconnect is scheduled
144
- - `degraded`: bridge is still alive but hit a runtime fault that needs attention
145
- - `error`: startup or auth-level failure that prevents useful operation
146
- - `stopped`: bridge is not running or was intentionally stopped
147
-
148
- For voice support, a `voice_session_*` failure should be treated as narrower than a full provider outage.
147
+ ## Persona Scaffolding
149
148
 
150
- ## Troubleshooting
149
+ Use the scaffold flow when OpenClaw needs to build a managed persona app that will live inside Oomi:
151
150
 
152
- ### `invalid handshake: first request must be connect`
153
-
154
- Meaning:
155
- - a gateway request was forwarded before the session had accepted `connect`
156
-
157
- What to check:
158
- - update to the latest `oomi-ai`
159
- - restart the bridge worker
160
- - confirm only one active bridge worker exists for the device
161
-
162
- ### `duplicate plugin id detected`
163
-
164
- Meaning:
165
- - OpenClaw can see more than one `oomi-ai` plugin source
166
-
167
- What to check:
168
- - ensure there is only one active install under OpenClaw plugin discovery paths
169
- - remove stale local extension copies before reinstalling
170
-
171
- ### Bridge keeps flipping between `reconnecting`, `degraded`, or `stopped`
172
-
173
- What to check:
174
- - `oomi openclaw bridge ps`
175
- - `oomi openclaw bridge service status`
176
- - `tail -f ~/.openclaw/logs/oomi-bridge-live.log`
177
- - `tail -f ~/.openclaw/logs/gateway.log`
178
-
179
- If the process is alive but runtime faults are being caught, expect `degraded` rather than an immediate hard stop.
180
-
181
- ### Voice STT works but the agent does not answer
182
-
183
- This usually means one of these:
184
- - the managed gateway/device side is not actually ready
185
- - the bridge or agent run failed after delivery
186
- - the OpenClaw run stopped with an upstream provider `network_error`
187
-
188
- In that situation, inspect:
189
- - `~/.openclaw/logs/gateway.log`
190
- - `~/.openclaw/logs/gateway.err.log`
191
- - the relevant session JSONL in `~/.openclaw/agents/main/sessions/`
192
-
193
- ## Developer Notes
151
+ ```bash
152
+ oomi personas scaffold market-analyst --name "Market Analyst" --description "Private app for reviewing my broker positions and risk." --out ~/.openclaw/personas/market-analyst
153
+ ```
194
154
 
195
- If you are inspecting this package on npm, the main architectural points are:
196
- - the extension path is the stable managed text contract
197
- - the local bridge exists because Oomi also needs device-backed and voice-capable flows
198
- - the bridge has been hardened for:
199
- - strict `connect`-first forwarding
200
- - method-specific request shaping
201
- - `idempotencyKey` handling
202
- - bridge status that does not report `connected` before managed subscription is ready
203
- - runtime fault isolation so local session failures are less likely to crash the whole provider
204
- - hidden managed-voice speech metadata forwarding, with a synthesized fallback when upstream does not provide `metadata.spoken`
155
+ Use:
156
+ - `oomi personas create <id>` for repo-local manifest work
157
+ - `oomi personas create-managed --name "Cooking Persona" --description "Private cooking workspace"` for the end-to-end Oomi-managed persona flow
158
+ - `oomi personas scaffold <slug>` for a WebSpatial-based Oomi app shell with runtime metadata and health documents
159
+ - `oomi persona-jobs execute --message-file <job.json>` when OpenClaw receives a structured persona orchestration job from Oomi
205
160
 
206
- If you are developing the plugin, test the packaged surface with:
161
+ Additional persona runtime commands:
207
162
 
208
163
  ```bash
209
- cd packages/oomi-ai
210
- node --test test/*.test.mjs
211
- npm pack --dry-run
164
+ oomi personas runtime-register market-analyst --local-port 4789
165
+ oomi personas heartbeat market-analyst --local-port 4789
166
+ oomi persona-jobs start pj_123
167
+ oomi persona-jobs succeed pj_123 --workspace-path ~/.openclaw/personas/market-analyst --local-port 4789
168
+ oomi persona-jobs fail pj_123 --code JOB_FAILED --message "Scaffold generation failed."
212
169
  ```
213
170
 
214
- ## Release Process
215
-
216
- Before publishing:
171
+ Recommended agent flow:
217
172
 
218
173
  ```bash
219
- cd packages/oomi-ai
220
- node --test test/*.test.mjs
221
- npm pack --dry-run
174
+ oomi personas create-managed --name "Cooking Persona" --description "Private cooking workspace for recipes, meal planning, and kitchen notes."
222
175
  ```
223
176
 
177
+ That command creates the managed persona record in Oomi using the linked device identity. The backend then enqueues the `persona_job`, and the running bridge consumes that job automatically. The poll path is filtered to `metadata.type = persona_job`, so it does not consume normal queued chat traffic.
178
+
179
+ ## Bridge Health States
180
+
181
+ The bridge status file is written locally and should roughly be interpreted as:
182
+ - `starting`: process booting or waiting for managed subscription
183
+ - `connected`: broker connected and managed subscription confirmed
184
+ - `reconnecting`: broker or gateway transport dropped and reconnect is scheduled
185
+ - `degraded`: bridge is still alive but hit a runtime fault that needs attention
186
+ - `error`: startup or auth-level failure that prevents useful operation
187
+ - `stopped`: bridge is not running or was intentionally stopped
188
+
189
+ For voice support, a `voice_session_*` failure should be treated as narrower than a full provider outage.
190
+
191
+ ## Troubleshooting
192
+
193
+ ### `invalid handshake: first request must be connect`
194
+
195
+ Meaning:
196
+ - a gateway request was forwarded before the session had accepted `connect`
197
+
198
+ What to check:
199
+ - update to the latest `oomi-ai`
200
+ - restart the bridge worker
201
+ - confirm only one active bridge worker exists for the device
202
+
203
+ ### `duplicate plugin id detected`
204
+
205
+ Meaning:
206
+ - OpenClaw can see more than one `oomi-ai` plugin source
207
+
208
+ What to check:
209
+ - ensure there is only one active install under OpenClaw plugin discovery paths
210
+ - remove stale local extension copies before reinstalling
211
+
212
+ ### Bridge keeps flipping between `reconnecting`, `degraded`, or `stopped`
213
+
214
+ What to check:
215
+ - `oomi openclaw bridge ps`
216
+ - `oomi openclaw bridge service status`
217
+ - `tail -f ~/.openclaw/logs/oomi-bridge-live.log`
218
+ - `tail -f ~/.openclaw/logs/gateway.log`
219
+
220
+ If the process is alive but runtime faults are being caught, expect `degraded` rather than an immediate hard stop.
221
+
222
+ ### Voice STT works but the agent does not answer
223
+
224
+ This usually means one of these:
225
+ - the managed gateway/device side is not actually ready
226
+ - the bridge or agent run failed after delivery
227
+ - the OpenClaw run stopped with an upstream provider `network_error`
228
+
229
+ In that situation, inspect:
230
+ - `~/.openclaw/logs/gateway.log`
231
+ - `~/.openclaw/logs/gateway.err.log`
232
+ - the relevant session JSONL in `~/.openclaw/agents/main/sessions/`
233
+
234
+ ## Developer Notes
235
+
236
+ If you are inspecting this package on npm, the main architectural points are:
237
+ - the extension path is the stable managed text contract
238
+ - the local bridge exists because Oomi also needs device-backed and voice-capable flows
239
+ - the bridge has been hardened for:
240
+ - strict `connect`-first forwarding
241
+ - method-specific request shaping
242
+ - `idempotencyKey` handling
243
+ - bridge status that does not report `connected` before managed subscription is ready
244
+ - runtime fault isolation so local session failures are less likely to crash the whole provider
245
+ - hidden managed-voice speech metadata forwarding, with a synthesized fallback when upstream does not provide `metadata.spoken`
246
+
247
+ If you are developing the plugin, test the packaged surface with:
248
+
249
+ ```bash
250
+ cd packages/oomi-ai
251
+ node --test test/*.test.mjs
252
+ npm pack --dry-run
253
+ ```
254
+
255
+ ## Release Process
256
+
257
+ Before publishing:
258
+
259
+ ```bash
260
+ cd packages/oomi-ai
261
+ node --test test/*.test.mjs
262
+ npm pack --dry-run
263
+ ```
264
+
224
265
  Then publish the bumped version:
225
266
 
226
267
  ```bash
227
- npm publish --access public
268
+ pnpm check
269
+ pnpm publish --dry-run --no-git-checks --access public
270
+ pnpm publish --access public
228
271
  ```