coding-agents-sdk 0.17.0 → 0.20.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.
Files changed (82) hide show
  1. package/README.md +222 -3
  2. package/dist/Agent-DjrM6eSk.mjs +4 -0
  3. package/dist/SdkAgent-DYmXd2QH.mjs +1 -0
  4. package/dist/adapters/claude-code-cli/index.d.mts +2 -2
  5. package/dist/adapters/claude-code-cli/index.mjs +1 -1
  6. package/dist/adapters/claude-code-cli-pty/index.d.mts +2 -2
  7. package/dist/adapters/claude-code-cli-pty/index.mjs +5 -5
  8. package/dist/adapters/claude-code-sdk/index.d.mts +1 -1
  9. package/dist/adapters/claude-code-sdk/index.mjs +4 -4
  10. package/dist/adapters/codex-cli/index.d.mts +1 -1
  11. package/dist/adapters/codex-cli/index.mjs +4 -2
  12. package/dist/adapters/codex-sdk/index.d.mts +1 -1
  13. package/dist/adapters/codex-sdk/index.mjs +1 -1
  14. package/dist/adapters/cursor-cli/index.d.mts +1 -1
  15. package/dist/adapters/cursor-cli/index.mjs +1 -1
  16. package/dist/adapters/cursor-sdk/index.d.mts +1 -1
  17. package/dist/adapters/cursor-sdk/index.mjs +1 -1
  18. package/dist/adapters/gemini-cli/index.d.mts +1 -1
  19. package/dist/adapters/gemini-cli/index.mjs +1 -1
  20. package/dist/adapters/opencode-cli/index.d.mts +1 -1
  21. package/dist/adapters/opencode-cli/index.mjs +1 -1
  22. package/dist/adapters/pi-cli/index.d.mts +1 -1
  23. package/dist/adapters/pi-cli/index.mjs +1 -1
  24. package/dist/classify-error-DJq_uoy2.mjs +8 -0
  25. package/dist/container/index.d.mts +2 -2
  26. package/dist/container/index.mjs +1 -1
  27. package/dist/container-BlsSoBe1.mjs +1 -0
  28. package/dist/container-C7oWwLGK.mjs +1 -0
  29. package/dist/container-DUoj_mnh.mjs +1 -0
  30. package/dist/container-DXQ92RVu.mjs +1 -0
  31. package/dist/container-MazMFZg8.mjs +1 -0
  32. package/dist/control-requests-DtjV0e4o.mjs +1 -0
  33. package/dist/core/process/index.d.mts +2 -2
  34. package/dist/core/process/index.mjs +1 -1
  35. package/dist/diff-CMWH9a0d.mjs +1 -0
  36. package/dist/{errors-aYGbvsaq.mjs → errors-BauhTL3l.mjs} +1 -1
  37. package/dist/{events-BxEB6zHt.d.mts → events-DoTNE9UF.d.mts} +64 -5
  38. package/dist/{index-DmpVdnKm.d.mts → index--TbBtTi8.d.mts} +4 -10
  39. package/dist/{index-m5Pqs8Jz.d.mts → index-B6HqsIFZ.d.mts} +4 -10
  40. package/dist/{index-CN0WGc9T.d.mts → index-BA-SATzW.d.mts} +3 -7
  41. package/dist/{index-CQzF8Cli.d.mts → index-BOpfjzkT.d.mts} +1 -5
  42. package/dist/{index-Bi9Dh34t.d.mts → index-BUsykYQW.d.mts} +5 -9
  43. package/dist/index-BimeR91j.d.mts +6 -0
  44. package/dist/{index-BbZPkmE-.d.mts → index-Bs2PNdMx.d.mts} +4 -10
  45. package/dist/{index-CjjUmMwQ.d.mts → index-CDN7Re-3.d.mts} +3 -7
  46. package/dist/{index-kXfBtyJn.d.mts → index-DOsWiOqK.d.mts} +88 -25
  47. package/dist/{index-CZbgTv8P.d.mts → index-DP-w59TG.d.mts} +1 -5
  48. package/dist/{index-BiUoRRsR.d.mts → index-DmzP2soo.d.mts} +4 -10
  49. package/dist/{index-CyIiBK-O.d.mts → index-DoVEbwlx.d.mts} +102 -23
  50. package/dist/{index-65Dv7ed0.d.mts → index-_lsNncl5.d.mts} +29 -18
  51. package/dist/index.d.mts +17 -19
  52. package/dist/index.mjs +1 -1
  53. package/dist/oci-t88M5ODN.mjs +2 -0
  54. package/dist/parser-D-7JMlQr.mjs +2 -0
  55. package/dist/permission-updates-lGl8T2lW.mjs +1 -0
  56. package/dist/sandbox/index.d.mts +1 -1
  57. package/dist/sandbox/index.mjs +1 -1
  58. package/dist/{sandbox-CYA69miM.mjs → sandbox-BemAIoIo.mjs} +2 -2
  59. package/dist/schemas/index.d.mts +2 -2
  60. package/dist/schemas/index.mjs +1 -1
  61. package/dist/schemas-CF1pu_vW.mjs +1 -0
  62. package/dist/spawner-CYAQQABs.mjs +1 -0
  63. package/dist/{types-Ba2NYJOB.d.mts → types-1ueeWtwd.d.mts} +76 -10
  64. package/dist/{types-COmjfh8B.d.mts → types-BetgZysV.d.mts} +0 -2
  65. package/dist/util-CCXryPDO.mjs +1 -0
  66. package/package.json +10 -10
  67. package/dist/Agent-BjaeRtLk.mjs +0 -4
  68. package/dist/SdkAgent-Dtsr8Ycr.mjs +0 -1
  69. package/dist/classify-error-DOqkMCcy.mjs +0 -8
  70. package/dist/container-Bdb90GJb.mjs +0 -1
  71. package/dist/container-DMFxf-kn.mjs +0 -1
  72. package/dist/container-Dvr-p53c.mjs +0 -1
  73. package/dist/container-dCRMBvQw.mjs +0 -1
  74. package/dist/container-w0rl1QMH.mjs +0 -1
  75. package/dist/diff-Dqyk2cdt.mjs +0 -1
  76. package/dist/index-DvwVRB7K.d.mts +0 -10
  77. package/dist/oci-DTNwW-WH.mjs +0 -1
  78. package/dist/parser-C1kvDtRD.mjs +0 -2
  79. package/dist/schemas-CkdQXAep.mjs +0 -1
  80. package/dist/session-markers-Dt7TWdKY.mjs +0 -1
  81. package/dist/spawner-CgfyvnR4.mjs +0 -1
  82. package/dist/util-B4HTdOSc.mjs +0 -1
