stitchkit 0.130.1 → 0.132.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/CHANGELOG.md +68 -0
- package/dist/agent-executor/acp/v1-connect.d.ts +40 -26
- package/dist/agent-executor/acp/v1-connect.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-driver.d.ts +10 -4
- package/dist/agent-executor/acp/v1-driver.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-handlers.d.ts +6 -2
- package/dist/agent-executor/acp/v1-handlers.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-probe.d.ts +38 -0
- package/dist/agent-executor/acp/v1-probe.d.ts.map +1 -0
- package/dist/agent-executor/acp/v1-protocol.d.ts +15 -0
- package/dist/agent-executor/acp/v1-protocol.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-session.d.ts +9 -7
- package/dist/agent-executor/acp/v1-session.d.ts.map +1 -1
- package/dist/agent-executor/claude/cli-driver.d.ts +7 -7
- package/dist/agent-executor/claude/cli-driver.d.ts.map +1 -1
- package/dist/agent-executor/claude/limits.d.ts +6 -4
- package/dist/agent-executor/claude/limits.d.ts.map +1 -1
- package/dist/agent-executor/claude/session.d.ts +3 -3
- package/dist/agent-executor/claude/session.d.ts.map +1 -1
- package/dist/agent-executor/claude/transcript.d.ts +1 -1
- package/dist/agent-executor/claude/transcript.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/controls.d.ts +1 -0
- package/dist/agent-executor/claude-sdk/controls.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/driver.d.ts +51 -50
- package/dist/agent-executor/claude-sdk/driver.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/probe.d.ts +3 -3
- package/dist/agent-executor/claude-sdk/probe.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/query-loop.d.ts +2 -1
- package/dist/agent-executor/claude-sdk/query-loop.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/session.d.ts.map +1 -1
- package/dist/agent-executor/codex/classify.d.ts.map +1 -1
- package/dist/agent-executor/codex/connect.d.ts +7 -7
- package/dist/agent-executor/codex/connect.d.ts.map +1 -1
- package/dist/agent-executor/codex/control-client.d.ts +86 -99
- package/dist/agent-executor/codex/control-client.d.ts.map +1 -1
- package/dist/agent-executor/codex/control-read-methods.d.ts +7 -0
- package/dist/agent-executor/codex/control-read-methods.d.ts.map +1 -0
- package/dist/agent-executor/codex/driver.d.ts +29 -28
- package/dist/agent-executor/codex/driver.d.ts.map +1 -1
- package/dist/agent-executor/codex/event-routing.d.ts +14 -0
- package/dist/agent-executor/codex/event-routing.d.ts.map +1 -0
- package/dist/agent-executor/codex/handlers.d.ts +2 -2
- package/dist/agent-executor/codex/handlers.d.ts.map +1 -1
- package/dist/agent-executor/codex/limits.d.ts +9 -3
- package/dist/agent-executor/codex/limits.d.ts.map +1 -1
- package/dist/agent-executor/codex/notifications.d.ts +183 -0
- package/dist/agent-executor/codex/notifications.d.ts.map +1 -0
- package/dist/agent-executor/codex/pagination.d.ts +54 -0
- package/dist/agent-executor/codex/pagination.d.ts.map +1 -0
- package/dist/agent-executor/codex/protocol.d.ts +586 -148
- package/dist/agent-executor/codex/protocol.d.ts.map +1 -1
- package/dist/agent-executor/codex/request-answers.d.ts +4 -2
- package/dist/agent-executor/codex/request-answers.d.ts.map +1 -1
- package/dist/agent-executor/codex/responses.d.ts +855 -0
- package/dist/agent-executor/codex/responses.d.ts.map +1 -0
- package/dist/agent-executor/codex/session-bind.d.ts +410 -0
- package/dist/agent-executor/codex/session-bind.d.ts.map +1 -0
- package/dist/agent-executor/codex/session-controls.d.ts +19 -190
- package/dist/agent-executor/codex/session-controls.d.ts.map +1 -1
- package/dist/agent-executor/codex/session-types.d.ts +190 -0
- package/dist/agent-executor/codex/session-types.d.ts.map +1 -0
- package/dist/agent-executor/codex/session.d.ts +1 -1
- package/dist/agent-executor/codex/session.d.ts.map +1 -1
- package/dist/agent-executor/codex/shared-server.d.ts +4 -4
- package/dist/agent-executor/codex/shared-server.d.ts.map +1 -1
- package/dist/agent-executor/codex/shared-thread.d.ts +5 -5
- package/dist/agent-executor/codex/shared-thread.d.ts.map +1 -1
- package/dist/agent-executor/codex/thread-controls.d.ts +45 -36
- package/dist/agent-executor/codex/thread-controls.d.ts.map +1 -1
- package/dist/agent-executor/codex/thread-list-query.d.ts +5 -0
- package/dist/agent-executor/codex/thread-list-query.d.ts.map +1 -0
- package/dist/agent-executor/codex/thread-open.d.ts +20 -20
- package/dist/agent-executor/codex/thread-open.d.ts.map +1 -1
- package/dist/agent-executor/codex/turn-input.d.ts +4 -3
- package/dist/agent-executor/codex/turn-input.d.ts.map +1 -1
- package/dist/agent-executor/codex/unix-socket-target.d.ts +12 -3
- package/dist/agent-executor/codex/unix-socket-target.d.ts.map +1 -1
- package/dist/agent-executor/codex/ws-frame.d.ts +4 -1
- package/dist/agent-executor/codex/ws-frame.d.ts.map +1 -1
- package/dist/agent-executor/contract.d.ts +3 -1
- package/dist/agent-executor/contract.d.ts.map +1 -1
- package/dist/agent-executor/engine-process.d.ts +4 -4
- package/dist/agent-executor/engine-process.d.ts.map +1 -1
- package/dist/agent-executor/engine.d.ts +3 -3
- package/dist/agent-executor/engine.d.ts.map +1 -1
- package/dist/agent-executor/handoff.d.ts.map +1 -1
- package/dist/agent-executor/hello.d.ts +7 -0
- package/dist/agent-executor/hello.d.ts.map +1 -1
- package/dist/agent-executor/json-rpc-peer.d.ts +9 -4
- package/dist/agent-executor/json-rpc-peer.d.ts.map +1 -1
- package/dist/agent-executor/leases.d.ts +1 -1
- package/dist/agent-executor/leases.d.ts.map +1 -1
- package/dist/agent-executor/plan-limits.d.ts +12 -1
- package/dist/agent-executor/plan-limits.d.ts.map +1 -1
- package/dist/agent-executor/profile.d.ts +9 -1
- package/dist/agent-executor/profile.d.ts.map +1 -1
- package/dist/agent-executor/session-primitives.d.ts +8 -0
- package/dist/agent-executor/session-primitives.d.ts.map +1 -1
- package/dist/agent-executor/testing/consumer-stubs.d.ts +45 -0
- package/dist/agent-executor/testing/consumer-stubs.d.ts.map +1 -0
- package/dist/agent-executor/testing/fake-claude-sdk-query.d.ts +88 -0
- package/dist/agent-executor/testing/fake-claude-sdk-query.d.ts.map +1 -0
- package/dist/agent-executor/testing/fake-codex-app-server.d.ts +56 -0
- package/dist/agent-executor/testing/fake-codex-app-server.d.ts.map +1 -0
- package/dist/agent-executor/testing/fixtures.d.ts +26 -0
- package/dist/agent-executor/testing/fixtures.d.ts.map +1 -0
- package/dist/agent-executor/testing/replay-driver.d.ts +8 -8
- package/dist/agent-executor/testing/replay-driver.d.ts.map +1 -1
- package/dist/agent-executor/testing/replay-runner.d.ts +3 -2
- package/dist/agent-executor/testing/replay-runner.d.ts.map +1 -1
- package/dist/agent-executor/testing/replay-transcript.d.ts +5 -3
- package/dist/agent-executor/testing/replay-transcript.d.ts.map +1 -1
- package/dist/agent-runtime/branch-observations.d.ts +19 -19
- package/dist/agent-runtime/sql-rows.d.ts +10 -10
- package/dist/agent-runtime/store-conformance-lifecycle.d.ts +20 -20
- package/dist/agent-runtime/store-conformance-support.d.ts +10 -10
- package/dist/agent-runtime/terminal-commit.d.ts +10 -10
- package/dist/entrypoints/agent-executor/acp.d.ts +2 -1
- package/dist/entrypoints/agent-executor/acp.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/acp.js +284 -82
- package/dist/entrypoints/agent-executor/claude-sdk.d.ts +4 -0
- package/dist/entrypoints/agent-executor/claude-sdk.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/claude-sdk.js +64 -37
- package/dist/entrypoints/agent-executor/claude.d.ts +2 -2
- package/dist/entrypoints/agent-executor/claude.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/claude.js +29 -23
- package/dist/entrypoints/agent-executor/codex.d.ts +9 -5
- package/dist/entrypoints/agent-executor/codex.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/codex.js +1860 -1695
- package/dist/entrypoints/agent-executor/testing.d.ts +4 -0
- package/dist/entrypoints/agent-executor/testing.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/testing.js +880 -18
- package/dist/entrypoints/agent-executor.d.ts +3 -3
- package/dist/entrypoints/agent-executor.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor.js +42 -8
- package/dist/entrypoints/process.js +3 -3
- package/dist/entrypoints/sync.js +8 -4
- package/dist/{index-jrn3prgm.js → index-athc412x.js} +29 -4
- package/dist/{index-dbp6xemn.js → index-f9p62ean.js} +219 -7
- package/dist/index-j15dhkda.js +749 -0
- package/dist/index-jcrj0b8z.js +56 -0
- package/dist/{index-1q0n6zek.js → index-kwsr7j5k.js} +84 -44
- package/dist/{index-p1qmpq0p.js → index-z114ax5e.js} +93 -57
- package/dist/sync/session-machine.d.ts.map +1 -1
- package/dist/sync/session.d.ts +3 -3
- package/llms/agent-executor-acp.txt +5 -5
- package/llms/agent-executor-claude-sdk.txt +3 -1
- package/llms/agent-executor-claude.txt +2 -2
- package/llms/agent-executor-codex.txt +11 -8
- package/llms/agent-executor-testing.txt +5 -1
- package/llms/agent-executor.txt +10 -4
- package/llms/stitchkit.txt +75 -74
- package/llms/sync.txt +1 -1
- package/llms/{upgrading-0.128.0-0.130.0.txt → upgrading-0.128.0-0.132.0.txt} +76 -3
- package/llms/upgrading.txt +1 -1
- package/llms-full.txt +185 -96
- package/llms.txt +8 -8
- package/package.json +3 -3
- package/dist/index-2s8sy57y.js +0 -229
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import {
|
|
2
|
+
offerTurnDelta
|
|
3
|
+
} from "./index-f9p62ean.js";
|
|
4
|
+
|
|
5
|
+
// src/agent-executor/engine-requests.ts
|
|
6
|
+
function holdEngineRequest(turn, request) {
|
|
7
|
+
if (turn.state.interruptRequested) {
|
|
8
|
+
request.resolve(request.refusal);
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
const offered = request.delta();
|
|
12
|
+
turn.pending.set(request.interactionId, {
|
|
13
|
+
detail: request.detail,
|
|
14
|
+
answeredBy: request.answeredBy,
|
|
15
|
+
resolve: request.resolve
|
|
16
|
+
});
|
|
17
|
+
offerTurnDelta(turn.channel, offered);
|
|
18
|
+
}
|
|
19
|
+
function answerEngineRequest(turn, interactionId, answer) {
|
|
20
|
+
const waiting = turn.pending.get(interactionId);
|
|
21
|
+
if (waiting === undefined)
|
|
22
|
+
return false;
|
|
23
|
+
waiting.resolve(answer);
|
|
24
|
+
turn.pending.delete(interactionId);
|
|
25
|
+
offerTurnDelta(turn.channel, {
|
|
26
|
+
type: "request-resolved",
|
|
27
|
+
turnId: turn.state.turnId,
|
|
28
|
+
itemId: `resolved:${interactionId}`,
|
|
29
|
+
raw: waiting.answeredBy,
|
|
30
|
+
interactionId
|
|
31
|
+
});
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
function drainEngineRequests(turn, answer) {
|
|
35
|
+
if (turn === undefined)
|
|
36
|
+
return;
|
|
37
|
+
for (const [interactionId, waiting] of [...turn.pending]) {
|
|
38
|
+
answerEngineRequest(turn, interactionId, answer(waiting));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function endEngineTurn(turn, answer, deltas) {
|
|
42
|
+
if (turn === undefined)
|
|
43
|
+
return;
|
|
44
|
+
drainEngineRequests(turn, answer);
|
|
45
|
+
for (const delta of deltas)
|
|
46
|
+
offerTurnDelta(turn.channel, delta);
|
|
47
|
+
turn.channel.close();
|
|
48
|
+
}
|
|
49
|
+
function loseEngineTurn(turn, answer, error) {
|
|
50
|
+
if (turn === undefined)
|
|
51
|
+
return;
|
|
52
|
+
drainEngineRequests(turn, answer);
|
|
53
|
+
turn.channel.fail(error);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export { holdEngineRequest, answerEngineRequest, drainEngineRequests, endEngineTurn, loseEngineTurn };
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
assertTimerMs
|
|
3
3
|
} from "./index-agy5fqgf.js";
|
|
4
|
+
import {
|
|
5
|
+
abortReason
|
|
6
|
+
} from "./index-rptj3qnc.js";
|
|
4
7
|
|
|
5
8
|
// src/agent-executor/json-rpc-peer.ts
|
|
6
9
|
import { z } from "zod";
|
|
10
|
+
var JsonRpcValueSchema2 = z.json();
|
|
11
|
+
var JsonRpcRecordSchema2 = z.record(z.string(), JsonRpcValueSchema2);
|
|
7
12
|
var IdSchema = z.union([z.string(), z.int()]);
|
|
8
13
|
var MessageSchema = z.looseObject({
|
|
9
14
|
jsonrpc: z.literal("2.0").optional(),
|
|
10
15
|
id: IdSchema.optional(),
|
|
11
16
|
method: z.string().optional(),
|
|
12
|
-
params:
|
|
13
|
-
result:
|
|
14
|
-
error: z.looseObject({ code: z.int(), message: z.string(), data:
|
|
17
|
+
params: JsonRpcValueSchema2.optional(),
|
|
18
|
+
result: JsonRpcValueSchema2.optional(),
|
|
19
|
+
error: z.looseObject({ code: z.int(), message: z.string(), data: JsonRpcValueSchema2.optional() }).optional()
|
|
15
20
|
});
|
|
16
21
|
|
|
17
22
|
class JsonRpcError2 extends Error {
|
|
@@ -48,6 +53,25 @@ function parseJsonValue(value) {
|
|
|
48
53
|
return { ok: false, message: errorMessage(error) };
|
|
49
54
|
}
|
|
50
55
|
}
|
|
56
|
+
function buildAnswerPayload(id, outcome) {
|
|
57
|
+
if ("result" in outcome) {
|
|
58
|
+
const checked = parseJsonValue(outcome.result);
|
|
59
|
+
if (!checked.ok) {
|
|
60
|
+
return { id, error: { code: JSON_RPC_INTERNAL_ERROR, message: checked.message } };
|
|
61
|
+
}
|
|
62
|
+
return { id, result: checked.value };
|
|
63
|
+
}
|
|
64
|
+
const code = Number.isSafeInteger(outcome.error.code) ? outcome.error.code : JSON_RPC_INTERNAL_ERROR;
|
|
65
|
+
const message = typeof outcome.error.message === "string" ? outcome.error.message : "Internal error";
|
|
66
|
+
if (outcome.error.data === undefined) {
|
|
67
|
+
return { id, error: { code, message } };
|
|
68
|
+
}
|
|
69
|
+
const checked = parseJsonValue(outcome.error.data);
|
|
70
|
+
if (!checked.ok) {
|
|
71
|
+
return { id, error: { code: JSON_RPC_INTERNAL_ERROR, message: checked.message } };
|
|
72
|
+
}
|
|
73
|
+
return { id, error: { code, message, data: checked.value } };
|
|
74
|
+
}
|
|
51
75
|
function createJsonRpcPeer2(config) {
|
|
52
76
|
assertTimerMs("requestTimeoutMs", config.requestTimeoutMs, { absent: "refused" });
|
|
53
77
|
let nextId = 1;
|
|
@@ -67,33 +91,7 @@ function createJsonRpcPeer2(config) {
|
|
|
67
91
|
const answer = (id, outcome) => {
|
|
68
92
|
if (closed)
|
|
69
93
|
return;
|
|
70
|
-
|
|
71
|
-
const checked = parseJsonValue(outcome.result);
|
|
72
|
-
if (!checked.ok) {
|
|
73
|
-
sendResponse({
|
|
74
|
-
id,
|
|
75
|
-
error: { code: JSON_RPC_INTERNAL_ERROR, message: checked.message }
|
|
76
|
-
});
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
sendResponse({ id, result: checked.value });
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
const code = Number.isSafeInteger(outcome.error.code) ? outcome.error.code : JSON_RPC_INTERNAL_ERROR;
|
|
83
|
-
const message = typeof outcome.error.message === "string" ? outcome.error.message : "Internal error";
|
|
84
|
-
if (outcome.error.data === undefined) {
|
|
85
|
-
sendResponse({ id, error: { code, message } });
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
const checked = parseJsonValue(outcome.error.data);
|
|
89
|
-
if (!checked.ok) {
|
|
90
|
-
sendResponse({
|
|
91
|
-
id,
|
|
92
|
-
error: { code: JSON_RPC_INTERNAL_ERROR, message: checked.message }
|
|
93
|
-
});
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
sendResponse({ id, error: { code, message, data: checked.value } });
|
|
94
|
+
sendResponse(buildAnswerPayload(id, outcome));
|
|
97
95
|
};
|
|
98
96
|
return {
|
|
99
97
|
request(method, params, options) {
|
|
@@ -105,22 +103,68 @@ function createJsonRpcPeer2(config) {
|
|
|
105
103
|
return Promise.reject(error);
|
|
106
104
|
}
|
|
107
105
|
}
|
|
106
|
+
const signal = options?.signal;
|
|
107
|
+
if (signal?.aborted)
|
|
108
|
+
return Promise.reject(abortReason(signal));
|
|
108
109
|
if (closed)
|
|
109
110
|
return Promise.reject(closedBy);
|
|
110
111
|
const id = nextId++;
|
|
111
112
|
return new Promise((resolve, reject) => {
|
|
112
|
-
|
|
113
|
+
let settled = false;
|
|
114
|
+
let timer;
|
|
115
|
+
const onAbort = () => {
|
|
116
|
+
if (settled)
|
|
117
|
+
return;
|
|
118
|
+
settled = true;
|
|
119
|
+
cleanup();
|
|
113
120
|
pending.delete(id);
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
121
|
+
if (signal !== undefined)
|
|
122
|
+
reject(abortReason(signal));
|
|
123
|
+
};
|
|
124
|
+
const cleanup = () => {
|
|
125
|
+
if (timer !== undefined) {
|
|
126
|
+
clearTimeout(timer);
|
|
127
|
+
timer = undefined;
|
|
128
|
+
}
|
|
129
|
+
signal?.removeEventListener("abort", onAbort);
|
|
130
|
+
};
|
|
131
|
+
if (timeoutMs !== null) {
|
|
132
|
+
timer = setTimeout(() => {
|
|
133
|
+
if (settled)
|
|
134
|
+
return;
|
|
135
|
+
settled = true;
|
|
136
|
+
cleanup();
|
|
137
|
+
pending.delete(id);
|
|
138
|
+
reject(new JsonRpcError2(JSON_RPC_LOCAL_TIMEOUT2, `${method} had no answer within ${timeoutMs} ms`));
|
|
139
|
+
}, timeoutMs);
|
|
140
|
+
}
|
|
141
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
142
|
+
pending.set(id, {
|
|
143
|
+
resolve: (value) => {
|
|
144
|
+
if (settled)
|
|
145
|
+
return;
|
|
146
|
+
settled = true;
|
|
147
|
+
cleanup();
|
|
148
|
+
resolve(value);
|
|
149
|
+
},
|
|
150
|
+
reject: (error) => {
|
|
151
|
+
if (settled)
|
|
152
|
+
return;
|
|
153
|
+
settled = true;
|
|
154
|
+
cleanup();
|
|
155
|
+
reject(error);
|
|
156
|
+
},
|
|
157
|
+
cleanup
|
|
158
|
+
});
|
|
117
159
|
try {
|
|
118
160
|
write({ id, method, ...params !== undefined && { params } });
|
|
119
161
|
} catch (error) {
|
|
120
|
-
if (
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
162
|
+
if (!settled) {
|
|
163
|
+
settled = true;
|
|
164
|
+
cleanup();
|
|
165
|
+
pending.delete(id);
|
|
166
|
+
reject(error);
|
|
167
|
+
}
|
|
124
168
|
}
|
|
125
169
|
});
|
|
126
170
|
},
|
|
@@ -143,7 +187,7 @@ function createJsonRpcPeer2(config) {
|
|
|
143
187
|
});
|
|
144
188
|
return;
|
|
145
189
|
}
|
|
146
|
-
Promise
|
|
190
|
+
new Promise((resolve) => resolve(onRequest(method, message.params, id))).then((result) => answer(id, { result }), (error) => answer(id, {
|
|
147
191
|
error: error instanceof JsonRpcError2 ? error : new JsonRpcError2(JSON_RPC_INTERNAL_ERROR, errorMessage(error))
|
|
148
192
|
}));
|
|
149
193
|
return;
|
|
@@ -158,8 +202,6 @@ function createJsonRpcPeer2(config) {
|
|
|
158
202
|
if (waiter === undefined)
|
|
159
203
|
return;
|
|
160
204
|
pending.delete(message.id);
|
|
161
|
-
if (waiter.timer !== undefined)
|
|
162
|
-
clearTimeout(waiter.timer);
|
|
163
205
|
if (message.error !== undefined) {
|
|
164
206
|
waiter.reject(new JsonRpcError2(message.error.code, message.error.message, message.error.data));
|
|
165
207
|
} else {
|
|
@@ -172,8 +214,6 @@ function createJsonRpcPeer2(config) {
|
|
|
172
214
|
closed = true;
|
|
173
215
|
closedBy = reason;
|
|
174
216
|
for (const [id, waiter] of pending) {
|
|
175
|
-
if (waiter.timer !== undefined)
|
|
176
|
-
clearTimeout(waiter.timer);
|
|
177
217
|
pending.delete(id);
|
|
178
218
|
waiter.reject(reason);
|
|
179
219
|
}
|
|
@@ -181,4 +221,4 @@ function createJsonRpcPeer2(config) {
|
|
|
181
221
|
};
|
|
182
222
|
}
|
|
183
223
|
|
|
184
|
-
export { JsonRpcError2, JSON_RPC_METHOD_NOT_FOUND2, JSON_RPC_LOCAL_TIMEOUT2, createJsonRpcPeer2 };
|
|
224
|
+
export { JsonRpcValueSchema2, JsonRpcRecordSchema2, JsonRpcError2, JSON_RPC_METHOD_NOT_FOUND2, JSON_RPC_LOCAL_TIMEOUT2, createJsonRpcPeer2 };
|
|
@@ -2,20 +2,22 @@ import {
|
|
|
2
2
|
InteractionReplySchema2,
|
|
3
3
|
PlanWindowSchema2,
|
|
4
4
|
PlanLimitsSchema2,
|
|
5
|
-
engineProfile
|
|
6
|
-
} from "./index-dbp6xemn.js";
|
|
7
|
-
import {
|
|
5
|
+
engineProfile,
|
|
8
6
|
nonEmptyString,
|
|
7
|
+
clampPlanName,
|
|
9
8
|
epochSecondsToIso,
|
|
10
9
|
safeJsonValue,
|
|
11
10
|
clampUniqueWindowName
|
|
12
|
-
} from "./index-
|
|
11
|
+
} from "./index-f9p62ean.js";
|
|
13
12
|
import {
|
|
14
13
|
isSupportedImageMediaType
|
|
15
14
|
} from "./index-y0a4gt1s.js";
|
|
16
15
|
import {
|
|
17
16
|
errnoOf
|
|
18
17
|
} from "./index-jj9228tt.js";
|
|
18
|
+
import {
|
|
19
|
+
isRecord
|
|
20
|
+
} from "./index-ps3djm8d.js";
|
|
19
21
|
|
|
20
22
|
// src/agent-executor/claude/classify.ts
|
|
21
23
|
import { z as z3 } from "zod";
|
|
@@ -1038,13 +1040,83 @@ var FIXED_USAGE_WINDOWS = [
|
|
|
1038
1040
|
"seven_day_opus",
|
|
1039
1041
|
"seven_day_sonnet"
|
|
1040
1042
|
];
|
|
1043
|
+
var FIXED_USAGE_WINDOW_SET = new Set(FIXED_USAGE_WINDOWS);
|
|
1044
|
+
var SKIPPED_USAGE_KEYS = new Set([
|
|
1045
|
+
"extra_usage",
|
|
1046
|
+
"limits",
|
|
1047
|
+
"spend",
|
|
1048
|
+
"model_scoped",
|
|
1049
|
+
"subscription_type",
|
|
1050
|
+
"rate_limits_available",
|
|
1051
|
+
"rate_limits"
|
|
1052
|
+
]);
|
|
1041
1053
|
function parseIsoReset(value) {
|
|
1042
1054
|
if (typeof value !== "string")
|
|
1043
1055
|
return;
|
|
1044
1056
|
const parsed = PlanWindowSchema2.shape.resetsAt.safeParse(value);
|
|
1045
1057
|
return parsed.success ? parsed.data : undefined;
|
|
1046
1058
|
}
|
|
1047
|
-
function
|
|
1059
|
+
function appendUsageBucket(windows, seenNames, key, rawEntry) {
|
|
1060
|
+
if (windows.length >= MAX_PLAN_WINDOWS || !isRecord(rawEntry))
|
|
1061
|
+
return;
|
|
1062
|
+
const entryParsed = ClaudeUsageWindowSchema.safeParse(rawEntry);
|
|
1063
|
+
if (!entryParsed.success)
|
|
1064
|
+
return;
|
|
1065
|
+
const entry = entryParsed.data;
|
|
1066
|
+
if (entry.utilization == null || !Number.isFinite(entry.utilization))
|
|
1067
|
+
return;
|
|
1068
|
+
const trimmedKey = nonEmptyString(key)?.trim();
|
|
1069
|
+
if (trimmedKey === undefined)
|
|
1070
|
+
return;
|
|
1071
|
+
const resetsAt = parseIsoReset(entry.resets_at);
|
|
1072
|
+
const name = clampUniqueWindowName(trimmedKey, "", seenNames, key, MAX_WINDOW_NAME_CHARS);
|
|
1073
|
+
windows.push(PlanWindowSchema2.parse({
|
|
1074
|
+
name,
|
|
1075
|
+
usedPercent: Math.min(100, entry.utilization),
|
|
1076
|
+
...resetsAt !== undefined && { resetsAt }
|
|
1077
|
+
}));
|
|
1078
|
+
}
|
|
1079
|
+
function extractUsageWindows(bucketMap) {
|
|
1080
|
+
const windows = [];
|
|
1081
|
+
const seenNames = new Set;
|
|
1082
|
+
for (const key of FIXED_USAGE_WINDOWS) {
|
|
1083
|
+
if (windows.length >= MAX_PLAN_WINDOWS)
|
|
1084
|
+
break;
|
|
1085
|
+
if (key in bucketMap)
|
|
1086
|
+
appendUsageBucket(windows, seenNames, key, bucketMap[key]);
|
|
1087
|
+
}
|
|
1088
|
+
for (const key of Object.keys(bucketMap).sort((a, b) => a.localeCompare(b))) {
|
|
1089
|
+
if (windows.length >= MAX_PLAN_WINDOWS)
|
|
1090
|
+
break;
|
|
1091
|
+
if (FIXED_USAGE_WINDOW_SET.has(key) || SKIPPED_USAGE_KEYS.has(key))
|
|
1092
|
+
continue;
|
|
1093
|
+
appendUsageBucket(windows, seenNames, key, bucketMap[key]);
|
|
1094
|
+
}
|
|
1095
|
+
const modelScoped = bucketMap.model_scoped;
|
|
1096
|
+
if (Array.isArray(modelScoped)) {
|
|
1097
|
+
for (let index = 0;index < modelScoped.length; index += 1) {
|
|
1098
|
+
if (windows.length >= MAX_PLAN_WINDOWS)
|
|
1099
|
+
break;
|
|
1100
|
+
const entry = ClaudeModelScopedWindowSchema.safeParse(modelScoped[index]);
|
|
1101
|
+
if (!entry.success)
|
|
1102
|
+
continue;
|
|
1103
|
+
const { display_name, utilization, resets_at } = entry.data;
|
|
1104
|
+
const label = clampPlanName(display_name, MAX_WINDOW_NAME_CHARS);
|
|
1105
|
+
if (utilization == null || !Number.isFinite(utilization))
|
|
1106
|
+
continue;
|
|
1107
|
+
const name = clampUniqueWindowName(label === undefined ? "model_scoped" : `model:${label}`, "", seenNames, `model:${display_name ?? label}:${index}`, MAX_WINDOW_NAME_CHARS);
|
|
1108
|
+
const resetsAt = parseIsoReset(resets_at);
|
|
1109
|
+
windows.push(PlanWindowSchema2.parse({
|
|
1110
|
+
name,
|
|
1111
|
+
usedPercent: Math.min(100, utilization),
|
|
1112
|
+
...resetsAt !== undefined && { resetsAt },
|
|
1113
|
+
...label !== undefined && { label, scope: label }
|
|
1114
|
+
}));
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
return windows;
|
|
1118
|
+
}
|
|
1119
|
+
function claudeUsagePlanLimits2(raw, now = new Date) {
|
|
1048
1120
|
const parsed = ClaudeUsageResponseSchema.safeParse(raw);
|
|
1049
1121
|
if (!parsed.success) {
|
|
1050
1122
|
return PlanLimitsSchema2.parse({
|
|
@@ -1054,60 +1126,24 @@ function claudeUsagePlanLimits(raw, now) {
|
|
|
1054
1126
|
});
|
|
1055
1127
|
}
|
|
1056
1128
|
const { subscription_type, rate_limits_available, rate_limits } = parsed.data;
|
|
1129
|
+
const plan = clampPlanName(subscription_type, MAX_WINDOW_NAME_CHARS);
|
|
1130
|
+
const isEnvelope = isRecord(raw) && (("rate_limits" in raw) || ("rate_limits_available" in raw));
|
|
1057
1131
|
if (rate_limits_available === false) {
|
|
1058
1132
|
return PlanLimitsSchema2.parse({
|
|
1059
|
-
answer:
|
|
1133
|
+
answer: plan !== undefined ? "unpublished" : "no-plan-limit",
|
|
1060
1134
|
windows: [],
|
|
1061
|
-
observedAt: now.toISOString()
|
|
1135
|
+
observedAt: now.toISOString(),
|
|
1136
|
+
...plan !== undefined && { plan }
|
|
1062
1137
|
});
|
|
1063
1138
|
}
|
|
1064
|
-
const
|
|
1065
|
-
const
|
|
1066
|
-
|
|
1067
|
-
for (const key of FIXED_USAGE_WINDOWS) {
|
|
1068
|
-
if (windows.length >= MAX_PLAN_WINDOWS)
|
|
1069
|
-
break;
|
|
1070
|
-
const entryParsed = ClaudeUsageWindowSchema.safeParse(rate_limits[key]);
|
|
1071
|
-
if (!entryParsed.success)
|
|
1072
|
-
continue;
|
|
1073
|
-
const entry = entryParsed.data;
|
|
1074
|
-
if (entry.utilization == null || !Number.isFinite(entry.utilization))
|
|
1075
|
-
continue;
|
|
1076
|
-
const resetsAt = parseIsoReset(entry.resets_at);
|
|
1077
|
-
seenNames.add(key);
|
|
1078
|
-
windows.push(PlanWindowSchema2.parse({
|
|
1079
|
-
name: key,
|
|
1080
|
-
usedPercent: Math.min(100, entry.utilization),
|
|
1081
|
-
...resetsAt !== undefined && { resetsAt }
|
|
1082
|
-
}));
|
|
1083
|
-
}
|
|
1084
|
-
const modelScoped = rate_limits.model_scoped;
|
|
1085
|
-
if (Array.isArray(modelScoped)) {
|
|
1086
|
-
for (let index = 0;index < modelScoped.length; index += 1) {
|
|
1087
|
-
if (windows.length >= MAX_PLAN_WINDOWS)
|
|
1088
|
-
break;
|
|
1089
|
-
const entry = ClaudeModelScopedWindowSchema.safeParse(modelScoped[index]);
|
|
1090
|
-
if (!entry.success)
|
|
1091
|
-
continue;
|
|
1092
|
-
const { display_name, utilization, resets_at } = entry.data;
|
|
1093
|
-
const label = nonEmptyString(display_name)?.trim().slice(0, MAX_WINDOW_NAME_CHARS);
|
|
1094
|
-
if (label === undefined || utilization == null || !Number.isFinite(utilization))
|
|
1095
|
-
continue;
|
|
1096
|
-
const name = clampUniqueWindowName(`model:${label}`, "", seenNames, `model:${display_name ?? label}:${index}`, MAX_WINDOW_NAME_CHARS);
|
|
1097
|
-
const resetsAt = parseIsoReset(resets_at);
|
|
1098
|
-
windows.push(PlanWindowSchema2.parse({
|
|
1099
|
-
name,
|
|
1100
|
-
usedPercent: Math.min(100, utilization),
|
|
1101
|
-
...resetsAt !== undefined && { resetsAt },
|
|
1102
|
-
label
|
|
1103
|
-
}));
|
|
1104
|
-
}
|
|
1105
|
-
}
|
|
1106
|
-
}
|
|
1139
|
+
const bucketMap = isEnvelope ? isRecord(rate_limits) ? rate_limits : undefined : isRecord(raw) ? raw : undefined;
|
|
1140
|
+
const windows = bucketMap !== undefined ? extractUsageWindows(bucketMap) : [];
|
|
1141
|
+
const answer = windows.length > 0 ? "known" : "unpublished";
|
|
1107
1142
|
return PlanLimitsSchema2.parse({
|
|
1108
|
-
answer
|
|
1143
|
+
answer,
|
|
1109
1144
|
windows,
|
|
1110
|
-
observedAt: now.toISOString()
|
|
1145
|
+
observedAt: now.toISOString(),
|
|
1146
|
+
...plan !== undefined && { plan }
|
|
1111
1147
|
});
|
|
1112
1148
|
}
|
|
1113
1149
|
function claudePlanWindows2(info) {
|
|
@@ -1196,7 +1232,7 @@ function classifyTranscriptLine(bytes, uuid) {
|
|
|
1196
1232
|
return "invalid";
|
|
1197
1233
|
return recordUuid === uuid ? "match" : "other";
|
|
1198
1234
|
}
|
|
1199
|
-
async function
|
|
1235
|
+
async function claudeTranscriptHasUuid2(path, uuid) {
|
|
1200
1236
|
let handle;
|
|
1201
1237
|
try {
|
|
1202
1238
|
handle = await open(path, "r");
|
|
@@ -1288,13 +1324,13 @@ async function claudeTranscriptExists(path) {
|
|
|
1288
1324
|
await handle.close();
|
|
1289
1325
|
return true;
|
|
1290
1326
|
}
|
|
1291
|
-
async function
|
|
1292
|
-
const profile = engineProfile(engine, input.profile);
|
|
1293
|
-
return
|
|
1327
|
+
async function findTranscriptInput2(engine, input, ambient) {
|
|
1328
|
+
const profile = engineProfile(engine, input.profile, ambient);
|
|
1329
|
+
return claudeTranscriptHasUuid2(claudeTranscriptPath2({
|
|
1294
1330
|
home: profile.home,
|
|
1295
1331
|
cwd: input.cwd,
|
|
1296
1332
|
sessionId: input.nativeThreadId
|
|
1297
1333
|
}), input.clientId);
|
|
1298
1334
|
}
|
|
1299
1335
|
|
|
1300
|
-
export { ClaudeTaskUsageSchema2, ClaudeRuntimeEventSchema2, claudeUserContent, claudeUserMessage, resolveClaudePermissionReply, claudePermissionResponse, claudeControlError, claudeInterrupt, newClaudeTurnState, classifyClaudeRecord,
|
|
1336
|
+
export { ClaudeTaskUsageSchema2, ClaudeRuntimeEventSchema2, claudeUserContent, claudeUserMessage, resolveClaudePermissionReply, claudePermissionResponse, claudeControlError, claudeInterrupt, newClaudeTurnState, classifyClaudeRecord, claudeUsagePlanLimits2, claudePlanWindows2, claudeTranscriptPath2, claudeTranscriptHasUuid2, claudeTranscriptExists, findTranscriptInput2 };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-machine.d.ts","sourceRoot":"","sources":["../../src/sync/session-machine.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,KAAK,aAAa,EAAqC,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"session-machine.d.ts","sourceRoot":"","sources":["../../src/sync/session-machine.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,KAAK,aAAa,EAAqC,MAAM,qBAAqB,CAAC;AAG5F,OAAO,EAAqB,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AACpE,OAAO,KAAK,EACV,UAAU,EAEV,sBAAsB,EACtB,gBAAgB,EAEjB,MAAM,WAAW,CAAC;AAUnB,uFAAuF;AACvF,eAAO,MAAM,kBAAkB,EAAE,aAIhC,CAAC;AAEF,qBAAa,kBAAkB,CAAC,IAAI,SAAS,cAAc;IAoC7C,OAAO,CAAC,QAAQ,CAAC,KAAK;IAnClC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAe;IACnC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAe;IACrC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAmD;IAC5E,OAAO,CAAC,IAAI,CAAuC;IAEnD,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO,CAAC,kBAAkB,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,UAAU,CAAK;IACvB,OAAO,CAAC,SAAS,CAAM;IACvB,OAAO,CAAC,SAAS,CAAM;IACvB,OAAO,CAAC,SAAS,CAAK;IACtB,OAAO,CAAC,WAAW,CAA2B;IAG9C,OAAO,CAAC,QAAQ,CAAK;IACrB,OAAO,CAAC,WAAW,CAA4B;IAG/C,OAAO,CAAC,UAAU,CAAuB;IACzC,OAAO,CAAC,SAAS,CAAuB;IACxC,OAAO,CAAC,YAAY,CAAK;IAGzB,OAAO,CAAC,MAAM,CAAmC;IAKjD,OAAO,CAAC,YAAY,CAAuB;IAC3C,0FAA0F;IAC1F,OAAO,CAAC,QAAQ,CAAuB;IAEvC,YAA6B,KAAK,EAAE,gBAAgB,CAAC,IAAI,CAAC,EAOzD;IAED,OAAO,CAAC,KAAK;IAIb,OAAO,CAAC,UAAU;IAKlB,OAAO,CAAC,KAAK;IASb,OAAO,CAAC,UAAU;IAKlB,OAAO,CAAC,QAAQ;IAIhB,iGAAiG;IACjG,OAAO,CAAC,cAAc;IAQtB;;;;OAIG;IACH,KAAK,IAAI,IAAI,CAkBZ;IAED,OAAO,CAAC,SAAS;IAUjB,OAAO,CAAC,OAAO;IAiCf,OAAO,CAAC,QAAQ;IAsBhB,OAAO,CAAC,WAAW;IAWnB,WAAW,IAAI,UAAU,CAAC,IAAI,CAAC,CAyC9B;IAED,2FAA2F;IAC3F,OAAO,CAAC,gBAAgB;IAWxB,OAAO,CAAC,aAAa;IA4BrB,eAAe,IAAI,UAAU,CAAC,IAAI,CAAC,CAGlC;IAED,OAAO,CAAC,OAAO;IASf,WAAW,IAAI,UAAU,CAAC,IAAI,CAAC,CAG9B;IAED,4FAA4F;IAC5F,OAAO,CAAC,SAAS;IAcjB,uFAAuF;IACvF,OAAO,CAAC,aAAa;IAKrB,0FAA0F;IAC1F,OAAO,CAAC,UAAU;IAiClB,4EAA4E;IAC5E,OAAO,CAAC,YAAY;IA2BpB,cAAc,CAAC,IAAI,EAAE,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,CA+C3C;IAED,WAAW,CAAC,OAAO,EAAE;QACnB,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;QAClB,IAAI,EAAE,MAAM,CAAC;KACd,GAAG,UAAU,CAAC,IAAI,CAAC,CAoBnB;IAED,WAAW,IAAI,sBAAsB,CAQpC;IAED,IAAI,IAAI,IAAI,CAGX;CACF"}
|
package/dist/sync/session.d.ts
CHANGED
|
@@ -48,9 +48,9 @@ export interface SyncSessionPorts<PAGE extends SyncPageHeader> {
|
|
|
48
48
|
/** The transport is connected; without it no session starts. */
|
|
49
49
|
isConnected(): boolean;
|
|
50
50
|
/**
|
|
51
|
-
* What `saveCursor` or `saveProgress` saved last.
|
|
52
|
-
*
|
|
53
|
-
* `SyncSnapshotResume` continues the interrupted full snapshot where it stands.
|
|
51
|
+
* What `saveCursor` or `saveProgress` saved last. Return null for an uninitialized store.
|
|
52
|
+
* A nonnegative integer, including zero, requests changes after that version.
|
|
53
|
+
* A `SyncSnapshotResume` continues the interrupted full snapshot where it stands.
|
|
54
54
|
*/
|
|
55
55
|
readCursor(): Eventually<number | SyncSnapshotResume | null>;
|
|
56
56
|
/**
|
|
@@ -31,11 +31,11 @@ approvals for unprompted tool calls. Explicit `approve` supports `scope: 'once'`
|
|
|
31
31
|
|
|
32
32
|
| Export | Kind | Purpose |
|
|
33
33
|
|--------|------|---------|
|
|
34
|
-
| `createAcpDriver` / `AcpDriver` / `AcpDriverConfig` | function / _types_ | the driver (`approvalEnforcement: 'agent-initiated'`): `executable` and `args`; optional `clientInfo`, `sessionMeta`, `stdoutLineFilter`, `probeMode` (`'ephemeral-session' \| 'initialize-only' \| 'passive'`) / `passiveVersion`, `model` / `thoughtLevel` / `mode` (also overridable per open via `AcpOpenInput`, falling back to `session/set_model`), `mcpServers`, `transformUpdate`, post-settle `onUpdate` / `onPermissionRequest`, `onDisconnect`, `watchPromptOutcome`, `usageInputIncludesCachedRead`, `steerMode` (`'none' \| 'prompt'`), `resolveFile`, `maxImageBytes` (5 MiB), `maxFrameBytes` (8 MiB), `ambient`, and `requestTimeoutMs` (60 s, capping `session/close` / `session/delete` to at most 5 s) |
|
|
35
|
-
| `AcpSession` / `AcpOpenInput` / `AcpSteerTurnInput` / `AcpConfigOption` / `AcpApprovalEnforcement` | _types_ | a session's settings, title and commands, `approvalEnforcement` (`'agent-initiated'`), `setConfigOption(category or id, value)`, `respond(interactionId, reply)` for
|
|
36
|
-
| `AcpProbeMode` / `AcpSteerMode` / `AcpSessionMetaInput` / `AcpWatchPromptOutcome` / `AcpPromptOutcomeOverride` | _types_ | probe strategy, steer mode, static or `initialize`-derived `_meta` attachment on session open, and prompt-outcome verification hook reclassifying masked `end_turn` failures with `errorKind` and `threadDisposition` |
|
|
37
|
-
| `AcpTransformUpdate` / `AcpUpdateEvent` / `AcpPermissionRequestEvent` | _types_ | update normalizer (`transformUpdate`), live/post-settle `session/update` observer payload (`onUpdate`), and
|
|
38
|
-
| `AcpClientInfoSchema` / `AcpClientInfo` / `AcpInitializeResult` / `AcpSessionUpdate` / `AcpPromptResult` / `AcpPromptUsage` / `AcpPermissionRequest` / `AcpPermissionOption` |
|
|
34
|
+
| `createAcpDriver` / `AcpDriver` / `AcpDriverConfig` | function / _types_ | the driver (`approvalEnforcement: 'agent-initiated'`): `executable` and `args`; optional `clientInfo`, `sessionMeta`, `stdoutLineFilter`, `probeMode` (`'ephemeral-session' \| 'initialize-only' \| 'passive'`) / `passiveVersion`, `model` / `thoughtLevel` / `mode` (also overridable per open via `AcpOpenInput`, falling back to `session/set_model`), `mcpServers`, `transformUpdate`, post-settle `onUpdate` / `onPermissionRequest`, `permissionRequestDelivery` (`'external-only' \| 'all'`), `onProviderPid` (fired during `open()`), `onDisconnect`, `watchPromptOutcome`, `usageInputIncludesCachedRead`, `steerMode` (`'none' \| 'prompt'`), `resolveFile`, `maxImageBytes` (5 MiB), `maxFrameBytes` (8 MiB), `ambient`, and `requestTimeoutMs` (60 s, capping `session/close` / `session/delete` to at most 5 s); exposes `probeCapabilities(AcpProbeCapabilitiesInput)` for non-inference capability probing |
|
|
35
|
+
| `AcpSession` / `AcpOpenInput` / `AcpSteerTurnInput` / `AcpConfigOption` / `AcpConfigOptionChoice` / `acpOptionChoices` / `acpOptionValues` / `AcpApprovalEnforcement` | _types_ / functions | a session's `providerPid`, settings, title and commands, `approvalEnforcement` (`'agent-initiated'`), `setConfigOption(category or id, value)`, `respond(interactionId, reply)` for pending permissions, `steerTurn(input)` when `steerMode: 'prompt'`, per-open overrides on `AcpOpenInput`, and flat/grouped config-option flattening helpers (`acpOptionChoices`, `acpOptionValues`) |
|
|
36
|
+
| `AcpProbeCapabilitiesInput` / `AcpCapabilitiesProbe` / `AcpProbeMode` / `AcpSteerMode` / `AcpSessionMetaInput` / `AcpWatchPromptOutcome` / `AcpPromptOutcomeOverride` | _types_ | non-inference capability probe input/result (running regardless of `probeMode` and calling both `session/close` and `session/delete` in `finally`), probe strategy, steer mode, static or `initialize`-derived `_meta` attachment on session open, and prompt-outcome verification hook reclassifying masked `end_turn` failures with `errorKind` and `threadDisposition` |
|
|
37
|
+
| `AcpTransformUpdate` / `AcpUpdateEvent` / `AcpPermissionRequestEvent` | _types_ | update normalizer (`transformUpdate`), live/post-settle `session/update` observer payload (`onUpdate`), and permission request payload with `duringActiveTurn`, full typed `request.options`, and shared single-shot `respond()` (`onPermissionRequest`) |
|
|
38
|
+
| `AcpClientInfoSchema` / `AcpClientInfo` / `AcpInitializeResultSchema` / `AcpInitializeResult` / `AcpConfigOptionSchema` / `AcpSessionUpdateSchema` / `AcpSessionUpdate` / `AcpPromptResult` / `AcpPromptUsage` / `AcpPermissionRequestSchema` / `AcpPermissionRequest` / `AcpPermissionOptionSchema` / `AcpPermissionOption` | schemas / _types_ | loose Zod schemas and typed ACP v1 wire payloads exposed to `sessionMeta`, `transformUpdate`, `onUpdate`, `onPermissionRequest`, and `watchPromptOutcome` |
|
|
39
39
|
| `AcpSessionSummary` | _type_ | a session the agent keeps: id, working directory, title, last update |
|
|
40
40
|
| `AcpMcpServerSchema` / `AcpMcpServer` | schema / _type_ | an MCP server as ACP v1 names it: a command with arguments and environment, or an `http`/`sse` URL with headers |
|
|
41
41
|
| `ACP_PROTOCOL_VERSION` | constant | `1`; ACP v1 agents answering `protocolVersion >= 1` are accepted while protocol `< 1` and ACP v2 responses carrying `"info"` are refused at hello |
|
|
@@ -27,10 +27,12 @@ profile's transcript. Evolving.
|
|
|
27
27
|
| Export | Kind | Purpose |
|
|
28
28
|
|--------|------|---------|
|
|
29
29
|
| `createClaudeSdkDriver` / `ClaudeSdkDriver` / `ClaudeSdkDriverConfig` | function / _types_ | the driver: `query` and `sdkVersion` required; optional `forkSession`, `model`, `permissionMode` (default `default`), `allowDangerouslySkipPermissions`, `pathToClaudeCodeExecutable`, `systemPrompt`, `settingSources`, `enableFileCheckpointing`, `supportedDialogKinds` / `onUserDialog`, `hooks`, `tools`, `allowedTools`, `disallowedTools`, `mcpServers`, `mcpServersDelivery`, `strictMcpConfig`, `plugins`, `agents`, `extraArgs`, `stderr`, `spawnClaudeCodeProcess`, `onProviderPid`, `onQueryExit`, `onElicitation`, `onPermissionRequest`, `onEvent`, `onTurnUsage`, `verifyDelegation`, `resolveFile`, `maxImageBytes` (default 5 MiB), and `ambient`. Exposes `probeCapabilities(input)` for isolated never-yielding capability probes, `status` over passive `rate_limit_event` or active `readUsage()`, and `forkSession(sessionId, options?)` |
|
|
30
|
-
| `ClaudeSdkSession` / `ClaudeSdkOpenInput` / `ClaudeSdkUsageRead` / `ClaudeSdkQueryExitContext` / `ClaudeSdkPermissionRequestMeta` | _types_ | extended session returned by `open(ClaudeSdkOpenInput)` (supporting `resumeSessionAt`, `resumeDropsTurn`, and `onStartupPhase`): exposes `providerPid`, `readUsage(opts?)`, `setModel`, `setPermissionMode
|
|
30
|
+
| `ClaudeSdkSession` / `ClaudeSdkOpenInput` / `ClaudeSdkUsageRead` / `ClaudeSdkQueryExitContext` / `ClaudeSdkPermissionRequestMeta` / `ClaudeSdkFlagSettings` | _types_ | extended session returned by `open(ClaudeSdkOpenInput)` (supporting `resumeSessionAt`, `resumeDropsTurn`, and `onStartupPhase`): exposes `providerPid`, `readUsage(opts?)`, `setModel`, `setPermissionMode` (returning `SDKControlSetPermissionModeResponse \| undefined`), `applyFlagSettings(ClaudeSdkFlagSettings)`, `initializationResult`, `supportedModels`, `supportedCommands`, `accountInfo`, `getContextUsage`, `mcpServerStatus`, `toggleMcpServer`, `reconnectMcpServer`, `setMcpServers`, `stopTask`, `backgroundTasks`, and `rewindFiles`; supports `approve` with `updatedInput` for `AskUserQuestion` and emits `ClaudeSdkPermissionRequestMeta` (`input: Readonly<Record<string, JsonRpcValue>>`) to `onPermissionRequest` |
|
|
31
31
|
| `ClaudeRuntimeEventSchema` / `ClaudeRuntimeEvent` / `ClaudeTaskUsageSchema` / `ClaudeTaskUsage` / `ClaudeSdkTurnUsageSchema` / `ClaudeSdkTurnUsage` / `ClaudeSdkTokenPairSchema` / `ClaudeSdkTokenPair` | schemas / _types_ | structured runtime events delivered to `onEvent` during and after turns (`task_started`, `task_updated`, `task_progress`, `task_notification`, `background_tasks_changed`, `tool_progress`, `api_retry`, `elicitation_complete`) alongside `compact_boundary` → `window { reset: 'context' }`, plus per-turn additive `modelUsage` deltas and `otherUsage` delivered to `onTurnUsage` |
|
|
32
32
|
| `ClaudeSdkProbeCapabilitiesInput` / `ClaudeSdkCapabilitiesProbe` | _types_ | input and result shapes for `driver.probeCapabilities(input)`: runs an isolated never-yielding SDK query to inspect models, commands, account info, and optional usage, always closing the query in `finally` |
|
|
33
33
|
| `ClaudeSdkDelegationCheck` | _type_ | fail-closed startup verification options (`requireHooksApplied`, `requireNoMcpServers`, `timeoutMs`) enforced at `open()` and on every query restart |
|
|
34
34
|
| `ClaudeSdkQuery` / `ClaudeSdkRun` / `ClaudeSdkForkSession` | _types_ | the SDK `query` / `forkSession` signatures the leaf takes and the subset of a running `Query` it uses; the SDK's own functions fit as they are |
|
|
35
|
+
| `AccountInfo` / `EffortLevel` / `ForkSessionOptions` / `ForkSessionResult` / `McpServerStatus` / `McpSetServersResult` / `ModelInfo` / `PermissionMode` / `RewindFilesResult` / `SDKControlGetContextUsageResponse` / `SDKControlGetUsageResponse` / `SDKControlInitializeResponse` / `SDKControlSetPermissionModeResponse` / `SlashCommand` | _types_ | type-only re-exports of the `@anthropic-ai/claude-agent-sdk` types referenced in `ClaudeSdkSession` and `ClaudeSdkDriver` signatures |
|
|
36
|
+
| `claudeUsagePlanLimits` / `claudeTranscriptHasUuid` / `findTranscriptInput` | functions | direct offline transcript reconciliation and open-bucket Claude usage plan-limit helpers shared with `stitchkit/agent-executor/claude` |
|
|
35
37
|
|
|
36
38
|
---
|
|
@@ -23,7 +23,7 @@ Evolving.
|
|
|
23
23
|
|--------|------|---------|
|
|
24
24
|
| `createClaudeCliDriver` / `ClaudeCliDriverConfig` | function / _type_ | the driver; `permissionMode` defaults to `default`, so the server decides every tool the profile does not already allow; optional `resolveFile` and `maxImageBytes` (default 5 MiB) enable ordered turn-input image attachments |
|
|
25
25
|
| `claudeFakeScenarios` | constant | the conformance scenarios in this dialect, for a scripted engine |
|
|
26
|
-
| `claudeTranscriptPath`
|
|
27
|
-
| `claudePlanWindows` |
|
|
26
|
+
| `claudeTranscriptPath` / `claudeTranscriptHasUuid` / `findTranscriptInput` | functions | offline Claude transcript path resolution (resolving `realpath` of `cwd` or its nearest existing ancestor) and bounded streaming UUID lookup / reconciliation without instantiating a driver |
|
|
27
|
+
| `claudePlanWindows` / `claudeUsagePlanLimits` | functions | Claude's `rate_limit_event` windows and open-bucket usage / `/api/oauth/usage` `PlanLimits` mapping preserving `plan` and the reported model name as `scope` and `label` on model-scoped windows |
|
|
28
28
|
|
|
29
29
|
---
|
|
@@ -20,16 +20,19 @@ WebSocket-over-Unix-socket (`unix-listen` / `unix-connect`). Evolving.
|
|
|
20
20
|
| Export | Kind | Purpose |
|
|
21
21
|
|--------|------|---------|
|
|
22
22
|
| `createCodexDriver` / `CodexDriver` / `CodexDriverConfig` | function / _types_ | the driver: `transport` (`stdio`, `unix-listen`, `unix-connect`), `serverArgs`, thread policy (`model`, `modelProvider`, `approvalPolicy`, `sandbox`, `developerInstructions`, `runtimeWorkspaceRoots`, `config`), `prepareThread` / `verifyThread` lifecycle hooks, observers (`onNotification`, `onServerRequest`, `serverRequestDelivery` `'external-only' \| 'all'`, `onDisconnect`), `maxFrameBytes` (WebSocket/stdio frame ceiling), optional `resolveFile` and `maxImageBytes` (default 5 MiB) for turn-input images, `connectControl(input)` for threadless connections, opt-in `openSharedServer(input)` for headless `stdio` multi-thread multiplexing (ADR 0329), approvals and input asked of the host, and multi-bucket limits from `account/rateLimits/read` |
|
|
23
|
-
| `CodexTransportConfig` | _type_ | transport selector: `{ kind: 'stdio' }`, `{ kind: 'unix-listen', socketPath, listenTimeoutMs? }`, or `{ kind: 'unix-connect', socketPath, expectedOwnerUid? }` |
|
|
24
|
-
| `CodexSession` / `CodexControlClient` / `CodexControlConnection` / `CodexControlConnectInput` | _types_ | extended session returned by `open()` and threadless connection returned by `connectControl()`: expose `providerPid`, `userAgent` (from `initialize`), `respond`, `readConfig`, `readThread`, `resumeThread`, `interruptTurn`, `steerTurn`, `compactThread`, `listThreads`, `listLoadedThreads`, `listCollaborationModes`, `listTurns`, `listItems`, `archiveThread`, `unarchiveThread`, `unsubscribeThread`, `setThreadName`, `updateThreadMetadata`, `revertThread`, `injectItems`, `listMcpServerStatus`, `listSkills`, `listModels`, `readAccount`, and `readRateLimits
|
|
23
|
+
| `CodexTransportConfig` | _type_ | transport selector: `{ kind: 'stdio' }`, `{ kind: 'unix-listen', socketPath, listenTimeoutMs? }`, or `{ kind: 'unix-connect', socketPath, expectedOwnerUid? }` (resolving symlink chains on parent directories safely across Linux and Darwin) |
|
|
24
|
+
| `CodexSession` / `CodexControlClient` / `CodexControlConnection` / `CodexControlConnectInput` / `CodexRpcCallOptions` | _types_ | extended session returned by `open()` and threadless connection returned by `connectControl()`: expose `providerPid`, `userAgent` (from `initialize`), `respond`, `readConfig`, `readThread`, `resumeThread`, `startThreadTurn` (threadless `turn/start` without occupying a local session turn slot), `interruptTurn`, `steerTurn`, `compactThread`, `listThreads`, `listLoadedThreads`, `listCollaborationModes`, `listTurns`, `listItems`, `archiveThread`, `unarchiveThread`, `unsubscribeThread`, `setThreadName`, `updateThreadMetadata`, `revertThread`, `injectItems`, `listMcpServerStatus`, `listSkills`, `listModels`, `readAccount`, and `readRateLimits`, each accepting optional per-call `CodexRpcCallOptions` (`{ timeoutMs?, signal? }`); `CodexSession` also exposes `threadContext`, `startTurn` (returning `CodexTurn`), and non-mutating `forkThread` |
|
|
25
25
|
| `CodexSharedServer` / `CodexSharedServerOpenInput` / `CodexSharedServerThreadInput` | _types_ | opt-in headless `stdio` multi-thread server returned by `driver.openSharedServer()` exposing `userAgent` and multiplexing up to `maxThreads` (default `32`, hard cap `256`) independent `CodexSession` instances with per-thread routing and `thread/unsubscribe` cleanup on thread close (refuses `unix-listen` / `unix-connect` fail-closed) |
|
|
26
|
-
| `CodexReadThreadParams` / `CodexResumeThreadParams` / `CodexListThreadsParams` / `CodexListLoadedThreadsParams` / `CodexListTurnsParams` / `CodexListItemsParams` / `CodexThreadItemsCursor` / `CodexThreadItemsDeferOutput` / `CodexThreadSortKey` / `CodexThreadSourceKind` | _types_ | typed parameters for `thread/read`, `thread/resume` (`excludeTurns` defaulting to `true` plus policy overrides), `thread/list`, `thread/loaded/list`, `thread/turns/list` (nullable `cursor`), and `thread/items/list` (nullable `cursor`) |
|
|
27
|
-
| `CodexThreadIdParams` / `CodexInterruptTurnParams` / `CodexControlSteerTurnParams` / `CodexSetThreadNameParams` / `CodexUpdateThreadMetadataParams` / `CodexThreadGitInfoUpdate` / `CodexRevertThreadParams` / `CodexRevertThreadResult` / `CodexInjectItemsParams` | _types_ | typed parameters and results for thread lifecycle (`archive`, `unarchive`, `unsubscribe`, `compact/start`, `name/set`, `metadata/update`), arbitrary-turn `turn/interrupt` (`interruptTurn`), cross-connection `turn/steer` (`steerTurn`), history rollback (`thread/revert` via `revertThread`), and item injection (`thread/inject_items` via `injectItems`) |
|
|
28
|
-
| `
|
|
29
|
-
| `
|
|
30
|
-
| `
|
|
26
|
+
| `CodexReadThreadParams` / `CodexResumeThreadParams` / `CodexListThreadsParams` / `CodexListLoadedThreadsParams` / `CodexListTurnsParams` / `CodexListItemsParams` / `CodexThreadItemsCursor` / `CodexThreadItemsDeferOutput` / `CodexThreadSortKey` / `CodexThreadSourceKind` / `CodexThreadSourceKindSchema` / `CODEX_THREAD_SOURCE_KINDS` | schemas / constant / _types_ | typed parameters and source-kind vocabulary for `thread/read`, `thread/resume` (`excludeTurns` defaulting to `true` plus policy overrides), `thread/list`, `thread/loaded/list`, `thread/turns/list` (nullable `cursor`), and `thread/items/list` (nullable `cursor`) |
|
|
27
|
+
| `CodexThreadIdParams` / `CodexControlStartTurnParams` / `CodexInterruptTurnParams` / `CodexControlSteerTurnParams` / `CodexSetThreadNameParams` / `CodexUpdateThreadMetadataParams` / `CodexThreadGitInfoUpdate` / `CodexRevertThreadParams` / `CodexRevertThreadResult` / `CodexInjectItemsParams` | _types_ | typed parameters and results for thread lifecycle (`archive`, `unarchive`, `unsubscribe`, `compact/start`, `name/set`, `metadata/update`), threadless `turn/start` (`startThreadTurn`), arbitrary-turn `turn/interrupt` (`interruptTurn`), cross-connection `turn/steer` (`steerTurn`), history rollback (`thread/revert` via `revertThread`), and item injection (`thread/inject_items` via `injectItems`) |
|
|
28
|
+
| `CodexProtocolError` / `CodexConfigReadResponseSchema` / `CodexConfigReadResponse` / `CodexConfigSchema` / `CodexReadThreadResponseSchema` / `CodexReadThreadResponse` / `CodexResumeThreadResponseSchema` / `CodexResumeThreadResponse` / `CodexCollaborationModesResponseSchema` / `CodexCollaborationModesResponse` / `CodexCollaborationModePresetSchema` / `CodexItemsPageSchema` / `CodexItemsPage` / `CodexThreadItemEntrySchema` / `CodexThreadItemEntry` / `CodexMcpServerStatusPageSchema` / `CodexMcpServerStatusPage` / `CodexMcpServerStatusSchema` / `CodexSkillsListResponseSchema` / `CodexSkillsListResponse` / `CodexModelsPageSchema` / `CodexModelsPage` / `CodexModelSchema` / `CodexModel` / `CodexAccountReadResponseSchema` / `CodexAccountReadResponse` / `CodexAccountSchema` / `CodexAccount` / `CodexRateLimitsResponseSchema` / `CodexRateLimitsResponse` / `CodexRateLimitSnapshotSchema` / `CodexRateLimitWindowSchema` / `CodexThreadsPageSchema` / `CodexThreadsPage` / `CodexLoadedThreadsPageSchema` / `CodexLoadedThreadsPage` / `CodexThreadUnsubscribeResponseSchema` / `CodexThreadUnsubscribeResponse` / `CodexThreadUnsubscribeStatusSchema` / `CodexThreadUnarchiveResponseSchema` / `CodexThreadUnarchiveResponse` / `CodexThreadMetadataUpdateResponseSchema` / `CodexThreadMetadataUpdateResponse` | class / schemas / _types_ | Zod-first loose response DTOs validated at every `CodexControlClient` boundary (preserving unknown extra fields and open future variants while throwing `CodexProtocolError` on malformed payloads) |
|
|
29
|
+
| `CodexThreadSchema` / `CodexThread` / `CodexThreadStatusSchema` / `CodexThreadStatus` / `CodexThreadContextSchema` / `CodexThreadContext` / `CodexThreadItemSchema` / `CodexThreadItem` / `CodexTurnsPageSchema` / `CodexTurnsPage` / `CodexListedTurnSchema` / `CodexListedTurn` / `CodexTurnStatusSchema` / `CodexTurnStatus` / `CodexTurnItemsViewSchema` / `CodexTurnItemsView` / `CodexApprovalPolicySchema` / `CodexApprovalPolicy` / `CodexSandboxModeSchema` / `CodexSandboxMode` / `CodexSandboxPolicySchema` / `CodexSandboxPolicy` / `CodexCollaborationModeSchema` / `CodexCollaborationMode` / `CODEX_TOOL_ITEMS` | schemas / constant / _types_ | core Codex protocol schemas and open-variant types (`CodexThreadStatus`, `CodexSandboxPolicy`, `CodexTurnItemsView`, `CodexListedTurn` carrying `itemsView` and `startedAt`/`completedAt`/`durationMs`/`rootTurnId`, plus `CODEX_TOOL_ITEMS`) |
|
|
30
|
+
| `parseCodexNotification` / `CodexNotificationParams` / `CodexNotificationMethod` / `CodexParsedNotification` / `CodexNotificationEvent` / `CodexServerRequestEvent` / `CodexServerRequestMethod` / `CodexMcpElicitationMode` | function / constant / _types_ | discriminated parser for all 14 documented Codex server notifications (including quiet lifecycle notifications; returns `null` for unknown methods and throws `CodexProtocolError` on malformed known payloads) plus observer event payloads for notifications and the 5 handled v2 server requests (`item/commandExecution/requestApproval`, `item/fileChange/requestApproval`, `item/permissions/requestApproval`, `item/tool/requestUserInput`, `mcpServer/elicitation/request`, carrying `requestId` and `duringActiveTurn`) |
|
|
31
|
+
| `iterateCodexPages` / `IterateCodexPagesOptions` / `IterateCodexPagesResult` / `CodexPageCursorResult` / `findCodexTurnByClientId` / `FindCodexTurnByClientIdParams` | functions / _types_ | bounded cursor pagination helper (empty-string cursor support, repeated-cursor loop protection, `AbortSignal`) and streaming live-connection turn lookup by `clientId` (failing closed on incomplete `itemsView` or page-ceiling exhaustion) |
|
|
32
|
+
| `CodexOpenInput` / `CodexOpenForkOptions` / `CodexThreadPolicyOverrides` | _types_ | `open()` input (including opening directly through `thread/fork` via `forkFrom` with `deferGoalContinuation`) and overridable thread policy fields |
|
|
33
|
+
| `CodexTurn` / `CodexTurnInput` / `CodexTurnInputPart` / `CodexLocalImageInputSchema` / `CodexLocalImageInput` / `CodexSkillInputSchema` / `CodexSkillInput` / `CodexSteerTurnInput` / `CodexForkThreadOptions` / `CodexForkedThread` | schemas / _types_ | `CodexTurn` (`nativeTurnId` from `turn/start`), per-turn `startTurn` overrides (`cwd`, `model`, fail-closed `modelProvider`, `reasoningEffort`, `collaborationMode`, `approvalPolicy`, `sandboxPolicy`, `runtimeWorkspaceRoots`), ordered text / image / `localImage` (`{ type: 'localImage', path }`) / `skill` (`{ type: 'skill', name, path }`) turn and steer inputs, and `forkThread` options/result (including `deferGoalContinuation`) |
|
|
31
34
|
| `CodexUnixSocketError` / `CodexUnixSocketErrorKind` | class / _type_ | typed Unix-socket refusal/transport error distinguishing `endpoint-absent`, `endpoint-not-listening`, `target-refused`, `upgrade-refused`, and `connection-lost` |
|
|
32
35
|
| `codexFakeScenarios` | constant | the conformance scenarios in this dialect, for a scripted app-server |
|
|
33
|
-
| `codexPlanWindows` |
|
|
36
|
+
| `codexPlanWindows` / `codexPlanLimits` | functions | unfolds Codex's `account/rateLimits/read` envelope (camelCase or snake_case rollout `token_count`, seconds/ms/ISO `resetsAt`, `plan_type`) or a flat snapshot with a sibling per-model map into `PlanWindow[]` or full `PlanLimits`, retaining account and scoped measurements |
|
|
34
37
|
|
|
35
38
|
---
|
|
@@ -21,8 +21,12 @@ Also read:
|
|
|
21
21
|
| `createReplayGate` / `ReplayGate` | function / _type_ | deterministic label-based synchronization gate pausing `{ kind: 'gate', label }` steps until `waitForReached` / `release` without timers |
|
|
22
22
|
| `ExecutorReplayTranscriptSchema` / `ExecutorReplayTranscript` / `ExecutorReplayStepSchema` / `ExecutorReplayStep` / `parseReplayTranscript` / `ParseReplayTranscriptOptions` / `formatReplayTranscript` | schemas / functions / _types_ | strict Zod-validated NDJSON transcript format (bounded by `maxBytes` and `maxSteps`, substituting `<workspace>` placeholders) and round-trip parser/formatter |
|
|
23
23
|
| `REPLAY_SCENARIOS` / `unpackReplayScenario` / `replayDialectScenarios` | constant / functions | built-in deterministic scenario presets (`'text-stream'`, `'approval'`, `'user-input'`, `'tool-calls'`, `'rate-limit'`, `'multi-turn'`, `'crash-mid-turn'`) and conformance dialect adapter |
|
|
24
|
+
| `createFakeCodexAppServer` / `FakeCodexAppServer` / `FakeCodexAppServerConfig` / `FakeCodexRpcHandler` / `FakeCodexRpcHandlerOutcome` / `FakeCodexRpcErrorOutcome` / `RecordedJsonRpcRequest` | function / _types_ | portable (Bun and Node.js) real Unix-socket WebSocket JSON-RPC fake Codex app-server for integration tests with `createCodexDriver({ transport: { kind: 'unix-connect' } })`: automatic `initialize` handshake, `'hang'` / DTO / RPC error handlers, `requests` recording, `sendNotification`, `sendRequest`, `sendRaw`, `disconnect()`, and idempotent `close()` |
|
|
25
|
+
| `createFakeClaudeSdkQuery` / `FakeClaudeSdkQueryConfig` / `FakeClaudeSdkQueryHarness` / `FakeClaudeSdkRunController` / `FakeClaudeSdkScriptedTurn` / `FakeClaudeSdkRecordedCall` | function / _types_ | scripted multi-turn in-process `ClaudeSdkQuery` harness over real `createClaudeSdkDriver` supporting `canUseTool` via `askPermission`, live control call recording, optional experimental usage attachment, and non-inference `probeCapabilities` |
|
|
26
|
+
| `createStubCodexControlClient` / `createStubCodexControlConnection` / `createStubCodexSession` / `createStubCodexSharedServer` / `createStubCodexTurn` / `createStubAgentEngineTurn` / `createStubClaudeSdkSession` / `createStubAcpSession` / `StubOverrides` / `StubAgentEngineTurnOverrides` / `StubCodexTurnOverrides` | functions / _types_ | fail-loud typed consumer stub factories (`exactOptionalPropertyTypes: true`-safe `StubOverrides<T>`, no-op `close()`, unexpected-call throws on unset methods) |
|
|
27
|
+
| `makeExecutorDelta` / `ExecutorDeltaInput` / `makeCodexNotificationEvent` / `CodexNotificationEventOverrides` / `makeCodexThreadFixture` | functions / _types_ | schema-validated fixture factories for `ExecutorDelta`, `CodexNotificationEvent`, and `CodexThread` |
|
|
24
28
|
| `FakeEngineScenarioSchema` / `FakeEngineScenario` / `FakeEngineStepSchema` / `FakeEngineStep` | schemas / _types_ | a scripted engine turn in any dialect: expect, emit, delay, crash, exit |
|
|
25
|
-
| `runFakeClaudeEngine` | function | play a scenario as Claude Code does on `stream-json` — the engine side of a Claude-dialect conformance test
|
|
29
|
+
| `runFakeClaudeEngine` | function | play a scenario as Claude Code does on `stream-json` — the engine side of a Claude-dialect conformance test |
|
|
26
30
|
|
|
27
31
|
---
|
|
28
32
|
|