coding-agents-sdk 0.14.0 → 0.14.1
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 +8 -1
- package/dist/adapters/claude-code-cli/index.d.mts +1 -1
- 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 +2 -2
- package/dist/adapters/codex-cli/index.d.mts +1 -1
- package/dist/adapters/codex-cli/index.mjs +2 -2
- 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-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-oGViyTTR.mjs → container-B3SrSQYp.mjs} +1 -1
- package/dist/{container-D5P0tyx7.mjs → container-B5suwmUQ.mjs} +1 -1
- package/dist/{container-CNM4U7vL.mjs → container-BH5So6E_.mjs} +1 -1
- package/dist/{container-mzyYSG7P.mjs → container-BPllAKd8.mjs} +1 -1
- package/dist/{container-BYRWV-A_.mjs → container-DQzVZjLd.mjs} +1 -1
- package/dist/diff-Bh8JPwVM.mjs +1 -0
- package/dist/{events-BF6ELG7c.d.mts → events-BxEB6zHt.d.mts} +6 -7
- package/dist/{index-CGMqyNOd.d.mts → index-BQwDFirP.d.mts} +1 -2
- package/dist/{index-68ih5kFM.d.mts → index-BXgvYZSv.d.mts} +10 -1
- package/dist/{index-DwlwQ9R0.d.mts → index-CGGPY1qE.d.mts} +2 -1
- package/dist/{index-62Ld65Q8.d.mts → index-CSfb-Q3A.d.mts} +29 -16
- package/dist/{index-CAWun0L4.d.mts → index-CSty5NNW.d.mts} +41 -31
- package/dist/{index-ByyejuZo.d.mts → index-C_WwuF3E.d.mts} +2 -3
- package/dist/{index-CPnH6YAO.d.mts → index-Cxegh1Rs.d.mts} +20 -12
- package/dist/{index-CzvAiGC9.d.mts → index-D1IlwEGE.d.mts} +22 -13
- package/dist/{index-CW1kBJ3d.d.mts → index-Dm9HCmWK.d.mts} +3 -2
- package/dist/{index-DCbDnTQ_.d.mts → index-TzOW2t1h.d.mts} +20 -12
- package/dist/{index-GW5zKifI.d.mts → index-f1x-Ugwa.d.mts} +26 -16
- package/dist/{index-DzfIudMp.d.mts → index-tmvnx5wp.d.mts} +22 -13
- package/dist/index.d.mts +15 -14
- package/dist/index.mjs +1 -1
- package/dist/{oci-FTrEF0I6.mjs → oci-C5y_whHx.mjs} +1 -1
- package/dist/{parser-CfDBEv7A.mjs → parser-CTagqQyR.mjs} +1 -1
- package/dist/sandbox/index.d.mts +1 -1
- package/dist/schemas/index.d.mts +1 -1
- package/dist/structured-output-Bfzi3RU4.mjs +1 -0
- package/dist/{types-BQeZnkDv.d.mts → types-CeIQCAFV.d.mts} +23 -7
- package/package.json +12 -11
- package/dist/diff-ByicTI7l.mjs +0 -1
- package/dist/structured-output-BeZPb2QW.mjs +0 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ZodType, z } from "zod/v4";
|
|
2
|
-
|
|
3
2
|
//#region src/schemas/agent.d.ts
|
|
4
3
|
/** Plain text content block in a {@link ContentPart} array. */
|
|
5
4
|
declare const textContentPartSchema: z.ZodObject<{
|
|
@@ -123,8 +122,8 @@ declare const messageEventSchema: z.ZodObject<{
|
|
|
123
122
|
sessionId: z.ZodOptional<z.ZodString>;
|
|
124
123
|
model: z.ZodNullable<z.ZodString>;
|
|
125
124
|
role: z.ZodEnum<{
|
|
126
|
-
system: "system";
|
|
127
125
|
assistant: "assistant";
|
|
126
|
+
system: "system";
|
|
128
127
|
user: "user";
|
|
129
128
|
}>;
|
|
130
129
|
content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -245,9 +244,9 @@ declare const sessionEndEventSchema: z.ZodObject<{
|
|
|
245
244
|
type: z.ZodLiteral<"session-end">;
|
|
246
245
|
sessionId: z.ZodOptional<z.ZodString>;
|
|
247
246
|
status: z.ZodEnum<{
|
|
248
|
-
failed: "failed";
|
|
249
|
-
completed: "completed";
|
|
250
247
|
cancelled: "cancelled";
|
|
248
|
+
completed: "completed";
|
|
249
|
+
failed: "failed";
|
|
251
250
|
}>;
|
|
252
251
|
error: z.ZodOptional<z.ZodString>;
|
|
253
252
|
}, z.core.$strip>;
|
|
@@ -287,8 +286,8 @@ declare const eventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
287
286
|
sessionId: z.ZodOptional<z.ZodString>;
|
|
288
287
|
model: z.ZodNullable<z.ZodString>;
|
|
289
288
|
role: z.ZodEnum<{
|
|
290
|
-
system: "system";
|
|
291
289
|
assistant: "assistant";
|
|
290
|
+
system: "system";
|
|
292
291
|
user: "user";
|
|
293
292
|
}>;
|
|
294
293
|
content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -352,9 +351,9 @@ declare const eventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
352
351
|
type: z.ZodLiteral<"session-end">;
|
|
353
352
|
sessionId: z.ZodOptional<z.ZodString>;
|
|
354
353
|
status: z.ZodEnum<{
|
|
355
|
-
failed: "failed";
|
|
356
|
-
completed: "completed";
|
|
357
354
|
cancelled: "cancelled";
|
|
355
|
+
completed: "completed";
|
|
356
|
+
failed: "failed";
|
|
358
357
|
}>;
|
|
359
358
|
error: z.ZodOptional<z.ZodString>;
|
|
360
359
|
}, z.core.$strip>], "type">;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { k as ProcessSpawner } from "./types-
|
|
2
|
-
|
|
1
|
+
import { k as ProcessSpawner } from "./types-CeIQCAFV.mjs";
|
|
3
2
|
//#region src/container/types.d.ts
|
|
4
3
|
/** Which provider backs a container. Selects which CLI/SDK the adapter speaks. */
|
|
5
4
|
type ContainerType = "docker" | "e2b" | "nerdctl" | "podman";
|
|
@@ -1,4 +1,5 @@
|
|
|
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-CeIQCAFV.mjs";
|
|
2
|
+
import "@openai/codex-sdk";
|
|
2
3
|
//#region src/adapters/codex-sdk/types.d.ts
|
|
3
4
|
type CodexSdkSandboxMode = "danger-full-access" | "read-only" | "workspace-write";
|
|
4
5
|
type CodexSdkModelReasoningEffort = "high" | "low" | "medium" | "minimal" | "xhigh";
|
|
@@ -16,10 +17,18 @@ type CodexSdkConfigObject = {
|
|
|
16
17
|
* - `"untrusted"`: prompt for every potentially destructive action (most restrictive).
|
|
17
18
|
*/
|
|
18
19
|
type CodexSdkPermissionMode = "never" | "on-failure" | "on-request" | "untrusted";
|
|
20
|
+
/**
|
|
21
|
+
* Token counts for a completed turn, as reported by Codex.
|
|
22
|
+
*
|
|
23
|
+
* `cached_input_tokens` and `cache_write_input_tokens` are subsets of `input_tokens`, and
|
|
24
|
+
* `reasoning_output_tokens` a subset of `output_tokens`; summing them double-counts.
|
|
25
|
+
*/
|
|
19
26
|
interface CodexSdkUsage {
|
|
20
27
|
input_tokens: number;
|
|
21
28
|
cached_input_tokens: number;
|
|
29
|
+
cache_write_input_tokens: number;
|
|
22
30
|
output_tokens: number;
|
|
31
|
+
reasoning_output_tokens: number;
|
|
23
32
|
}
|
|
24
33
|
interface CodexSdkCommandExecutionItem {
|
|
25
34
|
id: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
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-CeIQCAFV.mjs";
|
|
2
|
+
import "@cursor/sdk";
|
|
2
3
|
//#region src/adapters/cursor-sdk/types.d.ts
|
|
3
4
|
/** OAuth-style credentials for HTTP/SSE MCP servers configured for the agent. */
|
|
4
5
|
interface CursorSdkMcpHttpAuth {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { S as McpServerConfig } from "./events-
|
|
2
|
-
import { f as EnsureDisjoint, k as ProcessSpawner, 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-
|
|
1
|
+
import { S as McpServerConfig } from "./events-BxEB6zHt.mjs";
|
|
2
|
+
import { f as EnsureDisjoint, k as ProcessSpawner, l as BaseAgent, p as ExclusiveExecutionTargetOptions, t as AgentEventHandler } from "./types-CeIQCAFV.mjs";
|
|
3
|
+
import { t as Container } from "./index-BQwDFirP.mjs";
|
|
4
|
+
import { l as Sandbox } from "./index-C_WwuF3E.mjs";
|
|
5
5
|
import { z } from "zod/v4";
|
|
6
|
-
|
|
7
6
|
//#region src/adapters/codex-cli/events/schemas.d.ts
|
|
8
7
|
/**
|
|
9
8
|
* Permissive shape for any raw event Codex CLI emits — `{ type: string }`
|
|
@@ -26,6 +25,7 @@ declare const codexTurnCompletedEventSchema: z.ZodObject<{
|
|
|
26
25
|
usage: z.ZodOptional<z.ZodObject<{
|
|
27
26
|
input_tokens: z.ZodOptional<z.ZodNumber>;
|
|
28
27
|
cached_input_tokens: z.ZodOptional<z.ZodNumber>;
|
|
28
|
+
cache_write_input_tokens: z.ZodOptional<z.ZodNumber>;
|
|
29
29
|
output_tokens: z.ZodOptional<z.ZodNumber>;
|
|
30
30
|
reasoning_output_tokens: z.ZodOptional<z.ZodNumber>;
|
|
31
31
|
total_tokens: z.ZodOptional<z.ZodNumber>;
|
|
@@ -40,6 +40,7 @@ declare const codexTurnFailedEventSchema: z.ZodObject<{
|
|
|
40
40
|
usage: z.ZodOptional<z.ZodObject<{
|
|
41
41
|
input_tokens: z.ZodOptional<z.ZodNumber>;
|
|
42
42
|
cached_input_tokens: z.ZodOptional<z.ZodNumber>;
|
|
43
|
+
cache_write_input_tokens: z.ZodOptional<z.ZodNumber>;
|
|
43
44
|
output_tokens: z.ZodOptional<z.ZodNumber>;
|
|
44
45
|
reasoning_output_tokens: z.ZodOptional<z.ZodNumber>;
|
|
45
46
|
total_tokens: z.ZodOptional<z.ZodNumber>;
|
|
@@ -93,13 +94,16 @@ type CodexCliSandboxMode = "danger-full-access" | "read-only" | "workspace-write
|
|
|
93
94
|
/**
|
|
94
95
|
* How Codex CLI handles approval prompts.
|
|
95
96
|
* - `"default"`: leave Codex CLI's own default approval behavior in place (this adapter does not bridge approvals to a permission handler).
|
|
96
|
-
* - `"auto-approve"`: pass `--
|
|
97
|
-
* - `"bypass-sandbox"`: pass `--dangerously-bypass-approvals-and-sandbox`;
|
|
97
|
+
* - `"auto-approve"`: pass `--approve-for-me`; Codex uses automatic review in the `workspace-write` sandbox.
|
|
98
|
+
* - `"bypass-sandbox"`: pass `--dangerously-bypass-approvals-and-sandbox`; disable approvals and Codex's sandbox for externally isolated execution.
|
|
98
99
|
*/
|
|
99
100
|
type CodexCliPermissionMode = "auto-approve" | "bypass-sandbox" | "default";
|
|
100
101
|
/** Per-run options for the `codex-cli` adapter. */
|
|
101
102
|
interface CodexCliRunOptions {
|
|
102
|
-
/**
|
|
103
|
+
/**
|
|
104
|
+
* Filesystem sandbox policy for the default approval strategy.
|
|
105
|
+
* Other permission modes select their own sandbox behavior.
|
|
106
|
+
*/
|
|
103
107
|
sandboxMode?: CodexCliSandboxMode;
|
|
104
108
|
/** Extra directories outside `cwd` writable under `workspace-write`. */
|
|
105
109
|
additionalDirectories?: string[];
|
|
@@ -120,14 +124,23 @@ interface CodexCliRunOptions {
|
|
|
120
124
|
}
|
|
121
125
|
/** Constructor options for `createAgent("codex-cli", ...)`. */
|
|
122
126
|
type CodexCliAgentOptions = CodexCliRunOptions & ExclusiveExecutionTargetOptions<Container, Sandbox> & {
|
|
123
|
-
/** Path or argv to the `codex` binary. */
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
127
|
+
/** Path or argv to the `codex` binary. */
|
|
128
|
+
command?: string[] | string;
|
|
129
|
+
/** Working directory the agent operates against. */
|
|
130
|
+
cwd?: string;
|
|
131
|
+
/** Environment variables for the subprocess. Layered on top of host env when `propagateEnv` is `true` (default). */
|
|
132
|
+
env?: Record<string, string>;
|
|
133
|
+
/** Default `true`: `process.env` is inherited and `env` overlays it. Set `false` to suppress host-env propagation. */
|
|
134
|
+
propagateEnv?: boolean;
|
|
135
|
+
/** Existing Codex thread ID to resume via `codex resume`. */
|
|
136
|
+
sessionId?: string;
|
|
137
|
+
/** Codex model identifier. */
|
|
138
|
+
model?: string;
|
|
139
|
+
/** File path to write the raw CLI log to (useful for debugging). */
|
|
140
|
+
logPath?: string;
|
|
141
|
+
/** Custom process spawner; set by `createContainer`/`createSandbox`, rarely needed manually. */
|
|
142
|
+
spawner?: ProcessSpawner;
|
|
143
|
+
/** Convenience: equivalent to calling `agent.onEvent(handler)` post-construction. */
|
|
131
144
|
onEvent?: AgentEventHandler;
|
|
132
145
|
};
|
|
133
146
|
/** Agent instance returned by `createAgent("codex-cli", ...)`. */
|
|
@@ -1,29 +1,28 @@
|
|
|
1
|
-
import { S as McpServerConfig } from "./events-
|
|
2
|
-
import { f as EnsureDisjoint, k as ProcessSpawner, 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-
|
|
1
|
+
import { S as McpServerConfig } from "./events-BxEB6zHt.mjs";
|
|
2
|
+
import { f as EnsureDisjoint, k as ProcessSpawner, l as BaseAgent, p as ExclusiveExecutionTargetOptions, t as AgentEventHandler } from "./types-CeIQCAFV.mjs";
|
|
3
|
+
import { t as Container } from "./index-BQwDFirP.mjs";
|
|
4
|
+
import { l as Sandbox } from "./index-C_WwuF3E.mjs";
|
|
5
5
|
import { z } from "zod/v4";
|
|
6
|
-
|
|
7
6
|
//#region src/adapters/claude-code-cli/events/schemas.d.ts
|
|
8
7
|
declare const claudeSystemEventSchema: z.ZodObject<{
|
|
9
8
|
type: z.ZodLiteral<"system">;
|
|
10
9
|
session_id: z.ZodString;
|
|
11
10
|
subtype: z.ZodEnum<{
|
|
12
|
-
init: "init";
|
|
13
|
-
hook_response: "hook_response";
|
|
14
|
-
hook_started: "hook_started";
|
|
15
|
-
hook_finished: "hook_finished";
|
|
16
11
|
hook_failed: "hook_failed";
|
|
12
|
+
hook_finished: "hook_finished";
|
|
13
|
+
hook_response: "hook_response";
|
|
17
14
|
hook_skipped: "hook_skipped";
|
|
15
|
+
hook_started: "hook_started";
|
|
16
|
+
init: "init";
|
|
18
17
|
}>;
|
|
19
18
|
uuid: z.ZodString;
|
|
20
19
|
tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
21
20
|
mcp_servers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
22
21
|
name: z.ZodString;
|
|
23
22
|
status: z.ZodEnum<{
|
|
24
|
-
error: "error";
|
|
25
23
|
connected: "connected";
|
|
26
24
|
disconnected: "disconnected";
|
|
25
|
+
error: "error";
|
|
27
26
|
failed: "failed";
|
|
28
27
|
}>;
|
|
29
28
|
}, z.core.$strip>>>;
|
|
@@ -60,10 +59,10 @@ declare const claudeAssistantEventSchema: z.ZodObject<{
|
|
|
60
59
|
signature: z.ZodOptional<z.ZodString>;
|
|
61
60
|
}, z.core.$strip>]>>;
|
|
62
61
|
stop_reason: z.ZodNullable<z.ZodEnum<{
|
|
63
|
-
tool_use: "tool_use";
|
|
64
62
|
end_turn: "end_turn";
|
|
65
63
|
max_tokens: "max_tokens";
|
|
66
64
|
stop_sequence: "stop_sequence";
|
|
65
|
+
tool_use: "tool_use";
|
|
67
66
|
}>>;
|
|
68
67
|
stop_sequence: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
69
68
|
context_management: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
|
|
@@ -109,9 +108,9 @@ declare const claudeResultEventSchema: z.ZodObject<{
|
|
|
109
108
|
session_id: z.ZodString;
|
|
110
109
|
uuid: z.ZodString;
|
|
111
110
|
subtype: z.ZodEnum<{
|
|
112
|
-
success: "success";
|
|
113
|
-
error_max_turns: "error_max_turns";
|
|
114
111
|
error_during_execution: "error_during_execution";
|
|
112
|
+
error_max_turns: "error_max_turns";
|
|
113
|
+
success: "success";
|
|
115
114
|
}>;
|
|
116
115
|
duration_ms: z.ZodNumber;
|
|
117
116
|
duration_api_ms: z.ZodNumber;
|
|
@@ -155,21 +154,21 @@ declare const claudeEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
155
154
|
type: z.ZodLiteral<"system">;
|
|
156
155
|
session_id: z.ZodString;
|
|
157
156
|
subtype: z.ZodEnum<{
|
|
158
|
-
init: "init";
|
|
159
|
-
hook_response: "hook_response";
|
|
160
|
-
hook_started: "hook_started";
|
|
161
|
-
hook_finished: "hook_finished";
|
|
162
157
|
hook_failed: "hook_failed";
|
|
158
|
+
hook_finished: "hook_finished";
|
|
159
|
+
hook_response: "hook_response";
|
|
163
160
|
hook_skipped: "hook_skipped";
|
|
161
|
+
hook_started: "hook_started";
|
|
162
|
+
init: "init";
|
|
164
163
|
}>;
|
|
165
164
|
uuid: z.ZodString;
|
|
166
165
|
tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
167
166
|
mcp_servers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
168
167
|
name: z.ZodString;
|
|
169
168
|
status: z.ZodEnum<{
|
|
170
|
-
error: "error";
|
|
171
169
|
connected: "connected";
|
|
172
170
|
disconnected: "disconnected";
|
|
171
|
+
error: "error";
|
|
173
172
|
failed: "failed";
|
|
174
173
|
}>;
|
|
175
174
|
}, z.core.$strip>>>;
|
|
@@ -204,10 +203,10 @@ declare const claudeEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
204
203
|
signature: z.ZodOptional<z.ZodString>;
|
|
205
204
|
}, z.core.$strip>]>>;
|
|
206
205
|
stop_reason: z.ZodNullable<z.ZodEnum<{
|
|
207
|
-
tool_use: "tool_use";
|
|
208
206
|
end_turn: "end_turn";
|
|
209
207
|
max_tokens: "max_tokens";
|
|
210
208
|
stop_sequence: "stop_sequence";
|
|
209
|
+
tool_use: "tool_use";
|
|
211
210
|
}>>;
|
|
212
211
|
stop_sequence: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
213
212
|
context_management: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
|
|
@@ -249,9 +248,9 @@ declare const claudeEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
249
248
|
session_id: z.ZodString;
|
|
250
249
|
uuid: z.ZodString;
|
|
251
250
|
subtype: z.ZodEnum<{
|
|
252
|
-
success: "success";
|
|
253
|
-
error_max_turns: "error_max_turns";
|
|
254
251
|
error_during_execution: "error_during_execution";
|
|
252
|
+
error_max_turns: "error_max_turns";
|
|
253
|
+
success: "success";
|
|
255
254
|
}>;
|
|
256
255
|
duration_ms: z.ZodNumber;
|
|
257
256
|
duration_api_ms: z.ZodNumber;
|
|
@@ -316,16 +315,27 @@ interface ClaudeCodeCliRunOptions {
|
|
|
316
315
|
}
|
|
317
316
|
/** Constructor options for `createAgent("claude-code-cli", ...)`. */
|
|
318
317
|
type ClaudeCodeCliAgentOptions = ClaudeCodeCliRunOptions & ExclusiveExecutionTargetOptions<Container, Sandbox> & {
|
|
319
|
-
/** Path or argv to the `claude` binary. Defaults to looking up `claude` on `PATH`. */
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
318
|
+
/** Path or argv to the `claude` binary. Defaults to looking up `claude` on `PATH`. */
|
|
319
|
+
command?: string[] | string;
|
|
320
|
+
/** Working directory the agent operates against. */
|
|
321
|
+
cwd?: string;
|
|
322
|
+
/** Environment variables for the subprocess. */
|
|
323
|
+
env?: Record<string, string>;
|
|
324
|
+
/** Inherit `process.env` and overlay `env` on top, instead of replacing. */
|
|
325
|
+
propagateEnv?: boolean;
|
|
326
|
+
/** Existing session ID to resume via `--resume`. */
|
|
327
|
+
sessionId?: string;
|
|
328
|
+
/** Model identifier (e.g. `"claude-sonnet-4-6"`). */
|
|
329
|
+
model?: string;
|
|
330
|
+
/** Replaces the default system prompt entirely. */
|
|
331
|
+
systemPrompt?: string;
|
|
332
|
+
/** File path to write the raw CLI log to (useful for debugging). */
|
|
333
|
+
logPath?: string;
|
|
334
|
+
/** Sets `CI=true` in the subprocess env unless explicitly `false`. Default: `true`. Does not change Claude Code's output formatting on its own. */
|
|
335
|
+
ci?: boolean;
|
|
336
|
+
/** Custom process spawner; set by `createContainer`/`createSandbox`, rarely needed manually. */
|
|
337
|
+
spawner?: ProcessSpawner;
|
|
338
|
+
/** Convenience: equivalent to calling `agent.onEvent(handler)` post-construction. */
|
|
329
339
|
onEvent?: AgentEventHandler;
|
|
330
340
|
};
|
|
331
341
|
/** Agent instance returned by `createAgent("claude-code-cli", ...)`. */
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { k as ProcessSpawner } from "./types-
|
|
2
|
-
import { A as VolumeMount } from "./index-
|
|
3
|
-
|
|
1
|
+
import { k as ProcessSpawner } from "./types-CeIQCAFV.mjs";
|
|
2
|
+
import { A as VolumeMount } from "./index-BQwDFirP.mjs";
|
|
4
3
|
//#region src/sandbox/types.d.ts
|
|
5
4
|
/** Which sandbox binary backs the policy. The binary must be installed on the host. */
|
|
6
5
|
type SandboxType = "bubblewrap" | "firejail" | "nsjail";
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { f as EnsureDisjoint, k as ProcessSpawner, l as BaseAgent, p as ExclusiveExecutionTargetOptions, t as AgentEventHandler } from "./types-
|
|
2
|
-
import { t as Container } from "./index-
|
|
3
|
-
import { l as Sandbox } from "./index-
|
|
1
|
+
import { f as EnsureDisjoint, k as ProcessSpawner, l as BaseAgent, p as ExclusiveExecutionTargetOptions, t as AgentEventHandler } from "./types-CeIQCAFV.mjs";
|
|
2
|
+
import { t as Container } from "./index-BQwDFirP.mjs";
|
|
3
|
+
import { l as Sandbox } from "./index-C_WwuF3E.mjs";
|
|
4
4
|
import { z } from "zod/v4";
|
|
5
|
-
|
|
6
5
|
//#region src/adapters/cursor-cli/events/schemas.d.ts
|
|
7
6
|
/**
|
|
8
7
|
* Permissive raw-event shape for Cursor CLI: `{ type: string }` plus
|
|
@@ -50,14 +49,23 @@ interface CursorCliRunOptions {
|
|
|
50
49
|
}
|
|
51
50
|
/** Constructor options for `createAgent("cursor-cli", ...)`. */
|
|
52
51
|
type CursorCliAgentOptions = CursorCliRunOptions & ExclusiveExecutionTargetOptions<Container, Sandbox> & {
|
|
53
|
-
/** Path or argv to the Cursor agent binary. Defaults to `"agent"` on `PATH`. */
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
52
|
+
/** Path or argv to the Cursor agent binary. Defaults to `"agent"` on `PATH`. */
|
|
53
|
+
command?: string[] | string;
|
|
54
|
+
/** Working directory the agent operates against. */
|
|
55
|
+
cwd?: string;
|
|
56
|
+
/** Environment variables for the subprocess. Layered on top of host env when `propagateEnv` is `true` (default). */
|
|
57
|
+
env?: Record<string, string>;
|
|
58
|
+
/** Default `true`: `process.env` is inherited and `env` overlays it. Set `false` to suppress host-env propagation. */
|
|
59
|
+
propagateEnv?: boolean;
|
|
60
|
+
/** Existing Cursor agent ID to resume via `--resume`. */
|
|
61
|
+
sessionId?: string;
|
|
62
|
+
/** Cursor model identifier. */
|
|
63
|
+
model?: string;
|
|
64
|
+
/** File path to write the raw CLI log to (useful for debugging). */
|
|
65
|
+
logPath?: string;
|
|
66
|
+
/** Custom process spawner; set by `createContainer`/`createSandbox`, rarely needed manually. */
|
|
67
|
+
spawner?: ProcessSpawner;
|
|
68
|
+
/** Convenience: equivalent to calling `agent.onEvent(handler)` post-construction. */
|
|
61
69
|
onEvent?: AgentEventHandler;
|
|
62
70
|
};
|
|
63
71
|
/** Agent instance returned by `createAgent("cursor-cli", ...)`. */
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { f as EnsureDisjoint, k as ProcessSpawner, l as BaseAgent, p as ExclusiveExecutionTargetOptions, t as AgentEventHandler } from "./types-
|
|
2
|
-
import { t as Container } from "./index-
|
|
3
|
-
import { l as Sandbox } from "./index-
|
|
1
|
+
import { f as EnsureDisjoint, k as ProcessSpawner, l as BaseAgent, p as ExclusiveExecutionTargetOptions, t as AgentEventHandler } from "./types-CeIQCAFV.mjs";
|
|
2
|
+
import { t as Container } from "./index-BQwDFirP.mjs";
|
|
3
|
+
import { l as Sandbox } from "./index-C_WwuF3E.mjs";
|
|
4
4
|
import { z } from "zod/v4";
|
|
5
|
-
|
|
6
5
|
//#region src/adapters/pi-cli/events/schemas.d.ts
|
|
7
6
|
/**
|
|
8
7
|
* Permissive raw-event shape for Pi CLI: `{ type: string }` plus arbitrary
|
|
@@ -39,15 +38,25 @@ interface PiCliRunOptions {
|
|
|
39
38
|
}
|
|
40
39
|
/** Constructor options for `createAgent("pi-cli", ...)`. */
|
|
41
40
|
type PiCliAgentOptions = ExclusiveExecutionTargetOptions<Container, Sandbox> & PiCliRunOptions & {
|
|
42
|
-
/** Path or argv to the `pi` binary. */
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
41
|
+
/** Path or argv to the `pi` binary. */
|
|
42
|
+
command?: string[] | string;
|
|
43
|
+
/** Working directory the agent operates against. */
|
|
44
|
+
cwd?: string;
|
|
45
|
+
/** Environment variables for the subprocess. Layered on top of host env when `propagateEnv` is `true` (default). */
|
|
46
|
+
env?: Record<string, string>;
|
|
47
|
+
/** Default `true`: `process.env` is inherited and `env` overlays it. Set `false` to suppress host-env propagation. */
|
|
48
|
+
propagateEnv?: boolean;
|
|
49
|
+
/** Existing Pi session ID to resume. */
|
|
50
|
+
sessionId?: string;
|
|
51
|
+
/** Pi model identifier (provider-dependent). */
|
|
52
|
+
model?: string;
|
|
53
|
+
/** Replaces Pi's default system prompt entirely; use `appendSystemPrompt` to add to it. */
|
|
54
|
+
systemPrompt?: string;
|
|
55
|
+
/** File path to write the raw CLI log to (useful for debugging). */
|
|
56
|
+
logPath?: string;
|
|
57
|
+
/** Custom process spawner; set by `createContainer`/`createSandbox`, rarely needed manually. */
|
|
58
|
+
spawner?: ProcessSpawner;
|
|
59
|
+
/** Convenience: equivalent to calling `agent.onEvent(handler)` post-construction. */
|
|
51
60
|
onEvent?: AgentEventHandler;
|
|
52
61
|
};
|
|
53
62
|
/** Agent instance returned by `createAgent("pi-cli", ...)`. */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { S as McpServerConfig } from "./events-
|
|
2
|
-
import { f as EnsureDisjoint, l as BaseAgent, t as AgentEventHandler } from "./types-
|
|
1
|
+
import { S as McpServerConfig } from "./events-BxEB6zHt.mjs";
|
|
2
|
+
import { f as EnsureDisjoint, l as BaseAgent, t as AgentEventHandler } from "./types-CeIQCAFV.mjs";
|
|
3
|
+
import "@anthropic-ai/claude-agent-sdk";
|
|
3
4
|
//#region src/adapters/claude-code-sdk/types.d.ts
|
|
4
5
|
/**
|
|
5
6
|
* How Claude Code handles tool-permission prompts.
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { f as EnsureDisjoint, k as ProcessSpawner, l as BaseAgent, p as ExclusiveExecutionTargetOptions, t as AgentEventHandler } from "./types-
|
|
2
|
-
import { t as Container } from "./index-
|
|
3
|
-
import { l as Sandbox } from "./index-
|
|
1
|
+
import { f as EnsureDisjoint, k as ProcessSpawner, l as BaseAgent, p as ExclusiveExecutionTargetOptions, t as AgentEventHandler } from "./types-CeIQCAFV.mjs";
|
|
2
|
+
import { t as Container } from "./index-BQwDFirP.mjs";
|
|
3
|
+
import { l as Sandbox } from "./index-C_WwuF3E.mjs";
|
|
4
4
|
import { z } from "zod/v4";
|
|
5
|
-
|
|
6
5
|
//#region src/adapters/opencode-cli/events/schemas.d.ts
|
|
7
6
|
/**
|
|
8
7
|
* Permissive raw-event shape for OpenCode CLI: `{ type: string }` plus
|
|
@@ -37,14 +36,23 @@ interface OpencodeCliRunOptions {
|
|
|
37
36
|
}
|
|
38
37
|
/** Constructor options for `createAgent("opencode-cli", ...)`. */
|
|
39
38
|
type OpencodeCliAgentOptions = ExclusiveExecutionTargetOptions<Container, Sandbox> & OpencodeCliRunOptions & {
|
|
40
|
-
/** Path or argv to the `opencode` binary. */
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
39
|
+
/** Path or argv to the `opencode` binary. */
|
|
40
|
+
command?: string[] | string;
|
|
41
|
+
/** Working directory the agent operates against. */
|
|
42
|
+
cwd?: string;
|
|
43
|
+
/** Environment variables for the subprocess. Layered on top of host env when `propagateEnv` is `true` (default). */
|
|
44
|
+
env?: Record<string, string>;
|
|
45
|
+
/** Default `true`: `process.env` is inherited and `env` overlays it. Set `false` to suppress host-env propagation. */
|
|
46
|
+
propagateEnv?: boolean;
|
|
47
|
+
/** Existing OpenCode session ID to resume. */
|
|
48
|
+
sessionId?: string;
|
|
49
|
+
/** OpenCode model identifier. */
|
|
50
|
+
model?: string;
|
|
51
|
+
/** File path to write the raw CLI log to (useful for debugging). */
|
|
52
|
+
logPath?: string;
|
|
53
|
+
/** Custom process spawner; set by `createContainer`/`createSandbox`, rarely needed manually. */
|
|
54
|
+
spawner?: ProcessSpawner;
|
|
55
|
+
/** Convenience: equivalent to calling `agent.onEvent(handler)` post-construction. */
|
|
48
56
|
onEvent?: AgentEventHandler;
|
|
49
57
|
};
|
|
50
58
|
/** Agent instance returned by `createAgent("opencode-cli", ...)`. */
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { S as McpServerConfig } from "./events-
|
|
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-
|
|
6
|
-
|
|
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-CeIQCAFV.mjs";
|
|
3
|
+
import { t as Container } from "./index-BQwDFirP.mjs";
|
|
4
|
+
import { l as Sandbox } from "./index-C_WwuF3E.mjs";
|
|
5
|
+
import { i as ClaudeCodeCliPermissionMode } from "./index-CSty5NNW.mjs";
|
|
7
6
|
//#region src/adapters/claude-code-cli-pty/types.d.ts
|
|
8
7
|
/** Same modes as {@link ClaudeCodeCliPermissionMode}; re-exported for convenience. */
|
|
9
8
|
type ClaudeCodeCliPtyPermissionMode = ClaudeCodeCliPermissionMode;
|
|
@@ -69,16 +68,27 @@ interface ClaudeCodeCliPtyRunOptions {
|
|
|
69
68
|
}
|
|
70
69
|
/** Constructor options for `createAgent("claude-code-cli-pty", ...)`. */
|
|
71
70
|
type ClaudeCodeCliPtyAgentOptions = ClaudeCodeCliPtyRunOptions & ExclusiveExecutionTargetOptions<Container, Sandbox> & {
|
|
72
|
-
/** Path or argv to the `claude` binary. */
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
71
|
+
/** Path or argv to the `claude` binary. */
|
|
72
|
+
command?: string[] | string;
|
|
73
|
+
/** Working directory the agent operates against. */
|
|
74
|
+
cwd?: string;
|
|
75
|
+
/** Environment variables for the subprocess. */
|
|
76
|
+
env?: Record<string, string>;
|
|
77
|
+
/** Inherit `process.env` and overlay `env` on top, instead of replacing. */
|
|
78
|
+
propagateEnv?: boolean;
|
|
79
|
+
/** Existing session ID to resume via `--resume`. */
|
|
80
|
+
sessionId?: string;
|
|
81
|
+
/** Model identifier (e.g. `"claude-sonnet-4-6"`). */
|
|
82
|
+
model?: string;
|
|
83
|
+
/** Replaces Claude Code's default system prompt entirely. */
|
|
84
|
+
systemPrompt?: string;
|
|
85
|
+
/** File path to write the raw CLI log to (useful for debugging). */
|
|
86
|
+
logPath?: string;
|
|
87
|
+
/** Sets `CI=true` in the subprocess env unless explicitly `false`. Default: `true`. */
|
|
88
|
+
ci?: boolean;
|
|
89
|
+
/** Optional PTY module override. See {@link ClaudeCodeCliPtyModule}. */
|
|
90
|
+
pty?: ClaudeCodeCliPtyModule;
|
|
91
|
+
/** Convenience: equivalent to calling `agent.onEvent(handler)` post-construction. */
|
|
82
92
|
onEvent?: AgentEventHandler;
|
|
83
93
|
};
|
|
84
94
|
/**
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { f as EnsureDisjoint, k as ProcessSpawner, l as BaseAgent, p as ExclusiveExecutionTargetOptions, t as AgentEventHandler } from "./types-
|
|
2
|
-
import { t as Container } from "./index-
|
|
3
|
-
import { l as Sandbox } from "./index-
|
|
1
|
+
import { f as EnsureDisjoint, k as ProcessSpawner, l as BaseAgent, p as ExclusiveExecutionTargetOptions, t as AgentEventHandler } from "./types-CeIQCAFV.mjs";
|
|
2
|
+
import { t as Container } from "./index-BQwDFirP.mjs";
|
|
3
|
+
import { l as Sandbox } from "./index-C_WwuF3E.mjs";
|
|
4
4
|
import { z } from "zod/v4";
|
|
5
|
-
|
|
6
5
|
//#region src/adapters/gemini-cli/events/schemas.d.ts
|
|
7
6
|
/**
|
|
8
7
|
* Permissive raw-event shape for Gemini CLI: `{ type: string }` plus
|
|
@@ -38,15 +37,25 @@ interface GeminiCliRunOptions {
|
|
|
38
37
|
}
|
|
39
38
|
/** Constructor options for `createAgent("gemini-cli", ...)`. */
|
|
40
39
|
type GeminiCliAgentOptions = ExclusiveExecutionTargetOptions<Container, Sandbox> & GeminiCliRunOptions & {
|
|
41
|
-
/** Path or argv to the `gemini` binary. */
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
40
|
+
/** Path or argv to the `gemini` binary. */
|
|
41
|
+
command?: string[] | string;
|
|
42
|
+
/** Working directory the agent operates against. */
|
|
43
|
+
cwd?: string;
|
|
44
|
+
/** Environment variables for the subprocess. Layered on top of host env when `propagateEnv` is `true` (default). */
|
|
45
|
+
env?: Record<string, string>;
|
|
46
|
+
/** Default `true`: `process.env` is inherited and `env` overlays it. Set `false` to suppress host-env propagation. */
|
|
47
|
+
propagateEnv?: boolean;
|
|
48
|
+
/** Existing Gemini session ID to resume. */
|
|
49
|
+
sessionId?: string;
|
|
50
|
+
/** Gemini model identifier. */
|
|
51
|
+
model?: string;
|
|
52
|
+
/** Replaces Gemini's default system prompt entirely. */
|
|
53
|
+
systemPrompt?: string;
|
|
54
|
+
/** File path to write the raw CLI log to (useful for debugging). */
|
|
55
|
+
logPath?: string;
|
|
56
|
+
/** Custom process spawner; set by `createContainer`/`createSandbox`, rarely needed manually. */
|
|
57
|
+
spawner?: ProcessSpawner;
|
|
58
|
+
/** Convenience: equivalent to calling `agent.onEvent(handler)` post-construction. */
|
|
50
59
|
onEvent?: AgentEventHandler;
|
|
51
60
|
};
|
|
52
61
|
/** Agent instance returned by `createAgent("gemini-cli", ...)`. */
|