@excitedjs/agent-runtime-claude-code 0.2.0-alpha.g0ddd418597ca
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/LICENSE +21 -0
- package/README.md +32 -0
- package/dist/args.d.ts +71 -0
- package/dist/args.d.ts.map +1 -0
- package/dist/args.js +87 -0
- package/dist/args.js.map +1 -0
- package/dist/config.d.ts +71 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +86 -0
- package/dist/config.js.map +1 -0
- package/dist/diagnostic.d.ts +12 -0
- package/dist/diagnostic.d.ts.map +1 -0
- package/dist/diagnostic.js +25 -0
- package/dist/diagnostic.js.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/completion-body.d.ts +38 -0
- package/dist/internal/completion-body.d.ts.map +1 -0
- package/dist/internal/completion-body.js +62 -0
- package/dist/internal/completion-body.js.map +1 -0
- package/dist/internal/config-validate.d.ts +23 -0
- package/dist/internal/config-validate.d.ts.map +1 -0
- package/dist/internal/config-validate.js +122 -0
- package/dist/internal/config-validate.js.map +1 -0
- package/dist/internal/os.d.ts +30 -0
- package/dist/internal/os.d.ts.map +1 -0
- package/dist/internal/os.js +81 -0
- package/dist/internal/os.js.map +1 -0
- package/dist/internal/turn-render.d.ts +22 -0
- package/dist/internal/turn-render.d.ts.map +1 -0
- package/dist/internal/turn-render.js +40 -0
- package/dist/internal/turn-render.js.map +1 -0
- package/dist/mcp-config.d.ts +19 -0
- package/dist/mcp-config.d.ts.map +1 -0
- package/dist/mcp-config.js +22 -0
- package/dist/mcp-config.js.map +1 -0
- package/dist/provider-ref.d.ts +8 -0
- package/dist/provider-ref.d.ts.map +1 -0
- package/dist/provider-ref.js +8 -0
- package/dist/provider-ref.js.map +1 -0
- package/dist/provider.d.ts +60 -0
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +110 -0
- package/dist/provider.js.map +1 -0
- package/dist/rpc.d.ts +45 -0
- package/dist/rpc.d.ts.map +1 -0
- package/dist/rpc.js +212 -0
- package/dist/rpc.js.map +1 -0
- package/dist/runtime.d.ts +174 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +464 -0
- package/dist/runtime.js.map +1 -0
- package/dist/stream.d.ts +96 -0
- package/dist/stream.d.ts.map +1 -0
- package/dist/stream.js +289 -0
- package/dist/stream.js.map +1 -0
- package/dist/supervisor.d.ts +17 -0
- package/dist/supervisor.d.ts.map +1 -0
- package/dist/supervisor.js +170 -0
- package/dist/supervisor.js.map +1 -0
- package/dist/types.d.ts +133 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +7 -0
- package/dist/types.js.map +1 -0
- package/package.json +53 -0
package/dist/stream.js
ADDED
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Claude Code stream-json wire protocol (issue #120).
|
|
3
|
+
*
|
|
4
|
+
* A clean-room model of the NDJSON envelopes the `claude` CLI emits and accepts
|
|
5
|
+
* on stdio under `--input-format stream-json --output-format stream-json`. This
|
|
6
|
+
* is what makes the `builtin:claude-code` runtime *resident*: one long-lived
|
|
7
|
+
* `claude --print` process consumes user-message lines on stdin and streams
|
|
8
|
+
* `init` / `assistant` / `result` envelopes on stdout, instead of a fresh
|
|
9
|
+
* one-shot process per turn.
|
|
10
|
+
*
|
|
11
|
+
* Two design rules, both load-bearing:
|
|
12
|
+
*
|
|
13
|
+
* - **Forward-tolerant by construction.** The CLI's real envelope set is much
|
|
14
|
+
* wider than anything Dreamux consumes (extra `system` subtypes, rate-limit
|
|
15
|
+
* events, hook lifecycle, streamlined variants, and extra `result` fields).
|
|
16
|
+
* This parser never validates a closed schema and never throws on an unknown
|
|
17
|
+
* `type` / `subtype`; it reads only the fields the runtime needs and ignores
|
|
18
|
+
* the rest. A wider or newer CLI build cannot break a turn.
|
|
19
|
+
*
|
|
20
|
+
* - **Pure, no IO.** No process, no clock, no filesystem — so the line framer,
|
|
21
|
+
* the line parser, and the turn aggregator are unit-tested against synthetic
|
|
22
|
+
* envelope sequences (hand-authored to the real wire shapes) with no live
|
|
23
|
+
* `claude` binary.
|
|
24
|
+
*
|
|
25
|
+
* Public-safety note: this module is a generic protocol model. It carries no
|
|
26
|
+
* Feishu identifiers, tokens, private paths, or environment-specific details.
|
|
27
|
+
*/
|
|
28
|
+
function isObject(v) {
|
|
29
|
+
return typeof v === 'object' && v !== null && !Array.isArray(v);
|
|
30
|
+
}
|
|
31
|
+
function str(v) {
|
|
32
|
+
return typeof v === 'string' ? v : null;
|
|
33
|
+
}
|
|
34
|
+
// ─── Line framing ───────────────────────────────────────────────────────────
|
|
35
|
+
/**
|
|
36
|
+
* Incremental newline framer. The child's stdout is NDJSON but arrives in
|
|
37
|
+
* arbitrary chunks; `push` returns the complete lines so far and buffers a
|
|
38
|
+
* trailing partial line until its newline lands. Blank lines are dropped.
|
|
39
|
+
*/
|
|
40
|
+
export class LineBuffer {
|
|
41
|
+
buf = '';
|
|
42
|
+
push(chunk) {
|
|
43
|
+
this.buf += chunk;
|
|
44
|
+
const out = [];
|
|
45
|
+
let nl = this.buf.indexOf('\n');
|
|
46
|
+
while (nl >= 0) {
|
|
47
|
+
const line = this.buf.slice(0, nl);
|
|
48
|
+
this.buf = this.buf.slice(nl + 1);
|
|
49
|
+
const trimmed = line.endsWith('\r') ? line.slice(0, -1) : line;
|
|
50
|
+
if (trimmed.length > 0)
|
|
51
|
+
out.push(trimmed);
|
|
52
|
+
nl = this.buf.indexOf('\n');
|
|
53
|
+
}
|
|
54
|
+
return out;
|
|
55
|
+
}
|
|
56
|
+
/** Any buffered bytes with no trailing newline (e.g. at stream end). */
|
|
57
|
+
flush() {
|
|
58
|
+
const rest = this.buf.trim();
|
|
59
|
+
this.buf = '';
|
|
60
|
+
return rest.length > 0 ? rest : null;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Join the text blocks of an Anthropic assistant `message.content` array.
|
|
65
|
+
* `thinking` and `tool_use` blocks contribute no visible text and are skipped.
|
|
66
|
+
*/
|
|
67
|
+
export function assistantText(message) {
|
|
68
|
+
if (!isObject(message))
|
|
69
|
+
return '';
|
|
70
|
+
const content = message['content'];
|
|
71
|
+
if (typeof content === 'string')
|
|
72
|
+
return content;
|
|
73
|
+
if (!Array.isArray(content))
|
|
74
|
+
return '';
|
|
75
|
+
const parts = [];
|
|
76
|
+
for (const block of content) {
|
|
77
|
+
if (!isObject(block))
|
|
78
|
+
continue;
|
|
79
|
+
if (block['type'] === 'text') {
|
|
80
|
+
const t = str(block['text']);
|
|
81
|
+
if (t !== null)
|
|
82
|
+
parts.push(t);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return parts.join('');
|
|
86
|
+
}
|
|
87
|
+
function parseResult(o) {
|
|
88
|
+
const subtype = str(o['subtype']);
|
|
89
|
+
const errorsRaw = o['errors'];
|
|
90
|
+
const errors = Array.isArray(errorsRaw)
|
|
91
|
+
? errorsRaw.filter((e) => typeof e === 'string')
|
|
92
|
+
: [];
|
|
93
|
+
let isError;
|
|
94
|
+
if (subtype !== null) {
|
|
95
|
+
isError = subtype !== 'success';
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
isError = o['is_error'] === true || errors.length > 0;
|
|
99
|
+
}
|
|
100
|
+
return {
|
|
101
|
+
subtype,
|
|
102
|
+
isError,
|
|
103
|
+
text: str(o['result']),
|
|
104
|
+
sessionId: str(o['session_id']),
|
|
105
|
+
errors,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Decode one stdout line. Never throws: a non-JSON line becomes `parse_error`,
|
|
110
|
+
* and a JSON object of an unmodelled type becomes `other`.
|
|
111
|
+
*/
|
|
112
|
+
export function parseLine(line) {
|
|
113
|
+
let parsed;
|
|
114
|
+
try {
|
|
115
|
+
parsed = JSON.parse(line);
|
|
116
|
+
}
|
|
117
|
+
catch {
|
|
118
|
+
return { kind: 'parse_error', raw: line };
|
|
119
|
+
}
|
|
120
|
+
if (!isObject(parsed))
|
|
121
|
+
return { kind: 'parse_error', raw: line };
|
|
122
|
+
const type = str(parsed['type']);
|
|
123
|
+
const subtype = str(parsed['subtype']);
|
|
124
|
+
switch (type) {
|
|
125
|
+
case 'system':
|
|
126
|
+
if (subtype === 'init') {
|
|
127
|
+
return {
|
|
128
|
+
kind: 'init',
|
|
129
|
+
sessionId: str(parsed['session_id']),
|
|
130
|
+
model: str(parsed['model']),
|
|
131
|
+
raw: parsed,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
return { kind: 'other', type, subtype, raw: parsed };
|
|
135
|
+
case 'assistant':
|
|
136
|
+
return {
|
|
137
|
+
kind: 'assistant',
|
|
138
|
+
text: assistantText(parsed['message']),
|
|
139
|
+
sessionId: str(parsed['session_id']),
|
|
140
|
+
raw: parsed,
|
|
141
|
+
};
|
|
142
|
+
case 'result':
|
|
143
|
+
return { kind: 'result', outcome: parseResult(parsed), raw: parsed };
|
|
144
|
+
case 'control_request': {
|
|
145
|
+
const request = parsed['request'];
|
|
146
|
+
return {
|
|
147
|
+
kind: 'control_request',
|
|
148
|
+
requestId: str(parsed['request_id']),
|
|
149
|
+
subtype: isObject(request) ? str(request['subtype']) : null,
|
|
150
|
+
request: isObject(request) ? request : {},
|
|
151
|
+
raw: parsed,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
case 'control_response': {
|
|
155
|
+
const response = parsed['response'];
|
|
156
|
+
if (isObject(response)) {
|
|
157
|
+
const inner = response['response'];
|
|
158
|
+
return {
|
|
159
|
+
kind: 'control_response',
|
|
160
|
+
requestId: str(response['request_id']),
|
|
161
|
+
ok: response['subtype'] === 'success',
|
|
162
|
+
response: isObject(inner) ? inner : null,
|
|
163
|
+
error: str(response['error']),
|
|
164
|
+
raw: parsed,
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
return {
|
|
168
|
+
kind: 'control_response',
|
|
169
|
+
requestId: null,
|
|
170
|
+
ok: false,
|
|
171
|
+
response: null,
|
|
172
|
+
error: null,
|
|
173
|
+
raw: parsed,
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
default:
|
|
177
|
+
return { kind: 'other', type, subtype, raw: parsed };
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
// ─── Outbound message builders (stdin) ──────────────────────────────────────
|
|
181
|
+
/**
|
|
182
|
+
* One user turn as a stream-json `user` message line (no trailing newline).
|
|
183
|
+
*
|
|
184
|
+
* `isSynthetic` / `priority` are siblings of `message` on the stdin envelope
|
|
185
|
+
* (claude-code SDKUserMessage schema), not part of the message body. They are
|
|
186
|
+
* only set for the native completion-notification idiom; a plain channel turn
|
|
187
|
+
* omits them entirely and reads as a normal human user turn.
|
|
188
|
+
*/
|
|
189
|
+
export function buildUserMessage(text, options = {}) {
|
|
190
|
+
const envelope = {
|
|
191
|
+
type: 'user',
|
|
192
|
+
message: { role: 'user', content: [{ type: 'text', text }] },
|
|
193
|
+
};
|
|
194
|
+
if (options.isSynthetic === true)
|
|
195
|
+
envelope['isSynthetic'] = true;
|
|
196
|
+
if (options.priority !== undefined)
|
|
197
|
+
envelope['priority'] = options.priority;
|
|
198
|
+
return JSON.stringify(envelope);
|
|
199
|
+
}
|
|
200
|
+
/** Enable Claude Code Remote Control via a stream-json control request. */
|
|
201
|
+
export function buildRemoteControlEnable(requestId) {
|
|
202
|
+
return JSON.stringify({
|
|
203
|
+
type: 'control_request',
|
|
204
|
+
request_id: requestId,
|
|
205
|
+
request: { subtype: 'remote_control', enabled: true },
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Answer a `can_use_tool` control request with `allow`. A Dreamux dispatcher
|
|
210
|
+
* runs unattended, so the answer for a runtime that has no human to consult is
|
|
211
|
+
* "allow"; `updatedInput` echoes the tool's original input back unchanged.
|
|
212
|
+
*
|
|
213
|
+
* This is a defensive path: under a bypassing permission mode the CLI does not
|
|
214
|
+
* gate tools, so `can_use_tool` is not normally emitted. It is wired so that if
|
|
215
|
+
* a build or mode does emit one, the runtime answers it rather than leaving the
|
|
216
|
+
* turn waiting on an unanswered control request.
|
|
217
|
+
*/
|
|
218
|
+
export function buildCanUseToolAllow(requestId, input) {
|
|
219
|
+
return JSON.stringify({
|
|
220
|
+
type: 'control_response',
|
|
221
|
+
response: {
|
|
222
|
+
subtype: 'success',
|
|
223
|
+
request_id: requestId,
|
|
224
|
+
response: { behavior: 'allow', updatedInput: input },
|
|
225
|
+
},
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
/** Acknowledge any other control request with a bare success so the CLI proceeds. */
|
|
229
|
+
export function buildControlAck(requestId) {
|
|
230
|
+
return JSON.stringify({
|
|
231
|
+
type: 'control_response',
|
|
232
|
+
response: { subtype: 'success', request_id: requestId, response: {} },
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
// ─── Turn aggregation ───────────────────────────────────────────────────────
|
|
236
|
+
/**
|
|
237
|
+
* Accumulates the envelopes of a single turn and resolves a `TurnOutcome` when
|
|
238
|
+
* the `result` lands. One aggregator per turn: feed every `ParsedLine`, then
|
|
239
|
+
* read `outcome()` once `done` is true.
|
|
240
|
+
*
|
|
241
|
+
* The final text prefers the `result.result` (the CLI's own canonical answer)
|
|
242
|
+
* and falls back to the latest `assistant` snapshot — so a turn that ends
|
|
243
|
+
* tool-only or whose result text is empty still surfaces whatever the model
|
|
244
|
+
* last said.
|
|
245
|
+
*/
|
|
246
|
+
export class TurnAggregator {
|
|
247
|
+
lastAssistantText = '';
|
|
248
|
+
result = null;
|
|
249
|
+
initSessionId = null;
|
|
250
|
+
/** Returns `true` once the terminal `result` has been seen. */
|
|
251
|
+
get done() {
|
|
252
|
+
return this.result !== null;
|
|
253
|
+
}
|
|
254
|
+
/** The session id from `init` (or the result), once known. */
|
|
255
|
+
get sessionId() {
|
|
256
|
+
return this.result?.sessionId ?? this.initSessionId;
|
|
257
|
+
}
|
|
258
|
+
accept(line) {
|
|
259
|
+
switch (line.kind) {
|
|
260
|
+
case 'init':
|
|
261
|
+
if (line.sessionId !== null)
|
|
262
|
+
this.initSessionId = line.sessionId;
|
|
263
|
+
break;
|
|
264
|
+
case 'assistant':
|
|
265
|
+
if (line.text.length > 0)
|
|
266
|
+
this.lastAssistantText = line.text;
|
|
267
|
+
break;
|
|
268
|
+
case 'result':
|
|
269
|
+
this.result = line.outcome;
|
|
270
|
+
break;
|
|
271
|
+
default:
|
|
272
|
+
break;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
outcome() {
|
|
276
|
+
const r = this.result;
|
|
277
|
+
if (r === null)
|
|
278
|
+
return null;
|
|
279
|
+
const text = r.text !== null && r.text.length > 0 ? r.text : this.lastAssistantText;
|
|
280
|
+
return {
|
|
281
|
+
isError: r.isError,
|
|
282
|
+
text,
|
|
283
|
+
sessionId: r.sessionId ?? this.initSessionId,
|
|
284
|
+
subtype: r.subtype,
|
|
285
|
+
errors: r.errors,
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
//# sourceMappingURL=stream.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stream.js","sourceRoot":"","sources":["../src/stream.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAiBH,SAAS,QAAQ,CAAC,CAAU;IAC1B,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAClE,CAAC;AAED,SAAS,GAAG,CAAC,CAAU;IACrB,OAAO,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC1C,CAAC;AAED,+EAA+E;AAE/E;;;;GAIG;AACH,MAAM,OAAO,UAAU;IACb,GAAG,GAAG,EAAE,CAAC;IAE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QACtB,IAAI,CAAC,KAAK,IAAI;YAAE,OAAO,IAAI,CAAC;QAC5B,MAAM,IAAI,GACR,CAAC,CAAC,IAAI,KAAK,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC;QACzE,OAAO;YACL,OAAO,EAAE,CAAC,CAAC,OAAO;YAClB,IAAI;YACJ,SAAS,EAAE,CAAC,CAAC,SAAS,IAAI,IAAI,CAAC,aAAa;YAC5C,OAAO,EAAE,CAAC,CAAC,OAAO;YAClB,MAAM,EAAE,CAAC,CAAC,MAAM;SACjB,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Claude Code resident child process supervisor.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors `codex/supervisor.ts` for the `builtin:claude-code` transport:
|
|
5
|
+
* spawn the long-lived `claude --print --input-format stream-json` child,
|
|
6
|
+
* own its process group, surface unexpected exits, and delegate turn RPC to
|
|
7
|
+
* `claude-code/rpc.ts`.
|
|
8
|
+
*/
|
|
9
|
+
import type { ClaudeCodeSession, ClaudeCodeSessionSpec } from './types.js';
|
|
10
|
+
/**
|
|
11
|
+
* The default factory: spawns the real `claude` binary. The returned session
|
|
12
|
+
* exposes a `setOnExit` registration the runtime uses to react to an unexpected
|
|
13
|
+
* child death (degrade + re-spawn next turn).
|
|
14
|
+
*/
|
|
15
|
+
export declare function createDefaultClaudeCodeSession(spec: ClaudeCodeSessionSpec): ClaudeCodeSession;
|
|
16
|
+
export type { ClaudeCodeSession, ClaudeCodeSessionFactory, ClaudeCodeSessionSpec, TurnOutcome, TurnSubmitOptions, } from './types.js';
|
|
17
|
+
//# sourceMappingURL=supervisor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"supervisor.d.ts","sourceRoot":"","sources":["../src/supervisor.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAYH,OAAO,KAAK,EACV,iBAAiB,EACjB,qBAAqB,EAGtB,MAAM,YAAY,CAAC;AA6JpB;;;;GAIG;AACH,wBAAgB,8BAA8B,CAC5C,IAAI,EAAE,qBAAqB,GAC1B,iBAAiB,CAEnB;AAED,YAAY,EACV,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EACrB,WAAW,EACX,iBAAiB,GAClB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Claude Code resident child process supervisor.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors `codex/supervisor.ts` for the `builtin:claude-code` transport:
|
|
5
|
+
* spawn the long-lived `claude --print --input-format stream-json` child,
|
|
6
|
+
* own its process group, surface unexpected exits, and delegate turn RPC to
|
|
7
|
+
* `claude-code/rpc.ts`.
|
|
8
|
+
*/
|
|
9
|
+
import { spawn } from 'node:child_process';
|
|
10
|
+
import { mkdir, open } from 'node:fs/promises';
|
|
11
|
+
import { dirname } from 'node:path';
|
|
12
|
+
import { isProcessAlive, killProcessGroup, removeEmptyLogFile, } from '@excitedjs/dreamux-utils';
|
|
13
|
+
import { ClaudeCodeStreamRpc } from './rpc.js';
|
|
14
|
+
/** The live session: spawns and supervises the real `claude` child. */
|
|
15
|
+
class LiveClaudeCodeSession {
|
|
16
|
+
spec;
|
|
17
|
+
child = null;
|
|
18
|
+
pid = null;
|
|
19
|
+
exited = false;
|
|
20
|
+
stopped = false;
|
|
21
|
+
rpc = null;
|
|
22
|
+
onExitHandler = null;
|
|
23
|
+
constructor(spec) {
|
|
24
|
+
this.spec = spec;
|
|
25
|
+
}
|
|
26
|
+
isAlive() {
|
|
27
|
+
return this.child !== null && !this.exited;
|
|
28
|
+
}
|
|
29
|
+
async start() {
|
|
30
|
+
if (this.child !== null) {
|
|
31
|
+
throw new Error('ClaudeCodeSession.start: already started');
|
|
32
|
+
}
|
|
33
|
+
await mkdir(this.spec.cwd, { recursive: true });
|
|
34
|
+
await mkdir(dirname(this.spec.stderrLogPath), { recursive: true });
|
|
35
|
+
// Open the stderr log as a FileHandle and hand its fd to the child. The
|
|
36
|
+
// handle is closed once the child owns the inherited fd (the finally),
|
|
37
|
+
// matching the timing discipline in codex/supervisor.ts.
|
|
38
|
+
const stderrHandle = await open(this.spec.stderrLogPath, 'a', 0o600);
|
|
39
|
+
const spawnOpts = {
|
|
40
|
+
cwd: this.spec.cwd,
|
|
41
|
+
env: this.spec.env,
|
|
42
|
+
// Own process group so a leaked grandchild is group-killable on reap.
|
|
43
|
+
detached: true,
|
|
44
|
+
stdio: ['pipe', 'pipe', stderrHandle.fd],
|
|
45
|
+
};
|
|
46
|
+
let child;
|
|
47
|
+
try {
|
|
48
|
+
child = await new Promise((resolve, reject) => {
|
|
49
|
+
let settled = false;
|
|
50
|
+
const c = spawn(this.spec.bin, this.spec.args, spawnOpts);
|
|
51
|
+
c.once('error', (e) => {
|
|
52
|
+
if (settled)
|
|
53
|
+
return;
|
|
54
|
+
settled = true;
|
|
55
|
+
reject(e instanceof Error ? e : new Error(String(e)));
|
|
56
|
+
});
|
|
57
|
+
c.once('spawn', () => {
|
|
58
|
+
if (settled)
|
|
59
|
+
return;
|
|
60
|
+
settled = true;
|
|
61
|
+
resolve(c);
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
finally {
|
|
66
|
+
await stderrHandle.close();
|
|
67
|
+
}
|
|
68
|
+
if (child.pid === undefined) {
|
|
69
|
+
throw new Error('claude resident child spawned without a pid');
|
|
70
|
+
}
|
|
71
|
+
this.child = child;
|
|
72
|
+
this.pid = child.pid;
|
|
73
|
+
// Post-spawn `error` must not crash the host event loop.
|
|
74
|
+
child.on('error', (err) => {
|
|
75
|
+
this.spec.log?.('warn', 'claude resident child error', err);
|
|
76
|
+
});
|
|
77
|
+
const stdin = child.stdin;
|
|
78
|
+
if (stdin === null) {
|
|
79
|
+
throw new Error('claude resident child spawned without stdin');
|
|
80
|
+
}
|
|
81
|
+
const rpc = new ClaudeCodeStreamRpc(stdin, {
|
|
82
|
+
turnTimeoutMs: this.spec.turnTimeoutMs,
|
|
83
|
+
log: this.spec.log,
|
|
84
|
+
reapOnTimeout: () => {
|
|
85
|
+
void this.stop().catch(() => {
|
|
86
|
+
/* reap is best-effort */
|
|
87
|
+
});
|
|
88
|
+
},
|
|
89
|
+
onRemoteControlUrl: this.spec.onRemoteControlUrl,
|
|
90
|
+
});
|
|
91
|
+
this.rpc = rpc;
|
|
92
|
+
child.stdout?.setEncoding('utf8');
|
|
93
|
+
child.stdout?.on('data', (chunk) => {
|
|
94
|
+
rpc.onStdoutChunk(chunk);
|
|
95
|
+
});
|
|
96
|
+
if (this.spec.remoteControl)
|
|
97
|
+
rpc.enableRemoteControl();
|
|
98
|
+
child.once('exit', () => this.onChildExit());
|
|
99
|
+
}
|
|
100
|
+
async submitTurn(prompt, options = {}) {
|
|
101
|
+
if (this.stopped) {
|
|
102
|
+
return Promise.reject(new Error('claude resident session is stopped'));
|
|
103
|
+
}
|
|
104
|
+
if (this.child === null || this.exited || this.rpc === null) {
|
|
105
|
+
return Promise.reject(new Error('claude resident child is not running'));
|
|
106
|
+
}
|
|
107
|
+
return this.rpc.submitTurn(prompt, options);
|
|
108
|
+
}
|
|
109
|
+
async steerTurn(prompt, options = {}) {
|
|
110
|
+
if (this.stopped) {
|
|
111
|
+
return Promise.reject(new Error('claude resident session is stopped'));
|
|
112
|
+
}
|
|
113
|
+
if (this.child === null || this.exited || this.rpc === null) {
|
|
114
|
+
return Promise.reject(new Error('claude resident child is not running'));
|
|
115
|
+
}
|
|
116
|
+
return this.rpc.steerTurn(prompt, options);
|
|
117
|
+
}
|
|
118
|
+
async stop() {
|
|
119
|
+
if (this.stopped)
|
|
120
|
+
return;
|
|
121
|
+
this.stopped = true;
|
|
122
|
+
// Mark exited up front so the child's own `exit` event (fired by the kill
|
|
123
|
+
// below) is treated as a deliberate stop, never an unexpected exit that
|
|
124
|
+
// would fire `onExit` and degrade the runtime we are intentionally tearing
|
|
125
|
+
// down.
|
|
126
|
+
this.exited = true;
|
|
127
|
+
this.rpc?.failPending(new Error('claude resident session stopped mid-turn'));
|
|
128
|
+
const pid = this.pid;
|
|
129
|
+
if (pid !== null) {
|
|
130
|
+
if (isProcessAlive(pid)) {
|
|
131
|
+
killProcessGroup(pid, 'SIGTERM');
|
|
132
|
+
const deadline = Date.now() + 1000;
|
|
133
|
+
while (Date.now() < deadline) {
|
|
134
|
+
if (!isProcessAlive(pid))
|
|
135
|
+
break;
|
|
136
|
+
await new Promise((r) => setTimeout(r, 25));
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
// Always SIGKILL the group — a reparented grandchild outliving its leader
|
|
140
|
+
// is the exact leak this guards against.
|
|
141
|
+
killProcessGroup(pid, 'SIGKILL');
|
|
142
|
+
}
|
|
143
|
+
this.exited = true;
|
|
144
|
+
this.rpc = null;
|
|
145
|
+
this.child = null;
|
|
146
|
+
// The child is gone, so its inherited stderr fd is released. Drop the stderr
|
|
147
|
+
// log if it stayed empty — claude traffic flows over the resident stream, so
|
|
148
|
+
// it usually captures nothing (issue #182 logs stage).
|
|
149
|
+
await removeEmptyLogFile(this.spec.stderrLogPath);
|
|
150
|
+
}
|
|
151
|
+
onChildExit() {
|
|
152
|
+
if (this.exited)
|
|
153
|
+
return;
|
|
154
|
+
this.exited = true;
|
|
155
|
+
this.rpc?.failPending(new Error('claude resident child exited mid-turn'));
|
|
156
|
+
this.onExitHandler?.();
|
|
157
|
+
}
|
|
158
|
+
setOnExit(handler) {
|
|
159
|
+
this.onExitHandler = handler;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* The default factory: spawns the real `claude` binary. The returned session
|
|
164
|
+
* exposes a `setOnExit` registration the runtime uses to react to an unexpected
|
|
165
|
+
* child death (degrade + re-spawn next turn).
|
|
166
|
+
*/
|
|
167
|
+
export function createDefaultClaudeCodeSession(spec) {
|
|
168
|
+
return new LiveClaudeCodeSession(spec);
|
|
169
|
+
}
|
|
170
|
+
//# sourceMappingURL=supervisor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"supervisor.js","sourceRoot":"","sources":["../src/supervisor.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,KAAK,EAAwC,MAAM,oBAAoB,CAAC;AACjF,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAQ/C,uEAAuE;AACvE,MAAM,qBAAqB;IAQI;IAPrB,KAAK,GAAwB,IAAI,CAAC;IAClC,GAAG,GAAkB,IAAI,CAAC;IAC1B,MAAM,GAAG,KAAK,CAAC;IACf,OAAO,GAAG,KAAK,CAAC;IAChB,GAAG,GAA+B,IAAI,CAAC;IACvC,aAAa,GAAwB,IAAI,CAAC;IAElD,YAA6B,IAA2B;QAA3B,SAAI,GAAJ,IAAI,CAAuB;IAAG,CAAC;IAE5D,OAAO;QACL,OAAO,IAAI,CAAC,KAAK,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,KAAK;QACT,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;QAC9D,CAAC;QACD,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAChD,MAAM,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,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AAC,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC,CAAC;QAC1E,IAAI,CAAC,aAAa,EAAE,EAAE,CAAC;IACzB,CAAC;IAED,SAAS,CAAC,OAAmB;QAC3B,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC;IAC/B,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,UAAU,8BAA8B,CAC5C,IAA2B;IAE3B,OAAO,IAAI,qBAAqB,CAAC,IAAI,CAAC,CAAC;AACzC,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Claude Code stream-json protocol and resident-session types.
|
|
3
|
+
*
|
|
4
|
+
* These are data contracts only: no IO, no process spawning, no timers.
|
|
5
|
+
*/
|
|
6
|
+
/** A parsed JSON object, or `null` for anything that is not a JSON object. */
|
|
7
|
+
export type JsonObject = Record<string, unknown>;
|
|
8
|
+
/**
|
|
9
|
+
* One decoded stdout line. `kind` is Dreamux's coarse classification, not the
|
|
10
|
+
* CLI's `type` — it groups the wire types by how the runtime reacts.
|
|
11
|
+
*/
|
|
12
|
+
export type ParsedLine = {
|
|
13
|
+
kind: 'init';
|
|
14
|
+
sessionId: string | null;
|
|
15
|
+
model: string | null;
|
|
16
|
+
raw: JsonObject;
|
|
17
|
+
} | {
|
|
18
|
+
kind: 'assistant';
|
|
19
|
+
text: string;
|
|
20
|
+
sessionId: string | null;
|
|
21
|
+
raw: JsonObject;
|
|
22
|
+
} | {
|
|
23
|
+
kind: 'result';
|
|
24
|
+
outcome: ResultEnvelope;
|
|
25
|
+
raw: JsonObject;
|
|
26
|
+
} | {
|
|
27
|
+
kind: 'control_request';
|
|
28
|
+
requestId: string | null;
|
|
29
|
+
subtype: string | null;
|
|
30
|
+
request: JsonObject;
|
|
31
|
+
raw: JsonObject;
|
|
32
|
+
} | {
|
|
33
|
+
kind: 'control_response';
|
|
34
|
+
requestId: string | null;
|
|
35
|
+
ok: boolean;
|
|
36
|
+
response: JsonObject | null;
|
|
37
|
+
error: string | null;
|
|
38
|
+
raw: JsonObject;
|
|
39
|
+
} | {
|
|
40
|
+
kind: 'other';
|
|
41
|
+
type: string | null;
|
|
42
|
+
subtype: string | null;
|
|
43
|
+
raw: JsonObject;
|
|
44
|
+
} | {
|
|
45
|
+
kind: 'parse_error';
|
|
46
|
+
raw: string;
|
|
47
|
+
};
|
|
48
|
+
/** The terminal `result` envelope, reduced to what the runtime records per turn. */
|
|
49
|
+
export interface ResultEnvelope {
|
|
50
|
+
/** `success` or one of the `error_*` subtypes. Unknown subtypes pass through. */
|
|
51
|
+
readonly subtype: string | null;
|
|
52
|
+
readonly isError: boolean;
|
|
53
|
+
/** The success-path final text (`result`); `null` for error subtypes. */
|
|
54
|
+
readonly text: string | null;
|
|
55
|
+
readonly sessionId: string | null;
|
|
56
|
+
/** Error subtypes may carry a message list; empty otherwise. */
|
|
57
|
+
readonly errors: readonly string[];
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Per-turn stdin delivery options. The default (an absent object) produces a
|
|
61
|
+
* plain human-equivalent user turn; completion delivery opts into the native
|
|
62
|
+
* notification idiom.
|
|
63
|
+
*/
|
|
64
|
+
export interface TurnSubmitOptions {
|
|
65
|
+
/**
|
|
66
|
+
* Mark the stdin user message synthetic. claude-code maps this to its
|
|
67
|
+
* internal `isMeta`: hidden in the TUI transcript but model-visible and sent
|
|
68
|
+
* to the API like a normal user turn — the native channel for a background /
|
|
69
|
+
* sub-agent completion notification. Never set on human channel turns.
|
|
70
|
+
*/
|
|
71
|
+
isSynthetic?: boolean;
|
|
72
|
+
/** Optional stdin delivery priority (claude-code `priority`). */
|
|
73
|
+
priority?: 'now' | 'next' | 'later';
|
|
74
|
+
}
|
|
75
|
+
/** The reduced outcome of one assistant turn, terminated by a `result`. */
|
|
76
|
+
export interface TurnOutcome {
|
|
77
|
+
readonly isError: boolean;
|
|
78
|
+
/** Final reply text: the `result.result`, falling back to the last assistant snapshot. */
|
|
79
|
+
readonly text: string;
|
|
80
|
+
readonly sessionId: string | null;
|
|
81
|
+
readonly subtype: string | null;
|
|
82
|
+
readonly errors: readonly string[];
|
|
83
|
+
}
|
|
84
|
+
/** Everything needed to spawn one resident `claude` stream-json child. */
|
|
85
|
+
export interface ClaudeCodeSessionSpec {
|
|
86
|
+
bin: string;
|
|
87
|
+
args: string[];
|
|
88
|
+
cwd: string;
|
|
89
|
+
env: NodeJS.ProcessEnv;
|
|
90
|
+
/** Where to append the child's stderr (its stdout is the in-process data plane). */
|
|
91
|
+
stderrLogPath: string;
|
|
92
|
+
/**
|
|
93
|
+
* Per-turn deadline (ms). If the still-alive child never emits a terminal
|
|
94
|
+
* `result` within this window, the turn is failed and the child is reaped so
|
|
95
|
+
* the serial turn queue (and TeamMate completion delivery behind it) cannot
|
|
96
|
+
* wedge forever. Must be > 0.
|
|
97
|
+
*/
|
|
98
|
+
turnTimeoutMs: number;
|
|
99
|
+
/**
|
|
100
|
+
* Enable Claude Code Remote Control for this resident session at startup.
|
|
101
|
+
* Implemented as a stream-json control request, not as a user turn.
|
|
102
|
+
*/
|
|
103
|
+
remoteControl: boolean;
|
|
104
|
+
/** Surface the local-only Remote Control URL when Claude returns one. */
|
|
105
|
+
onRemoteControlUrl?: (url: string) => void;
|
|
106
|
+
/** Diagnostic logger for protocol-level events (parse errors, control answers). */
|
|
107
|
+
log?: (level: 'info' | 'warn' | 'error', msg: string, err?: unknown) => void;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* A resident Claude Code session. Full turns are serialized by the caller;
|
|
111
|
+
* `steerTurn` is the one allowed concurrent write, used to steer the active
|
|
112
|
+
* turn without creating a second completion subscription.
|
|
113
|
+
*/
|
|
114
|
+
export interface ClaudeCodeSession {
|
|
115
|
+
/** Spawn the child and resolve once it is up (reject on spawn error). */
|
|
116
|
+
start(): Promise<void>;
|
|
117
|
+
/** Submit one user turn; resolve with the outcome when `result` lands. */
|
|
118
|
+
submitTurn(prompt: string, options?: TurnSubmitOptions): Promise<TurnOutcome>;
|
|
119
|
+
/** Send a user message into the active turn without awaiting a separate result. */
|
|
120
|
+
steerTurn(prompt: string, options?: TurnSubmitOptions): Promise<void>;
|
|
121
|
+
/** Whether the child is currently alive. */
|
|
122
|
+
isAlive(): boolean;
|
|
123
|
+
/**
|
|
124
|
+
* Register a one-shot handler fired when the child exits unexpectedly (not via
|
|
125
|
+
* {@link stop}). The runtime uses it to mark itself degraded and re-spawn on
|
|
126
|
+
* the next turn. Register before {@link start}.
|
|
127
|
+
*/
|
|
128
|
+
setOnExit(handler: () => void): void;
|
|
129
|
+
/** Reap the child (SIGTERM -> SIGKILL group). Idempotent. */
|
|
130
|
+
stop(): Promise<void>;
|
|
131
|
+
}
|
|
132
|
+
export type ClaudeCodeSessionFactory = (spec: ClaudeCodeSessionSpec) => ClaudeCodeSession;
|
|
133
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,8EAA8E;AAC9E,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEjD;;;GAGG;AACH,MAAM,MAAM,UAAU,GAClB;IACE,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,GAAG,EAAE,UAAU,CAAC;CACjB,GACD;IACE,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,GAAG,EAAE,UAAU,CAAC;CACjB,GACD;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,OAAO,EAAE,cAAc,CAAC;IAAC,GAAG,EAAE,UAAU,CAAA;CAAE,GAC5D;IACE,IAAI,EAAE,iBAAiB,CA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