@earzbook/openclaw 0.1.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 +46 -0
- package/dist/adapter.d.ts +29 -0
- package/dist/adapter.d.ts.map +1 -0
- package/dist/adapter.js +368 -0
- package/dist/adapter.js.map +1 -0
- package/dist/config.d.ts +7 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +84 -0
- package/dist/config.js.map +1 -0
- package/dist/dispatch.d.ts +48 -0
- package/dist/dispatch.d.ts.map +1 -0
- package/dist/dispatch.js +261 -0
- package/dist/dispatch.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +571 -0
- package/dist/index.js.map +1 -0
- package/dist/lockfile.d.ts +20 -0
- package/dist/lockfile.d.ts.map +1 -0
- package/dist/lockfile.js +113 -0
- package/dist/lockfile.js.map +1 -0
- package/dist/logging.d.ts +5 -0
- package/dist/logging.d.ts.map +1 -0
- package/dist/logging.js +98 -0
- package/dist/logging.js.map +1 -0
- package/dist/platform/launchd.d.ts +12 -0
- package/dist/platform/launchd.d.ts.map +1 -0
- package/dist/platform/launchd.js +37 -0
- package/dist/platform/launchd.js.map +1 -0
- package/dist/platform/systemd.d.ts +10 -0
- package/dist/platform/systemd.d.ts.map +1 -0
- package/dist/platform/systemd.js +18 -0
- package/dist/platform/systemd.js.map +1 -0
- package/dist/self-update.d.ts +36 -0
- package/dist/self-update.d.ts.map +1 -0
- package/dist/self-update.js +151 -0
- package/dist/self-update.js.map +1 -0
- package/dist/types.d.ts +236 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +22 -0
- package/dist/types.js.map +1 -0
- package/package.json +48 -0
package/dist/dispatch.js
ADDED
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
// Dispatch an inbound user_message into the local OpenClaw agent and
|
|
2
|
+
// return the agent's reply text.
|
|
3
|
+
//
|
|
4
|
+
// We spawn `openclaw agent --agent <id> --message <text> --json --timeout
|
|
5
|
+
// <s>` per inbound, capture stdout, and extract the reply text. This is
|
|
6
|
+
// the same path a user would invoke by hand — we're just automating it.
|
|
7
|
+
//
|
|
8
|
+
// Concurrency: callers (index.ts) MUST serialize dispatches. A single
|
|
9
|
+
// sidecar = single user = single OpenClaw agent session; running two
|
|
10
|
+
// `openclaw agent` invocations concurrently against the same session is
|
|
11
|
+
// not supported by OpenClaw 2026.5.22.
|
|
12
|
+
//
|
|
13
|
+
// Timeout: hard-kill the child after agentTimeoutMs (default 120s). On
|
|
14
|
+
// timeout we surface a user-visible error reply so the app doesn't hang
|
|
15
|
+
// on the "thinking" indicator forever.
|
|
16
|
+
import { spawn } from "node:child_process";
|
|
17
|
+
import { log, warn, errLog } from "./logging.js";
|
|
18
|
+
const TAG = "[earzbook-sidecar:dispatch]";
|
|
19
|
+
/**
|
|
20
|
+
* Session-key namespace for ALL Earzbook-originated agent invocations.
|
|
21
|
+
*
|
|
22
|
+
* v1 (legacy / no-sessionKey-from-app): the sidecar uses bare
|
|
23
|
+
* `earzbook-app` — a single shared session for the user. Earlier in the
|
|
24
|
+
* project this was a hardcoded isolation invariant (no override allowed)
|
|
25
|
+
* to keep the chat context clean of unrelated CLI traffic.
|
|
26
|
+
*
|
|
27
|
+
* v1 multi-session (this change): the app now sends a `sessionKey` per
|
|
28
|
+
* inbound user_message. The sidecar resolves the OpenClaw session key as
|
|
29
|
+
* `earzbook-app:<sessionKey>` — same namespace prefix preserves isolation
|
|
30
|
+
* from non-Earzbook OpenClaw use on the same machine, while the suffix
|
|
31
|
+
* gives every chat its own dedicated trajectory file on disk (and thus
|
|
32
|
+
* its own isolated AI memory context).
|
|
33
|
+
*
|
|
34
|
+
* The bare `SESSION_KEY` constant is kept as the fallback for inbound
|
|
35
|
+
* frames that don't carry a sessionKey — this keeps old app versions
|
|
36
|
+
* working during rollout.
|
|
37
|
+
*
|
|
38
|
+
* The original "isolated from heartbeat / wake-up" guarantee still holds:
|
|
39
|
+
* the gateway's default session is `main`, ours starts with
|
|
40
|
+
* `earzbook-app`, so they never collide regardless of suffix.
|
|
41
|
+
*/
|
|
42
|
+
const SESSION_KEY = "earzbook-app";
|
|
43
|
+
/**
|
|
44
|
+
* Build the final --session-key argv value. Pure function; safe to test.
|
|
45
|
+
* Returns the legacy constant when no per-frame sessionKey is given.
|
|
46
|
+
*/
|
|
47
|
+
export function resolveSessionKey(perFrameSessionKey) {
|
|
48
|
+
if (!perFrameSessionKey)
|
|
49
|
+
return SESSION_KEY;
|
|
50
|
+
return `${SESSION_KEY}:${perFrameSessionKey}`;
|
|
51
|
+
}
|
|
52
|
+
/** Run one agent turn and return the reply text. */
|
|
53
|
+
export function dispatchToAgent(input) {
|
|
54
|
+
const timeoutMs = input.timeoutMs ?? 120_000;
|
|
55
|
+
const spawnFn = input.spawnFn ?? spawn;
|
|
56
|
+
const start = Date.now();
|
|
57
|
+
return new Promise(resolve => {
|
|
58
|
+
let resolved = false;
|
|
59
|
+
function finish(r) {
|
|
60
|
+
if (resolved)
|
|
61
|
+
return;
|
|
62
|
+
resolved = true;
|
|
63
|
+
resolve(r);
|
|
64
|
+
}
|
|
65
|
+
const resolvedSessionKey = resolveSessionKey(input.sessionKey);
|
|
66
|
+
log(TAG, `spawning openclaw agent agentId=${input.agentId} chars=${input.text.length} sessionKey=${resolvedSessionKey} (perFrame=${input.sessionKey ?? "(none)"})`);
|
|
67
|
+
let child;
|
|
68
|
+
try {
|
|
69
|
+
// ── Sidecar non-restriction policy ──────────────────────────────
|
|
70
|
+
// The argv below contains ONLY:
|
|
71
|
+
// - the protocol invariants (`agent`, `--message`, `--json`)
|
|
72
|
+
// - user-overridable plumbing (`--agent`, `--timeout`)
|
|
73
|
+
// - the session-key (per-message isolation — see resolveSessionKey
|
|
74
|
+
// above; v1 multi-session uses `earzbook-app:<sessionKey>` to
|
|
75
|
+
// give every app-side chat its own trajectory file).
|
|
76
|
+
//
|
|
77
|
+
// Anything else that affects OpenClaw behavior — model selection,
|
|
78
|
+
// thinking level, skills, workspace files, channels — must NOT be
|
|
79
|
+
// added here. Those are user choices that belong in the user's
|
|
80
|
+
// own ~/.openclaw/openclaw.json. If a future maintainer is
|
|
81
|
+
// tempted to add e.g. `--model` or `--thinking` to this argv,
|
|
82
|
+
// STOP — that's the sidecar dictating OpenClaw behavior to the
|
|
83
|
+
// end user, which is exactly the restriction we removed.
|
|
84
|
+
// ───────────────────────────────────────────────────────────────
|
|
85
|
+
child = spawnFn("openclaw", [
|
|
86
|
+
"agent",
|
|
87
|
+
"--agent",
|
|
88
|
+
input.agentId,
|
|
89
|
+
"--message",
|
|
90
|
+
input.text,
|
|
91
|
+
"--json",
|
|
92
|
+
// Per-message session isolation. See resolveSessionKey() docs.
|
|
93
|
+
"--session-key",
|
|
94
|
+
resolvedSessionKey,
|
|
95
|
+
// OpenClaw's --timeout is in seconds; ours in ms.
|
|
96
|
+
"--timeout",
|
|
97
|
+
String(Math.ceil(timeoutMs / 1000)),
|
|
98
|
+
], { stdio: ["ignore", "pipe", "pipe"] });
|
|
99
|
+
}
|
|
100
|
+
catch (e) {
|
|
101
|
+
const msg = e instanceof Error ? e.message : String(e);
|
|
102
|
+
errLog(TAG, `spawn threw: ${msg}`);
|
|
103
|
+
finish({
|
|
104
|
+
ok: false,
|
|
105
|
+
userVisibleError: `Earzbook couldn't start the local OpenClaw agent (${msg}). Is openclaw on your PATH?`,
|
|
106
|
+
durationMs: Date.now() - start,
|
|
107
|
+
});
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
let stdout = "";
|
|
111
|
+
let stderr = "";
|
|
112
|
+
child.stdout?.on("data", (chunk) => {
|
|
113
|
+
stdout += chunk.toString();
|
|
114
|
+
});
|
|
115
|
+
child.stderr?.on("data", (chunk) => {
|
|
116
|
+
stderr += chunk.toString();
|
|
117
|
+
});
|
|
118
|
+
const killTimer = setTimeout(() => {
|
|
119
|
+
warn(TAG, `agent run exceeded ${timeoutMs}ms — killing`);
|
|
120
|
+
try {
|
|
121
|
+
child.kill("SIGKILL");
|
|
122
|
+
}
|
|
123
|
+
catch {
|
|
124
|
+
/* ignore */
|
|
125
|
+
}
|
|
126
|
+
finish({
|
|
127
|
+
ok: false,
|
|
128
|
+
userVisibleError: `The agent took longer than ${Math.round(timeoutMs / 1000)}s and was stopped.`,
|
|
129
|
+
durationMs: Date.now() - start,
|
|
130
|
+
});
|
|
131
|
+
}, timeoutMs);
|
|
132
|
+
child.on("error", (e) => {
|
|
133
|
+
clearTimeout(killTimer);
|
|
134
|
+
errLog(TAG, `child error: ${e.message}`);
|
|
135
|
+
finish({
|
|
136
|
+
ok: false,
|
|
137
|
+
userVisibleError: `Earzbook couldn't invoke OpenClaw: ${e.message}`,
|
|
138
|
+
durationMs: Date.now() - start,
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
child.on("close", code => {
|
|
142
|
+
clearTimeout(killTimer);
|
|
143
|
+
const durationMs = Date.now() - start;
|
|
144
|
+
if (code !== 0) {
|
|
145
|
+
const tail = (stderr || stdout).slice(-400).trim();
|
|
146
|
+
warn(TAG, `agent exit code=${code} durationMs=${durationMs} stderr-tail="${tail}"`);
|
|
147
|
+
finish({
|
|
148
|
+
ok: false,
|
|
149
|
+
userVisibleError: friendlyAgentError(code, tail),
|
|
150
|
+
durationMs,
|
|
151
|
+
});
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
const text = extractReplyText(stdout);
|
|
155
|
+
log(TAG, `agent ok chars=${text.length} durationMs=${durationMs}`);
|
|
156
|
+
finish({ ok: true, replyText: text, durationMs });
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Pull the reply text out of `openclaw agent --json` stdout.
|
|
162
|
+
*
|
|
163
|
+
* OpenClaw 2026.5.22 emits this shape on success (verified against a real
|
|
164
|
+
* run):
|
|
165
|
+
* {
|
|
166
|
+
* "payloads": [{"text": "...", "mediaUrl": null}],
|
|
167
|
+
* "meta": { ..., "finalAssistantVisibleText": "...", ... }
|
|
168
|
+
* }
|
|
169
|
+
*
|
|
170
|
+
* `payloads[0].text` is the canonical reply text. `finalAssistantVisibleText`
|
|
171
|
+
* is a meta mirror — usually identical, but we treat it as a fallback.
|
|
172
|
+
* Older candidates (output/reply/text at top level) stay in the list so we
|
|
173
|
+
* don't break if OpenClaw changes the shape.
|
|
174
|
+
*/
|
|
175
|
+
export function extractReplyText(stdout) {
|
|
176
|
+
const trimmed = stdout.trim();
|
|
177
|
+
if (trimmed.length === 0)
|
|
178
|
+
return "(no response)";
|
|
179
|
+
// Try whole-stdout JSON first.
|
|
180
|
+
try {
|
|
181
|
+
const parsed = JSON.parse(trimmed);
|
|
182
|
+
// OpenClaw's canonical shape: payloads[].text (may have multiple
|
|
183
|
+
// payloads for multi-part replies; concatenate the text fields).
|
|
184
|
+
const payloads = parsed.payloads;
|
|
185
|
+
if (Array.isArray(payloads) && payloads.length > 0) {
|
|
186
|
+
const texts = [];
|
|
187
|
+
for (const p of payloads) {
|
|
188
|
+
if (p && typeof p === "object") {
|
|
189
|
+
const t = p.text;
|
|
190
|
+
if (typeof t === "string")
|
|
191
|
+
texts.push(t);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
const joined = texts.join("\n").trim();
|
|
195
|
+
if (joined.length > 0)
|
|
196
|
+
return joined;
|
|
197
|
+
}
|
|
198
|
+
// Meta fallback — same text as payloads[].text in practice.
|
|
199
|
+
const meta = parsed.meta;
|
|
200
|
+
if (meta) {
|
|
201
|
+
const candidates = [
|
|
202
|
+
meta.finalAssistantVisibleText,
|
|
203
|
+
meta.finalAssistantRawText,
|
|
204
|
+
];
|
|
205
|
+
for (const c of candidates) {
|
|
206
|
+
if (typeof c === "string" && c.length > 0)
|
|
207
|
+
return c;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
// Older / alternate shapes — kept for forward compat.
|
|
211
|
+
const candidates = [
|
|
212
|
+
parsed.output,
|
|
213
|
+
parsed.reply,
|
|
214
|
+
parsed.text,
|
|
215
|
+
parsed.message,
|
|
216
|
+
parsed.result?.text,
|
|
217
|
+
parsed.result?.output,
|
|
218
|
+
];
|
|
219
|
+
for (const c of candidates) {
|
|
220
|
+
if (typeof c === "string" && c.length > 0)
|
|
221
|
+
return c;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
catch {
|
|
225
|
+
/* not whole-doc JSON — try line-delimited */
|
|
226
|
+
}
|
|
227
|
+
// Fallback: look for the LAST line that parses as a JSON object with a
|
|
228
|
+
// text-ish field (OpenClaw streams JSON events in some modes).
|
|
229
|
+
const lines = trimmed.split("\n").reverse();
|
|
230
|
+
for (const line of lines) {
|
|
231
|
+
const l = line.trim();
|
|
232
|
+
if (!l.startsWith("{"))
|
|
233
|
+
continue;
|
|
234
|
+
try {
|
|
235
|
+
const parsed = JSON.parse(l);
|
|
236
|
+
const c = parsed.text ?? parsed.output ?? parsed.reply;
|
|
237
|
+
if (typeof c === "string" && c.length > 0)
|
|
238
|
+
return c;
|
|
239
|
+
}
|
|
240
|
+
catch {
|
|
241
|
+
/* skip non-JSON */
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
// Last resort: return the raw stdout — better than dropping the reply.
|
|
245
|
+
return trimmed;
|
|
246
|
+
}
|
|
247
|
+
/** Map common agent exit failures to user-readable copy. */
|
|
248
|
+
function friendlyAgentError(code, tail) {
|
|
249
|
+
const lower = tail.toLowerCase();
|
|
250
|
+
if (lower.includes("credit balance is too low") || lower.includes("billing")) {
|
|
251
|
+
return "Your Anthropic credits are depleted. Top up at console.anthropic.com to continue chatting.";
|
|
252
|
+
}
|
|
253
|
+
if (lower.includes("gateway") && lower.includes("connect")) {
|
|
254
|
+
return "Your local OpenClaw gateway isn't reachable. Try `openclaw gateway restart`.";
|
|
255
|
+
}
|
|
256
|
+
if (code === 127) {
|
|
257
|
+
return "The `openclaw` command wasn't found on PATH for the sidecar.";
|
|
258
|
+
}
|
|
259
|
+
return `OpenClaw agent run failed (ex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