agentbox-sdk 0.0.0 → 0.1.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 ADDED
@@ -0,0 +1,414 @@
1
+ # AgentBox
2
+
3
+ Run coding agents inside sandboxes. One API, any provider.
4
+
5
+ Unlike wrappers that shell out to CLIs in non-interactive mode (e.g. `claude --print`), AgentBox launches each agent as a **server process** inside the sandbox and communicates over WebSocket or HTTP. This preserves the full interactive capabilities of each agent — approval flows, tool-use control, streaming events.
6
+
7
+ ```ts
8
+ import { Agent, Sandbox } from "agentbox-sdk";
9
+
10
+ const sandbox = new Sandbox("local-docker", {
11
+ workingDir: "/workspace",
12
+ image: process.env.IMAGE_ID!,
13
+ env: { ANTHROPIC_API_KEY: process.env.ANTHROPIC_API_KEY! },
14
+ });
15
+
16
+ const run = new Agent("claude-code", {
17
+ sandbox,
18
+ cwd: "/workspace",
19
+ approvalMode: "auto",
20
+ }).stream({
21
+ model: "sonnet",
22
+ input: "Create a hello world Express server in /workspace/server.ts",
23
+ });
24
+
25
+ for await (const event of run) {
26
+ if (event.type === "text.delta") process.stdout.write(event.delta);
27
+ }
28
+
29
+ await sandbox.delete();
30
+ ```
31
+
32
+ Providers are mix-and-match:
33
+
34
+ - **Agents** — [`claude-code`](./src/agents/providers/claude-code.ts), [`opencode`](./src/agents/providers/opencode.ts), [`codex`](./src/agents/providers/codex.ts)
35
+ - **Sandboxes** — [`local-docker`](./src/sandboxes/providers/local-docker.ts), [`e2b`](./src/sandboxes/providers/e2b.ts), [`modal`](./src/sandboxes/providers/modal.ts), [`daytona`](./src/sandboxes/providers/daytona.ts), [`vercel`](./src/sandboxes/providers/vercel.ts)
36
+
37
+ Swap either one and your app code stays the same.
38
+
39
+ ## Install
40
+
41
+ ```bash
42
+ npm install agentbox-sdk
43
+ ```
44
+
45
+ Requires Node >= 20. The agent CLI you want to use (`claude`, `opencode`, `codex`) should be installed inside your sandbox image.
46
+
47
+ ## Getting started
48
+
49
+ ### 1. Build a sandbox image
50
+
51
+ AgentBox ships with built-in image presets. Build one for your sandbox provider:
52
+
53
+ ```bash
54
+ npx agentbox image build --provider local-docker --preset browser-agent
55
+ ```
56
+
57
+ This prints an image reference (a Docker tag, Modal image ID, E2B template, or Daytona snapshot depending on the provider). Set it as `IMAGE_ID`:
58
+
59
+ ```bash
60
+ export IMAGE_ID=<printed value>
61
+ ```
62
+
63
+ ### 2. Run an agent
64
+
65
+ ```ts
66
+ import { Agent, Sandbox } from "agentbox-sdk";
67
+
68
+ const sandbox = new Sandbox("local-docker", {
69
+ workingDir: "/workspace",
70
+ image: process.env.IMAGE_ID!,
71
+ env: { ANTHROPIC_API_KEY: process.env.ANTHROPIC_API_KEY! },
72
+ });
73
+
74
+ const agent = new Agent("claude-code", {
75
+ sandbox,
76
+ cwd: "/workspace",
77
+ approvalMode: "auto",
78
+ });
79
+
80
+ const result = await agent.run({
81
+ model: "sonnet",
82
+ input:
83
+ "Explain the project structure and write a summary to /workspace/OVERVIEW.md",
84
+ });
85
+
86
+ console.log(result.text);
87
+ await sandbox.delete();
88
+ ```
89
+
90
+ ### 3. Stream events
91
+
92
+ `agent.stream()` returns an async iterable of normalized events:
93
+
94
+ ```ts
95
+ const run = agent.stream({
96
+ model: "sonnet",
97
+ input: "Write a fizzbuzz in Python",
98
+ });
99
+
100
+ for await (const event of run) {
101
+ if (event.type === "text.delta") {
102
+ process.stdout.write(event.delta);
103
+ }
104
+ }
105
+
106
+ const result = await run.finished;
107
+ ```
108
+
109
+ ## Agents
110
+
111
+ Three agent providers are supported. Each wraps a CLI that runs inside the sandbox:
112
+
113
+ | Provider | CLI | Model format |
114
+ | ------------- | ---------- | ----------------------------------------------- |
115
+ | `claude-code` | `claude` | `sonnet`, `opus`, `haiku` |
116
+ | `opencode` | `opencode` | `anthropic/claude-sonnet-4-6`, `openai/gpt-4.1` |
117
+ | `codex` | `codex` | `gpt-5.3-codex`, `gpt-5.4` |
118
+
119
+ ```ts
120
+ new Agent("claude-code", { sandbox, cwd: "/workspace", approvalMode: "auto" });
121
+ new Agent("opencode", { sandbox, cwd: "/workspace", approvalMode: "auto" });
122
+ new Agent("codex", { sandbox, cwd: "/workspace", approvalMode: "auto" });
123
+ ```
124
+
125
+ ## Sandboxes
126
+
127
+ Five sandbox providers are supported. Each gives you an isolated environment with the same interface:
128
+
129
+ | Provider | What it is | Auth |
130
+ | -------------- | ---------------------- | ------------------------------------------------------- |
131
+ | `local-docker` | Local Docker container | Docker daemon |
132
+ | `e2b` | Cloud micro-VM | `E2B_API_KEY` |
133
+ | `modal` | Cloud container | `MODAL_TOKEN_ID` + `MODAL_TOKEN_SECRET` |
134
+ | `daytona` | Cloud dev environment | `DAYTONA_API_KEY` |
135
+ | `vercel` | Ephemeral cloud VM | `VERCEL_TOKEN` + `VERCEL_TEAM_ID` + `VERCEL_PROJECT_ID` |
136
+
137
+ Every sandbox supports: `run()`, `runAsync()`, `gitClone()`, `openPort()`, `getPreviewLink()`, `snapshot()`, `stop()`, `delete()`.
138
+
139
+ Vercel sandboxes use runtime snapshots instead of pre-built images — call `sandbox.snapshot()` to capture state and pass the returned id via `provider.snapshotId` on the next run.
140
+
141
+ Vercel also requires ports to be declared at create time via `provider.ports` — `openPort()` is a no-op at runtime, so any port the agent (or your own code) will listen on must be listed up front:
142
+
143
+ ```ts
144
+ const sandbox = new Sandbox("vercel", {
145
+ provider: {
146
+ snapshotId: process.env.VERCEL_SNAPSHOT_ID!,
147
+ ports: [4096], // e.g. opencode; codex/claude-code use 43180
148
+ },
149
+ });
150
+ ```
151
+
152
+ ## Skills
153
+
154
+ Attach GitHub repos as agent skills. They're cloned into the sandbox and surfaced to the agent:
155
+
156
+ ```ts
157
+ const agent = new Agent("claude-code", {
158
+ sandbox,
159
+ cwd: "/workspace",
160
+ approvalMode: "auto",
161
+ skills: [
162
+ {
163
+ name: "agent-browser",
164
+ repo: "https://github.com/vercel-labs/agent-browser",
165
+ },
166
+ ],
167
+ });
168
+ ```
169
+
170
+ You can also embed skills inline:
171
+
172
+ ```ts
173
+ skills: [
174
+ {
175
+ source: "embedded",
176
+ name: "lint-fix",
177
+ files: {
178
+ "SKILL.md": "Run `npm run lint:fix` and verify the output is clean.",
179
+ },
180
+ },
181
+ ],
182
+ ```
183
+
184
+ ## Sub-agents
185
+
186
+ Delegate tasks to specialized sub-agents:
187
+
188
+ ```ts
189
+ const agent = new Agent("claude-code", {
190
+ sandbox,
191
+ cwd: "/workspace",
192
+ approvalMode: "auto",
193
+ subAgents: [
194
+ {
195
+ name: "reviewer",
196
+ description: "Reviews code for bugs and security issues",
197
+ instructions:
198
+ "Flag bugs, security issues, and missing edge cases. Be concise.",
199
+ tools: ["bash", "read"],
200
+ },
201
+ ],
202
+ });
203
+ ```
204
+
205
+ ## MCP servers
206
+
207
+ Connect MCP servers to give agents access to external tools:
208
+
209
+ ```ts
210
+ const agent = new Agent("claude-code", {
211
+ sandbox,
212
+ cwd: "/workspace",
213
+ approvalMode: "auto",
214
+ mcps: [
215
+ {
216
+ name: "filesystem",
217
+ type: "local",
218
+ command: "npx",
219
+ args: ["-y", "@modelcontextprotocol/server-filesystem", "/workspace"],
220
+ },
221
+ {
222
+ name: "my-api",
223
+ type: "remote",
224
+ url: "https://mcp.example.com/sse",
225
+ },
226
+ ],
227
+ });
228
+ ```
229
+
230
+ ## Custom commands
231
+
232
+ Register slash commands the agent can use:
233
+
234
+ ```ts
235
+ const agent = new Agent("opencode", {
236
+ sandbox,
237
+ cwd: "/workspace",
238
+ approvalMode: "auto",
239
+ commands: [
240
+ {
241
+ name: "triage",
242
+ description: "Triage a bug report into root cause + fix plan",
243
+ template:
244
+ "Analyze the bug report. Return: root cause, files to change, and tests to add.",
245
+ },
246
+ ],
247
+ });
248
+ ```
249
+
250
+ ## Multimodal input
251
+
252
+ Pass images and files alongside text:
253
+
254
+ ```ts
255
+ import { pathToFileURL } from "node:url";
256
+
257
+ const result = await agent.run({
258
+ model: "sonnet",
259
+ input: [
260
+ { type: "text", text: "Describe this mockup and suggest improvements." },
261
+ { type: "image", image: pathToFileURL("/workspace/mockup.png") },
262
+ ],
263
+ });
264
+ ```
265
+
266
+ Provider support: `opencode` (text, images, files), `claude-code` (text, images, PDFs), `codex` (text, images).
267
+
268
+ ## Custom sandbox images
269
+
270
+ Define your own image when the built-in presets don't cover your needs.
271
+
272
+ Create `my-image.mjs`:
273
+
274
+ ```js
275
+ export default {
276
+ name: "playwright-sandbox",
277
+ base: "node:20-bookworm",
278
+ env: { PLAYWRIGHT_BROWSERS_PATH: "/ms-playwright" },
279
+ run: [
280
+ "apt-get update && apt-get install -y git python3 ca-certificates",
281
+ "npm install -g pnpm @anthropic-ai/claude-code",
282
+ "npx playwright install --with-deps chromium",
283
+ ],
284
+ workdir: "/workspace",
285
+ cmd: ["sleep", "infinity"],
286
+ };
287
+ ```
288
+
289
+ Build it:
290
+
291
+ ```bash
292
+ npx agentbox image build --provider local-docker --file ./my-image.mjs
293
+ ```
294
+
295
+ This works with all providers. For cloud providers, the printed value will be that provider's native image reference.
296
+
297
+ ## Hooks
298
+
299
+ Hooks let you run code at specific points in the agent lifecycle. Each provider has its own hook format:
300
+
301
+ **Claude Code** — native hook settings:
302
+
303
+ ```ts
304
+ new Agent("claude-code", {
305
+ sandbox,
306
+ cwd: "/workspace",
307
+ provider: {
308
+ hooks: {
309
+ PostToolUse: [
310
+ { matcher: "Bash", hooks: [{ type: "command", command: "echo done" }] },
311
+ ],
312
+ },
313
+ },
314
+ });
315
+ ```
316
+
317
+ **Codex** — similar to Claude Code:
318
+
319
+ ```ts
320
+ new Agent("codex", {
321
+ sandbox,
322
+ cwd: "/workspace",
323
+ provider: {
324
+ hooks: {
325
+ PostToolUse: [
326
+ { matcher: "Bash", hooks: [{ type: "command", command: "echo done" }] },
327
+ ],
328
+ },
329
+ },
330
+ });
331
+ ```
332
+
333
+ **OpenCode** — plugin-based hooks:
334
+
335
+ ```ts
336
+ new Agent("opencode", {
337
+ sandbox,
338
+ cwd: "/workspace",
339
+ provider: {
340
+ plugins: [
341
+ {
342
+ name: "session-notifier",
343
+ hooks: [{ event: "session.idle", body: 'return "session-idle";' }],
344
+ },
345
+ ],
346
+ },
347
+ });
348
+ ```
349
+
350
+ ## Examples
351
+
352
+ The [`examples/`](./examples) directory has short, runnable scripts that each demonstrate one feature:
353
+
354
+ | Example | What it shows |
355
+ | --------------------------------------------------------------- | ----------------------------- |
356
+ | [`basic.ts`](./examples/basic.ts) | Minimal agent + sandbox |
357
+ | [`streaming.ts`](./examples/streaming.ts) | Stream and handle events |
358
+ | [`interactive-approval.ts`](./examples/interactive-approval.ts) | Approve tool calls from stdin |
359
+ | [`skills.ts`](./examples/skills.ts) | Attach a GitHub skill |
360
+ | [`sub-agents.ts`](./examples/sub-agents.ts) | Delegate to sub-agents |
361
+ | [`mcp-server.ts`](./examples/mcp-server.ts) | Connect an MCP server |
362
+ | [`multimodal.ts`](./examples/multimodal.ts) | Send images to the agent |
363
+ | [`custom-image.ts`](./examples/custom-image.ts) | Build a custom sandbox image |
364
+ | [`cloud-sandbox.ts`](./examples/cloud-sandbox.ts) | Use E2B, Modal, or Daytona |
365
+ | [`basic-vercel.ts`](./examples/basic-vercel.ts) | Use a Vercel sandbox |
366
+ | [`git-clone.ts`](./examples/git-clone.ts) | Clone a repo into the sandbox |
367
+
368
+ All examples import from `"agentbox-sdk"` like a normal dependency. Run them with:
369
+
370
+ ```bash
371
+ npx tsx examples/basic.ts
372
+ ```
373
+
374
+ ## Package exports
375
+
376
+ ```ts
377
+ import { Agent, Sandbox } from "agentbox-sdk"; // main entrypoint
378
+ import type { AgentRun } from "agentbox-sdk/agents"; // agent types
379
+ import type { CommandResult } from "agentbox-sdk/sandboxes"; // sandbox types
380
+ import type { NormalizedAgentEvent } from "agentbox-sdk/events"; // event types
381
+ ```
382
+
383
+ ## Contributing
384
+
385
+ ```bash
386
+ npm install
387
+ npm run build
388
+ npm run typecheck
389
+ npm test
390
+ ```
391
+
392
+ `npm run build` generates the `dist/` directory. You need to build before the examples or CLI work locally.
393
+
394
+ To test your local build from another project:
395
+
396
+ ```bash
397
+ npm run build && npm pack
398
+ # then in your project:
399
+ npm install /path/to/agentbox-sdk-0.1.0.tgz
400
+ ```
401
+
402
+ ### Tests
403
+
404
+ ```bash
405
+ npm test # fast, no real providers
406
+ AGENTBOX_RUN_SMOKE_TESTS=1 npm run test:smoke # live smoke tests
407
+ AGENTBOX_RUN_MATRIX_E2E=1 npm run test:e2e:matrix # provider matrix
408
+ ```
409
+
410
+ Live test suites are opt-in because they provision real infrastructure.
411
+
412
+ ## License
413
+
414
+ MIT
@@ -0,0 +1,225 @@
1
+ import { Sandbox as Sandbox$1 } from 'e2b';
2
+ import { Sandbox as Sandbox$2 } from '@vercel/sandbox';
3
+ import { Daytona, Sandbox as Sandbox$3 } from '@daytonaio/sdk';
4
+ import { ModalClient, Sandbox as Sandbox$4 } from 'modal';
5
+ import Docker from 'dockerode';
6
+ import { SandboxProvider } from './enums.js';
7
+
8
+ type E2bRaw = {
9
+ sandbox?: Sandbox$1;
10
+ };
11
+
12
+ type VercelRaw = {
13
+ sandbox?: Sandbox$2;
14
+ };
15
+
16
+ type DaytonaRaw = {
17
+ client: Daytona;
18
+ sandbox?: Sandbox$3;
19
+ };
20
+
21
+ type ModalRaw = {
22
+ client: ModalClient;
23
+ sandbox?: Sandbox$4;
24
+ };
25
+
26
+ type DockerRaw = {
27
+ client: Docker;
28
+ container?: Docker.Container;
29
+ };
30
+
31
+ type SandboxProviderName = SandboxProvider;
32
+ interface CommandOptions {
33
+ cwd?: string;
34
+ env?: Record<string, string>;
35
+ timeoutMs?: number;
36
+ pty?: boolean;
37
+ }
38
+ interface CommandResult {
39
+ exitCode: number;
40
+ stdout: string;
41
+ stderr: string;
42
+ combinedOutput: string;
43
+ raw?: unknown;
44
+ }
45
+ interface CommandEvent {
46
+ type: "stdout" | "stderr" | "exit";
47
+ chunk?: string;
48
+ exitCode?: number;
49
+ timestamp: string;
50
+ raw?: unknown;
51
+ }
52
+ interface AsyncCommandHandle extends AsyncIterable<CommandEvent> {
53
+ id: string;
54
+ raw?: unknown;
55
+ write?(input: string): Promise<void>;
56
+ wait(): Promise<CommandResult>;
57
+ kill(): Promise<void>;
58
+ }
59
+ interface GitCloneOptions {
60
+ repoUrl: string;
61
+ branch?: string;
62
+ targetDir?: string;
63
+ depth?: number;
64
+ token?: string;
65
+ headers?: Record<string, string>;
66
+ }
67
+ interface SandboxListOptions {
68
+ tags?: Record<string, string>;
69
+ }
70
+ interface SandboxDescriptor {
71
+ provider: SandboxProviderName;
72
+ id: string;
73
+ state?: string;
74
+ tags: Record<string, string>;
75
+ createdAt?: string;
76
+ raw?: unknown;
77
+ }
78
+ interface SandboxOptionsBase {
79
+ tags?: Record<string, string>;
80
+ env?: Record<string, string>;
81
+ workingDir?: string;
82
+ idleTimeoutMs?: number;
83
+ autoStopMs?: number;
84
+ image?: string;
85
+ resources?: SandboxResourceSpec;
86
+ }
87
+ interface SandboxResourceSpec {
88
+ cpu?: number;
89
+ memoryMiB?: number;
90
+ }
91
+ interface LocalDockerProviderOptions {
92
+ name?: string;
93
+ command?: string[];
94
+ pull?: boolean;
95
+ autoRemove?: boolean;
96
+ binds?: string[];
97
+ networkMode?: string;
98
+ publishedPorts?: number[];
99
+ }
100
+ interface ModalProviderOptions {
101
+ appName?: string;
102
+ environment?: string;
103
+ endpoint?: string;
104
+ tokenId?: string;
105
+ tokenSecret?: string;
106
+ encryptedPorts?: number[];
107
+ unencryptedPorts?: number[];
108
+ command?: string[];
109
+ verbose?: boolean;
110
+ }
111
+ interface DaytonaProviderOptions {
112
+ apiKey?: string;
113
+ jwtToken?: string;
114
+ organizationId?: string;
115
+ apiUrl?: string;
116
+ target?: string;
117
+ name?: string;
118
+ language?: string;
119
+ user?: string;
120
+ public?: boolean;
121
+ }
122
+ interface VercelGitSource {
123
+ url: string;
124
+ depth?: number;
125
+ revision?: string;
126
+ username?: string;
127
+ password?: string;
128
+ }
129
+ interface VercelProviderOptions {
130
+ token?: string;
131
+ teamId?: string;
132
+ projectId?: string;
133
+ runtime?: string;
134
+ snapshotId?: string;
135
+ timeoutMs?: number;
136
+ gitSource?: VercelGitSource;
137
+ /**
138
+ * Ports to declare at sandbox creation time. The Vercel SDK requires ports
139
+ * to be known upfront; runtime-opened ports are not supported. Max 4.
140
+ */
141
+ ports?: number[];
142
+ /**
143
+ * Vercel Deployment Protection bypass token. When set, every request the
144
+ * agent transports send through the sandbox preview URL will include
145
+ * `x-vercel-protection-bypass: <token>`. Required when the linked Vercel
146
+ * project has Deployment Protection enabled — without it, POST requests
147
+ * to sandbox-exposed ports come back 200 + empty body.
148
+ */
149
+ protectionBypass?: string;
150
+ }
151
+ interface E2bProviderOptions {
152
+ apiKey?: string;
153
+ accessToken?: string;
154
+ domain?: string;
155
+ apiUrl?: string;
156
+ sandboxUrl?: string;
157
+ debug?: boolean;
158
+ requestTimeoutMs?: number;
159
+ headers?: Record<string, string>;
160
+ timeoutMs?: number;
161
+ lifecycle?: {
162
+ onTimeout?: "pause" | "kill";
163
+ autoResume?: boolean;
164
+ };
165
+ secure?: boolean;
166
+ allowInternetAccess?: boolean;
167
+ }
168
+ interface LocalDockerSandboxOptions extends SandboxOptionsBase {
169
+ provider?: LocalDockerProviderOptions;
170
+ }
171
+ interface ModalSandboxOptions extends SandboxOptionsBase {
172
+ provider?: ModalProviderOptions;
173
+ }
174
+ interface DaytonaSandboxOptions extends SandboxOptionsBase {
175
+ provider?: DaytonaProviderOptions;
176
+ }
177
+ interface VercelSandboxOptions extends SandboxOptionsBase {
178
+ provider?: VercelProviderOptions;
179
+ }
180
+ interface E2bSandboxOptions extends SandboxOptionsBase {
181
+ provider?: E2bProviderOptions;
182
+ }
183
+ type SandboxOptionsMap = {
184
+ "local-docker": LocalDockerSandboxOptions;
185
+ modal: ModalSandboxOptions;
186
+ daytona: DaytonaSandboxOptions;
187
+ vercel: VercelSandboxOptions;
188
+ e2b: E2bSandboxOptions;
189
+ };
190
+ type SandboxOptions<P extends SandboxProviderName = SandboxProviderName> = SandboxOptionsMap[P];
191
+ type SandboxRawMap = {
192
+ "local-docker": DockerRaw;
193
+ modal: ModalRaw;
194
+ daytona: DaytonaRaw;
195
+ vercel: VercelRaw;
196
+ e2b: E2bRaw;
197
+ };
198
+ type SandboxRaw<P extends SandboxProviderName = SandboxProviderName> = SandboxRawMap[P];
199
+
200
+ declare class Sandbox<P extends SandboxProviderName = SandboxProviderName> {
201
+ private readonly providerName;
202
+ private readonly options;
203
+ private readonly adapter;
204
+ constructor(providerName: P, options: SandboxOptions<P>);
205
+ get provider(): P;
206
+ get optionsSnapshot(): SandboxOptions<P>;
207
+ get id(): string | undefined;
208
+ get raw(): SandboxRaw<P> | undefined;
209
+ openPort(port: number): Promise<this>;
210
+ setSecret(name: string, value: string): this;
211
+ setSecrets(values: Record<string, string>): this;
212
+ gitClone(options: GitCloneOptions): Promise<CommandResult>;
213
+ run(command: string | string[], options?: CommandOptions): Promise<CommandResult>;
214
+ runAsync(command: string | string[], options?: CommandOptions): Promise<AsyncCommandHandle>;
215
+ list(options?: SandboxListOptions): Promise<SandboxDescriptor[]>;
216
+ snapshot(): Promise<string | null>;
217
+ stop(): Promise<void>;
218
+ delete(): Promise<void>;
219
+ getPreviewLink(port: number): Promise<string>;
220
+ get previewHeaders(): Record<string, string>;
221
+ uploadFile(content: Buffer | string, targetPath: string): Promise<void>;
222
+ downloadFile(sourcePath: string): Promise<Buffer>;
223
+ }
224
+
225
+ export { type AsyncCommandHandle as A, type CommandEvent as C, type DaytonaProviderOptions as D, type E2bProviderOptions as E, type GitCloneOptions as G, type LocalDockerProviderOptions as L, type ModalProviderOptions as M, Sandbox as S, type VercelGitSource as V, type CommandOptions as a, type CommandResult as b, type DaytonaSandboxOptions as c, type E2bSandboxOptions as d, type LocalDockerSandboxOptions as e, type ModalSandboxOptions as f, type SandboxDescriptor as g, type SandboxListOptions as h, type SandboxOptions as i, type SandboxOptionsBase as j, type SandboxOptionsMap as k, type SandboxProviderName as l, type SandboxRaw as m, type SandboxRawMap as n, type SandboxResourceSpec as o, type VercelProviderOptions as p, type VercelSandboxOptions as q };
@@ -0,0 +1,39 @@
1
+ import { m as AgentProviderName, f as AgentOptions, q as AgentRunConfig, p as AgentRun, o as AgentResult, Z as RawAgentEvent } from '../types-Et22oPap.js';
2
+ export { a as AgentApprovalMode, b as AgentCommandConfig, c as AgentExecutionRequest, d as AgentLocalMcpConfig, e as AgentMcpConfig, g as AgentOptionsBase, h as AgentOptionsMap, i as AgentPermissionDecision, j as AgentPermissionKind, k as AgentPermissionResponse, l as AgentProviderAdapter, n as AgentRemoteMcpConfig, r as AgentRunSink, s as AgentSkillConfig, t as AgentSubAgentConfig, C as ClaudeCodeAgentOptions, u as ClaudeCodeHookConfig, v as ClaudeCodeHookEvent, w as ClaudeCodeHookHandler, x as ClaudeCodeHookMatcherGroup, y as ClaudeCodeHooksConfig, z as ClaudeCodeProviderOptions, B as CodexAgentOptions, D as CodexCommandHook, E as CodexHookEvent, F as CodexHookMatcherGroup, G as CodexHooksConfig, H as CodexProviderOptions, I as DataContent, J as EmbeddedSkillConfig, K as FilePart, L as ImagePart, S as OpenCodeAgentOptions, T as OpenCodePluginConfig, U as OpenCodePluginEvent, V as OpenCodePluginHookConfig, W as OpenCodeProviderOptions, $ as RepoSkillConfig, a4 as TextPart, a8 as UserContent, a9 as UserContentPart } from '../types-Et22oPap.js';
3
+ export { AgentProvider } from '../enums.js';
4
+ import '../Sandbox-BQX-sWzs.js';
5
+ import 'e2b';
6
+ import '@vercel/sandbox';
7
+ import '@daytonaio/sdk';
8
+ import 'modal';
9
+ import 'dockerode';
10
+
11
+ declare class Agent<P extends AgentProviderName = AgentProviderName> {
12
+ private readonly adapter;
13
+ private readonly provider;
14
+ private readonly options;
15
+ constructor(provider: P, options: AgentOptions<P>);
16
+ stream(runConfig: AgentRunConfig): AgentRun;
17
+ run(runConfig: AgentRunConfig): Promise<AgentResult>;
18
+ rawEvents(runConfig: AgentRunConfig): AsyncIterable<RawAgentEvent>;
19
+ }
20
+
21
+ /**
22
+ * Ports each agent harness needs exposed on its sandbox in order to reach
23
+ * its app-server (or equivalent local server). These are used to:
24
+ *
25
+ * 1. Drive `sandbox.openPort(...)` at `Agent` construction time so providers
26
+ * whose `openPort` only mutates options before provisioning (Modal) still
27
+ * include the port.
28
+ * 2. Pre-declare the ports on Modal sandboxes by default so that a Modal
29
+ * sandbox created without explicit `unencryptedPorts` still works when
30
+ * the caller later points an `Agent` at it.
31
+ *
32
+ * Exported so callers can forward the ports to sandbox creation options when
33
+ * they know in advance which harness will be used (e.g.
34
+ * `provider.unencryptedPorts: AGENT_RESERVED_PORTS.codex`).
35
+ */
36
+ declare const AGENT_RESERVED_PORTS: Record<AgentProviderName, readonly number[]>;
37
+ declare function collectAllAgentReservedPorts(): number[];
38
+
39
+ export { AGENT_RESERVED_PORTS, Agent, AgentOptions, AgentProviderName, AgentResult, AgentRun, AgentRunConfig, collectAllAgentReservedPorts };
@@ -0,0 +1,18 @@
1
+ import {
2
+ Agent
3
+ } from "../chunk-G27423WX.js";
4
+ import "../chunk-7FLLQJ6J.js";
5
+ import {
6
+ AGENT_RESERVED_PORTS,
7
+ collectAllAgentReservedPorts
8
+ } from "../chunk-O7HCJXKW.js";
9
+ import "../chunk-NSJM57Z4.js";
10
+ import {
11
+ AgentProvider
12
+ } from "../chunk-2NKMDGYH.js";
13
+ export {
14
+ AGENT_RESERVED_PORTS,
15
+ Agent,
16
+ AgentProvider,
17
+ collectAllAgentReservedPorts
18
+ };