coding-agents-sdk 0.15.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +46 -0
- package/dist/Agent-BjaeRtLk.mjs +4 -0
- package/dist/adapters/claude-code-cli/index.d.mts +2 -2
- package/dist/adapters/claude-code-cli/index.mjs +1 -1
- package/dist/adapters/claude-code-cli-pty/index.d.mts +2 -2
- package/dist/adapters/claude-code-cli-pty/index.mjs +2 -2
- package/dist/adapters/claude-code-sdk/index.d.mts +1 -1
- package/dist/adapters/codex-cli/index.d.mts +2 -2
- package/dist/adapters/codex-cli/index.mjs +2 -2
- package/dist/adapters/codex-sdk/index.d.mts +1 -1
- package/dist/adapters/cursor-cli/index.d.mts +1 -1
- package/dist/adapters/cursor-cli/index.mjs +1 -1
- package/dist/adapters/cursor-sdk/index.d.mts +1 -1
- package/dist/adapters/gemini-cli/index.d.mts +1 -1
- package/dist/adapters/gemini-cli/index.mjs +1 -1
- package/dist/adapters/opencode-cli/index.d.mts +1 -1
- package/dist/adapters/opencode-cli/index.mjs +1 -1
- package/dist/adapters/pi-cli/index.d.mts +1 -1
- package/dist/adapters/pi-cli/index.mjs +1 -1
- package/dist/container/index.d.mts +1 -1
- package/dist/container/index.mjs +1 -1
- package/dist/{container-B2i85Vkf.mjs → container-Bdb90GJb.mjs} +1 -1
- package/dist/{container-Dk4QgU9G.mjs → container-DMFxf-kn.mjs} +1 -1
- package/dist/{container-CbvaYn8K.mjs → container-Dvr-p53c.mjs} +1 -1
- package/dist/{container-BwDinlQ1.mjs → container-dCRMBvQw.mjs} +1 -1
- package/dist/container-w0rl1QMH.mjs +1 -0
- package/dist/core/process/index.d.mts +3 -0
- package/dist/core/process/index.mjs +1 -0
- package/dist/diff-Dqyk2cdt.mjs +1 -0
- package/dist/errors-aYGbvsaq.mjs +1 -0
- package/dist/index-65Dv7ed0.d.mts +415 -0
- package/dist/{index-gtpzhLCF.d.mts → index-BbZPkmE-.d.mts} +4 -3
- package/dist/{index-C09YdI2A.d.mts → index-Bi9Dh34t.d.mts} +4 -4
- package/dist/{index-D3yvIIre.d.mts → index-BiUoRRsR.d.mts} +4 -3
- package/dist/{index-CT-rhJzK.d.mts → index-CN0WGc9T.d.mts} +3 -2
- package/dist/{index-BXgvYZSv.d.mts → index-CQzF8Cli.d.mts} +1 -1
- package/dist/{index-CGGPY1qE.d.mts → index-CZbgTv8P.d.mts} +1 -1
- package/dist/{index-Dm9HCmWK.d.mts → index-CjjUmMwQ.d.mts} +1 -1
- package/dist/{index-DGY0wFGC.d.mts → index-CyIiBK-O.d.mts} +130 -4
- package/dist/{index-D_qqPXPO.d.mts → index-DmpVdnKm.d.mts} +4 -3
- package/dist/index-DvwVRB7K.d.mts +10 -0
- package/dist/{index-WaVqMCYN.d.mts → index-kXfBtyJn.d.mts} +2 -1
- package/dist/{index-BkIhoEPd.d.mts → index-m5Pqs8Jz.d.mts} +4 -3
- package/dist/index.d.mts +16 -14
- package/dist/index.mjs +1 -1
- package/dist/oci-DTNwW-WH.mjs +1 -0
- package/dist/{parser-15-5gbtk.mjs → parser-C1kvDtRD.mjs} +1 -1
- package/dist/sandbox/index.d.mts +1 -1
- package/dist/sandbox/index.mjs +1 -1
- package/dist/{sandbox-CoV-gBuM.mjs → sandbox-CYA69miM.mjs} +1 -1
- package/dist/spawner-CgfyvnR4.mjs +1 -0
- package/dist/{types-CeIQCAFV.d.mts → types-Ba2NYJOB.d.mts} +10 -57
- package/dist/types-COmjfh8B.d.mts +57 -0
- package/package.json +5 -1
- package/dist/Agent-mSH_-Sf8.mjs +0 -4
- package/dist/container-DfDs2Bmh.mjs +0 -1
- package/dist/diff-C60ujrU_.mjs +0 -1
- package/dist/index-fZiuDQFa.d.mts +0 -154
- package/dist/oci-BvdPJQRS.mjs +0 -1
- package/dist/spawner-BE2hAC0w.mjs +0 -1
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
import { S as McpServerConfig } from "./events-BxEB6zHt.mjs";
|
|
2
|
+
import { i as ProcessSpawner } from "./types-COmjfh8B.mjs";
|
|
3
|
+
import { _ as ProviderEventHandler, f as EnsureDisjoint, l as BaseAgent, p as ExclusiveExecutionTargetOptions, t as AgentEventHandler } from "./types-Ba2NYJOB.mjs";
|
|
4
|
+
import { t as Container } from "./index-kXfBtyJn.mjs";
|
|
5
|
+
import { l as Sandbox } from "./index-CN0WGc9T.mjs";
|
|
6
|
+
import { z } from "zod/v4";
|
|
7
|
+
//#region src/adapters/codex-cli/events/schemas.d.ts
|
|
8
|
+
/**
|
|
9
|
+
* Permissive shape for any raw event Codex CLI emits — `{ type: string }`
|
|
10
|
+
* plus arbitrary additional fields. Narrow on `event.type` against the
|
|
11
|
+
* specific exported event types (`CodexThreadStartedEvent`,
|
|
12
|
+
* `CodexTurnCompletedEvent`, `CodexItemStartedEvent`, etc.) when you need
|
|
13
|
+
* field-level access.
|
|
14
|
+
*/
|
|
15
|
+
declare const codexEventSchema: z.ZodObject<{
|
|
16
|
+
type: z.ZodString;
|
|
17
|
+
}, z.core.$loose>;
|
|
18
|
+
type CodexEvent = z.infer<typeof codexEventSchema>;
|
|
19
|
+
declare const codexThreadStartedEventSchema: z.ZodObject<{
|
|
20
|
+
type: z.ZodLiteral<"thread.started">;
|
|
21
|
+
thread_id: z.ZodString;
|
|
22
|
+
}, z.core.$loose>;
|
|
23
|
+
type CodexThreadStartedEvent = z.infer<typeof codexThreadStartedEventSchema>;
|
|
24
|
+
declare const codexTurnCompletedEventSchema: z.ZodObject<{
|
|
25
|
+
type: z.ZodLiteral<"turn.completed">;
|
|
26
|
+
usage: z.ZodOptional<z.ZodObject<{
|
|
27
|
+
input_tokens: z.ZodOptional<z.ZodNumber>;
|
|
28
|
+
cached_input_tokens: z.ZodOptional<z.ZodNumber>;
|
|
29
|
+
cache_write_input_tokens: z.ZodOptional<z.ZodNumber>;
|
|
30
|
+
output_tokens: z.ZodOptional<z.ZodNumber>;
|
|
31
|
+
reasoning_output_tokens: z.ZodOptional<z.ZodNumber>;
|
|
32
|
+
total_tokens: z.ZodOptional<z.ZodNumber>;
|
|
33
|
+
}, z.core.$loose>>;
|
|
34
|
+
last_agent_message: z.ZodOptional<z.ZodString>;
|
|
35
|
+
duration_ms: z.ZodOptional<z.ZodNumber>;
|
|
36
|
+
num_turns: z.ZodOptional<z.ZodNumber>;
|
|
37
|
+
}, z.core.$loose>;
|
|
38
|
+
type CodexTurnCompletedEvent = z.infer<typeof codexTurnCompletedEventSchema>;
|
|
39
|
+
declare const codexTurnFailedEventSchema: z.ZodObject<{
|
|
40
|
+
type: z.ZodLiteral<"turn.failed">;
|
|
41
|
+
usage: z.ZodOptional<z.ZodObject<{
|
|
42
|
+
input_tokens: z.ZodOptional<z.ZodNumber>;
|
|
43
|
+
cached_input_tokens: z.ZodOptional<z.ZodNumber>;
|
|
44
|
+
cache_write_input_tokens: z.ZodOptional<z.ZodNumber>;
|
|
45
|
+
output_tokens: z.ZodOptional<z.ZodNumber>;
|
|
46
|
+
reasoning_output_tokens: z.ZodOptional<z.ZodNumber>;
|
|
47
|
+
total_tokens: z.ZodOptional<z.ZodNumber>;
|
|
48
|
+
}, z.core.$loose>>;
|
|
49
|
+
last_agent_message: z.ZodOptional<z.ZodString>;
|
|
50
|
+
duration_ms: z.ZodOptional<z.ZodNumber>;
|
|
51
|
+
num_turns: z.ZodOptional<z.ZodNumber>;
|
|
52
|
+
message: z.ZodOptional<z.ZodString>;
|
|
53
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
54
|
+
}, z.core.$loose>;
|
|
55
|
+
type CodexTurnFailedEvent = z.infer<typeof codexTurnFailedEventSchema>;
|
|
56
|
+
declare const codexItemStartedEventSchema: z.ZodObject<{
|
|
57
|
+
type: z.ZodLiteral<"item.started">;
|
|
58
|
+
item: z.ZodObject<{
|
|
59
|
+
id: z.ZodString;
|
|
60
|
+
type: z.ZodString;
|
|
61
|
+
}, z.core.$loose>;
|
|
62
|
+
}, z.core.$loose>;
|
|
63
|
+
type CodexItemStartedEvent = z.infer<typeof codexItemStartedEventSchema>;
|
|
64
|
+
declare const codexItemUpdatedEventSchema: z.ZodObject<{
|
|
65
|
+
type: z.ZodLiteral<"item.updated">;
|
|
66
|
+
item: z.ZodObject<{
|
|
67
|
+
id: z.ZodString;
|
|
68
|
+
type: z.ZodString;
|
|
69
|
+
}, z.core.$loose>;
|
|
70
|
+
}, z.core.$loose>;
|
|
71
|
+
type CodexItemUpdatedEvent = z.infer<typeof codexItemUpdatedEventSchema>;
|
|
72
|
+
declare const codexItemCompletedEventSchema: z.ZodObject<{
|
|
73
|
+
type: z.ZodLiteral<"item.completed">;
|
|
74
|
+
item: z.ZodObject<{
|
|
75
|
+
id: z.ZodString;
|
|
76
|
+
type: z.ZodString;
|
|
77
|
+
}, z.core.$loose>;
|
|
78
|
+
}, z.core.$loose>;
|
|
79
|
+
type CodexItemCompletedEvent = z.infer<typeof codexItemCompletedEventSchema>;
|
|
80
|
+
declare const codexErrorEventSchema: z.ZodObject<{
|
|
81
|
+
type: z.ZodLiteral<"error">;
|
|
82
|
+
message: z.ZodOptional<z.ZodString>;
|
|
83
|
+
error: z.ZodOptional<z.ZodUnknown>;
|
|
84
|
+
}, z.core.$loose>;
|
|
85
|
+
type CodexErrorEvent = z.infer<typeof codexErrorEventSchema>;
|
|
86
|
+
declare const codexProviderItemSchema: z.ZodObject<{
|
|
87
|
+
id: z.ZodString;
|
|
88
|
+
type: z.ZodEnum<{
|
|
89
|
+
agent_message: "agent_message";
|
|
90
|
+
collab_tool_call: "collab_tool_call";
|
|
91
|
+
command_execution: "command_execution";
|
|
92
|
+
error: "error";
|
|
93
|
+
file_change: "file_change";
|
|
94
|
+
mcp_tool_call: "mcp_tool_call";
|
|
95
|
+
plan_update: "plan_update";
|
|
96
|
+
reasoning: "reasoning";
|
|
97
|
+
todo_list: "todo_list";
|
|
98
|
+
web_search: "web_search";
|
|
99
|
+
}>;
|
|
100
|
+
text: z.ZodOptional<z.ZodString>;
|
|
101
|
+
reasoning: z.ZodOptional<z.ZodString>;
|
|
102
|
+
command: z.ZodOptional<z.ZodString>;
|
|
103
|
+
status: z.ZodOptional<z.ZodString>;
|
|
104
|
+
output: z.ZodOptional<z.ZodString>;
|
|
105
|
+
aggregated_output: z.ZodOptional<z.ZodString>;
|
|
106
|
+
exit_code: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
107
|
+
path: z.ZodOptional<z.ZodString>;
|
|
108
|
+
diff: z.ZodOptional<z.ZodString>;
|
|
109
|
+
changes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
110
|
+
path: z.ZodOptional<z.ZodString>;
|
|
111
|
+
kind: z.ZodOptional<z.ZodString>;
|
|
112
|
+
}, z.core.$loose>>>;
|
|
113
|
+
query: z.ZodOptional<z.ZodString>;
|
|
114
|
+
results: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
115
|
+
action: z.ZodOptional<z.ZodUnknown>;
|
|
116
|
+
sender_thread_id: z.ZodOptional<z.ZodString>;
|
|
117
|
+
receiver_thread_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
118
|
+
prompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
119
|
+
agents_states: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
120
|
+
todos: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
121
|
+
plan: z.ZodOptional<z.ZodString>;
|
|
122
|
+
items: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
123
|
+
text: z.ZodOptional<z.ZodString>;
|
|
124
|
+
completed: z.ZodOptional<z.ZodBoolean>;
|
|
125
|
+
}, z.core.$loose>>>;
|
|
126
|
+
message: z.ZodOptional<z.ZodString>;
|
|
127
|
+
error: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
128
|
+
message: z.ZodOptional<z.ZodString>;
|
|
129
|
+
}, z.core.$loose>]>>;
|
|
130
|
+
server: z.ZodOptional<z.ZodString>;
|
|
131
|
+
tool: z.ZodOptional<z.ZodString>;
|
|
132
|
+
arguments: z.ZodOptional<z.ZodUnknown>;
|
|
133
|
+
result: z.ZodOptional<z.ZodUnknown>;
|
|
134
|
+
tool_name: z.ZodOptional<z.ZodString>;
|
|
135
|
+
tool_input: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
136
|
+
tool_output: z.ZodOptional<z.ZodString>;
|
|
137
|
+
}, z.core.$loose>;
|
|
138
|
+
type CodexProviderItem = z.infer<typeof codexProviderItemSchema>;
|
|
139
|
+
declare const codexProviderEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
140
|
+
type: z.ZodLiteral<"thread.started">;
|
|
141
|
+
thread_id: z.ZodString;
|
|
142
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
143
|
+
type: z.ZodLiteral<"turn.started">;
|
|
144
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
145
|
+
type: z.ZodLiteral<"turn.completed">;
|
|
146
|
+
usage: z.ZodOptional<z.ZodObject<{
|
|
147
|
+
input_tokens: z.ZodOptional<z.ZodNumber>;
|
|
148
|
+
cached_input_tokens: z.ZodOptional<z.ZodNumber>;
|
|
149
|
+
cache_write_input_tokens: z.ZodOptional<z.ZodNumber>;
|
|
150
|
+
output_tokens: z.ZodOptional<z.ZodNumber>;
|
|
151
|
+
reasoning_output_tokens: z.ZodOptional<z.ZodNumber>;
|
|
152
|
+
total_tokens: z.ZodOptional<z.ZodNumber>;
|
|
153
|
+
}, z.core.$loose>>;
|
|
154
|
+
last_agent_message: z.ZodOptional<z.ZodString>;
|
|
155
|
+
duration_ms: z.ZodOptional<z.ZodNumber>;
|
|
156
|
+
num_turns: z.ZodOptional<z.ZodNumber>;
|
|
157
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
158
|
+
type: z.ZodLiteral<"turn.failed">;
|
|
159
|
+
usage: z.ZodOptional<z.ZodObject<{
|
|
160
|
+
input_tokens: z.ZodOptional<z.ZodNumber>;
|
|
161
|
+
cached_input_tokens: z.ZodOptional<z.ZodNumber>;
|
|
162
|
+
cache_write_input_tokens: z.ZodOptional<z.ZodNumber>;
|
|
163
|
+
output_tokens: z.ZodOptional<z.ZodNumber>;
|
|
164
|
+
reasoning_output_tokens: z.ZodOptional<z.ZodNumber>;
|
|
165
|
+
total_tokens: z.ZodOptional<z.ZodNumber>;
|
|
166
|
+
}, z.core.$loose>>;
|
|
167
|
+
last_agent_message: z.ZodOptional<z.ZodString>;
|
|
168
|
+
duration_ms: z.ZodOptional<z.ZodNumber>;
|
|
169
|
+
num_turns: z.ZodOptional<z.ZodNumber>;
|
|
170
|
+
message: z.ZodOptional<z.ZodString>;
|
|
171
|
+
error: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
172
|
+
message: z.ZodOptional<z.ZodString>;
|
|
173
|
+
}, z.core.$loose>]>>;
|
|
174
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
175
|
+
type: z.ZodLiteral<"item.started">;
|
|
176
|
+
item: z.ZodObject<{
|
|
177
|
+
id: z.ZodString;
|
|
178
|
+
type: z.ZodEnum<{
|
|
179
|
+
agent_message: "agent_message";
|
|
180
|
+
collab_tool_call: "collab_tool_call";
|
|
181
|
+
command_execution: "command_execution";
|
|
182
|
+
error: "error";
|
|
183
|
+
file_change: "file_change";
|
|
184
|
+
mcp_tool_call: "mcp_tool_call";
|
|
185
|
+
plan_update: "plan_update";
|
|
186
|
+
reasoning: "reasoning";
|
|
187
|
+
todo_list: "todo_list";
|
|
188
|
+
web_search: "web_search";
|
|
189
|
+
}>;
|
|
190
|
+
text: z.ZodOptional<z.ZodString>;
|
|
191
|
+
reasoning: z.ZodOptional<z.ZodString>;
|
|
192
|
+
command: z.ZodOptional<z.ZodString>;
|
|
193
|
+
status: z.ZodOptional<z.ZodString>;
|
|
194
|
+
output: z.ZodOptional<z.ZodString>;
|
|
195
|
+
aggregated_output: z.ZodOptional<z.ZodString>;
|
|
196
|
+
exit_code: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
197
|
+
path: z.ZodOptional<z.ZodString>;
|
|
198
|
+
diff: z.ZodOptional<z.ZodString>;
|
|
199
|
+
changes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
200
|
+
path: z.ZodOptional<z.ZodString>;
|
|
201
|
+
kind: z.ZodOptional<z.ZodString>;
|
|
202
|
+
}, z.core.$loose>>>;
|
|
203
|
+
query: z.ZodOptional<z.ZodString>;
|
|
204
|
+
results: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
205
|
+
action: z.ZodOptional<z.ZodUnknown>;
|
|
206
|
+
sender_thread_id: z.ZodOptional<z.ZodString>;
|
|
207
|
+
receiver_thread_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
208
|
+
prompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
209
|
+
agents_states: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
210
|
+
todos: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
211
|
+
plan: z.ZodOptional<z.ZodString>;
|
|
212
|
+
items: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
213
|
+
text: z.ZodOptional<z.ZodString>;
|
|
214
|
+
completed: z.ZodOptional<z.ZodBoolean>;
|
|
215
|
+
}, z.core.$loose>>>;
|
|
216
|
+
message: z.ZodOptional<z.ZodString>;
|
|
217
|
+
error: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
218
|
+
message: z.ZodOptional<z.ZodString>;
|
|
219
|
+
}, z.core.$loose>]>>;
|
|
220
|
+
server: z.ZodOptional<z.ZodString>;
|
|
221
|
+
tool: z.ZodOptional<z.ZodString>;
|
|
222
|
+
arguments: z.ZodOptional<z.ZodUnknown>;
|
|
223
|
+
result: z.ZodOptional<z.ZodUnknown>;
|
|
224
|
+
tool_name: z.ZodOptional<z.ZodString>;
|
|
225
|
+
tool_input: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
226
|
+
tool_output: z.ZodOptional<z.ZodString>;
|
|
227
|
+
}, z.core.$loose>;
|
|
228
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
229
|
+
type: z.ZodLiteral<"item.updated">;
|
|
230
|
+
item: z.ZodObject<{
|
|
231
|
+
id: z.ZodString;
|
|
232
|
+
type: z.ZodEnum<{
|
|
233
|
+
agent_message: "agent_message";
|
|
234
|
+
collab_tool_call: "collab_tool_call";
|
|
235
|
+
command_execution: "command_execution";
|
|
236
|
+
error: "error";
|
|
237
|
+
file_change: "file_change";
|
|
238
|
+
mcp_tool_call: "mcp_tool_call";
|
|
239
|
+
plan_update: "plan_update";
|
|
240
|
+
reasoning: "reasoning";
|
|
241
|
+
todo_list: "todo_list";
|
|
242
|
+
web_search: "web_search";
|
|
243
|
+
}>;
|
|
244
|
+
text: z.ZodOptional<z.ZodString>;
|
|
245
|
+
reasoning: z.ZodOptional<z.ZodString>;
|
|
246
|
+
command: z.ZodOptional<z.ZodString>;
|
|
247
|
+
status: z.ZodOptional<z.ZodString>;
|
|
248
|
+
output: z.ZodOptional<z.ZodString>;
|
|
249
|
+
aggregated_output: z.ZodOptional<z.ZodString>;
|
|
250
|
+
exit_code: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
251
|
+
path: z.ZodOptional<z.ZodString>;
|
|
252
|
+
diff: z.ZodOptional<z.ZodString>;
|
|
253
|
+
changes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
254
|
+
path: z.ZodOptional<z.ZodString>;
|
|
255
|
+
kind: z.ZodOptional<z.ZodString>;
|
|
256
|
+
}, z.core.$loose>>>;
|
|
257
|
+
query: z.ZodOptional<z.ZodString>;
|
|
258
|
+
results: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
259
|
+
action: z.ZodOptional<z.ZodUnknown>;
|
|
260
|
+
sender_thread_id: z.ZodOptional<z.ZodString>;
|
|
261
|
+
receiver_thread_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
262
|
+
prompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
263
|
+
agents_states: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
264
|
+
todos: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
265
|
+
plan: z.ZodOptional<z.ZodString>;
|
|
266
|
+
items: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
267
|
+
text: z.ZodOptional<z.ZodString>;
|
|
268
|
+
completed: z.ZodOptional<z.ZodBoolean>;
|
|
269
|
+
}, z.core.$loose>>>;
|
|
270
|
+
message: z.ZodOptional<z.ZodString>;
|
|
271
|
+
error: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
272
|
+
message: z.ZodOptional<z.ZodString>;
|
|
273
|
+
}, z.core.$loose>]>>;
|
|
274
|
+
server: z.ZodOptional<z.ZodString>;
|
|
275
|
+
tool: z.ZodOptional<z.ZodString>;
|
|
276
|
+
arguments: z.ZodOptional<z.ZodUnknown>;
|
|
277
|
+
result: z.ZodOptional<z.ZodUnknown>;
|
|
278
|
+
tool_name: z.ZodOptional<z.ZodString>;
|
|
279
|
+
tool_input: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
280
|
+
tool_output: z.ZodOptional<z.ZodString>;
|
|
281
|
+
}, z.core.$loose>;
|
|
282
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
283
|
+
type: z.ZodLiteral<"item.completed">;
|
|
284
|
+
item: z.ZodObject<{
|
|
285
|
+
id: z.ZodString;
|
|
286
|
+
type: z.ZodEnum<{
|
|
287
|
+
agent_message: "agent_message";
|
|
288
|
+
collab_tool_call: "collab_tool_call";
|
|
289
|
+
command_execution: "command_execution";
|
|
290
|
+
error: "error";
|
|
291
|
+
file_change: "file_change";
|
|
292
|
+
mcp_tool_call: "mcp_tool_call";
|
|
293
|
+
plan_update: "plan_update";
|
|
294
|
+
reasoning: "reasoning";
|
|
295
|
+
todo_list: "todo_list";
|
|
296
|
+
web_search: "web_search";
|
|
297
|
+
}>;
|
|
298
|
+
text: z.ZodOptional<z.ZodString>;
|
|
299
|
+
reasoning: z.ZodOptional<z.ZodString>;
|
|
300
|
+
command: z.ZodOptional<z.ZodString>;
|
|
301
|
+
status: z.ZodOptional<z.ZodString>;
|
|
302
|
+
output: z.ZodOptional<z.ZodString>;
|
|
303
|
+
aggregated_output: z.ZodOptional<z.ZodString>;
|
|
304
|
+
exit_code: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
305
|
+
path: z.ZodOptional<z.ZodString>;
|
|
306
|
+
diff: z.ZodOptional<z.ZodString>;
|
|
307
|
+
changes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
308
|
+
path: z.ZodOptional<z.ZodString>;
|
|
309
|
+
kind: z.ZodOptional<z.ZodString>;
|
|
310
|
+
}, z.core.$loose>>>;
|
|
311
|
+
query: z.ZodOptional<z.ZodString>;
|
|
312
|
+
results: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
313
|
+
action: z.ZodOptional<z.ZodUnknown>;
|
|
314
|
+
sender_thread_id: z.ZodOptional<z.ZodString>;
|
|
315
|
+
receiver_thread_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
316
|
+
prompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
317
|
+
agents_states: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
318
|
+
todos: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
319
|
+
plan: z.ZodOptional<z.ZodString>;
|
|
320
|
+
items: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
321
|
+
text: z.ZodOptional<z.ZodString>;
|
|
322
|
+
completed: z.ZodOptional<z.ZodBoolean>;
|
|
323
|
+
}, z.core.$loose>>>;
|
|
324
|
+
message: z.ZodOptional<z.ZodString>;
|
|
325
|
+
error: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
326
|
+
message: z.ZodOptional<z.ZodString>;
|
|
327
|
+
}, z.core.$loose>]>>;
|
|
328
|
+
server: z.ZodOptional<z.ZodString>;
|
|
329
|
+
tool: z.ZodOptional<z.ZodString>;
|
|
330
|
+
arguments: z.ZodOptional<z.ZodUnknown>;
|
|
331
|
+
result: z.ZodOptional<z.ZodUnknown>;
|
|
332
|
+
tool_name: z.ZodOptional<z.ZodString>;
|
|
333
|
+
tool_input: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
334
|
+
tool_output: z.ZodOptional<z.ZodString>;
|
|
335
|
+
}, z.core.$loose>;
|
|
336
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
337
|
+
type: z.ZodLiteral<"error">;
|
|
338
|
+
message: z.ZodOptional<z.ZodString>;
|
|
339
|
+
error: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
340
|
+
message: z.ZodOptional<z.ZodString>;
|
|
341
|
+
}, z.core.$loose>]>>;
|
|
342
|
+
}, z.core.$loose>], "type">;
|
|
343
|
+
type CodexProviderEvent = z.infer<typeof codexProviderEventSchema>;
|
|
344
|
+
//#endregion
|
|
345
|
+
//#region src/adapters/codex-cli/types.d.ts
|
|
346
|
+
/**
|
|
347
|
+
* Filesystem sandbox policy for Codex CLI.
|
|
348
|
+
* - `"read-only"`: tools cannot write.
|
|
349
|
+
* - `"workspace-write"`: writes allowed inside `cwd` only.
|
|
350
|
+
* - `"danger-full-access"`: no filesystem restrictions.
|
|
351
|
+
*/
|
|
352
|
+
type CodexCliSandboxMode = "danger-full-access" | "read-only" | "workspace-write";
|
|
353
|
+
/**
|
|
354
|
+
* How Codex CLI handles approval prompts.
|
|
355
|
+
* - `"default"`: leave Codex CLI's own default approval behavior in place (this adapter does not bridge approvals to a permission handler).
|
|
356
|
+
* - `"auto-approve"`: pass `--approve-for-me`; Codex uses automatic review in the `workspace-write` sandbox.
|
|
357
|
+
* - `"bypass-sandbox"`: pass `--dangerously-bypass-approvals-and-sandbox`; disable approvals and Codex's sandbox for externally isolated execution.
|
|
358
|
+
*/
|
|
359
|
+
type CodexCliPermissionMode = "auto-approve" | "bypass-sandbox" | "default";
|
|
360
|
+
/** Per-run options for the `codex-cli` adapter. */
|
|
361
|
+
interface CodexCliRunOptions {
|
|
362
|
+
/**
|
|
363
|
+
* Filesystem sandbox policy for the default approval strategy.
|
|
364
|
+
* Other permission modes select their own sandbox behavior.
|
|
365
|
+
*/
|
|
366
|
+
sandboxMode?: CodexCliSandboxMode;
|
|
367
|
+
/** Extra directories outside `cwd` writable under `workspace-write`. */
|
|
368
|
+
additionalDirectories?: string[];
|
|
369
|
+
/** Suppress Codex's "not a git repo" confirmation prompt (`--skip-git-repo-check`). */
|
|
370
|
+
skipGitRepoCheck?: boolean;
|
|
371
|
+
/** Approval prompt strategy. */
|
|
372
|
+
permissionMode?: CodexCliPermissionMode;
|
|
373
|
+
/** When `true`, Codex does not persist this run's history. */
|
|
374
|
+
ephemeral?: boolean;
|
|
375
|
+
/** Path to an MCP config file passed via `--mcp-config`. */
|
|
376
|
+
mcpConfig?: string;
|
|
377
|
+
/** Inline MCP server config map. */
|
|
378
|
+
mcpServers?: Record<string, McpServerConfig>;
|
|
379
|
+
/** Extra CLI flags appended verbatim. */
|
|
380
|
+
extraArgs?: string[];
|
|
381
|
+
/** Not supported — Codex manages its own system prompt. */
|
|
382
|
+
systemPrompt?: never;
|
|
383
|
+
}
|
|
384
|
+
/** Constructor options for `createAgent("codex-cli", ...)`. */
|
|
385
|
+
type CodexCliAgentOptions = CodexCliRunOptions & ExclusiveExecutionTargetOptions<Container, Sandbox> & {
|
|
386
|
+
/** Path or argv to the `codex` binary. */
|
|
387
|
+
command?: string[] | string;
|
|
388
|
+
/** Working directory the agent operates against. */
|
|
389
|
+
cwd?: string;
|
|
390
|
+
/** Environment variables for the subprocess. Layered on top of host env when `propagateEnv` is `true` (default). */
|
|
391
|
+
env?: Record<string, string>;
|
|
392
|
+
/** Default `true`: `process.env` is inherited and `env` overlays it. Set `false` to suppress host-env propagation. */
|
|
393
|
+
propagateEnv?: boolean;
|
|
394
|
+
/** Existing Codex thread ID to resume via `codex resume`. */
|
|
395
|
+
sessionId?: string;
|
|
396
|
+
/** Codex model identifier. */
|
|
397
|
+
model?: string;
|
|
398
|
+
/** File path to write the raw CLI log to (useful for debugging). */
|
|
399
|
+
logPath?: string;
|
|
400
|
+
/** Custom process spawner; set by `createContainer`/`createSandbox`, rarely needed manually. */
|
|
401
|
+
spawner?: ProcessSpawner;
|
|
402
|
+
/** Convenience: equivalent to calling `agent.onEvent(handler)` post-construction. */
|
|
403
|
+
onEvent?: AgentEventHandler;
|
|
404
|
+
onProviderEvent?: ProviderEventHandler<CodexProviderEvent>;
|
|
405
|
+
};
|
|
406
|
+
/** Agent instance returned by `createAgent("codex-cli", ...)`. */
|
|
407
|
+
interface CodexCliAgent extends BaseAgent<EnsureDisjoint<CodexCliRunOptions>> {
|
|
408
|
+
readonly type: "codex-cli";
|
|
409
|
+
onProviderEvent: (handler: ProviderEventHandler<CodexProviderEvent>) => () => void;
|
|
410
|
+
}
|
|
411
|
+
//#endregion
|
|
412
|
+
//#region src/adapters/codex-cli/adapter.d.ts
|
|
413
|
+
declare const createCodexCliAgent: (options?: CodexCliAgentOptions) => CodexCliAgent;
|
|
414
|
+
//#endregion
|
|
415
|
+
export { CodexCliRunOptions as a, CodexEvent as c, CodexItemUpdatedEvent as d, CodexProviderEvent as f, CodexTurnFailedEvent as g, CodexTurnCompletedEvent as h, CodexCliPermissionMode as i, CodexItemCompletedEvent as l, CodexThreadStartedEvent as m, CodexCliAgent as n, CodexCliSandboxMode as o, CodexProviderItem as p, CodexCliAgentOptions as r, CodexErrorEvent as s, createCodexCliAgent as t, CodexItemStartedEvent as u };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
3
|
-
import {
|
|
1
|
+
import { i as ProcessSpawner } from "./types-COmjfh8B.mjs";
|
|
2
|
+
import { f as EnsureDisjoint, l as BaseAgent, p as ExclusiveExecutionTargetOptions, t as AgentEventHandler } from "./types-Ba2NYJOB.mjs";
|
|
3
|
+
import { t as Container } from "./index-kXfBtyJn.mjs";
|
|
4
|
+
import { l as Sandbox } from "./index-CN0WGc9T.mjs";
|
|
4
5
|
import { z } from "zod/v4";
|
|
5
6
|
//#region src/adapters/gemini-cli/events/schemas.d.ts
|
|
6
7
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { S as McpServerConfig } from "./events-BxEB6zHt.mjs";
|
|
2
|
-
import { f as EnsureDisjoint, l as BaseAgent, p as ExclusiveExecutionTargetOptions, t as AgentEventHandler } from "./types-
|
|
3
|
-
import { t as Container } from "./index-
|
|
4
|
-
import { l as Sandbox } from "./index-
|
|
5
|
-
import { i as ClaudeCodeCliPermissionMode } from "./index-
|
|
2
|
+
import { f as EnsureDisjoint, l as BaseAgent, p as ExclusiveExecutionTargetOptions, t as AgentEventHandler } from "./types-Ba2NYJOB.mjs";
|
|
3
|
+
import { t as Container } from "./index-kXfBtyJn.mjs";
|
|
4
|
+
import { l as Sandbox } from "./index-CN0WGc9T.mjs";
|
|
5
|
+
import { i as ClaudeCodeCliPermissionMode } from "./index-CyIiBK-O.mjs";
|
|
6
6
|
//#region src/adapters/claude-code-cli-pty/types.d.ts
|
|
7
7
|
/** Same modes as {@link ClaudeCodeCliPermissionMode}; re-exported for convenience. */
|
|
8
8
|
type ClaudeCodeCliPtyPermissionMode = ClaudeCodeCliPermissionMode;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
3
|
-
import {
|
|
1
|
+
import { i as ProcessSpawner } from "./types-COmjfh8B.mjs";
|
|
2
|
+
import { f as EnsureDisjoint, l as BaseAgent, p as ExclusiveExecutionTargetOptions, t as AgentEventHandler } from "./types-Ba2NYJOB.mjs";
|
|
3
|
+
import { t as Container } from "./index-kXfBtyJn.mjs";
|
|
4
|
+
import { l as Sandbox } from "./index-CN0WGc9T.mjs";
|
|
4
5
|
import { z } from "zod/v4";
|
|
5
6
|
//#region src/adapters/pi-cli/events/schemas.d.ts
|
|
6
7
|
/**
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { i as ProcessSpawner } from "./types-COmjfh8B.mjs";
|
|
2
|
+
import "./types-Ba2NYJOB.mjs";
|
|
3
|
+
import { A as VolumeMount } from "./index-kXfBtyJn.mjs";
|
|
3
4
|
//#region src/sandbox/types.d.ts
|
|
4
5
|
/** Which sandbox binary backs the policy. The binary must be installed on the host. */
|
|
5
6
|
type SandboxType = "bubblewrap" | "firejail" | "nsjail";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as EnsureDisjoint, l as BaseAgent, t as AgentEventHandler } from "./types-
|
|
1
|
+
import { f as EnsureDisjoint, l as BaseAgent, t as AgentEventHandler } from "./types-Ba2NYJOB.mjs";
|
|
2
2
|
import "@openai/codex-sdk";
|
|
3
3
|
//#region src/adapters/codex-sdk/types.d.ts
|
|
4
4
|
type CodexSdkSandboxMode = "danger-full-access" | "read-only" | "workspace-write";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as EnsureDisjoint, l as BaseAgent, t as AgentEventHandler } from "./types-
|
|
1
|
+
import { f as EnsureDisjoint, l as BaseAgent, t as AgentEventHandler } from "./types-Ba2NYJOB.mjs";
|
|
2
2
|
import "@cursor/sdk";
|
|
3
3
|
//#region src/adapters/cursor-sdk/types.d.ts
|
|
4
4
|
/** OAuth-style credentials for HTTP/SSE MCP servers configured for the agent. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { S as McpServerConfig } from "./events-BxEB6zHt.mjs";
|
|
2
|
-
import { f as EnsureDisjoint, l as BaseAgent, t as AgentEventHandler } from "./types-
|
|
2
|
+
import { f as EnsureDisjoint, l as BaseAgent, t as AgentEventHandler } from "./types-Ba2NYJOB.mjs";
|
|
3
3
|
import "@anthropic-ai/claude-agent-sdk";
|
|
4
4
|
//#region src/adapters/claude-code-sdk/types.d.ts
|
|
5
5
|
/**
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { S as McpServerConfig } from "./events-BxEB6zHt.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
4
|
-
import {
|
|
2
|
+
import { i as ProcessSpawner } from "./types-COmjfh8B.mjs";
|
|
3
|
+
import { _ as ProviderEventHandler, f as EnsureDisjoint, l as BaseAgent, p as ExclusiveExecutionTargetOptions, t as AgentEventHandler } from "./types-Ba2NYJOB.mjs";
|
|
4
|
+
import { t as Container } from "./index-kXfBtyJn.mjs";
|
|
5
|
+
import { l as Sandbox } from "./index-CN0WGc9T.mjs";
|
|
5
6
|
import { z } from "zod/v4";
|
|
6
7
|
//#region src/adapters/claude-code-cli/events/schemas.d.ts
|
|
7
8
|
declare const claudeSystemEventSchema: z.ZodObject<{
|
|
@@ -282,6 +283,129 @@ declare const claudeEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
282
283
|
}, z.core.$strip>;
|
|
283
284
|
}, z.core.$strip>], "type">;
|
|
284
285
|
type ClaudeEvent = z.infer<typeof claudeEventSchema>;
|
|
286
|
+
declare const claudeProviderEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
287
|
+
type: z.ZodLiteral<"system">;
|
|
288
|
+
session_id: z.ZodString;
|
|
289
|
+
subtype: z.ZodEnum<{
|
|
290
|
+
hook_failed: "hook_failed";
|
|
291
|
+
hook_finished: "hook_finished";
|
|
292
|
+
hook_response: "hook_response";
|
|
293
|
+
hook_skipped: "hook_skipped";
|
|
294
|
+
hook_started: "hook_started";
|
|
295
|
+
init: "init";
|
|
296
|
+
}>;
|
|
297
|
+
tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
298
|
+
model: z.ZodOptional<z.ZodString>;
|
|
299
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
300
|
+
hook_name: z.ZodOptional<z.ZodString>;
|
|
301
|
+
hook_event: z.ZodOptional<z.ZodString>;
|
|
302
|
+
stdout: z.ZodOptional<z.ZodString>;
|
|
303
|
+
stderr: z.ZodOptional<z.ZodString>;
|
|
304
|
+
exit_code: z.ZodOptional<z.ZodNumber>;
|
|
305
|
+
uuid: z.ZodOptional<z.ZodString>;
|
|
306
|
+
mcp_servers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
307
|
+
name: z.ZodString;
|
|
308
|
+
status: z.ZodString;
|
|
309
|
+
}, z.core.$strip>>>;
|
|
310
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
311
|
+
type: z.ZodLiteral<"assistant">;
|
|
312
|
+
session_id: z.ZodString;
|
|
313
|
+
parent_tool_use_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
314
|
+
message: z.ZodObject<{
|
|
315
|
+
id: z.ZodString;
|
|
316
|
+
type: z.ZodLiteral<"message">;
|
|
317
|
+
role: z.ZodLiteral<"assistant">;
|
|
318
|
+
model: z.ZodString;
|
|
319
|
+
content: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
320
|
+
type: z.ZodLiteral<"text">;
|
|
321
|
+
text: z.ZodString;
|
|
322
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
323
|
+
type: z.ZodLiteral<"tool_use">;
|
|
324
|
+
id: z.ZodString;
|
|
325
|
+
name: z.ZodString;
|
|
326
|
+
input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
327
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
328
|
+
type: z.ZodLiteral<"thinking">;
|
|
329
|
+
thinking: z.ZodString;
|
|
330
|
+
signature: z.ZodOptional<z.ZodString>;
|
|
331
|
+
}, z.core.$strip>]>>;
|
|
332
|
+
stop_reason: z.ZodNullable<z.ZodEnum<{
|
|
333
|
+
end_turn: "end_turn";
|
|
334
|
+
max_tokens: "max_tokens";
|
|
335
|
+
stop_sequence: "stop_sequence";
|
|
336
|
+
tool_use: "tool_use";
|
|
337
|
+
}>>;
|
|
338
|
+
stop_sequence: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
339
|
+
context_management: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
|
|
340
|
+
usage: z.ZodObject<{
|
|
341
|
+
input_tokens: z.ZodNumber;
|
|
342
|
+
output_tokens: z.ZodNumber;
|
|
343
|
+
cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
|
|
344
|
+
cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
|
|
345
|
+
service_tier: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
346
|
+
premium: "premium";
|
|
347
|
+
standard: "standard";
|
|
348
|
+
}>>>;
|
|
349
|
+
}, z.core.$strip>;
|
|
350
|
+
ttftMs: z.ZodOptional<z.ZodNumber>;
|
|
351
|
+
}, z.core.$strip>;
|
|
352
|
+
uuid: z.ZodOptional<z.ZodString>;
|
|
353
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
354
|
+
type: z.ZodLiteral<"user">;
|
|
355
|
+
session_id: z.ZodString;
|
|
356
|
+
message: z.ZodObject<{
|
|
357
|
+
role: z.ZodLiteral<"user">;
|
|
358
|
+
content: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
359
|
+
type: z.ZodLiteral<"tool_result">;
|
|
360
|
+
tool_use_id: z.ZodString;
|
|
361
|
+
content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodObject<{
|
|
362
|
+
type: z.ZodLiteral<"text">;
|
|
363
|
+
text: z.ZodString;
|
|
364
|
+
}, z.core.$strip>>]>;
|
|
365
|
+
is_error: z.ZodOptional<z.ZodBoolean>;
|
|
366
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
367
|
+
type: z.ZodLiteral<"text">;
|
|
368
|
+
text: z.ZodString;
|
|
369
|
+
}, z.core.$strip>]>>;
|
|
370
|
+
}, z.core.$strip>;
|
|
371
|
+
parent_tool_use_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
372
|
+
isSynthetic: z.ZodOptional<z.ZodBoolean>;
|
|
373
|
+
uuid: z.ZodOptional<z.ZodString>;
|
|
374
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
375
|
+
type: z.ZodLiteral<"result">;
|
|
376
|
+
session_id: z.ZodString;
|
|
377
|
+
duration_ms: z.ZodNumber;
|
|
378
|
+
duration_api_ms: z.ZodNumber;
|
|
379
|
+
is_error: z.ZodBoolean;
|
|
380
|
+
num_turns: z.ZodNumber;
|
|
381
|
+
result: z.ZodOptional<z.ZodUnknown>;
|
|
382
|
+
structured_output: z.ZodOptional<z.ZodUnknown>;
|
|
383
|
+
total_cost_usd: z.ZodNumber;
|
|
384
|
+
usage: z.ZodOptional<z.ZodObject<{
|
|
385
|
+
input_tokens: z.ZodNumber;
|
|
386
|
+
cache_creation_input_tokens: z.ZodOptional<z.ZodNumber>;
|
|
387
|
+
cache_read_input_tokens: z.ZodOptional<z.ZodNumber>;
|
|
388
|
+
output_tokens: z.ZodNumber;
|
|
389
|
+
server_tool_use: z.ZodOptional<z.ZodObject<{
|
|
390
|
+
web_search_requests: z.ZodNumber;
|
|
391
|
+
}, z.core.$strip>>;
|
|
392
|
+
}, z.core.$strip>>;
|
|
393
|
+
uuid: z.ZodOptional<z.ZodString>;
|
|
394
|
+
subtype: z.ZodString;
|
|
395
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
396
|
+
type: z.ZodLiteral<"rate_limit_event">;
|
|
397
|
+
uuid: z.ZodString;
|
|
398
|
+
session_id: z.ZodOptional<z.ZodString>;
|
|
399
|
+
rate_limit_info: z.ZodObject<{
|
|
400
|
+
status: z.ZodString;
|
|
401
|
+
resetsAt: z.ZodOptional<z.ZodNumber>;
|
|
402
|
+
rateLimitType: z.ZodOptional<z.ZodString>;
|
|
403
|
+
overageStatus: z.ZodOptional<z.ZodString>;
|
|
404
|
+
overageDisabledReason: z.ZodOptional<z.ZodString>;
|
|
405
|
+
isUsingOverage: z.ZodOptional<z.ZodBoolean>;
|
|
406
|
+
}, z.core.$strip>;
|
|
407
|
+
}, z.core.$strip>], "type">;
|
|
408
|
+
type ClaudeProviderEvent = z.infer<typeof claudeProviderEventSchema>;
|
|
285
409
|
//#endregion
|
|
286
410
|
//#region src/adapters/claude-code-cli/types.d.ts
|
|
287
411
|
/**
|
|
@@ -337,10 +461,12 @@ type ClaudeCodeCliAgentOptions = ClaudeCodeCliRunOptions & ExclusiveExecutionTar
|
|
|
337
461
|
spawner?: ProcessSpawner;
|
|
338
462
|
/** Convenience: equivalent to calling `agent.onEvent(handler)` post-construction. */
|
|
339
463
|
onEvent?: AgentEventHandler;
|
|
464
|
+
onProviderEvent?: ProviderEventHandler<ClaudeProviderEvent>;
|
|
340
465
|
};
|
|
341
466
|
/** Agent instance returned by `createAgent("claude-code-cli", ...)`. */
|
|
342
467
|
interface ClaudeCodeCliAgent extends BaseAgent<EnsureDisjoint<ClaudeCodeCliRunOptions>> {
|
|
343
468
|
readonly type: "claude-code-cli";
|
|
469
|
+
onProviderEvent: (handler: ProviderEventHandler<ClaudeProviderEvent>) => () => void;
|
|
344
470
|
/**
|
|
345
471
|
* Branch a sibling agent from the current session.
|
|
346
472
|
*
|
|
@@ -353,4 +479,4 @@ interface ClaudeCodeCliAgent extends BaseAgent<EnsureDisjoint<ClaudeCodeCliRunOp
|
|
|
353
479
|
//#region src/adapters/claude-code-cli/adapter.d.ts
|
|
354
480
|
declare const createClaudeCodeCliAgent: (options?: ClaudeCodeCliAgentOptions) => ClaudeCodeCliAgent;
|
|
355
481
|
//#endregion
|
|
356
|
-
export { ClaudeCodeCliRunOptions as a,
|
|
482
|
+
export { ClaudeCodeCliRunOptions as a, ClaudeProviderEvent as c, ClaudeSystemEvent as d, ClaudeUserEvent as f, ClaudeCodeCliPermissionMode as i, ClaudeRateLimitEvent as l, ClaudeCodeCliAgent as n, ClaudeAssistantEvent as o, ClaudeCodeCliAgentOptions as r, ClaudeEvent as s, createClaudeCodeCliAgent as t, ClaudeResultEvent as u };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
3
|
-
import {
|
|
1
|
+
import { i as ProcessSpawner } from "./types-COmjfh8B.mjs";
|
|
2
|
+
import { f as EnsureDisjoint, l as BaseAgent, p as ExclusiveExecutionTargetOptions, t as AgentEventHandler } from "./types-Ba2NYJOB.mjs";
|
|
3
|
+
import { t as Container } from "./index-kXfBtyJn.mjs";
|
|
4
|
+
import { l as Sandbox } from "./index-CN0WGc9T.mjs";
|
|
4
5
|
import { z } from "zod/v4";
|
|
5
6
|
//#region src/adapters/opencode-cli/events/schemas.d.ts
|
|
6
7
|
/**
|