@@ -1,5 +1,4 @@
1
1
  import { ZodType, z } from "zod/v4";
2
- //#region src/schemas/agent.d.ts
3
2
  /** Plain text content block in a {@link ContentPart} array. */
4
3
  declare const textContentPartSchema: z.ZodObject<{
5
4
  type: z.ZodLiteral<"text">;
@@ -53,6 +52,9 @@ declare const agentCapabilitiesSchema: z.ZodObject<{
53
52
  eventStreaming: z.ZodBoolean;
54
53
  sessionFork: z.ZodOptional<z.ZodBoolean>;
55
54
  permissionRequests: z.ZodOptional<z.ZodBoolean>;
55
+ textStreaming: z.ZodOptional<z.ZodBoolean>;
56
+ midRunInput: z.ZodOptional<z.ZodBoolean>;
57
+ questionRequests: z.ZodOptional<z.ZodBoolean>;
56
58
  }, z.core.$strip>;
57
59
  /**
58
60
  * Feature flags published by an adapter via `agent.capabilities`. Use to
@@ -81,8 +83,6 @@ interface McpServerConfig {
81
83
  /** HTTP headers for HTTP/SSE-transport MCP servers. */
82
84
  headers?: Record<string, string>;
83
85
  }
84
- //#endregion
85
- //#region src/schemas/events.d.ts
86
86
  /** Fields shared by every {@link AgentEvent}. */
