ocuclaw 1.2.4 → 1.3.0

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 (59) hide show
  1. package/README.md +18 -5
  2. package/dist/config/runtime-config.js +81 -3
  3. package/dist/domain/activity-status-adapter.js +138 -605
  4. package/dist/domain/activity-status-arbiter.js +109 -0
  5. package/dist/domain/activity-status-labels.js +906 -0
  6. package/dist/domain/code-span-regions.js +103 -0
  7. package/dist/domain/conversation-state.js +14 -1
  8. package/dist/domain/debug-store.js +38 -182
  9. package/dist/domain/glasses-ui-content-summary.js +62 -0
  10. package/dist/domain/glasses-ui-system-prompt.js +28 -0
  11. package/dist/domain/message-emoji-allowlist.js +16 -0
  12. package/dist/domain/message-emoji-filter.js +33 -55
  13. package/dist/domain/neural-emoji-reactor-system-prompt.js +43 -0
  14. package/dist/domain/neural-emoji-reactor-tag-config.js +56 -0
  15. package/dist/domain/neural-pace-modulator-system-prompt.js +32 -0
  16. package/dist/domain/neural-pace-modulator-tag-config.js +51 -0
  17. package/dist/domain/tagged-span-parser.js +121 -0
  18. package/dist/domain/tagged-span-strip.js +38 -0
  19. package/dist/even-ai/even-ai-endpoint.js +91 -0
  20. package/dist/even-ai/even-ai-run-waiter.js +14 -0
  21. package/dist/even-ai/even-ai-settings-store.js +14 -0
  22. package/dist/gateway/gateway-bridge.js +14 -2
  23. package/dist/gateway/gateway-timing-ledger.js +457 -0
  24. package/dist/gateway/openclaw-client.js +462 -38
  25. package/dist/index.js +28 -1
  26. package/dist/runtime/downstream-handler.js +754 -83
  27. package/dist/runtime/downstream-server.js +700 -534
  28. package/dist/runtime/ocuclaw-settings-store.js +74 -31
  29. package/dist/runtime/plugin-update-service.js +216 -0
  30. package/dist/runtime/protocol-adapter.js +9 -0
  31. package/dist/runtime/provider-usage-select.js +168 -0
  32. package/dist/runtime/relay-client-nudge-controller.js +553 -0
  33. package/dist/runtime/relay-core.js +1209 -204
  34. package/dist/runtime/relay-health-monitor.js +172 -0
  35. package/dist/runtime/relay-operation-registry.js +263 -0
  36. package/dist/runtime/relay-service.js +201 -1
  37. package/dist/runtime/relay-worker-approval-replay-cache.js +68 -0
  38. package/dist/runtime/relay-worker-entry.js +32 -0
  39. package/dist/runtime/relay-worker-health.js +272 -0
  40. package/dist/runtime/relay-worker-protocol.js +285 -0
  41. package/dist/runtime/relay-worker-queue.js +202 -0
  42. package/dist/runtime/relay-worker-supervisor.js +1081 -0
  43. package/dist/runtime/relay-worker-transport.js +1051 -0
  44. package/dist/runtime/session-context-service.js +189 -0
  45. package/dist/runtime/session-service.js +615 -24
  46. package/dist/runtime/upstream-runtime.js +1167 -60
  47. package/dist/tools/device-info-tool.js +242 -0
  48. package/dist/tools/glasses-ui-cron.js +427 -0
  49. package/dist/tools/glasses-ui-descriptors.js +261 -0
  50. package/dist/tools/glasses-ui-limits.js +21 -0
  51. package/dist/tools/glasses-ui-paint-floor.js +99 -0
  52. package/dist/tools/glasses-ui-recipes.js +746 -0
  53. package/dist/tools/glasses-ui-surfaces.js +278 -0
  54. package/dist/tools/glasses-ui-template.js +182 -0
  55. package/dist/tools/glasses-ui-tool.js +1147 -0
  56. package/dist/tools/session-title-tool.js +209 -0
  57. package/dist/version.js +2 -0
  58. package/openclaw.plugin.json +163 -15
  59. package/package.json +12 -4
package/README.md CHANGED
@@ -2,13 +2,16 @@
2
2
 
3
3
  OcuClaw is an OpenClaw plugin for Even G2 smart glasses. Use the OcuClaw application within Even Hub App Store to connect the client side.
4
4
 
5
+ ## Requirements
6
+
7
+ OpenClaw `>= 2026.5.20` (older versions have a known plugin-install bug). Upgrade with `npm install -g openclaw@latest`.
8
+
5
9
  ## Install
6
10
 
7
11
  Install the plugin from the OpenClaw CLI:
8
12
 
9
13
  ```bash
10
14
  openclaw plugins install ocuclaw
11
- openclaw plugins enable ocuclaw
12
15
  ```
13
16
 
14
17
  ## Configure
