coding-agents-sdk 0.20.0 → 0.21.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 +81 -13
- package/dist/{Agent-DjrM6eSk.mjs → Agent-BsDJsgJa.mjs} +3 -3
- package/dist/{SdkAgent-DYmXd2QH.mjs → SdkAgent-jwighP_b.mjs} +1 -1
- package/dist/adapters/antigravity-cli/index.d.mts +2 -0
- package/dist/adapters/antigravity-cli/index.mjs +2 -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 +3 -3
- package/dist/adapters/claude-code-sdk/index.d.mts +1 -1
- package/dist/adapters/claude-code-sdk/index.mjs +4 -4
- package/dist/adapters/codex-cli/index.d.mts +1 -1
- package/dist/adapters/codex-cli/index.mjs +4 -4
- package/dist/adapters/codex-sdk/index.d.mts +1 -1
- package/dist/adapters/codex-sdk/index.mjs +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/cursor-sdk/index.mjs +1 -1
- package/dist/adapters/drac-cli/index.d.mts +2 -0
- package/dist/adapters/drac-cli/index.mjs +1 -0
- 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/classify-error-_WNZMhMY.mjs +8 -0
- package/dist/container/index.d.mts +1 -1
- package/dist/{events-DoTNE9UF.d.mts → events-DmlAPVpd.d.mts} +109 -1
- package/dist/{index-BUsykYQW.d.mts → index-5XiyFBcK.d.mts} +5 -5
- package/dist/{index--TbBtTi8.d.mts → index-Bl9DtOcy.d.mts} +3 -3
- package/dist/{index-B6HqsIFZ.d.mts → index-Brx5CEx7.d.mts} +3 -3
- package/dist/{index-BOpfjzkT.d.mts → index-CCsw4G4N.d.mts} +1 -1
- package/dist/{index-BA-SATzW.d.mts → index-CZiWvyn3.d.mts} +2 -2
- package/dist/{index-Bs2PNdMx.d.mts → index-DQYRy7xl.d.mts} +3 -3
- package/dist/index-DUTtolch.d.mts +63 -0
- package/dist/{index-DoVEbwlx.d.mts → index-DilMV_1s.d.mts} +128 -21
- package/dist/{index-_lsNncl5.d.mts → index-DpG9mouj.d.mts} +8 -4
- package/dist/{index-DP-w59TG.d.mts → index-DqNl8zYj.d.mts} +1 -1
- package/dist/index-Du99OLj6.d.mts +65 -0
- package/dist/{index-DOsWiOqK.d.mts → index-Q5jNyQHD.d.mts} +1 -1
- package/dist/{index-CDN7Re-3.d.mts → index-X-W5isMp.d.mts} +2 -2
- package/dist/{index-DmzP2soo.d.mts → index-oUIMXZIp.d.mts} +3 -3
- package/dist/index.d.mts +26 -17
- package/dist/index.mjs +1 -1
- package/dist/parser-BY3CZGmc.mjs +2 -0
- package/dist/permission-updates-CkFvevWQ.mjs +1 -0
- package/dist/permissions-BjNU9GCH.mjs +1 -0
- package/dist/questions-CaEwN4JQ.mjs +1 -0
- package/dist/sandbox/index.d.mts +1 -1
- package/dist/schemas/index.d.mts +2 -2
- package/dist/schemas/index.mjs +1 -1
- package/dist/schemas-CzJM9p-0.mjs +1 -0
- package/dist/{types-1ueeWtwd.d.mts → types-D_QP9PC-.d.mts} +35 -14
- package/package.json +11 -1
- package/dist/classify-error-DJq_uoy2.mjs +0 -8
- package/dist/parser-D-7JMlQr.mjs +0 -2
- package/dist/permission-updates-lGl8T2lW.mjs +0 -1
- package/dist/schemas-CF1pu_vW.mjs +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as DockerAttachConfig, B as WorkdirDiff, C as E2BConnectConfig, D as E2BCreateConfig, E as E2BContainerConfig, F as ExecOptions, H as WorkdirFileChange, I as ExecResult, L as PortMapping, M as DockerContainerConfig, N as ContainerStatus, O as E2BProviderConfig, P as ContainerType, R as VolumeMount, S as NerdctlProviderConfig, T as E2BContainer, U as WorkdirSnapshot, V as WorkdirDiffStats, W as WorkdirSnapshotOptions, _ as PodmanAttachConfig, a as ContainerAttachError, b as NerdctlContainer, c as ContainerDisposedError, d as ContainerNotFoundError, f as ContainerNotRunningError, g as AttachedPodmanContainer, h as MountValidationError, i as createContainer, j as DockerContainer, k as AttachedDockerContainer, l as ContainerError, m as ContainerStartError, n as ContainerConfig, o as ContainerCreateError, p as ContainerRemoveError, r as attachContainer, s as ContainerDiffError, t as Container, u as ContainerExecError, v as PodmanContainer, w as E2BConnectionConfig, x as NerdctlContainerConfig, y as PodmanContainerConfig, z as WorkdirChangeKind } from "../index-
|
|
1
|
+
import { A as DockerAttachConfig, B as WorkdirDiff, C as E2BConnectConfig, D as E2BCreateConfig, E as E2BContainerConfig, F as ExecOptions, H as WorkdirFileChange, I as ExecResult, L as PortMapping, M as DockerContainerConfig, N as ContainerStatus, O as E2BProviderConfig, P as ContainerType, R as VolumeMount, S as NerdctlProviderConfig, T as E2BContainer, U as WorkdirSnapshot, V as WorkdirDiffStats, W as WorkdirSnapshotOptions, _ as PodmanAttachConfig, a as ContainerAttachError, b as NerdctlContainer, c as ContainerDisposedError, d as ContainerNotFoundError, f as ContainerNotRunningError, g as AttachedPodmanContainer, h as MountValidationError, i as createContainer, j as DockerContainer, k as AttachedDockerContainer, l as ContainerError, m as ContainerStartError, n as ContainerConfig, o as ContainerCreateError, p as ContainerRemoveError, r as attachContainer, s as ContainerDiffError, t as Container, u as ContainerExecError, v as PodmanContainer, w as E2BConnectionConfig, x as NerdctlContainerConfig, y as PodmanContainerConfig, z as WorkdirChangeKind } from "../index-Q5jNyQHD.mjs";
|
|
2
2
|
export { type AttachedDockerContainer, type AttachedPodmanContainer, Container, ContainerAttachError, ContainerConfig, ContainerCreateError, ContainerDiffError, ContainerDisposedError, ContainerError, ContainerExecError, ContainerNotFoundError, ContainerNotRunningError, ContainerRemoveError, ContainerStartError, type ContainerStatus, type ContainerType, type DockerAttachConfig, type DockerContainer, type DockerContainerConfig, type E2BConnectConfig, type E2BConnectionConfig, type E2BContainer, type E2BContainerConfig, type E2BCreateConfig, type E2BProviderConfig, type ExecOptions, type ExecResult, MountValidationError, type NerdctlContainer, type NerdctlContainerConfig, type NerdctlProviderConfig, type PodmanAttachConfig, type PodmanContainer, type PodmanContainerConfig, type PortMapping, type VolumeMount, type WorkdirChangeKind, type WorkdirDiff, type WorkdirDiffStats, type WorkdirFileChange, type WorkdirSnapshot, type WorkdirSnapshotOptions, attachContainer, createContainer };
|
|
@@ -118,6 +118,7 @@ declare const messageEventSchema: z.ZodObject<{
|
|
|
118
118
|
id: z.ZodString;
|
|
119
119
|
runId: z.ZodString;
|
|
120
120
|
timestamp: z.ZodDate;
|
|
121
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
121
122
|
type: z.ZodLiteral<"message">;
|
|
122
123
|
sessionId: z.ZodOptional<z.ZodString>;
|
|
123
124
|
model: z.ZodNullable<z.ZodString>;
|
|
@@ -152,6 +153,7 @@ declare const reasoningEventSchema: z.ZodObject<{
|
|
|
152
153
|
id: z.ZodString;
|
|
153
154
|
runId: z.ZodString;
|
|
154
155
|
timestamp: z.ZodDate;
|
|
156
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
155
157
|
type: z.ZodLiteral<"reasoning">;
|
|
156
158
|
sessionId: z.ZodOptional<z.ZodString>;
|
|
157
159
|
model: z.ZodNullable<z.ZodString>;
|
|
@@ -181,6 +183,7 @@ declare const messageDeltaEventSchema: z.ZodObject<{
|
|
|
181
183
|
id: z.ZodString;
|
|
182
184
|
runId: z.ZodString;
|
|
183
185
|
timestamp: z.ZodDate;
|
|
186
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
184
187
|
type: z.ZodLiteral<"message-delta">;
|
|
185
188
|
sessionId: z.ZodOptional<z.ZodString>;
|
|
186
189
|
messageId: z.ZodString;
|
|
@@ -203,6 +206,7 @@ declare const reasoningDeltaEventSchema: z.ZodObject<{
|
|
|
203
206
|
id: z.ZodString;
|
|
204
207
|
runId: z.ZodString;
|
|
205
208
|
timestamp: z.ZodDate;
|
|
209
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
206
210
|
type: z.ZodLiteral<"reasoning-delta">;
|
|
207
211
|
sessionId: z.ZodOptional<z.ZodString>;
|
|
208
212
|
reasoningId: z.ZodString;
|
|
@@ -223,6 +227,7 @@ declare const toolCallEventSchema: z.ZodObject<{
|
|
|
223
227
|
id: z.ZodString;
|
|
224
228
|
runId: z.ZodString;
|
|
225
229
|
timestamp: z.ZodDate;
|
|
230
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
226
231
|
type: z.ZodLiteral<"tool-call">;
|
|
227
232
|
sessionId: z.ZodOptional<z.ZodString>;
|
|
228
233
|
model: z.ZodNullable<z.ZodString>;
|
|
@@ -244,6 +249,7 @@ declare const toolResultEventSchema: z.ZodObject<{
|
|
|
244
249
|
id: z.ZodString;
|
|
245
250
|
runId: z.ZodString;
|
|
246
251
|
timestamp: z.ZodDate;
|
|
252
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
247
253
|
type: z.ZodLiteral<"tool-result">;
|
|
248
254
|
sessionId: z.ZodOptional<z.ZodString>;
|
|
249
255
|
toolCallId: z.ZodString;
|
|
@@ -276,6 +282,65 @@ declare const stderrEventSchema: z.ZodObject<{
|
|
|
276
282
|
* only). Useful for surfacing provider diagnostics.
|
|
277
283
|
*/
|
|
278
284
|
type StderrEvent = z.infer<typeof stderrEventSchema>;
|
|
285
|
+
/**
|
|
286
|
+
* How much of one of the provider account's usage limits is used, as the provider reported it during the run.
|
|
287
|
+
* `claude-code-cli` and `claude-code-sdk` report the limit that applies to the run; `codex-cli` on the app-server
|
|
288
|
+
* transport reports the more used of Codex's two limit windows.
|
|
289
|
+
*/
|
|
290
|
+
declare const rateLimitEventSchema: z.ZodObject<{
|
|
291
|
+
id: z.ZodString;
|
|
292
|
+
runId: z.ZodString;
|
|
293
|
+
timestamp: z.ZodDate;
|
|
294
|
+
type: z.ZodLiteral<"rate-limit">;
|
|
295
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
296
|
+
status: z.ZodEnum<{
|
|
297
|
+
allowed: "allowed";
|
|
298
|
+
rejected: "rejected";
|
|
299
|
+
warning: "warning";
|
|
300
|
+
}>;
|
|
301
|
+
limitType: z.ZodOptional<z.ZodString>;
|
|
302
|
+
windowMinutes: z.ZodOptional<z.ZodNumber>;
|
|
303
|
+
utilization: z.ZodOptional<z.ZodNumber>;
|
|
304
|
+
resetsAt: z.ZodOptional<z.ZodDate>;
|
|
305
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
306
|
+
overageStatus: z.ZodOptional<z.ZodEnum<{
|
|
307
|
+
allowed: "allowed";
|
|
308
|
+
rejected: "rejected";
|
|
309
|
+
warning: "warning";
|
|
310
|
+
}>>;
|
|
311
|
+
isUsingOverage: z.ZodOptional<z.ZodBoolean>;
|
|
312
|
+
overageDisabledReason: z.ZodOptional<z.ZodString>;
|
|
313
|
+
}, z.core.$strip>;
|
|
314
|
+
/**
|
|
315
|
+
* How much of one of the provider account's usage limits is used, as the provider reported it during the run.
|
|
316
|
+
* `claude-code-cli` and `claude-code-sdk` report the limit that applies to the run; `codex-cli` on the app-server
|
|
317
|
+
* transport reports the more used of Codex's two limit windows.
|
|
318
|
+
*/
|
|
319
|
+
type RateLimitEvent = z.infer<typeof rateLimitEventSchema>;
|
|
320
|
+
/**
|
|
321
|
+
* Something that failed around the run without failing it, which the agent cannot see but the developer should:
|
|
322
|
+
* an MCP server that did not connect, so its tools are missing, or a hook whose command failed.
|
|
323
|
+
*/
|
|
324
|
+
declare const noticeEventSchema: z.ZodObject<{
|
|
325
|
+
id: z.ZodString;
|
|
326
|
+
runId: z.ZodString;
|
|
327
|
+
timestamp: z.ZodDate;
|
|
328
|
+
type: z.ZodLiteral<"notice">;
|
|
329
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
330
|
+
notice: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
331
|
+
kind: z.ZodLiteral<"mcp-server-failed">;
|
|
332
|
+
server: z.ZodString;
|
|
333
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
334
|
+
kind: z.ZodLiteral<"hook-failed">;
|
|
335
|
+
hook: z.ZodString;
|
|
336
|
+
exitCode: z.ZodOptional<z.ZodNumber>;
|
|
337
|
+
}, z.core.$strip>], "kind">;
|
|
338
|
+
}, z.core.$strip>;
|
|
339
|
+
/**
|
|
340
|
+
* Something that failed around the run without failing it, which the agent cannot see but the developer should:
|
|
341
|
+
* an MCP server that did not connect, so its tools are missing, or a hook whose command failed.
|
|
342
|
+
*/
|
|
343
|
+
type NoticeEvent = z.infer<typeof noticeEventSchema>;
|
|
279
344
|
/**
|
|
280
345
|
* Emitted exactly once at the end of a run, just before the `RunResult`
|
|
281
346
|
* promise resolves. Mirrors the run's terminal status; on failure, `error`
|
|
@@ -326,6 +391,7 @@ declare const eventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
326
391
|
id: z.ZodString;
|
|
327
392
|
runId: z.ZodString;
|
|
328
393
|
timestamp: z.ZodDate;
|
|
394
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
329
395
|
type: z.ZodLiteral<"message">;
|
|
330
396
|
sessionId: z.ZodOptional<z.ZodString>;
|
|
331
397
|
model: z.ZodNullable<z.ZodString>;
|
|
@@ -347,6 +413,7 @@ declare const eventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
347
413
|
id: z.ZodString;
|
|
348
414
|
runId: z.ZodString;
|
|
349
415
|
timestamp: z.ZodDate;
|
|
416
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
350
417
|
type: z.ZodLiteral<"reasoning">;
|
|
351
418
|
sessionId: z.ZodOptional<z.ZodString>;
|
|
352
419
|
model: z.ZodNullable<z.ZodString>;
|
|
@@ -363,6 +430,7 @@ declare const eventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
363
430
|
id: z.ZodString;
|
|
364
431
|
runId: z.ZodString;
|
|
365
432
|
timestamp: z.ZodDate;
|
|
433
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
366
434
|
type: z.ZodLiteral<"message-delta">;
|
|
367
435
|
sessionId: z.ZodOptional<z.ZodString>;
|
|
368
436
|
messageId: z.ZodString;
|
|
@@ -371,6 +439,7 @@ declare const eventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
371
439
|
id: z.ZodString;
|
|
372
440
|
runId: z.ZodString;
|
|
373
441
|
timestamp: z.ZodDate;
|
|
442
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
374
443
|
type: z.ZodLiteral<"reasoning-delta">;
|
|
375
444
|
sessionId: z.ZodOptional<z.ZodString>;
|
|
376
445
|
reasoningId: z.ZodString;
|
|
@@ -379,6 +448,7 @@ declare const eventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
379
448
|
id: z.ZodString;
|
|
380
449
|
runId: z.ZodString;
|
|
381
450
|
timestamp: z.ZodDate;
|
|
451
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
382
452
|
type: z.ZodLiteral<"tool-call">;
|
|
383
453
|
sessionId: z.ZodOptional<z.ZodString>;
|
|
384
454
|
model: z.ZodNullable<z.ZodString>;
|
|
@@ -389,6 +459,7 @@ declare const eventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
389
459
|
id: z.ZodString;
|
|
390
460
|
runId: z.ZodString;
|
|
391
461
|
timestamp: z.ZodDate;
|
|
462
|
+
parentToolCallId: z.ZodOptional<z.ZodString>;
|
|
392
463
|
type: z.ZodLiteral<"tool-result">;
|
|
393
464
|
sessionId: z.ZodOptional<z.ZodString>;
|
|
394
465
|
toolCallId: z.ZodString;
|
|
@@ -404,6 +475,43 @@ declare const eventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
404
475
|
type: z.ZodLiteral<"stderr">;
|
|
405
476
|
sessionId: z.ZodOptional<z.ZodString>;
|
|
406
477
|
text: z.ZodString;
|
|
478
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
479
|
+
id: z.ZodString;
|
|
480
|
+
runId: z.ZodString;
|
|
481
|
+
timestamp: z.ZodDate;
|
|
482
|
+
type: z.ZodLiteral<"rate-limit">;
|
|
483
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
484
|
+
status: z.ZodEnum<{
|
|
485
|
+
allowed: "allowed";
|
|
486
|
+
rejected: "rejected";
|
|
487
|
+
warning: "warning";
|
|
488
|
+
}>;
|
|
489
|
+
limitType: z.ZodOptional<z.ZodString>;
|
|
490
|
+
windowMinutes: z.ZodOptional<z.ZodNumber>;
|
|
491
|
+
utilization: z.ZodOptional<z.ZodNumber>;
|
|
492
|
+
resetsAt: z.ZodOptional<z.ZodDate>;
|
|
493
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
494
|
+
overageStatus: z.ZodOptional<z.ZodEnum<{
|
|
495
|
+
allowed: "allowed";
|
|
496
|
+
rejected: "rejected";
|
|
497
|
+
warning: "warning";
|
|
498
|
+
}>>;
|
|
499
|
+
isUsingOverage: z.ZodOptional<z.ZodBoolean>;
|
|
500
|
+
overageDisabledReason: z.ZodOptional<z.ZodString>;
|
|
501
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
502
|
+
id: z.ZodString;
|
|
503
|
+
runId: z.ZodString;
|
|
504
|
+
timestamp: z.ZodDate;
|
|
505
|
+
type: z.ZodLiteral<"notice">;
|
|
506
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
507
|
+
notice: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
508
|
+
kind: z.ZodLiteral<"mcp-server-failed">;
|
|
509
|
+
server: z.ZodString;
|
|
510
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
511
|
+
kind: z.ZodLiteral<"hook-failed">;
|
|
512
|
+
hook: z.ZodString;
|
|
513
|
+
exitCode: z.ZodOptional<z.ZodNumber>;
|
|
514
|
+
}, z.core.$strip>], "kind">;
|
|
407
515
|
}, z.core.$strip>, z.ZodObject<{
|
|
408
516
|
id: z.ZodString;
|
|
409
517
|
runId: z.ZodString;
|
|
@@ -432,4 +540,4 @@ declare const eventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
432
540
|
* ```
|
|
433
541
|
*/
|
|
434
542
|
type AgentEvent = z.infer<typeof eventSchema>;
|
|
435
|
-
export {
|
|
543
|
+
export { McpServerConfig as A, stderrEventSchema as C, ContentPart as D, AgentCapabilities as E, textContentPartSchema as F, agentCapabilitiesSchema as M, contentPartSchema as N, ImageContentPart as O, imageContentPartSchema as P, sessionStartEventSchema as S, toolResultEventSchema as T, noticeEventSchema as _, RateLimitEvent as a, reasoningEventSchema as b, SessionEndEvent as c, ToolCallEvent as d, ToolResultEvent as f, messageEventSchema as g, messageDeltaEventSchema as h, NoticeEvent as i, TextContentPart as j, JsonSchema as k, SessionStartEvent as l, eventSchema as m, MessageDeltaEvent as n, ReasoningDeltaEvent as o, baseEventSchema as p, MessageEvent as r, ReasoningEvent as s, AgentEvent as t, StderrEvent as u, rateLimitEventSchema as v, toolCallEventSchema as w, sessionEndEventSchema as x, reasoningDeltaEventSchema as y };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as Container } from "./index-
|
|
2
|
-
import { f as EnsureDisjoint, l as BaseAgent, p as ExclusiveExecutionTargetOptions, t as AgentEventHandler } from "./types-
|
|
3
|
-
import { l as Sandbox } from "./index-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { t as Container } from "./index-Q5jNyQHD.mjs";
|
|
2
|
+
import { f as EnsureDisjoint, l as BaseAgent, p as ExclusiveExecutionTargetOptions, t as AgentEventHandler } from "./types-D_QP9PC-.mjs";
|
|
3
|
+
import { l as Sandbox } from "./index-CZiWvyn3.mjs";
|
|
4
|
+
import { A as McpServerConfig } from "./events-DmlAPVpd.mjs";
|
|
5
|
+
import { f as ClaudeCodeCliPermissionMode } from "./index-DilMV_1s.mjs";
|
|
6
6
|
/** Same modes as {@link ClaudeCodeCliPermissionMode}; re-exported for convenience. */
|
|
7
7
|
type ClaudeCodeCliPtyPermissionMode = ClaudeCodeCliPermissionMode;
|
|
8
8
|
interface ClaudeCodeCliPtyExitEvent {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as ProcessSpawner } from "./types-BetgZysV.mjs";
|
|
2
|
-
import { t as Container } from "./index-
|
|
3
|
-
import { f as EnsureDisjoint, l as BaseAgent, p as ExclusiveExecutionTargetOptions, t as AgentEventHandler } from "./types-
|
|
4
|
-
import { l as Sandbox } from "./index-
|
|
2
|
+
import { t as Container } from "./index-Q5jNyQHD.mjs";
|
|
3
|
+
import { f as EnsureDisjoint, l as BaseAgent, p as ExclusiveExecutionTargetOptions, t as AgentEventHandler } from "./types-D_QP9PC-.mjs";
|
|
4
|
+
import { l as Sandbox } from "./index-CZiWvyn3.mjs";
|
|
5
5
|
import { z } from "zod/v4";
|
|
6
6
|
/**
|
|
7
7
|
* Permissive raw-event shape for OpenCode CLI: `{ type: string }` plus
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as ProcessSpawner } from "./types-BetgZysV.mjs";
|
|
2
|
-
import { t as Container } from "./index-
|
|
3
|
-
import { f as EnsureDisjoint, l as BaseAgent, p as ExclusiveExecutionTargetOptions, t as AgentEventHandler } from "./types-
|
|
4
|
-
import { l as Sandbox } from "./index-
|
|
2
|
+
import { t as Container } from "./index-Q5jNyQHD.mjs";
|
|
3
|
+
import { f as EnsureDisjoint, l as BaseAgent, p as ExclusiveExecutionTargetOptions, t as AgentEventHandler } from "./types-D_QP9PC-.mjs";
|
|
4
|
+
import { l as Sandbox } from "./index-CZiWvyn3.mjs";
|
|
5
5
|
import { z } from "zod/v4";
|
|
6
6
|
/**
|
|
7
7
|
* Permissive raw-event shape for Cursor CLI: `{ type: string }` plus
|
|
@@ -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-D_QP9PC-.mjs";
|
|
2
2
|
import "@openai/codex-sdk";
|
|
3
3
|
type CodexSdkSandboxMode = "danger-full-access" | "read-only" | "workspace-write";
|
|
4
4
|
type CodexSdkModelReasoningEffort = "high" | "low" | "medium" | "minimal" | "xhigh";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as ProcessSpawner } from "./types-BetgZysV.mjs";
|
|
2
|
-
import { R as VolumeMount } from "./index-
|
|
3
|
-
import "./types-
|
|
2
|
+
import { R as VolumeMount } from "./index-Q5jNyQHD.mjs";
|
|
3
|
+
import "./types-D_QP9PC-.mjs";
|
|
4
4
|
/** Which sandbox binary backs the policy. The binary must be installed on the host. */
|
|
5
5
|
type SandboxType = "bubblewrap" | "firejail" | "nsjail";
|
|
6
6
|
/** Lifecycle state of a sandbox. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as ProcessSpawner } from "./types-BetgZysV.mjs";
|
|
2
|
-
import { t as Container } from "./index-
|
|
3
|
-
import { f as EnsureDisjoint, l as BaseAgent, p as ExclusiveExecutionTargetOptions, t as AgentEventHandler } from "./types-
|
|
4
|
-
import { l as Sandbox } from "./index-
|
|
2
|
+
import { t as Container } from "./index-Q5jNyQHD.mjs";
|
|
3
|
+
import { f as EnsureDisjoint, l as BaseAgent, p as ExclusiveExecutionTargetOptions, t as AgentEventHandler } from "./types-D_QP9PC-.mjs";
|
|
4
|
+
import { l as Sandbox } from "./index-CZiWvyn3.mjs";
|
|
5
5
|
import { z } from "zod/v4";
|
|
6
6
|
/**
|
|
7
7
|
* Permissive raw-event shape for Gemini CLI: `{ type: string }` plus
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { i as ProcessSpawner } from "./types-BetgZysV.mjs";
|
|
2
|
+
import { t as Container } from "./index-Q5jNyQHD.mjs";
|
|
3
|
+
import { _ as ProviderEventHandler, f as EnsureDisjoint, l as BaseAgent, p as ExclusiveExecutionTargetOptions, t as AgentEventHandler } from "./types-D_QP9PC-.mjs";
|
|
4
|
+
import { l as Sandbox } from "./index-CZiWvyn3.mjs";
|
|
5
|
+
import { z } from "zod/v4";
|
|
6
|
+
declare const antigravityProviderEventSchema: z.ZodObject<{
|
|
7
|
+
sessionUpdate: z.ZodString;
|
|
8
|
+
}, z.core.$loose>;
|
|
9
|
+
type AntigravityProviderEvent = z.infer<typeof antigravityProviderEventSchema>;
|
|
10
|
+
/**
|
|
11
|
+
* Antigravity session mode a run starts in.
|
|
12
|
+
* - `"default"`: ask before edits and commands, per the user's permission settings.
|
|
13
|
+
* - `"accept-edits"`: approve file edits in the workspace without asking.
|
|
14
|
+
* - `"auto"`: approve edits and safe commands; ask before irreversible actions.
|
|
15
|
+
* - `"plan"`: plan before executing. The plan is written as a file whose `write_file` tool call carries
|
|
16
|
+
* `ArtifactMetadata.RequestFeedback: true`, and the run ends there; a later run in another mode carries it out.
|
|
17
|
+
*/
|
|
18
|
+
type AntigravityMode = "accept-edits" | "auto" | "default" | "plan";
|
|
19
|
+
/** Antigravity's thinking level. Each model offers only some levels; Antigravity rejects the others. */
|
|
20
|
+
type AntigravityThoughtLevel = "high" | "low" | "max" | "medium" | "xhigh";
|
|
21
|
+
interface AntigravityCliRunOptions {
|
|
22
|
+
/** Session mode the run starts in. Antigravity's own default is `"default"`. */
|
|
23
|
+
mode?: AntigravityMode;
|
|
24
|
+
thoughtLevel?: AntigravityThoughtLevel;
|
|
25
|
+
/** Extra flags appended verbatim to `agy acp`. */
|
|
26
|
+
extraArgs?: string[];
|
|
27
|
+
systemPrompt?: never;
|
|
28
|
+
}
|
|
29
|
+
type AntigravityCliAgentOptions = ExclusiveExecutionTargetOptions<Container, Sandbox> & AntigravityCliRunOptions & {
|
|
30
|
+
/** Path or argv to the `agy` binary, or a launcher that forwards its arguments to it. */
|
|
31
|
+
command?: string[] | string;
|
|
32
|
+
/** Working directory the agent operates against. Antigravity needs an absolute path. */
|
|
33
|
+
cwd?: string;
|
|
34
|
+
env?: Record<string, string>;
|
|
35
|
+
/** Default `true`: `process.env` is inherited and `env` overlays it. Set `false` to suppress host-env propagation. */
|
|
36
|
+
propagateEnv?: boolean;
|
|
37
|
+
/** Existing Antigravity conversation ID to resume. */
|
|
38
|
+
sessionId?: string;
|
|
39
|
+
/** Antigravity model ID: a full ID such as `"gemini-3.8-flash-low"`, or a base ID such as `"gemini-3.8-flash"`. */
|
|
40
|
+
model?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Start `agy acp` with `--dangerously-skip-permissions`: Antigravity approves every tool permission request
|
|
43
|
+
* itself, and none reaches the permission handler.
|
|
44
|
+
*/
|
|
45
|
+
skipPermissions?: boolean;
|
|
46
|
+
/** Emit `message-delta` and `reasoning-delta` events while text is generated. */
|
|
47
|
+
streamText?: boolean;
|
|
48
|
+
/** File path to write the raw protocol log to (useful for debugging). */
|
|
49
|
+
logPath?: string;
|
|
50
|
+
/** Custom process spawner; set by `createContainer`/`createSandbox`, rarely needed manually. */
|
|
51
|
+
spawner?: ProcessSpawner;
|
|
52
|
+
/** Convenience: equivalent to calling `agent.onEvent(handler)` post-construction. */
|
|
53
|
+
onEvent?: AgentEventHandler;
|
|
54
|
+
/** Convenience: equivalent to calling `agent.onProviderEvent(handler)` post-construction. */
|
|
55
|
+
onProviderEvent?: ProviderEventHandler<AntigravityProviderEvent>;
|
|
56
|
+
};
|
|
57
|
+
interface AntigravityCliAgent extends BaseAgent<EnsureDisjoint<AntigravityCliRunOptions>> {
|
|
58
|
+
readonly type: "antigravity-cli";
|
|
59
|
+
/** Subscribe to Antigravity's raw ACP session updates, such as `tool_call` and `agent_message_chunk`. */
|
|
60
|
+
onProviderEvent: (handler: ProviderEventHandler<AntigravityProviderEvent>) => () => void;
|
|
61
|
+
}
|
|
62
|
+
declare const createAntigravityCliAgent: (options?: AntigravityCliAgentOptions) => AntigravityCliAgent;
|
|
63
|
+
export { AntigravityMode as a, AntigravityCliRunOptions as i, AntigravityCliAgent as n, AntigravityThoughtLevel as o, AntigravityCliAgentOptions as r, AntigravityProviderEvent as s, createAntigravityCliAgent as t };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as Container } from "./index-
|
|
1
|
+
import { t as Container } from "./index-Q5jNyQHD.mjs";
|
|
2
2
|
import { i as ProcessSpawner } from "./types-BetgZysV.mjs";
|
|
3
|
-
import { N as ClaudePermissionMode, _ as ProviderEventHandler, f as EnsureDisjoint, l as BaseAgent, p as ExclusiveExecutionTargetOptions, t as AgentEventHandler } from "./types-
|
|
4
|
-
import { l as Sandbox } from "./index-
|
|
5
|
-
import {
|
|
3
|
+
import { N as ClaudePermissionMode, _ as ProviderEventHandler, c as AnyRunResult, f as EnsureDisjoint, l as BaseAgent, p as ExclusiveExecutionTargetOptions, t as AgentEventHandler } from "./types-D_QP9PC-.mjs";
|
|
4
|
+
import { l as Sandbox } from "./index-CZiWvyn3.mjs";
|
|
5
|
+
import { A as McpServerConfig } from "./events-DmlAPVpd.mjs";
|
|
6
6
|
import { z } from "zod/v4";
|
|
7
7
|
/** A control request Claude Code accepts on its stream-json input, such as `{ subtype: "stop_task", task_id }`. */
|
|
8
8
|
type ClaudeControlRequestPayload = {
|
|
@@ -33,18 +33,14 @@ declare const claudeSystemEventSchema: z.ZodObject<{
|
|
|
33
33
|
hook_started: "hook_started";
|
|
34
34
|
init: "init";
|
|
35
35
|
session_state_changed: "session_state_changed";
|
|
36
|
+
task_progress: "task_progress";
|
|
36
37
|
task_started: "task_started";
|
|
37
38
|
}>;
|
|
38
39
|
uuid: z.ZodString;
|
|
39
40
|
tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
40
41
|
mcp_servers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
41
42
|
name: z.ZodString;
|
|
42
|
-
status: z.
|
|
43
|
-
connected: "connected";
|
|
44
|
-
disconnected: "disconnected";
|
|
45
|
-
error: "error";
|
|
46
|
-
failed: "failed";
|
|
47
|
-
}>;
|
|
43
|
+
status: z.ZodString;
|
|
48
44
|
}, z.core.$strip>>>;
|
|
49
45
|
model: z.ZodOptional<z.ZodString>;
|
|
50
46
|
cwd: z.ZodOptional<z.ZodString>;
|
|
@@ -53,6 +49,7 @@ declare const claudeSystemEventSchema: z.ZodObject<{
|
|
|
53
49
|
stdout: z.ZodOptional<z.ZodString>;
|
|
54
50
|
stderr: z.ZodOptional<z.ZodString>;
|
|
55
51
|
exit_code: z.ZodOptional<z.ZodNumber>;
|
|
52
|
+
outcome: z.ZodOptional<z.ZodString>;
|
|
56
53
|
state: z.ZodOptional<z.ZodEnum<{
|
|
57
54
|
idle: "idle";
|
|
58
55
|
requires_action: "requires_action";
|
|
@@ -173,9 +170,13 @@ declare const claudeRateLimitEventSchema: z.ZodObject<{
|
|
|
173
170
|
status: z.ZodString;
|
|
174
171
|
resetsAt: z.ZodOptional<z.ZodNumber>;
|
|
175
172
|
rateLimitType: z.ZodOptional<z.ZodString>;
|
|
173
|
+
utilization: z.ZodOptional<z.ZodNumber>;
|
|
176
174
|
overageStatus: z.ZodOptional<z.ZodString>;
|
|
177
175
|
overageDisabledReason: z.ZodOptional<z.ZodString>;
|
|
178
176
|
isUsingOverage: z.ZodOptional<z.ZodBoolean>;
|
|
177
|
+
unifiedWindows: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
178
|
+
utilization: z.ZodOptional<z.ZodNumber>;
|
|
179
|
+
}, z.core.$strip>>>;
|
|
179
180
|
}, z.core.$strip>;
|
|
180
181
|
}, z.core.$strip>;
|
|
181
182
|
type ClaudeRateLimitEvent = z.infer<typeof claudeRateLimitEventSchema>;
|
|
@@ -196,18 +197,14 @@ declare const claudeEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
196
197
|
hook_started: "hook_started";
|
|
197
198
|
init: "init";
|
|
198
199
|
session_state_changed: "session_state_changed";
|
|
200
|
+
task_progress: "task_progress";
|
|
199
201
|
task_started: "task_started";
|
|
200
202
|
}>;
|
|
201
203
|
uuid: z.ZodString;
|
|
202
204
|
tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
203
205
|
mcp_servers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
204
206
|
name: z.ZodString;
|
|
205
|
-
status: z.
|
|
206
|
-
connected: "connected";
|
|
207
|
-
disconnected: "disconnected";
|
|
208
|
-
error: "error";
|
|
209
|
-
failed: "failed";
|
|
210
|
-
}>;
|
|
207
|
+
status: z.ZodString;
|
|
211
208
|
}, z.core.$strip>>>;
|
|
212
209
|
model: z.ZodOptional<z.ZodString>;
|
|
213
210
|
cwd: z.ZodOptional<z.ZodString>;
|
|
@@ -216,6 +213,7 @@ declare const claudeEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
216
213
|
stdout: z.ZodOptional<z.ZodString>;
|
|
217
214
|
stderr: z.ZodOptional<z.ZodString>;
|
|
218
215
|
exit_code: z.ZodOptional<z.ZodNumber>;
|
|
216
|
+
outcome: z.ZodOptional<z.ZodString>;
|
|
219
217
|
state: z.ZodOptional<z.ZodEnum<{
|
|
220
218
|
idle: "idle";
|
|
221
219
|
requires_action: "requires_action";
|
|
@@ -328,9 +326,13 @@ declare const claudeEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
328
326
|
status: z.ZodString;
|
|
329
327
|
resetsAt: z.ZodOptional<z.ZodNumber>;
|
|
330
328
|
rateLimitType: z.ZodOptional<z.ZodString>;
|
|
329
|
+
utilization: z.ZodOptional<z.ZodNumber>;
|
|
331
330
|
overageStatus: z.ZodOptional<z.ZodString>;
|
|
332
331
|
overageDisabledReason: z.ZodOptional<z.ZodString>;
|
|
333
332
|
isUsingOverage: z.ZodOptional<z.ZodBoolean>;
|
|
333
|
+
unifiedWindows: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
334
|
+
utilization: z.ZodOptional<z.ZodNumber>;
|
|
335
|
+
}, z.core.$strip>>>;
|
|
334
336
|
}, z.core.$strip>;
|
|
335
337
|
}, z.core.$strip>], "type">;
|
|
336
338
|
type ClaudeEvent = z.infer<typeof claudeEventSchema>;
|
|
@@ -345,6 +347,7 @@ declare const claudeProviderEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
345
347
|
stdout: z.ZodOptional<z.ZodString>;
|
|
346
348
|
stderr: z.ZodOptional<z.ZodString>;
|
|
347
349
|
exit_code: z.ZodOptional<z.ZodNumber>;
|
|
350
|
+
outcome: z.ZodOptional<z.ZodString>;
|
|
348
351
|
state: z.ZodOptional<z.ZodEnum<{
|
|
349
352
|
idle: "idle";
|
|
350
353
|
requires_action: "requires_action";
|
|
@@ -457,9 +460,13 @@ declare const claudeProviderEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
457
460
|
status: z.ZodString;
|
|
458
461
|
resetsAt: z.ZodOptional<z.ZodNumber>;
|
|
459
462
|
rateLimitType: z.ZodOptional<z.ZodString>;
|
|
463
|
+
utilization: z.ZodOptional<z.ZodNumber>;
|
|
460
464
|
overageStatus: z.ZodOptional<z.ZodString>;
|
|
461
465
|
overageDisabledReason: z.ZodOptional<z.ZodString>;
|
|
462
466
|
isUsingOverage: z.ZodOptional<z.ZodBoolean>;
|
|
467
|
+
unifiedWindows: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
468
|
+
utilization: z.ZodOptional<z.ZodNumber>;
|
|
469
|
+
}, z.core.$strip>>>;
|
|
463
470
|
}, z.core.$strip>;
|
|
464
471
|
}, z.core.$strip>], "type">;
|
|
465
472
|
type ClaudeProviderEvent = z.infer<typeof claudeProviderEventSchema>;
|
|
@@ -519,6 +526,26 @@ type ClaudeCodeCliAgentOptions = ClaudeCodeCliRunOptions & ExclusiveExecutionTar
|
|
|
519
526
|
* way without this option, but only this option makes the agent report `capabilities.midRunInput`.
|
|
520
527
|
*/
|
|
521
528
|
keepInputOpen?: boolean;
|
|
529
|
+
/**
|
|
530
|
+
* What a run does while Claude Code runs background tasks, such as a Bash command started with `run_in_background`.
|
|
531
|
+
* - `"wait"` (default): the run lasts until Claude Code exits, which it does only after its background tasks have
|
|
532
|
+
* ended and it has answered their ends.
|
|
533
|
+
* - `"keep-running"`: while background tasks run, the run ends at the result that answers its input, and the agent
|
|
534
|
+
* keeps Claude Code's process with its input open for the next run; once no task runs, the run ends when Claude
|
|
535
|
+
* Code reports itself idle and exits. When a task completes or fails while no run is active, Claude Code starts a
|
|
536
|
+
* turn by itself, which `onAgentRun()` handlers receive as a run. `stop()` then interrupts the run's turn and
|
|
537
|
+
* leaves the tasks running, `stopTask()` ends one task, and `dispose()` and `reset()` end the process with its
|
|
538
|
+
* tasks; after `reset()`, the next run starts a fresh session in a new process. A run's
|
|
539
|
+
* `permissionMode` is switched on the process it continues in, and when its turn ends while tasks run, or the run
|
|
540
|
+
* stops before its turn begins, the process is switched back to the agent's `permissionMode`, so turns Claude
|
|
541
|
+
* Code starts by itself run in that mode; an agent without a `permissionMode` leaves the process in the last
|
|
542
|
+
* run's mode. A run whose other options would start Claude Code differently, such as another `schema` or `model`,
|
|
543
|
+
* `forkSession`, or a permission or question handler registered or removed since the process started, cannot use
|
|
544
|
+
* a process that still runs background tasks: `run()` rejects it with `AgentValidationError`, or, when the tasks
|
|
545
|
+
* start while the run waits for a run Claude Code started by itself, resolves it as `failed` with a `process`
|
|
546
|
+
* error.
|
|
547
|
+
*/
|
|
548
|
+
backgroundTasks?: "keep-running" | "wait";
|
|
522
549
|
/**
|
|
523
550
|
* Emit `message-delta` and `reasoning-delta` events while Claude generates text, by running Claude Code with
|
|
524
551
|
* `--include-partial-messages`. The whole `message` and `reasoning` events still follow.
|
|
@@ -544,18 +571,98 @@ interface ClaudeCodeCliAgent extends BaseAgent<EnsureDisjoint<ClaudeCodeCliRunOp
|
|
|
544
571
|
/**
|
|
545
572
|
* Sends a control request to the running Claude Code process and resolves with the `response` of its success answer.
|
|
546
573
|
*
|
|
547
|
-
* Requires a run whose input is open (`keepInputOpen: true` or a permission handler)
|
|
548
|
-
* `
|
|
549
|
-
*
|
|
574
|
+
* Requires a run whose input is open (`keepInputOpen: true` or a permission handler), or, with
|
|
575
|
+
* `backgroundTasks: "keep-running"`, the Claude Code process the agent keeps between runs. Rejects with
|
|
576
|
+
* `ClaudeControlRequestError`: `"no-open-input"` when neither is there, `"input-closed"` when the run or the process
|
|
577
|
+
* ends before Claude Code answers, and `"refused"` when Claude Code answers with an error.
|
|
550
578
|
*/
|
|
551
579
|
sendControlRequest: (request: ClaudeControlRequestPayload) => Promise<unknown>;
|
|
552
580
|
/**
|
|
553
581
|
* Stops one running task, such as a subagent started with the Task tool, while the rest of the run continues. `taskId`
|
|
554
582
|
* is the `task_id` of the task's `system` `task_started` event, not its tool use id. Rejects like
|
|
555
583
|
* `sendControlRequest()`. Claude Code can answer success for an ID it does not know, so resolving does not confirm that
|
|
556
|
-
* a task stopped.
|
|
584
|
+
* a task stopped. With `backgroundTasks: "keep-running"`, it also reaches the process the agent keeps between runs.
|
|
557
585
|
*/
|
|
558
586
|
stopTask: (taskId: string) => Promise<void>;
|
|
587
|
+
/**
|
|
588
|
+
* Registers a handler for background tasks starting, progressing, and ending, in the order Claude Code reports them,
|
|
589
|
+
* also between runs. Returns an unsubscribe function. With `backgroundTasks: "keep-running"`, the end of a task that
|
|
590
|
+
* makes Claude Code start a run by itself reaches the handler right after that run reached the `onAgentRun()`
|
|
591
|
+
* handlers.
|
|
592
|
+
*/
|
|
593
|
+
onBackgroundTask: (handler: (change: ClaudeBackgroundTaskChange) => void) => () => void;
|
|
594
|
+
/**
|
|
595
|
+
* Registers a handler for the runs Claude Code starts by itself with `backgroundTasks: "keep-running"`. The handler is
|
|
596
|
+
* called before the run's first event, and the run answers permission and question requests with the handlers
|
|
597
|
+
* registered then, so the handler can replace them. Claude Code asks over its input only when a permission or question
|
|
598
|
+
* handler was registered when it started, so register one before the first run. Returns an unsubscribe function.
|
|
599
|
+
*/
|
|
600
|
+
onAgentRun: (handler: (run: ClaudeAgentRun) => void) => () => void;
|
|
601
|
+
}
|
|
602
|
+
/**
|
|
603
|
+
* How a background task ended: `"completed"` and `"failed"` as Claude Code reported the task's own end, `"stopped"`
|
|
604
|
+
* when it was stopped, for example with `stopTask()`, or ended with Claude Code's process.
|
|
605
|
+
*/
|
|
606
|
+
type ClaudeBackgroundTaskStatus = "completed" | "failed" | "stopped";
|
|
607
|
+
interface ClaudeBackgroundSubagent {
|
|
608
|
+
/** The subagent's type, such as `general-purpose` or `Explore`. */
|
|
609
|
+
type?: string;
|
|
610
|
+
/** The name supplied by the tool call that started the subagent. */
|
|
611
|
+
name?: string;
|
|
612
|
+
}
|
|
613
|
+
/**
|
|
614
|
+
* A task Claude Code keeps running apart from the model's turn, such as a Bash command started with `run_in_background`
|
|
615
|
+
* or a subagent started in the background with the Agent tool.
|
|
616
|
+
*/
|
|
617
|
+
interface ClaudeBackgroundTask {
|
|
618
|
+
/** Claude Code's ID for the task; pass it to `stopTask()`. */
|
|
619
|
+
taskId: string;
|
|
620
|
+
/** The tool call that started the task. */
|
|
621
|
+
toolCallId?: string;
|
|
622
|
+
description: string;
|
|
623
|
+
command?: string;
|
|
624
|
+
subagent?: ClaudeBackgroundSubagent;
|
|
625
|
+
/** The task whose subagent started this task; absent for a task the session's own agent started. */
|
|
626
|
+
parentTaskId?: string;
|
|
627
|
+
}
|
|
628
|
+
interface ClaudeBackgroundTaskUsage {
|
|
629
|
+
toolUses: number;
|
|
630
|
+
totalTokens: number;
|
|
631
|
+
}
|
|
632
|
+
interface ClaudeBackgroundTaskProgress extends ClaudeBackgroundTaskUsage {
|
|
633
|
+
lastToolName?: string;
|
|
634
|
+
summary?: string;
|
|
635
|
+
}
|
|
636
|
+
interface ClaudeBackgroundTaskEnd extends ClaudeBackgroundTask {
|
|
637
|
+
status: ClaudeBackgroundTaskStatus;
|
|
638
|
+
/** Claude Code's report of the end, which can include the command's exit code. */
|
|
639
|
+
summary?: string;
|
|
640
|
+
usage?: ClaudeBackgroundTaskUsage;
|
|
641
|
+
}
|
|
642
|
+
/**
|
|
643
|
+
* A background task's start, progress, or end, as `onBackgroundTask()` handlers receive it. Claude Code reports
|
|
644
|
+
* progress only for a task that runs a subagent.
|
|
645
|
+
*/
|
|
646
|
+
type ClaudeBackgroundTaskChange = {
|
|
647
|
+
kind: "started";
|
|
648
|
+
task: ClaudeBackgroundTask;
|
|
649
|
+
} | {
|
|
650
|
+
kind: "progressed";
|
|
651
|
+
task: ClaudeBackgroundTask;
|
|
652
|
+
progress: ClaudeBackgroundTaskProgress;
|
|
653
|
+
} | {
|
|
654
|
+
kind: "ended";
|
|
655
|
+
task: ClaudeBackgroundTaskEnd;
|
|
656
|
+
};
|
|
657
|
+
/** A run Claude Code started by itself, without input from the agent. */
|
|
658
|
+
interface ClaudeAgentRun {
|
|
659
|
+
readonly runId: string;
|
|
660
|
+
/** The background tasks whose end made Claude Code start the run; empty when it gave no reason. */
|
|
661
|
+
readonly endedTasks: readonly ClaudeBackgroundTaskEnd[];
|
|
662
|
+
/** Settles like the promise `run()` returns. */
|
|
663
|
+
readonly result: Promise<AnyRunResult>;
|
|
664
|
+
/** Stops the run as `stop()` stops a run started with `run()`, and resolves with its result. */
|
|
665
|
+
stop: () => Promise<AnyRunResult>;
|
|
559
666
|
}
|
|
560
667
|
declare const createClaudeCodeCliAgent: (options?: ClaudeCodeCliAgentOptions) => ClaudeCodeCliAgent;
|
|
561
|
-
export {
|
|
668
|
+
export { ClaudeControlRequestPayload as C, ClaudeControlRequestFailure as S, ClaudeRateLimitEvent as _, ClaudeBackgroundTaskChange as a, ClaudeUserEvent as b, ClaudeBackgroundTaskStatus as c, ClaudeCodeCliAgentOptions as d, ClaudeCodeCliPermissionMode as f, ClaudeProviderEvent as g, ClaudeEvent as h, ClaudeBackgroundTask as i, ClaudeBackgroundTaskUsage as l, ClaudeAssistantEvent as m, ClaudeAgentRun as n, ClaudeBackgroundTaskEnd as o, ClaudeCodeCliRunOptions as p, ClaudeBackgroundSubagent as r, ClaudeBackgroundTaskProgress as s, createClaudeCodeCliAgent as t, ClaudeCodeCliAgent as u, ClaudeResultEvent as v, ClaudeControlRequestError as x, ClaudeSystemEvent as y };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as Container } from "./index-
|
|
1
|
+
import { t as Container } from "./index-Q5jNyQHD.mjs";
|
|
2
2
|
import { i as ProcessSpawner } from "./types-BetgZysV.mjs";
|
|
3
|
-
import { _ as ProviderEventHandler, f as EnsureDisjoint, l as BaseAgent, p as ExclusiveExecutionTargetOptions, t as AgentEventHandler } from "./types-
|
|
4
|
-
import { l as Sandbox } from "./index-
|
|
5
|
-
import {
|
|
3
|
+
import { _ as ProviderEventHandler, f as EnsureDisjoint, l as BaseAgent, p as ExclusiveExecutionTargetOptions, t as AgentEventHandler } from "./types-D_QP9PC-.mjs";
|
|
4
|
+
import { l as Sandbox } from "./index-CZiWvyn3.mjs";
|
|
5
|
+
import { A as McpServerConfig } from "./events-DmlAPVpd.mjs";
|
|
6
6
|
import { z } from "zod/v4";
|
|
7
7
|
/**
|
|
8
8
|
* Permissive shape for any raw event Codex CLI emits — `{ type: string }`
|
|
@@ -30,6 +30,7 @@ declare const codexTurnCompletedEventSchema: z.ZodObject<{
|
|
|
30
30
|
reasoning_output_tokens: z.ZodOptional<z.ZodNumber>;
|
|
31
31
|
total_tokens: z.ZodOptional<z.ZodNumber>;
|
|
32
32
|
}, z.core.$loose>>;
|
|
33
|
+
models: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
33
34
|
last_agent_message: z.ZodOptional<z.ZodString>;
|
|
34
35
|
duration_ms: z.ZodOptional<z.ZodNumber>;
|
|
35
36
|
num_turns: z.ZodOptional<z.ZodNumber>;
|
|
@@ -45,6 +46,7 @@ declare const codexTurnFailedEventSchema: z.ZodObject<{
|
|
|
45
46
|
reasoning_output_tokens: z.ZodOptional<z.ZodNumber>;
|
|
46
47
|
total_tokens: z.ZodOptional<z.ZodNumber>;
|
|
47
48
|
}, z.core.$loose>>;
|
|
49
|
+
models: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
48
50
|
last_agent_message: z.ZodOptional<z.ZodString>;
|
|
49
51
|
duration_ms: z.ZodOptional<z.ZodNumber>;
|
|
50
52
|
num_turns: z.ZodOptional<z.ZodNumber>;
|
|
@@ -150,6 +152,7 @@ declare const codexProviderEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
150
152
|
reasoning_output_tokens: z.ZodOptional<z.ZodNumber>;
|
|
151
153
|
total_tokens: z.ZodOptional<z.ZodNumber>;
|
|
152
154
|
}, z.core.$loose>>;
|
|
155
|
+
models: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
153
156
|
last_agent_message: z.ZodOptional<z.ZodString>;
|
|
154
157
|
duration_ms: z.ZodOptional<z.ZodNumber>;
|
|
155
158
|
num_turns: z.ZodOptional<z.ZodNumber>;
|
|
@@ -163,6 +166,7 @@ declare const codexProviderEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
163
166
|
reasoning_output_tokens: z.ZodOptional<z.ZodNumber>;
|
|
164
167
|
total_tokens: z.ZodOptional<z.ZodNumber>;
|
|
165
168
|
}, z.core.$loose>>;
|
|
169
|
+
models: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
166
170
|
last_agent_message: z.ZodOptional<z.ZodString>;
|
|
167
171
|
duration_ms: z.ZodOptional<z.ZodNumber>;
|
|
168
172
|
num_turns: z.ZodOptional<z.ZodNumber>;
|