@shardworks/claude-code-apparatus 0.1.269 → 0.1.271
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 +8 -12
- package/dist/babysitter.d.ts +10 -142
- package/dist/babysitter.d.ts.map +1 -1
- package/dist/babysitter.js +23 -344
- package/dist/babysitter.js.map +1 -1
- package/dist/index.d.ts +17 -50
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +30 -90
- package/dist/index.js.map +1 -1
- package/dist/runtime.d.ts +165 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +357 -0
- package/dist/runtime.js.map +1 -0
- package/package.json +5 -5
package/dist/runtime.js
ADDED
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Babysitter runtime toolkit — single-purpose primitives shared by the
|
|
3
|
+
* orchestrator and proxy in `babysitter.ts`.
|
|
4
|
+
*
|
|
5
|
+
* Each export is a small, self-contained piece: stdin parsing, retrying
|
|
6
|
+
* HTTP, the DLQ writer, the SQLite trio, the lifecycle reporters, and
|
|
7
|
+
* the stderr redirector. The orchestrator composes them; this module
|
|
8
|
+
* does not know about the orchestrator.
|
|
9
|
+
*
|
|
10
|
+
* See: docs/architecture/detached-sessions.md
|
|
11
|
+
*/
|
|
12
|
+
import fs from 'node:fs';
|
|
13
|
+
import path from 'node:path';
|
|
14
|
+
import { toolNameToRoute } from '@shardworks/tools-apparatus';
|
|
15
|
+
import { extractFinalAssistantText } from "./index.js";
|
|
16
|
+
// ── Retry constants ─────────────────────────────────────────────────────
|
|
17
|
+
const RETRY_INITIAL_DELAY_MS = 1_000;
|
|
18
|
+
const RETRY_MAX_DELAY_MS = 8_000;
|
|
19
|
+
const RETRY_TIMEOUT_MS = 60_000;
|
|
20
|
+
const RETRYABLE_CODES = new Set(['ECONNREFUSED', 'ECONNRESET', 'ETIMEDOUT']);
|
|
21
|
+
/**
|
|
22
|
+
* Walk an error's cause chain looking for a retryable error code.
|
|
23
|
+
* Returns the first retryable code found, or null if none.
|
|
24
|
+
* Caps traversal depth to prevent infinite loops from circular cause chains.
|
|
25
|
+
*/
|
|
26
|
+
export function findRetryableCode(err, maxDepth = 5) {
|
|
27
|
+
let current = err;
|
|
28
|
+
for (let i = 0; i < maxDepth && current != null; i++) {
|
|
29
|
+
const code = current.code;
|
|
30
|
+
if (code && RETRYABLE_CODES.has(code)) {
|
|
31
|
+
return code;
|
|
32
|
+
}
|
|
33
|
+
current = current.cause;
|
|
34
|
+
}
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
// ── stdin config reader ─────────────────────────────────────────────────
|
|
38
|
+
/**
|
|
39
|
+
* Read the babysitter config from stdin.
|
|
40
|
+
*
|
|
41
|
+
* Reads stdin to completion, parses the JSON, and validates required fields.
|
|
42
|
+
* The spawning process writes config and closes the write end.
|
|
43
|
+
*/
|
|
44
|
+
export async function readConfigFromStdin(stream = process.stdin) {
|
|
45
|
+
const chunks = [];
|
|
46
|
+
for await (const chunk of stream) {
|
|
47
|
+
chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
|
|
48
|
+
}
|
|
49
|
+
const raw = Buffer.concat(chunks).toString('utf-8');
|
|
50
|
+
if (!raw.trim()) {
|
|
51
|
+
throw new Error('Empty config received on stdin');
|
|
52
|
+
}
|
|
53
|
+
let parsed;
|
|
54
|
+
try {
|
|
55
|
+
parsed = JSON.parse(raw);
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
throw new Error(`Invalid JSON config on stdin: ${raw.slice(0, 200)}`);
|
|
59
|
+
}
|
|
60
|
+
const config = parsed;
|
|
61
|
+
// Validate required fields
|
|
62
|
+
const required = [
|
|
63
|
+
'sessionId', 'guildToolUrl', 'dbPath', 'logDir', 'claudeArgs',
|
|
64
|
+
'cwd', 'env', 'prompt', 'tools', 'startedAt', 'provider',
|
|
65
|
+
];
|
|
66
|
+
for (const field of required) {
|
|
67
|
+
if (config[field] === undefined || config[field] === null) {
|
|
68
|
+
throw new Error(`Missing required config field: ${field}`);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return config;
|
|
72
|
+
}
|
|
73
|
+
// ── HTTP retry helper ───────────────────────────────────────────────────
|
|
74
|
+
/**
|
|
75
|
+
* Call a guild HTTP API endpoint with exponential backoff retry.
|
|
76
|
+
*
|
|
77
|
+
* Retries on connection errors (ECONNREFUSED, ECONNRESET, ETIMEDOUT).
|
|
78
|
+
* Returns the parsed JSON response on success.
|
|
79
|
+
* Throws after RETRY_TIMEOUT_MS of retrying.
|
|
80
|
+
*/
|
|
81
|
+
/**
|
|
82
|
+
* Encode a params object as a query string for GET requests.
|
|
83
|
+
*
|
|
84
|
+
* Scalars (string/number/boolean) become their string form. Arrays and
|
|
85
|
+
* objects are JSON-encoded so the tool-server can still parse them after
|
|
86
|
+
* its param coercion pass (though read-tools generally take scalar
|
|
87
|
+
* inputs). null/undefined values are skipped.
|
|
88
|
+
*/
|
|
89
|
+
function encodeParamsAsQuery(params) {
|
|
90
|
+
if (params == null || typeof params !== 'object')
|
|
91
|
+
return '';
|
|
92
|
+
const usp = new URLSearchParams();
|
|
93
|
+
for (const [key, value] of Object.entries(params)) {
|
|
94
|
+
if (value == null)
|
|
95
|
+
continue;
|
|
96
|
+
if (typeof value === 'string') {
|
|
97
|
+
usp.set(key, value);
|
|
98
|
+
}
|
|
99
|
+
else if (typeof value === 'number' || typeof value === 'boolean') {
|
|
100
|
+
usp.set(key, String(value));
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
usp.set(key, JSON.stringify(value));
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
const s = usp.toString();
|
|
107
|
+
return s.length > 0 ? `?${s}` : '';
|
|
108
|
+
}
|
|
109
|
+
export async function callGuildHttpApi(url, sessionId, body, timeoutMs = RETRY_TIMEOUT_MS, method = 'POST') {
|
|
110
|
+
const startTime = Date.now();
|
|
111
|
+
let delay = RETRY_INITIAL_DELAY_MS;
|
|
112
|
+
let lastError;
|
|
113
|
+
// GET can't carry a body — encode params as query string instead.
|
|
114
|
+
const targetUrl = method === 'GET' ? `${url}${encodeParamsAsQuery(body)}` : url;
|
|
115
|
+
const requestBody = method === 'GET' ? undefined : JSON.stringify(body);
|
|
116
|
+
while (Date.now() - startTime < timeoutMs) {
|
|
117
|
+
try {
|
|
118
|
+
const response = await fetch(targetUrl, {
|
|
119
|
+
method,
|
|
120
|
+
headers: {
|
|
121
|
+
'Content-Type': 'application/json',
|
|
122
|
+
'X-Session-Id': sessionId,
|
|
123
|
+
},
|
|
124
|
+
...(requestBody !== undefined ? { body: requestBody } : {}),
|
|
125
|
+
});
|
|
126
|
+
if (!response.ok) {
|
|
127
|
+
const text = await response.text().catch(() => '');
|
|
128
|
+
throw new Error(`HTTP ${response.status}: ${text.slice(0, 500)}`);
|
|
129
|
+
}
|
|
130
|
+
return await response.json();
|
|
131
|
+
}
|
|
132
|
+
catch (err) {
|
|
133
|
+
lastError = err instanceof Error ? err : new Error(String(err));
|
|
134
|
+
// Check if the error is retryable (connection-level error in the cause chain)
|
|
135
|
+
const isRetryable = findRetryableCode(err) !== null;
|
|
136
|
+
if (!isRetryable) {
|
|
137
|
+
throw lastError;
|
|
138
|
+
}
|
|
139
|
+
// Wait before retrying
|
|
140
|
+
const remaining = timeoutMs - (Date.now() - startTime);
|
|
141
|
+
if (remaining <= 0)
|
|
142
|
+
break;
|
|
143
|
+
await new Promise((resolve) => setTimeout(resolve, Math.min(delay, remaining)));
|
|
144
|
+
delay = Math.min(delay * 2, RETRY_MAX_DELAY_MS);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
throw new Error(`Guild HTTP API unreachable after ${timeoutMs}ms: ${lastError?.message ?? 'unknown error'}`);
|
|
148
|
+
}
|
|
149
|
+
// ── DLQ writer ──────────────────────────────────────────────────────────
|
|
150
|
+
/**
|
|
151
|
+
* Write a payload to the Dead Letter Queue.
|
|
152
|
+
*
|
|
153
|
+
* Creates the DLQ directory if it doesn't exist. Writes the payload as
|
|
154
|
+
* pretty-printed JSON. Used as a fallback when the guild HTTP API is
|
|
155
|
+
* unreachable for lifecycle calls.
|
|
156
|
+
*/
|
|
157
|
+
export function writeToDlq(cwd, filename, payload) {
|
|
158
|
+
const dlqDir = path.join(cwd, '.nexus', 'dlq');
|
|
159
|
+
fs.mkdirSync(dlqDir, { recursive: true });
|
|
160
|
+
fs.writeFileSync(path.join(dlqDir, filename), JSON.stringify(payload, null, 2));
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Open the guild's SQLite database for transcript streaming.
|
|
164
|
+
*
|
|
165
|
+
* Creates the database file and table if they don't exist.
|
|
166
|
+
* Enables WAL mode for concurrent read access by other processes
|
|
167
|
+
* (Oculus, CLI queries, other agents).
|
|
168
|
+
*
|
|
169
|
+
* Uses dynamic import() to load better-sqlite3 at runtime. This avoids
|
|
170
|
+
* requiring the native module at import time (beneficial for type-checking
|
|
171
|
+
* and testing).
|
|
172
|
+
*/
|
|
173
|
+
export async function openTranscriptDb(dbPath) {
|
|
174
|
+
const { default: Database } = await import('better-sqlite3');
|
|
175
|
+
return initTranscriptDb(Database, dbPath);
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Initialize a TranscriptDb from a Database constructor.
|
|
179
|
+
*
|
|
180
|
+
* Shared logic between openTranscriptDb() and test injection.
|
|
181
|
+
* Exported for testing — allows injecting a mock Database constructor.
|
|
182
|
+
*/
|
|
183
|
+
export function initTranscriptDb(DatabaseConstructor, dbPath) {
|
|
184
|
+
const raw = new DatabaseConstructor(dbPath);
|
|
185
|
+
raw.pragma('journal_mode = WAL');
|
|
186
|
+
raw.exec(`
|
|
187
|
+
CREATE TABLE IF NOT EXISTS books_animator_transcripts (
|
|
188
|
+
id TEXT PRIMARY KEY,
|
|
189
|
+
content TEXT NOT NULL
|
|
190
|
+
)
|
|
191
|
+
`);
|
|
192
|
+
const stmt = raw.prepare('INSERT OR REPLACE INTO books_animator_transcripts (id, content) VALUES (?, ?)');
|
|
193
|
+
return {
|
|
194
|
+
writeTranscript(sessionId, content) {
|
|
195
|
+
stmt.run(sessionId, content);
|
|
196
|
+
},
|
|
197
|
+
close() {
|
|
198
|
+
raw.close();
|
|
199
|
+
},
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Write the current transcript to SQLite.
|
|
204
|
+
*/
|
|
205
|
+
export function writeTranscript(db, sessionId, messages) {
|
|
206
|
+
const content = JSON.stringify({ id: sessionId, messages });
|
|
207
|
+
db.writeTranscript(sessionId, content);
|
|
208
|
+
}
|
|
209
|
+
// ── Session lifecycle reporting ─────────────────────────────────────────
|
|
210
|
+
/**
|
|
211
|
+
* Report "running" status to the guild via the session-running tool.
|
|
212
|
+
*
|
|
213
|
+
* If the guild is unreachable, writes the payload to the DLQ.
|
|
214
|
+
*/
|
|
215
|
+
export async function reportRunning(config, cancelHandle, timeoutMs) {
|
|
216
|
+
const route = toolNameToRoute('session-running');
|
|
217
|
+
const url = `${config.guildToolUrl}${route}`;
|
|
218
|
+
const payload = {
|
|
219
|
+
sessionId: config.sessionId,
|
|
220
|
+
startedAt: config.startedAt,
|
|
221
|
+
provider: config.provider,
|
|
222
|
+
metadata: config.metadata,
|
|
223
|
+
cancelHandle,
|
|
224
|
+
};
|
|
225
|
+
try {
|
|
226
|
+
await callGuildHttpApi(url, config.sessionId, payload, timeoutMs);
|
|
227
|
+
}
|
|
228
|
+
catch {
|
|
229
|
+
writeToDlq(config.cwd, `${config.sessionId}-running.json`, payload);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Resolve the terminal status and error text for a terminated session.
|
|
234
|
+
*
|
|
235
|
+
* Cascade order:
|
|
236
|
+
* 1. A `'cancelled'` override (SIGTERM path) — short-circuits.
|
|
237
|
+
* 2. A `terminationTag` already carried on the StreamJsonResult —
|
|
238
|
+
* set by the NDJSON detection cascade inside
|
|
239
|
+
* `parseStreamJsonMessage` (the only active detector).
|
|
240
|
+
* 3. Generic exit-code mapping (0 → completed, non-zero → failed).
|
|
241
|
+
*
|
|
242
|
+
* Generic non-zero exit codes surface as `'failed'`; the Animator's
|
|
243
|
+
* back-off machine only reacts to structured rate-limit terminals, and
|
|
244
|
+
* exit-code-based detection was retired because it produced
|
|
245
|
+
* false-positive pauses.
|
|
246
|
+
*
|
|
247
|
+
* Returns the payload status, a human-readable error string (only
|
|
248
|
+
* populated for the failed branches), and the tag that informed the
|
|
249
|
+
* decision (if any). The tag is forwarded to the guild so the Animator's
|
|
250
|
+
* back-off machine can disambiguate rate-limit terminations without
|
|
251
|
+
* pattern-matching on error text.
|
|
252
|
+
*/
|
|
253
|
+
export function resolveTerminalStatus(result, statusOverride) {
|
|
254
|
+
if (statusOverride === 'cancelled') {
|
|
255
|
+
return { status: 'cancelled' };
|
|
256
|
+
}
|
|
257
|
+
// Second priority: a structural NDJSON tag observed during stream
|
|
258
|
+
// parsing. Fire even on exit code 0 because claude may emit the
|
|
259
|
+
// rate-limit signal and still exit cleanly.
|
|
260
|
+
if (result.terminationTag) {
|
|
261
|
+
return {
|
|
262
|
+
status: 'rate-limited',
|
|
263
|
+
error: result.terminationTag.detail ?? `Anima provider reported a rate limit (source: ${result.terminationTag.source})`,
|
|
264
|
+
terminationTag: result.terminationTag,
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
if (result.exitCode === 0) {
|
|
268
|
+
return { status: 'completed' };
|
|
269
|
+
}
|
|
270
|
+
return {
|
|
271
|
+
status: 'failed',
|
|
272
|
+
error: `claude exited with code ${result.exitCode}`,
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
/** Maximum number of characters to retain for the diagnostic stderr tail. */
|
|
276
|
+
export const STDERR_DIAGNOSTIC_TAIL_LIMIT = 200;
|
|
277
|
+
/**
|
|
278
|
+
* Report the final session result to the guild via the session-record tool.
|
|
279
|
+
*
|
|
280
|
+
* When the resolved terminal status is exactly `'failed'` (non-zero exit,
|
|
281
|
+
* no structured termination tag, no cancel override), attach a passive
|
|
282
|
+
* `terminationDiagnostic: { exitCode, stderrExcerpt? }` to the payload.
|
|
283
|
+
* The diagnostic is informational only — the Animator's back-off
|
|
284
|
+
* machine never consumes it. The stderr excerpt is only present when
|
|
285
|
+
* the caller supplied a non-empty tail.
|
|
286
|
+
*
|
|
287
|
+
* If the guild is unreachable, writes the payload to the DLQ.
|
|
288
|
+
*/
|
|
289
|
+
export async function reportResult(config, result, transcript, timeoutMs, statusOverride, stderrTail) {
|
|
290
|
+
const route = toolNameToRoute('session-record');
|
|
291
|
+
const url = `${config.guildToolUrl}${route}`;
|
|
292
|
+
const resolved = resolveTerminalStatus(result, statusOverride);
|
|
293
|
+
const output = extractFinalAssistantText(transcript);
|
|
294
|
+
// Only attach the passive diagnostic on a clean `'failed'` bucket —
|
|
295
|
+
// timeout / cancelled / rate-limited are already well-classified.
|
|
296
|
+
const terminationDiagnostic = resolved.status === 'failed'
|
|
297
|
+
? {
|
|
298
|
+
exitCode: result.exitCode,
|
|
299
|
+
...(stderrTail && stderrTail.length > 0 ? { stderrExcerpt: stderrTail } : {}),
|
|
300
|
+
}
|
|
301
|
+
: undefined;
|
|
302
|
+
const payload = {
|
|
303
|
+
sessionId: config.sessionId,
|
|
304
|
+
status: resolved.status,
|
|
305
|
+
exitCode: result.exitCode,
|
|
306
|
+
signal: result.signal,
|
|
307
|
+
error: resolved.error,
|
|
308
|
+
costUsd: result.costUsd,
|
|
309
|
+
tokenUsage: result.tokenUsage,
|
|
310
|
+
output,
|
|
311
|
+
providerSessionId: result.providerSessionId,
|
|
312
|
+
transcript,
|
|
313
|
+
...(resolved.terminationTag ? { terminationTag: resolved.terminationTag } : {}),
|
|
314
|
+
...(terminationDiagnostic ? { terminationDiagnostic } : {}),
|
|
315
|
+
};
|
|
316
|
+
try {
|
|
317
|
+
await callGuildHttpApi(url, config.sessionId, payload, timeoutMs);
|
|
318
|
+
}
|
|
319
|
+
catch {
|
|
320
|
+
writeToDlq(config.cwd, `${config.sessionId}.json`, payload);
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
// ── Stderr redirect ────────────────────────────────────────────────────
|
|
324
|
+
/**
|
|
325
|
+
* Open a per-session log file and redirect process.stderr.write to it.
|
|
326
|
+
*
|
|
327
|
+
* Creates the logDir (recursive) and opens `<logDir>/<sessionId>.log`
|
|
328
|
+
* for append-writing. Replaces process.stderr.write with a function
|
|
329
|
+
* that calls fs.writeSync on the owned fd. Writes the startup banner
|
|
330
|
+
* as the first line.
|
|
331
|
+
*
|
|
332
|
+
* Returns the owned fd so the caller can close it in a finally block.
|
|
333
|
+
*
|
|
334
|
+
* @internal Exported for testing only.
|
|
335
|
+
*/
|
|
336
|
+
export function redirectStderrToFile(logDir, sessionId) {
|
|
337
|
+
fs.mkdirSync(logDir, { recursive: true });
|
|
338
|
+
const logFilePath = path.join(logDir, `${sessionId}.log`);
|
|
339
|
+
const fd = fs.openSync(logFilePath, 'a');
|
|
340
|
+
// Replace process.stderr.write with a function that writes to our fd.
|
|
341
|
+
process.stderr.write = function (chunk, encodingOrCallback, callback) {
|
|
342
|
+
const encoding = typeof encodingOrCallback === 'string' ? encodingOrCallback : 'utf8';
|
|
343
|
+
const cb = typeof encodingOrCallback === 'function' ? encodingOrCallback : callback;
|
|
344
|
+
const buffer = typeof chunk === 'string'
|
|
345
|
+
? Buffer.from(chunk, encoding)
|
|
346
|
+
: chunk;
|
|
347
|
+
fs.writeSync(fd, buffer);
|
|
348
|
+
if (cb)
|
|
349
|
+
cb();
|
|
350
|
+
return true;
|
|
351
|
+
};
|
|
352
|
+
// Write the startup banner (now goes to the log file).
|
|
353
|
+
const pgid = process.getgid?.() ?? process.pid;
|
|
354
|
+
process.stderr.write(`[babysitter] session=${sessionId} pid=${process.pid} pgid=${pgid} log=${logFilePath} started at ${new Date().toISOString()}\n`);
|
|
355
|
+
return fd;
|
|
356
|
+
}
|
|
357
|
+
//# sourceMappingURL=runtime.js.map
|
|
@@ -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ED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shardworks/claude-code-apparatus",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.271",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -26,14 +26,14 @@
|
|
|
26
26
|
"@modelcontextprotocol/sdk": "1.27.1",
|
|
27
27
|
"better-sqlite3": "12.8.0",
|
|
28
28
|
"zod": "4.3.6",
|
|
29
|
-
"@shardworks/animator-apparatus": "0.1.
|
|
30
|
-
"@shardworks/stacks-apparatus": "0.1.
|
|
31
|
-
"@shardworks/tools-apparatus": "0.1.
|
|
29
|
+
"@shardworks/animator-apparatus": "0.1.271",
|
|
30
|
+
"@shardworks/stacks-apparatus": "0.1.271",
|
|
31
|
+
"@shardworks/tools-apparatus": "0.1.271"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/better-sqlite3": "7.6.13",
|
|
35
35
|
"@types/node": "25.5.0",
|
|
36
|
-
"@shardworks/nexus-core": "0.1.
|
|
36
|
+
"@shardworks/nexus-core": "0.1.271"
|
|
37
37
|
},
|
|
38
38
|
"files": [
|
|
39
39
|
"dist"
|