@@ -18,7 +21,7 @@ Required:
18
21
  Set the OcuClaw relay token. This is a user-created password that must match the relay server token field in the OcuClaw application within Even Hub App Store.
19
22
 
20
23
  ```bash
21
- openclaw config set plugins.entries.ocuclaw.config.relayToken "<relay-token>"
24
+ openclaw config set plugins.entries.ocuclaw.config.relayToken "your-relay-token"
22
25
  ```
23
26
 
24
27
  Recommended:
@@ -26,7 +29,7 @@ Recommended:
26
29
  - `sonioxApiKey`: Enables Soniox speech-to-text for voice input.
27
30
 
28
31
  ```bash
29
- openclaw config set plugins.entries.ocuclaw.config.sonioxApiKey "<soniox-api-key>"
32
+ openclaw config set plugins.entries.ocuclaw.config.sonioxApiKey "your-soniox-api-key"
30
33
  ```
31
34
 
32
35
  - `evenAiEnabled`: Enables Even AI integration for OcuClaw.
@@ -38,9 +41,11 @@ openclaw config set plugins.entries.ocuclaw.config.evenAiEnabled true --strict-j
38
41
  - `evenAiToken`: Sets the user-created password for Even AI requests. This must match the password set in the Even AI Agent Configure section within the Even Realities app.
39
42
 
40
43
  ```bash
41
- openclaw config set plugins.entries.ocuclaw.config.evenAiToken "<even-ai-token>"
44
+ openclaw config set plugins.entries.ocuclaw.config.evenAiToken "your-even-ai-token"
42
45
  ```
43
46
 
47
+ > **Note:** When `evenAiEnabled` is `true`, `evenAiToken` is required. Config validation will reject the change if you enable Even AI without setting the token.
48
+
44
49
  Advanced optional settings:
45
50
 
46
51
  ```bash
@@ -50,6 +55,14 @@ openclaw config set plugins.entries.ocuclaw.config.sessionLimit 10 --strict-json
50
55
  openclaw config set plugins.entries.ocuclaw.config.externalDebugToolsEnabled true --strict-json
51
56
  ```
52
57
 
58
+ Run `openclaw plugins inspect ocuclaw` to see all settings with their descriptions and defaults.
59
+
60
+ ## Enable
61
+
62
+ ```bash
63
+ openclaw plugins enable ocuclaw
64
+ ```
65
+
53
66
  ## Restart
54
67
 
55
68
  Restart the gateway so the plugin and config changes take effect:
@@ -61,7 +74,7 @@ openclaw gateway restart
61
74
  ## Verify
62
75
 
63
76
  ```bash
64
- openclaw plugins inspect ocuclaw
77
+ openclaw plugins inspect ocuclaw --runtime
65
78
  openclaw plugins doctor
66
79
  openclaw gateway status
67
80
  ```
@@ -97,6 +97,56 @@ function resolveDebugNoisyPolicies(pluginValue, envValue) {
97
97
  return parseJsonOrUndefined(envValue, "debugNoisyPolicies");
98
98
  }
99
99
 
