ocuclaw 0.1.0 → 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.
- package/README.md +63 -8
- package/dist/config/runtime-config.js +81 -3
- package/dist/domain/activity-status-adapter.js +138 -605
- package/dist/domain/activity-status-arbiter.js +109 -0
- package/dist/domain/activity-status-labels.js +906 -0
- package/dist/domain/code-span-regions.js +103 -0
- package/dist/domain/conversation-state.js +14 -1
- package/dist/domain/debug-store.js +41 -184
- package/dist/domain/glasses-ui-content-summary.js +62 -0
- package/dist/domain/glasses-ui-system-prompt.js +28 -0
- package/dist/domain/message-emoji-allowlist.js +16 -0
- package/dist/domain/message-emoji-filter.js +33 -55
- package/dist/domain/neural-emoji-reactor-system-prompt.js +43 -0
- package/dist/domain/neural-emoji-reactor-tag-config.js +56 -0
- package/dist/domain/neural-pace-modulator-system-prompt.js +32 -0
- package/dist/domain/neural-pace-modulator-tag-config.js +51 -0
- package/dist/domain/tagged-span-parser.js +121 -0
- package/dist/domain/tagged-span-strip.js +38 -0
- package/dist/even-ai/even-ai-endpoint.js +91 -0
- package/dist/even-ai/even-ai-run-waiter.js +14 -0
- package/dist/even-ai/even-ai-settings-store.js +14 -0
- package/dist/gateway/gateway-bridge.js +14 -2
- package/dist/gateway/gateway-timing-ledger.js +457 -0
- package/dist/gateway/openclaw-client.js +462 -38
- package/dist/index.js +28 -1
- package/dist/runtime/downstream-handler.js +909 -68
- package/dist/runtime/downstream-server.js +1004 -512
- package/dist/runtime/ocuclaw-settings-store.js +74 -31
- package/dist/runtime/plugin-update-service.js +216 -0
- package/dist/runtime/protocol-adapter.js +9 -0
- package/dist/runtime/provider-usage-select.js +168 -0
- package/dist/runtime/relay-client-nudge-controller.js +553 -0
- package/dist/runtime/relay-core.js +1357 -210
- package/dist/runtime/relay-health-monitor.js +172 -0
- package/dist/runtime/relay-operation-registry.js +263 -0
- package/dist/runtime/relay-service.js +201 -1
- package/dist/runtime/relay-worker-approval-replay-cache.js +68 -0
- package/dist/runtime/relay-worker-entry.js +32 -0
- package/dist/runtime/relay-worker-health.js +272 -0
- package/dist/runtime/relay-worker-protocol.js +285 -0
- package/dist/runtime/relay-worker-queue.js +202 -0
- package/dist/runtime/relay-worker-supervisor.js +1081 -0
- package/dist/runtime/relay-worker-transport.js +1051 -0
- package/dist/runtime/session-context-service.js +189 -0
- package/dist/runtime/session-service.js +656 -38
- package/dist/runtime/upstream-runtime.js +1167 -60
- package/dist/tools/device-info-tool.js +242 -0
- package/dist/tools/glasses-ui-cron.js +427 -0
- package/dist/tools/glasses-ui-descriptors.js +261 -0
- package/dist/tools/glasses-ui-limits.js +21 -0
- package/dist/tools/glasses-ui-paint-floor.js +99 -0
- package/dist/tools/glasses-ui-recipes.js +746 -0
- package/dist/tools/glasses-ui-surfaces.js +278 -0
- package/dist/tools/glasses-ui-template.js +182 -0
- package/dist/tools/glasses-ui-tool.js +1147 -0
- package/dist/tools/session-title-tool.js +209 -0
- package/dist/version.js +2 -0
- package/openclaw.plugin.json +163 -15
- package/package.json +12 -4
package/README.md
CHANGED
|
@@ -1,25 +1,80 @@
|
|
|
1
1
|
# OcuClaw
|
|
2
2
|
|
|
3
|
-
OcuClaw is an OpenClaw plugin for Even G2 smart glasses.
|
|
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
|
+
|
|
5
|
+
## Requirements
|
|
6
|
+
|
|
7
|
+
OpenClaw `>= 2026.5.20` (older versions have a known plugin-install bug). Upgrade with `npm install -g openclaw@latest`.
|
|
4
8
|
|
|
5
9
|
## Install
|
|
6
10
|
|
|
11
|
+
Install the plugin from the OpenClaw CLI:
|
|
12
|
+
|
|
7
13
|
```bash
|
|
8
14
|
openclaw plugins install ocuclaw
|
|
9
|
-
openclaw plugins enable ocuclaw
|
|
10
15
|
```
|
|
11
16
|
|
|
12
17
|
## Configure
|
|
13
18
|
|
|
14
|
-
|
|
19
|
+
Required:
|
|
20
|
+
|
|
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.
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
openclaw config set plugins.entries.ocuclaw.config.relayToken "your-relay-token"
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Recommended:
|
|
28
|
+
|
|
29
|
+
- `sonioxApiKey`: Enables Soniox speech-to-text for voice input.
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
openclaw config set plugins.entries.ocuclaw.config.sonioxApiKey "your-soniox-api-key"
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
- `evenAiEnabled`: Enables Even AI integration for OcuClaw.
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
openclaw config set plugins.entries.ocuclaw.config.evenAiEnabled true --strict-json
|
|
39
|
+
```
|
|
40
|
+
|
|
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.
|
|
15
42
|
|
|
16
43
|
```bash
|
|
17
|
-
openclaw config set plugins.entries.ocuclaw.config.
|
|
44
|
+
openclaw config set plugins.entries.ocuclaw.config.evenAiToken "your-even-ai-token"
|
|
18
45
|
```
|
|
19
46
|
|
|
20
|
-
|
|
47
|
+
> **Note:** When `evenAiEnabled` is `true`, `evenAiToken` is required. Config validation will reject the change if you enable Even AI without setting the token.
|
|
21
48
|
|
|
22
|
-
|
|
49
|
+
Advanced optional settings:
|
|
23
50
|
|
|
24
|
-
|
|
25
|
-
|
|
51
|
+
```bash
|
|
52
|
+
openclaw config set plugins.entries.ocuclaw.config.wsBind "127.0.0.1"
|
|
53
|
+
openclaw config set plugins.entries.ocuclaw.config.wsPort 9000 --strict-json
|
|
54
|
+
openclaw config set plugins.entries.ocuclaw.config.sessionLimit 10 --strict-json
|
|
55
|
+
openclaw config set plugins.entries.ocuclaw.config.externalDebugToolsEnabled true --strict-json
|
|
56
|
+
```
|
|
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
|
+
|
|
66
|
+
## Restart
|
|
67
|
+
|
|
68
|
+
Restart the gateway so the plugin and config changes take effect:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
openclaw gateway restart
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Verify
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
openclaw plugins inspect ocuclaw --runtime
|
|
78
|
+
openclaw plugins doctor
|
|
79
|
+
openclaw gateway status
|
|
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
|
-
|
|
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
|
|
144
|
-
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
|
|