87
87
  declare const baseEventSchema: z.ZodObject<{
88
88
  id: z.ZodString;
@@ -171,6 +171,50 @@ declare const reasoningEventSchema: z.ZodObject<{
171
171
  * adapters emit these.
172
172
  */
173
173
  type ReasoningEvent = z.infer<typeof reasoningEventSchema>;
174
+ /**
175
+ * Partial text of an assistant message that is still being generated. Emitted only by agents that report
176
+ * `capabilities.textStreaming`. `messageId` is the `id` of the {@link MessageEvent} that later carries the whole
177
+ * text; that event stays authoritative, so replace the text accumulated from deltas with it. A message whose
178
+ * generation is cut short, for example by stopping the run, gets no `message` event.
179
+ */
180
+ declare const messageDeltaEventSchema: z.ZodObject<{
181
+ id: z.ZodString;
182
+ runId: z.ZodString;
183
+ timestamp: z.ZodDate;
184
+ type: z.ZodLiteral<"message-delta">;
185
+ sessionId: z.ZodOptional<z.ZodString>;
186
+ messageId: z.ZodString;
187
+ text: z.ZodString;
188
+ }, z.core.$strip>;
189
+ /**
190
+ * Partial text of an assistant message that is still being generated. Emitted only by agents that report
191
+ * `capabilities.textStreaming`. `messageId` is the `id` of the {@link MessageEvent} that later carries the whole
192
+ * text; that event stays authoritative, so replace the text accumulated from deltas with it. A message whose
193
+ * generation is cut short, for example by stopping the run, gets no `message` event.
194
+ */
195
+ type MessageDeltaEvent = z.infer<typeof messageDeltaEventSchema>;
196
+ /**
197
+ * Partial reasoning text that is still being generated. Emitted only by agents that report
198
+ * `capabilities.textStreaming`. `reasoningId` is the `id` of the {@link ReasoningEvent} that later carries the whole
199
+ * text; that event stays authoritative, so replace the text accumulated from deltas with it. Reasoning whose
200
+ * generation is cut short, for example by stopping the run, gets no `reasoning` event.
201
+ */
202
+ declare const reasoningDeltaEventSchema: z.ZodObject<{
203
+ id: z.ZodString;
204
+ runId: z.ZodString;
205
+ timestamp: z.ZodDate;
206
+ type: z.ZodLiteral<"reasoning-delta">;
207
+ sessionId: z.ZodOptional<z.ZodString>;
208
+ reasoningId: z.ZodString;
209
+ text: z.ZodString;
210
+ }, z.core.$strip>;
211
+ /**
212
+ * Partial reasoning text that is still being generated. Emitted only by agents that report
213
+ * `capabilities.textStreaming`. `reasoningId` is the `id` of the {@link ReasoningEvent} that later carries the whole
214
+ * text; that event stays authoritative, so replace the text accumulated from deltas with it. Reasoning whose
215
+ * generation is cut short, for example by stopping the run, gets no `reasoning` event.
216
+ */
217
+ type ReasoningDeltaEvent = z.infer<typeof reasoningDeltaEventSchema>;
174
218
  /**
175
219
  * Model invoked a tool with the given input. Pair with the subsequent
176
220
  * {@link ToolResultEvent} sharing the same `toolCallId`.
@@ -315,6 +359,22 @@ declare const eventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
315
359
  mediaType: z.ZodOptional<z.ZodString>;
316
360
  }, z.core.$strip>], "type">>;
317
361
  text: z.ZodOptional<z.ZodString>;
362
+ }, z.core.$strip>, z.ZodObject<{
363
+ id: z.ZodString;
364
+ runId: z.ZodString;
365
+ timestamp: z.ZodDate;
366
+ type: z.ZodLiteral<"message-delta">;
367
+ sessionId: z.ZodOptional<z.ZodString>;
368
+ messageId: z.ZodString;
369
+ text: z.ZodString;
370
+ }, z.core.$strip>, z.ZodObject<{
371
+ id: z.ZodString;
372
+ runId: z.ZodString;
373
+ timestamp: z.ZodDate;
374
+ type: z.ZodLiteral<"reasoning-delta">;
375
+ sessionId: z.ZodOptional<z.ZodString>;
376
+ reasoningId: z.ZodString;
377
+ text: z.ZodString;
318
378
  }, z.core.$strip>, z.ZodObject<{
319
379
  id: z.ZodString;
320
380
  runId: z.ZodString;
@@ -372,5 +432,4 @@ declare const eventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
372
432
  * ```
373
433
  */
374
434
  type AgentEvent = z.infer<typeof eventSchema>;
375
- //#endregion
376
- export { TextContentPart as C, textContentPartSchema as D, imageContentPartSchema as E, McpServerConfig as S, contentPartSchema as T, toolResultEventSchema as _, SessionStartEvent as a, ImageContentPart as b, ToolResultEvent as c, messageEventSchema as d, reasoningEventSchema as f, toolCallEventSchema as g, stderrEventSchema as h, SessionEndEvent as i, baseEventSchema as l, sessionStartEventSchema as m, MessageEvent as n, StderrEvent as o, sessionEndEventSchema as p, ReasoningEvent as r, ToolCallEvent as s, AgentEvent as t, eventSchema as u, AgentCapabilities as v, agentCapabilitiesSchema as w, JsonSchema as x, ContentPart as y };
435
+ export { imageContentPartSchema as A, ContentPart as C, TextContentPart as D, McpServerConfig as E, agentCapabilitiesSchema as O, AgentCapabilities as S, JsonSchema as T, sessionEndEventSchema as _, ReasoningEvent as a, toolCallEventSchema as b, StderrEvent as c, baseEventSchema as d, eventSchema as f, reasoningEventSchema as g, reasoningDeltaEventSchema as h, ReasoningDeltaEvent as i, textContentPartSchema as j, contentPartSchema as k, ToolCallEvent as l, messageEventSchema as m, MessageDeltaEvent as n, SessionEndEvent as o, messageDeltaEventSchema as p, MessageEvent as r, SessionStartEvent as s, AgentEvent as t, ToolResultEvent as u, sessionStartEventSchema as v, ImageContentPart as w, toolResultEventSchema as x, stderrEventSchema as y };
@@ -1,9 +1,8 @@
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";
1
+ import { i as ProcessSpawner } from "./types-BetgZysV.mjs";
2
+ import { t as Container } from "./index-DOsWiOqK.mjs";
3
+ import { f as EnsureDisjoint, l as BaseAgent, p as ExclusiveExecutionTargetOptions, t as AgentEventHandler } from "./types-1ueeWtwd.mjs";
4
+ import { l as Sandbox } from "./index-BA-SATzW.mjs";
5
5
  import { z } from "zod/v4";
6
- //#region src/adapters/opencode-cli/events/schemas.d.ts
7
6
  /**
8
7
  * Permissive raw-event shape for OpenCode CLI: `{ type: string }` plus
9
8
  * arbitrary additional fields the CLI may emit.
@@ -12,8 +11,6 @@ declare const opencodeEventSchema: z.ZodObject<{
12
11
  type: z.ZodString;
13
12
  }, z.core.$loose>;
14
13
  type OpencodeEvent = z.infer<typeof opencodeEventSchema>;
15
- //#endregion
16
- //#region src/adapters/opencode-cli/types.d.ts
17
14
  /** Per-run options for the `opencode-cli` adapter. */
18
15
  interface OpencodeCliRunOptions {
19
16
  /** Named OpenCode agent profile (e.g. `"coding"`, `"reviewer"`). */
@@ -60,8 +57,5 @@ type OpencodeCliAgentOptions = ExclusiveExecutionTargetOptions<Container, Sandbo
60
57
  interface OpencodeCliAgent extends BaseAgent<EnsureDisjoint<OpencodeCliRunOptions>> {
61
58
  readonly type: "opencode-cli";
62
59
  }
63
- //#endregion
64
- //#region src/adapters/opencode-cli/adapter.d.ts
65
60
  declare const createOpencodeCliAgent: (options?: OpencodeCliAgentOptions) => OpencodeCliAgent;
66
- //#endregion
67
61
  export { OpencodeEvent as a, OpencodeCliRunOptions as i, OpencodeCliAgent as n, OpencodeCliAgentOptions as r, createOpencodeCliAgent as t };
@@ -1,9 +1,8 @@
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";
1
+ import { i as ProcessSpawner } from "./types-BetgZysV.mjs";
2
+ import { t as Container } from "./index-DOsWiOqK.mjs";
3
+ import { f as EnsureDisjoint, l as BaseAgent, p as ExclusiveExecutionTargetOptions, t as AgentEventHandler } from "./types-1ueeWtwd.mjs";
4
+ import { l as Sandbox } from "./index-BA-SATzW.mjs";
5
5
  import { z } from "zod/v4";
6
- //#region src/adapters/cursor-cli/events/schemas.d.ts
7
6
  /**
8
7
  * Permissive raw-event shape for Cursor CLI: `{ type: string }` plus
9
8
  * arbitrary additional fields the CLI may emit.
@@ -12,8 +11,6 @@ declare const cursorCliEventSchema: z.ZodObject<{
12
11
  type: z.ZodString;
13
12
  }, z.core.$loose>;
14
13
  type CursorCliEvent = z.infer<typeof cursorCliEventSchema>;
15
- //#endregion
16
- //#region src/adapters/cursor-cli/types.d.ts
17
14
  /**
18
15
  * Cursor CLI permission mode — the run's approval/planning strategy. Named
19
16
  * `permissionMode` for consistency with the other adapters; the value union is
@@ -73,8 +70,5 @@ type CursorCliAgentOptions = CursorCliRunOptions & ExclusiveExecutionTargetOptio
73
70
  interface CursorCliAgent extends BaseAgent<EnsureDisjoint<CursorCliRunOptions>> {
74
71
  readonly type: "cursor-cli";
75
72
  }
76
- //#endregion
77
- //#region src/adapters/cursor-cli/adapter.d.ts
78
73
  declare const createCursorCliAgent: (options?: CursorCliAgentOptions) => CursorCliAgent;
79
- //#endregion
80
74
  export { CursorCliRunOptions as a, CursorCliPermissionMode as i, CursorCliAgent as n, CursorCliSandboxMode as o, CursorCliAgentOptions as r, CursorCliEvent as s, createCursorCliAgent as t };
@@ -1,7 +1,6 @@
1
- import { i as ProcessSpawner } from "./types-COmjfh8B.mjs";
2
- import "./types-Ba2NYJOB.mjs";
3
- import { A as VolumeMount } from "./index-kXfBtyJn.mjs";
4
- //#region src/sandbox/types.d.ts
1
+ import { i as ProcessSpawner } from "./types-BetgZysV.mjs";
2
+ import { R as VolumeMount } from "./index-DOsWiOqK.mjs";
3
+ import "./types-1ueeWtwd.mjs";
5
4
  /** Which sandbox binary backs the policy. The binary must be installed on the host. */
6
5
  type SandboxType = "bubblewrap" | "firejail" | "nsjail";
7
6
  /** Lifecycle state of a sandbox. */
@@ -145,8 +144,6 @@ interface NsjailSandbox extends SandboxBase<"nsjail", NsjailSandboxConfig> {}
145
144
  type SandboxConfig = BubblewrapSandboxConfig | FirejailSandboxConfig | NsjailSandboxConfig;
146
145
  /** Union of all sandbox instance types. */
147
146
  type Sandbox = BubblewrapSandbox | FirejailSandbox | NsjailSandbox;
148
- //#endregion
149
- //#region src/sandbox/index.d.ts
150
147
  /**
151
148
  * Thrown by `createSandbox(...)` when the configuration is invalid — e.g.
152
149
  * `config.type` is not one of the supported sandbox kinds.
@@ -191,5 +188,4 @@ declare class SandboxCreateError extends Error {
191
188
  declare function createSandbox(config: BubblewrapSandboxConfig): Promise<BubblewrapSandbox>;
192
189
  declare function createSandbox(config: FirejailSandboxConfig): Promise<FirejailSandbox>;
193
190
  declare function createSandbox(config: NsjailSandboxConfig): Promise<NsjailSandbox>;
194
- //#endregion
195
191
  export { FirejailSandbox as a, NsjailSandboxConfig as c, SandboxStatus as d, SandboxType as f, BubblewrapSandboxConfig as i, Sandbox as l, createSandbox as n, FirejailSandboxConfig as o, BubblewrapSandbox as r, NsjailSandbox as s, SandboxCreateError as t, SandboxConfig as u };
@@ -1,6 +1,5 @@
1
- import { f as EnsureDisjoint, l as BaseAgent, t as AgentEventHandler } from "./types-Ba2NYJOB.mjs";
1
+ import { f as EnsureDisjoint, l as BaseAgent, t as AgentEventHandler } from "./types-1ueeWtwd.mjs";
2
2
  import "@openai/codex-sdk";
3
- //#region src/adapters/codex-sdk/types.d.ts
4
3
  type CodexSdkSandboxMode = "danger-full-access" | "read-only" | "workspace-write";
5
4
  type CodexSdkModelReasoningEffort = "high" | "low" | "medium" | "minimal" | "xhigh";
6
5
  type CodexSdkWebSearchMode = "cached" | "disabled" | "live";
@@ -224,8 +223,5 @@ type CodexSdkItem = CodexSdkAgentMessageItem | CodexSdkCommandExecutionItem | Co
224
223
  * - `"error"` — fatal stream-level error.
225
224
  */
226
225
  type CodexSdkEvent = CodexSdkItemCompletedEvent | CodexSdkItemStartedEvent | CodexSdkItemUpdatedEvent | CodexSdkThreadErrorEvent | CodexSdkThreadStartedEvent | CodexSdkTurnCompletedEvent | CodexSdkTurnFailedEvent | CodexSdkTurnStartedEvent;
227
- //#endregion
228
- //#region src/adapters/codex-sdk/adapter.d.ts
229
226
  declare const createCodexSdkAgent: (options?: CodexSdkAgentOptions) => CodexSdkAgent;
230
- //#endregion
231
227
  export { CodexSdkItem as a, CodexSdkEvent as i, CodexSdkAgent as n, CodexSdkPermissionMode as o, CodexSdkAgentOptions as r, CodexSdkRunOptions as s, createCodexSdkAgent as t };
@@ -1,9 +1,8 @@
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-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
- //#region src/adapters/claude-code-cli-pty/types.d.ts
1
+ import { t as Container } from "./index-DOsWiOqK.mjs";
2
+ import { f as EnsureDisjoint, l as BaseAgent, p as ExclusiveExecutionTargetOptions, t as AgentEventHandler } from "./types-1ueeWtwd.mjs";
3
+ import { l as Sandbox } from "./index-BA-SATzW.mjs";
4
+ import { E as McpServerConfig } from "./events-DoTNE9UF.mjs";
5
+ import { i as ClaudeCodeCliPermissionMode } from "./index-DoVEbwlx.mjs";
7
6
  /** Same modes as {@link ClaudeCodeCliPermissionMode}; re-exported for convenience. */
8
7
  type ClaudeCodeCliPtyPermissionMode = ClaudeCodeCliPermissionMode;
9
8
  interface ClaudeCodeCliPtyExitEvent {
@@ -107,8 +106,5 @@ interface ClaudeCodeCliPtyAgent extends BaseAgent<EnsureDisjoint<ClaudeCodeCliPt
107
106
  */
108
107
  fork: () => ClaudeCodeCliPtyAgent;
109
108
  }
110
- //#endregion
111
- //#region src/adapters/claude-code-cli-pty/adapter.d.ts
112
109
  declare const createClaudeCodeCliPtyAgent: (options?: ClaudeCodeCliPtyAgentOptions) => ClaudeCodeCliPtyAgent;
113
- //#endregion
114
110
  export { ClaudeCodeCliPtyPermissionMode as a, ClaudeCodeCliPtyModule as i, ClaudeCodeCliPtyAgent as n, ClaudeCodeCliPtyProcess as o, ClaudeCodeCliPtyAgentOptions as r, ClaudeCodeCliPtyRunOptions as s, createClaudeCodeCliPtyAgent as t };
@@ -0,0 +1,6 @@
1
+ import { a as SpawnOptions, t as AgentProcess } from "./types-BetgZysV.mjs";
2
+ declare const spawnProcess: (command: string, args: string[], options?: SpawnOptions) => AgentProcess;
3
+ declare class ProcessStdinError extends Error {
4
+ constructor(cause: unknown);
5
+ }
6
+ export { spawnProcess as n, ProcessStdinError as t };
@@ -1,9 +1,8 @@
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";
1
+ import { i as ProcessSpawner } from "./types-BetgZysV.mjs";
2
+ import { t as Container } from "./index-DOsWiOqK.mjs";
3
+ import { f as EnsureDisjoint, l as BaseAgent, p as ExclusiveExecutionTargetOptions, t as AgentEventHandler } from "./types-1ueeWtwd.mjs";
4
+ import { l as Sandbox } from "./index-BA-SATzW.mjs";
5
5
  import { z } from "zod/v4";
6
- //#region src/adapters/gemini-cli/events/schemas.d.ts
7
6
  /**
8
7
  * Permissive raw-event shape for Gemini CLI: `{ type: string }` plus
9
8
  * arbitrary additional fields the CLI may emit.
@@ -12,8 +11,6 @@ declare const geminiEventSchema: z.ZodObject<{
12
11
  type: z.ZodString;
13
12
  }, z.core.$loose>;
14
13
  type GeminiEvent = z.infer<typeof geminiEventSchema>;
15
- //#endregion
16
- //#region src/adapters/gemini-cli/types.d.ts
17
14
  /**
18
15
  * Permission handling for Gemini CLI.
19
16
  * - `"default"`: prompt before risky tool calls.
@@ -63,8 +60,5 @@ type GeminiCliAgentOptions = ExclusiveExecutionTargetOptions<Container, Sandbox>
63
60
  interface GeminiCliAgent extends BaseAgent<EnsureDisjoint<GeminiCliRunOptions>> {
64
61
  readonly type: "gemini-cli";
65
62
  }
66
- //#endregion
67
- //#region src/adapters/gemini-cli/adapter.d.ts
68
63
  declare const createGeminiCliAgent: (options?: GeminiCliAgentOptions) => GeminiCliAgent;
69
- //#endregion
70
64
  export { GeminiCliRunOptions as a, GeminiCliPermissionMode as i, GeminiCliAgent as n, GeminiEvent as o, GeminiCliAgentOptions as r, createGeminiCliAgent as t };
@@ -1,7 +1,6 @@
1
- import { S as McpServerConfig } from "./events-BxEB6zHt.mjs";
2
- import { f as EnsureDisjoint, l as BaseAgent, t as AgentEventHandler } from "./types-Ba2NYJOB.mjs";
1
+ import { N as ClaudePermissionMode, f as EnsureDisjoint, l as BaseAgent, t as AgentEventHandler } from "./types-1ueeWtwd.mjs";
2
+ import { E as McpServerConfig } from "./events-DoTNE9UF.mjs";
3
3
  import "@anthropic-ai/claude-agent-sdk";
4
- //#region src/adapters/claude-code-sdk/types.d.ts
5
4
  /**
6
5
  * How Claude Code handles tool-permission prompts.
7
6
  * - `"default"`: stop and ask via the permission handler.
@@ -11,7 +10,7 @@ import "@anthropic-ai/claude-agent-sdk";
11
10
  * - `"bypassPermissions"`: disable the permission system entirely (dangerous).
12
11
  * - `"plan"`: read-only planning mode; no edits, no shell.
13
12
  */
14
- type ClaudeCodeSdkPermissionMode = "acceptEdits" | "auto" | "bypassPermissions" | "default" | "dontAsk" | "plan";
13
+ type ClaudeCodeSdkPermissionMode = ClaudePermissionMode;
15
14
  /** Which runtime to use when spawning the Claude Code SDK subprocess. */
16
15
  type ClaudeCodeSdkExecutable = "bun" | "deno" | "node";
17
16
  /** Which Claude Code settings layers to load from the local filesystem. */
@@ -91,8 +90,5 @@ interface ClaudeCodeSdkEvent {
91
90
  session_id?: string;
92
91
  [key: string]: unknown;
93
92
  }
94
- //#endregion
95
- //#region src/adapters/claude-code-sdk/adapter.d.ts
96
93
  declare const createClaudeCodeSdkAgent: (options?: ClaudeCodeSdkAgentOptions) => ClaudeCodeSdkAgent;
97
- //#endregion
98
94
  export { ClaudeCodeSdkExecutable as a, ClaudeCodeSdkSettingSource as c, ClaudeCodeSdkEvent as i, ClaudeCodeSdkSettings as l, ClaudeCodeSdkAgent as n, ClaudeCodeSdkPermissionMode as o, ClaudeCodeSdkAgentOptions as r, ClaudeCodeSdkRunOptions as s, createClaudeCodeSdkAgent as t };
@@ -1,6 +1,5 @@
1
- import { i as ProcessSpawner } from "./types-COmjfh8B.mjs";
2
- import "./types-Ba2NYJOB.mjs";
3
- //#region src/container/types.d.ts
1
+ import { i as ProcessSpawner } from "./types-BetgZysV.mjs";
2
+ import "./types-1ueeWtwd.mjs";
4
3
  /** Which provider backs a container. Selects which CLI/SDK the adapter speaks. */
5
4
  type ContainerType = "docker" | "e2b" | "nerdctl" | "podman";
6
5
  /** Container port → host port mapping for `start`/`run`. */
@@ -106,7 +105,10 @@ interface ContainerLifecycle {
106
105
  start: () => Promise<void>;
107
106
  /** Stop the container without removing it. */
108
107
  stop: () => Promise<void>;
109
- /** Stop and remove the container. Idempotent. */
108
+ /**
109
+ * Stop and remove a container made by `createContainer`. A container obtained with `attachContainer`
110
+ * is left as it is, neither stopped nor removed. Idempotent.
111
+ */
110
112
  dispose: () => Promise<void>;
111
113
  [Symbol.asyncDispose]: () => Promise<void>;
112
114
  }
@@ -155,8 +157,6 @@ interface ContainerObservability {
155
157
  }
156
158
  /** Composed shape of every concrete container instance. */
157
159
  interface ContainerBase<TType extends ContainerType, TConfig extends ContainerConfigBase<TType>> extends ContainerExecution, ContainerFileSystem, ContainerIdentity<TType, TConfig>, ContainerLifecycle, ContainerObservability {}
158
- //#endregion
159
- //#region src/container/oci.d.ts
160
160
  interface OciBuildBase {
161
161
  context?: string;
162
162
  args?: Record<string, string>;
@@ -186,8 +186,24 @@ type OciProviderConfig = OciProviderBase & ({
186
186
  image?: never;
187
187
  build: OciBuildConfig;
188
188
  });
189
- //#endregion
190
- //#region src/container/docker/types.d.ts
189
+ interface OciAttachConfig<TType extends ContainerType> extends ContainerConfigBase<TType> {
190
+ /** ID or name of the existing container. */
191
+ containerId: string;
192
+ binary?: string;
193
+ /** An existing container keeps the name and environment it was created with. */
194
+ name?: never;
195
+ env?: never;
196
+ }
197
+ interface AttachedOciContainer<TType extends ContainerType> extends ContainerBase<TType, OciAttachConfig<TType>> {
198
+ /**
199
+ * Stop the container if it is running, remove it and its anonymous volumes from the provider, and dispose
200
+ * this object. Succeeds when the container is already gone, so it can be called again, and also after
201
+ * `dispose()`. The container's image and its named volumes stay.
202
+ *
203
+ * @throws {ContainerRemoveError} If the provider could not remove the container. The object is then not disposed, so the call can be retried.
204
+ */
205
+ remove: () => Promise<void>;
206
+ }
191
207
  /** Full config passed to `createContainer({ type: "docker", ... })`. */
192
208
  type DockerContainerConfig = ContainerConfigBase<"docker"> & OciProviderConfig;
193
209
  /** Docker container instance. */
@@ -195,8 +211,9 @@ interface DockerContainer extends ContainerBase<"docker", DockerContainerConfig>
195
211
  /** Resolve the host port bound to a container port from {@link PortMapping}, or `undefined` if unmapped. */
196
212
  getMappedPort: (containerPort: number) => number | undefined;
197
213
  }
198
- //#endregion
199
- //#region src/container/e2b/types.d.ts
214
+ type DockerAttachConfig = OciAttachConfig<"docker">;
215
+ /** Docker container instance obtained with `attachContainer(...)`. Disposing it leaves the container as it is. */
216
+ type AttachedDockerContainer = AttachedOciContainer<"docker">;
200
217
  interface E2BSandboxNetworkOptions {
201
218
  allowOut?: string[];
202
219
  denyOut?: string[];
@@ -268,8 +285,6 @@ interface E2BContainer extends ContainerBase<"e2b", E2BContainerConfig> {
268
285
  /** Resolve the externally-reachable hostname for a sandbox port. */
269
286
  getHost: (port: number) => string;
270
287
  }
271
- //#endregion
272
- //#region src/container/nerdctl/types.d.ts
273
288
  /** Provider-specific fields for nerdctl, layered on top of generic OCI provider options. */
274
289
  interface NerdctlProviderBase extends OciProviderBase {
275
290
  /** containerd namespace. Defaults to `"default"`. */
@@ -292,8 +307,6 @@ interface NerdctlContainer extends ContainerBase<"nerdctl", NerdctlContainerConf
292
307
  /** Resolve the host port bound to a container port from {@link PortMapping}, or `undefined` if unmapped. */
293
308
  getMappedPort: (containerPort: number) => number | undefined;
294
309
  }
295
- //#endregion
296
- //#region src/container/podman/types.d.ts
297
310
  /** Full config passed to `createContainer({ type: "podman", ... })`. */
298
311
  type PodmanContainerConfig = ContainerConfigBase<"podman"> & OciProviderConfig;
299
312
  /** Podman container instance. */
@@ -301,12 +314,13 @@ interface PodmanContainer extends ContainerBase<"podman", PodmanContainerConfig>
301
314
  /** Resolve the host port bound to a container port from {@link PortMapping}, or `undefined` if unmapped. */
302
315
  getMappedPort: (containerPort: number) => number | undefined;
303
316
  }
304
- //#endregion
305
- //#region src/container/errors.d.ts
317
+ type PodmanAttachConfig = OciAttachConfig<"podman">;
318
+ /** Podman container instance obtained with `attachContainer(...)`. Disposing it leaves the container as it is. */
319
+ type AttachedPodmanContainer = AttachedOciContainer<"podman">;
306
320
  /**
307
- * Base class for every error thrown by `createContainer(...)` and the
308
- * resulting container instance. Catch this if you want to handle any
309
- * container failure uniformly.
321
+ * Base class for every error thrown by `createContainer(...)`,
322
+ * `attachContainer(...)`, and the resulting container instance. Catch this
323
+ * if you want to handle any container failure uniformly.
310
324
  */
311
325
  declare class ContainerError extends Error {
312
326
  constructor(message: string);
@@ -319,6 +333,29 @@ declare class ContainerError extends Error {
319
333
  declare class ContainerCreateError extends ContainerError {
320
334
  constructor(message: string);
321
335
  }
336
+ /**
337
+ * Thrown by `attachContainer(...)` when the provider reports no container
338
+ * with the given ID or name.
339
+ */
340
+ declare class ContainerNotFoundError extends ContainerError {
341
+ constructor(message: string);
342
+ }
343
+ /**
344
+ * Thrown by `attachContainer(...)` for every failure other than a missing
345
+ * container — e.g. the configured provider isn't available, or the working
346
+ * directory can't be created inside a running container.
347
+ */
348
+ declare class ContainerAttachError extends ContainerError {
349
+ constructor(message: string);
350
+ }
351
+ /**
352
+ * Thrown by `remove()` on an attached container when the provider could not
353
+ * remove it — e.g. the provider isn't available. The container object is not
354
+ * disposed, so the call can be retried.
355
+ */
356
+ declare class ContainerRemoveError extends ContainerError {
357
+ constructor(message: string);
358
+ }
322
359
  /**
323
360
  * Thrown when a configured `mounts` entry fails pre-flight validation —
324
361
  * typically a missing or unreadable source path on the host.
@@ -363,12 +400,10 @@ declare class ContainerDisposedError extends ContainerError {
363
400
  declare class ContainerDiffError extends ContainerError {
364
401
  constructor(message: string);
365
402
  }
366
- //#endregion
367
- //#region src/container/index.d.ts
368
403
  /** Union of every provider config accepted by `createContainer(...)`. Narrow on `type` to pick a provider. */
369
404
  type ContainerConfig = DockerContainerConfig | E2BContainerConfig | NerdctlContainerConfig | PodmanContainerConfig;
370
- /** Union of every provider's running container instance. Narrow on `container.type` to access provider-specific methods. */
371
- type Container = DockerContainer | E2BContainer | NerdctlContainer | PodmanContainer;
405
+ /** Union of every provider's container instance, created or attached. Narrow on `container.type` to pick a provider; a provider's created and attached instances have different extra methods. */
406
+ type Container = AttachedDockerContainer | AttachedPodmanContainer | DockerContainer | E2BContainer | NerdctlContainer | PodmanContainer;
372
407
  /**
373
408
  * Create a container for sandboxed agent execution.
374
409
  *
@@ -401,5 +436,33 @@ declare function createContainer(config: DockerContainerConfig): Promise<DockerC
401
436
  declare function createContainer(config: E2BContainerConfig): Promise<E2BContainer>;
402
437
  declare function createContainer(config: NerdctlContainerConfig): Promise<NerdctlContainer>;
403
438
  declare function createContainer(config: PodmanContainerConfig): Promise<PodmanContainer>;
404
- //#endregion
405
- export { VolumeMount as A, DockerContainer as C, ExecOptions as D, ContainerType as E, WorkdirSnapshot as F, WorkdirSnapshotOptions as I, WorkdirDiff as M, WorkdirDiffStats as N, ExecResult as O, WorkdirFileChange as P, E2BProviderConfig as S, ContainerStatus as T, E2BConnectConfig as _, ContainerDiffError as a, E2BContainerConfig as b, ContainerExecError as c, MountValidationError as d, PodmanContainer as f, NerdctlProviderConfig as g, NerdctlContainerConfig as h, ContainerCreateError as i, WorkdirChangeKind as j, PortMapping as k, ContainerNotRunningError as l, NerdctlContainer as m, ContainerConfig as n, ContainerDisposedError as o, PodmanContainerConfig as p, createContainer as r, ContainerError as s, Container as t, ContainerStartError as u, E2BConnectionConfig as v, DockerContainerConfig as w, E2BCreateConfig as x, E2BContainer as y };
439
+ /**
440
+ * Attach to an existing Docker or Podman container, identified by ID or name,
441
+ * without taking ownership of it.
442
+ *
443
+ * The result has the same execution, filesystem, and observability methods as
444
+ * a created container, and can be passed to a cli-adapter's `container`
445
+ * option. Attaching does not start a stopped container; call `start()` for
446
+ * that.
447
+ *
448
+ * Disposing the result, including through `await using`, neither stops nor
449
+ * removes the container. Call `stop()` to stop it, or `remove()` to stop and
450
+ * remove it.
451
+ *
452
+ * ```ts
453
+ * const container = await attachContainer({
454
+ * type: "docker",
455
+ * containerId: "my-workspace",
456
+ * workdir: "/workspace",
457
+ * });
458
+ * await container.exec("npm", ["test"]);
459
+ * ```
460
+ *
461
+ * @param config The provider, the container's ID or name, and the working directory to use inside it. A running container gets that directory created if it is missing.
462
+ * @returns A promise that resolves to a container in the state the provider reports: running, stopped, or created.
463
+ * @throws {ContainerNotFoundError} If the provider reports no container with that ID or name.
464
+ * @throws {ContainerAttachError} For every other failure, such as an unavailable provider.
465
+ */
466
+ declare function attachContainer(config: DockerAttachConfig): Promise<AttachedDockerContainer>;
467
+ declare function attachContainer(config: PodmanAttachConfig): Promise<AttachedPodmanContainer>;
468
+ export { DockerAttachConfig as A, WorkdirDiff as B, E2BConnectConfig as C, E2BCreateConfig as D, E2BContainerConfig as E, ExecOptions as F, WorkdirFileChange as H, ExecResult as I, PortMapping as L, DockerContainerConfig as M, ContainerStatus as N, E2BProviderConfig as O, ContainerType as P, VolumeMount as R, NerdctlProviderConfig as S, E2BContainer as T, WorkdirSnapshot as U, WorkdirDiffStats as V, WorkdirSnapshotOptions as W, PodmanAttachConfig as _, ContainerAttachError as a, NerdctlContainer as b, ContainerDisposedError as c, ContainerNotFoundError as d, ContainerNotRunningError as f, AttachedPodmanContainer as g, MountValidationError as h, createContainer as i, DockerContainer as j, AttachedDockerContainer as k, ContainerError as l, ContainerStartError as m, ContainerConfig as n, ContainerCreateError as o, ContainerRemoveError as p, attachContainer as r, ContainerDiffError as s, Container as t, ContainerExecError as u, PodmanContainer as v, E2BConnectionConfig as w, NerdctlContainerConfig as x, PodmanContainerConfig as y, WorkdirChangeKind as z };
@@ -1,6 +1,5 @@
1
- import { f as EnsureDisjoint, l as BaseAgent, t as AgentEventHandler } from "./types-Ba2NYJOB.mjs";
1
+ import { f as EnsureDisjoint, l as BaseAgent, t as AgentEventHandler } from "./types-1ueeWtwd.mjs";
2
2
  import "@cursor/sdk";
3
- //#region src/adapters/cursor-sdk/types.d.ts
4
3
  /** OAuth-style credentials for HTTP/SSE MCP servers configured for the agent. */
5
4
  interface CursorSdkMcpHttpAuth {
6
5
  CLIENT_ID: string;
@@ -187,8 +186,5 @@ interface CursorSdkAgentOptions extends CursorSdkRunOptions {
187
186
  interface CursorSdkAgent extends BaseAgent<EnsureDisjoint<CursorSdkRunOptions>> {
188
187
  readonly type: "cursor-sdk";
189
188
  }
190
- //#endregion
191
- //#region src/adapters/cursor-sdk/adapter.d.ts
192
189
  declare const createCursorSdkAgent: (options?: CursorSdkAgentOptions) => CursorSdkAgent;
193
- //#endregion
194
190
  export { CursorSdkMcpHttpAuth as a, CursorSdkSettingSource as c, CursorSdkEvent as i, CursorSdkAgent as n, CursorSdkMcpServerConfig as o, CursorSdkAgentOptions as r, CursorSdkRunOptions as s, createCursorSdkAgent as t };
@@ -1,9 +1,8 @@
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";
1
+ import { i as ProcessSpawner } from "./types-BetgZysV.mjs";
2
+ import { t as Container } from "./index-DOsWiOqK.mjs";
3
+ import { f as EnsureDisjoint, l as BaseAgent, p as ExclusiveExecutionTargetOptions, t as AgentEventHandler } from "./types-1ueeWtwd.mjs";
4
+ import { l as Sandbox } from "./index-BA-SATzW.mjs";
5
5
  import { z } from "zod/v4";
6
- //#region src/adapters/pi-cli/events/schemas.d.ts
7
6
  /**
8
7
  * Permissive raw-event shape for Pi CLI: `{ type: string }` plus arbitrary
9
8
  * additional fields the CLI may emit.
@@ -12,8 +11,6 @@ declare const piEventSchema: z.ZodObject<{
12
11
  type: z.ZodString;
13
12
  }, z.core.$loose>;
14
13
  type PiEvent = z.infer<typeof piEventSchema>;
15
- //#endregion
16
- //#region src/adapters/pi-cli/types.d.ts
17
14
  /** How much hidden reasoning Pi should perform per turn. */
18
15
  type PiCliThinkingLevel = "high" | "low" | "medium" | "minimal" | "off" | "xhigh";
19
16
  /** Per-run options for the `pi-cli` adapter. */
@@ -71,8 +68,5 @@ interface PiCliAgent extends BaseAgent<EnsureDisjoint<PiCliRunOptions>> {
71
68
  */
72
69
  fork: () => PiCliAgent;
73
70
  }
74
- //#endregion
75
- //#region src/adapters/pi-cli/adapter.d.ts
76
71
  declare const createPiCliAgent: (options?: PiCliAgentOptions) => PiCliAgent;
77
- //#endregion
78
72
  export { PiCliThinkingLevel as a, PiCliRunOptions as i, PiCliAgent as n, PiEvent as o, PiCliAgentOptions as r, createPiCliAgent as t };