100
+ // Supported live-refresh LLM backends. codex-cli was removed because the
101
+ // Codex CLI's read-only sandbox still permits filesystem reads — agents
102
+ // could exfil ~/.aws/credentials, ~/.ssh/*, etc. via stdout into the
103
+ // glasses surface. Claude CLI is kept because --tools "" structurally
104
+ // disables file access; operators who want Codex use openai-compat
105
+ // pointed at the Codex API endpoint (tool-less).
106
+ const GLASSES_UI_LIVE_BACKENDS = new Set([
107
+ "claude-cli",
108
+ "anthropic-api",
109
+ "openai-compat",
110
+ ]);
111
+
112
+ const GLASSES_UI_LIVE_DEFAULT_MODEL = {
113
+ "claude-cli": "claude-haiku-4-5-20251001",
114
+ "anthropic-api": "anthropic/claude-haiku-4-5-20251001",
115
+ "openai-compat": "gpt-4o-mini",
116
+ };
117
+
118
+ function resolveGlassesUiLive(value) {
119
+ const raw = isObject(value) ? value : {};
120
+ const tickBackend = GLASSES_UI_LIVE_BACKENDS.has(raw.tickBackend)
121
+ ? raw.tickBackend
122
+ : "claude-cli";
123
+ const tickModel = pickString(raw.tickModel) || GLASSES_UI_LIVE_DEFAULT_MODEL[tickBackend];
124
+ const tickApiBaseUrl = pickString(raw.tickApiBaseUrl) || "https://api.openai.com";
125
+ return {
126
+ enabled: parseBool(raw.enabled, true),
127
+ tickBackend,
128
+ tickModel,
129
+ tickApiBaseUrl,
130
+ allowAgentModelOverride: parseBool(raw.allowAgentModelOverride, false),
131
+ tickMaxOutputTokens: parseIntOrDefault(raw.tickMaxOutputTokens, 200),
132
+ // Shell recipes run agent-supplied commands on a schedule as the plugin
133
+ // user. Default to disabled — operators must explicitly opt in via
134
+ // plugins.entries.ocuclaw.config.glassesUiLive.shellEnabled = true.
135
+ shellEnabled: parseBool(raw.shellEnabled, false),
136
+ // http recipes issue agent-influenced outbound network requests on a
137
+ // schedule. The recipe executor blocks loopback/RFC1918/link-local
138
+ // destinations and resolves hostnames through an SSRF-safe dispatcher,
139
+ // but the capability — "the plugin's gateway host can fetch arbitrary
140
+ // public URLs the agent chooses" — is itself worth an operator opt-in.
141
+ // Mirrors the shellEnabled default above; set
142
+ // plugins.entries.ocuclaw.config.glassesUiLive.httpEnabled = true to
143
+ // enable. The dispatcher protection still applies once enabled.
144
+ httpEnabled: parseBool(raw.httpEnabled, false),
145
+ llmEnabled: parseBool(raw.llmEnabled, true),
146
+ maxConcurrentSurfacesPerHost: parseIntOrDefault(raw.maxConcurrentSurfacesPerHost, 4),
147
+ };
148
+ }
149
+
100
150
  export function createRuntimeConfig(opts = {}) {
101
151
  const pluginConfig = isObject(opts.pluginConfig) ? opts.pluginConfig : {};
102
152
  const openclawConfig = isObject(opts.openclawConfig) ? opts.openclawConfig : {};
@@ -106,7 +156,13 @@ export function createRuntimeConfig(opts = {}) {
106
156
 
107
157
  if (!relayToken) {
108
158
  throw new Error(
109
- "OcuClaw relayToken is required. Set plugins.entries.ocuclaw.config.relayToken.",
159
+ [
160
+ "OcuClaw relayToken is required.",
161
+ "Set the plugin config with:",
162
+ ' openclaw config set plugins.entries.ocuclaw.config.relayToken "your-token"',
163
+ "The same token must be entered in the OcuClaw app's relay server token field within Even Hub.",
164
+ "Then restart the gateway: openclaw gateway restart",
165
+ ].join("\n"),
110
166
  );
111
167
  }
112
168
  if (!gatewayUrl) {
@@ -120,6 +176,22 @@ export function createRuntimeConfig(opts = {}) {
120
176
  );
121
177
  }
122
178
 
179
+ const evenAiEnabled = parseBool(pluginConfig.evenAiEnabled, false);
180
+ const evenAiToken = pickString(pluginConfig.evenAiToken);
181
+ if (evenAiEnabled && !evenAiToken) {
182
+ throw new Error(
183
+ [
184
+ "OcuClaw evenAiToken is required when evenAiEnabled is true.",
185
+ "Set the plugin config with:",
186
+ ' openclaw config set plugins.entries.ocuclaw.config.evenAiToken "your-token"',
187
+ "The same token must be entered as the password in the Even AI Agent Configure section of the Even Realities app.",
188
+ "To disable Even AI instead, run:",
189
+ " openclaw config set plugins.entries.ocuclaw.config.evenAiEnabled false --strict-json",
190
+ "Then restart the gateway: openclaw gateway restart",
191
+ ].join("\n"),
192
+ );
193
+ }
194
+
123
195
  return {
124
196
  gatewayUrl,
125
197
  gatewayToken,
@@ -140,8 +212,8 @@ export function createRuntimeConfig(opts = {}) {
140
212
  pluginConfig.externalDebugToolsEnabled,
141
213
  false,
142
214
  ),
143
- evenAiEnabled: parseBool(pluginConfig.evenAiEnabled, false),
144
- evenAiToken: pickString(pluginConfig.evenAiToken),
215
+ evenAiEnabled,
216
+ evenAiToken,
145
217
  evenAiSystemPrompt: pickString(pluginConfig.evenAiSystemPrompt),
146
218
  evenAiRequestTimeoutMs: parseIntOrDefault(
147
219
  pluginConfig.evenAiRequestTimeoutMs,
@@ -159,6 +231,12 @@ export function createRuntimeConfig(opts = {}) {
159
231
  evenAiDedicatedSessionKey: parseEvenAiDedicatedSessionKey(
160
232
  pluginConfig.evenAiDedicatedSessionKey,
161
233
  ),
234
+ renderGlassesUiTimeoutMs: parseIntOrDefault(
235
+ pluginConfig.renderGlassesUiTimeoutMs,
236
+ 30 * 60 * 1000,
237
+ ),
238
+ glassesUiLive: resolveGlassesUiLive(pluginConfig.glassesUiLive),
239
+ freshnessWindowMs: parseIntOrDefault(pluginConfig.freshnessWindowMs, 5000),
162
240
  };
163
241
  }
164
242