agent-neckbeard 1.1.27 → 1.1.28

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/dist/index.d.cts CHANGED
@@ -1,5 +1,7 @@
1
1
  import { Buffer } from 'node:buffer';
2
2
  import { S as SandboxFileContent$1, a as SandboxCommandOptions, b as SandboxCommandResult, c as SandboxDetachedCommandOptions, d as SandboxDetachedCommand } from './sandbox-capabilities-CFjnZ_kB.cjs';
3
+ import { S as StartTurnRequest, T as TurnRecord, a as TurnHealth, b as ServedSession, c as ServeHandle } from './serve-Dan1HQKN.cjs';
4
+ export { P as PiTurnResult, d as TURN_PROTOCOL_VERSION, e as TurnOutcome, g as getPiTurnResult } from './serve-Dan1HQKN.cjs';
3
5
 
4
6
  /** Sandbox providers supported by the public and in-sandbox runtimes. */
5
7
  type SandboxProvider = 'e2b' | 'daytona' | 'modal' | 'docker';
@@ -89,12 +91,285 @@ interface ModalClientCredentials {
89
91
  }
90
92
  type ModalSandboxCreateOptions = ModalSandboxConfig & ModalClientCredentials & {
91
93
  envs?: Record<string, string | undefined>;
94
+ /**
95
+ * Runs as the sandbox's main process, with `template` used as-is: no setup layer and no
96
+ * working directory override. For images that already contain everything, as `Agent` uses.
97
+ */
98
+ command?: string[];
99
+ /** Name of a Modal Secret with `REGISTRY_USERNAME` and `REGISTRY_PASSWORD`, to pull a private `template`. */
100
+ registrySecret?: string;
92
101
  };
93
102
  type ModalSandboxConnectOptions = ModalClientCredentials & {
94
103
  provider: 'modal';
95
104
  sandboxId: string;
96
105
  };
97
106
 
107
+ type DaytonaCreateOptions = Extract<SandboxClientCreateOptions, {
108
+ provider: 'daytona';
109
+ }>;
110
+ type E2bCreateOptions = Extract<SandboxClientCreateOptions, {
111
+ provider: 'e2b';
112
+ }>;
113
+ /** The Modal sandbox options `Agent` passes through; the image is its `template`. */
114
+ interface ModalAgentSandbox extends Pick<ModalSandboxCreateOptions, 'provider' | 'appName' | 'environment' | 'timeoutMs' | 'cpu' | 'memoryMiB' | 'regions' | 'networkBlockAll' | 'networkAllowList' | 'domainAllowList' | 'registrySecret'> {
115
+ }
116
+ interface DaytonaAgentSandbox extends Pick<DaytonaSandboxConfig, 'provider' | 'networkBlockAll' | 'networkAllowList' | 'domainAllowList' | 'autoStopInterval' | 'autoDeleteInterval'>, Pick<DaytonaCreateOptions, 'apiKey'> {
117
+ /** Snapshot resources: vCPUs, and memory and disk in GiB. */
118
+ resources?: {
119
+ cpu?: number;
120
+ memory?: number;
121
+ disk?: number;
122
+ };
123
+ }
124
+ interface E2bAgentSandbox extends Pick<E2bCreateOptions, 'provider' | 'apiKey' | 'timeoutMs'> {
125
+ /** Template resources. */
126
+ cpuCount?: number;
127
+ memoryMB?: number;
128
+ /** Credentials E2B uses to pull a private image when it builds the template. */
129
+ registry?: {
130
+ username: string;
131
+ password: string;
132
+ };
133
+ }
134
+ type AgentSandbox = ModalAgentSandbox | DaytonaAgentSandbox | E2bAgentSandbox;
135
+ interface AgentOptions {
136
+ /** Names this agent's Daytona snapshots and E2B templates; lowercase letters, digits, and dashes. */
137
+ name: string;
138
+ /** Registry image with the agent and `serve()`, such as `ghcr.io/acme/agent:<commit>`. */
139
+ image: string;
140
+ sandbox: AgentSandbox;
141
+ /** Starts the runtime in the image. Defaults to `node /app/agent.mjs`. */
142
+ command?: string[];
143
+ /** Port `serve()` listens on, passed to it as `NECKBEARD_PORT`. Defaults to 8080. */
144
+ port?: number;
145
+ /** Environment of every sandbox. Secrets go here or in `start()`, never in the image. */
146
+ envs?: Record<string, string | undefined>;
147
+ /** How long `start()` waits for the runtime to answer. Defaults to two minutes. */
148
+ startTimeoutMs?: number;
149
+ /** How long `prepare()` waits for a Daytona snapshot or E2B template build. Defaults to 30 minutes. */
150
+ prepareTimeoutMs?: number;
151
+ }
152
+ interface StartOptions {
153
+ envs?: Record<string, string | undefined>;
154
+ /** Names the conversation a persisted Pi session keeps, given to the runtime as `NECKBEARD_SESSION_ID`. */
155
+ sessionId?: string;
156
+ signal?: AbortSignal;
157
+ }
158
+ interface RunOptions<TEvent> extends Omit<TurnStreamOptions, 'after'> {
159
+ /** Receives each record as it streams, for example to store or show it, keyed by `seq`. */
160
+ onRecord?: (record: TurnRecord<TEvent>) => void | Promise<void>;
161
+ }
162
+ interface TurnStreamOptions {
163
+ /** Stops reading the stream; the turn keeps running. Use `abort()` to stop the turn. */
164
+ signal?: AbortSignal;
165
+ /** Resume after this record's `seq`. Defaults to -1, the start of the turn. */
166
+ after?: number;
167
+ /**
168
+ * How long to keep reconnecting without a healthy connection. Defaults to two minutes. A
169
+ * connection that sends nothing, not even the runtime's heartbeat every 15 seconds, for this long
170
+ * is abandoned, so keep it above 15 seconds.
171
+ */
172
+ reconnectTimeoutMs?: number;
173
+ }
174
+ /**
175
+ * Runs a Pi agent from a prebuilt image whose main process is `serve()` from
176
+ * `agent-neckbeard/serve`. Every method takes the sandbox ID, so any host process can drive a
177
+ * sandbox another one started.
178
+ */
179
+ declare class Agent<TEvent = unknown> {
180
+ private readonly options;
181
+ readonly name: string;
182
+ readonly image: string;
183
+ readonly command: string[];
184
+ readonly port: number;
185
+ private readonly endpoints;
186
+ private preparing?;
187
+ constructor(options: AgentOptions);
188
+ get provider(): AgentSandbox['provider'];
189
+ /**
190
+ * Name of the Daytona snapshot or E2B template for this image, command, and resources. Equal
191
+ * inputs share one, so preparing again is a lookup.
192
+ */
193
+ get artifactName(): string;
194
+ /**
195
+ * Creates the Daytona snapshot or E2B template for the image if it is missing and waits until
196
+ * it can start sandboxes. Run it from CI after pushing the image so no sandbox waits on a
197
+ * build. Modal pulls the image directly, so this does nothing there. `refresh` builds it again
198
+ * even when it exists, as after pushing new contents under a tag it was built from, since its
199
+ * name comes from the image's reference, not its contents.
200
+ */
201
+ prepare(options?: {
202
+ signal?: AbortSignal;
203
+ onLog?: (line: string) => void;
204
+ refresh?: boolean;
205
+ }): Promise<void>;
206
+ /** Starts a sandbox from the image and waits for its runtime. Returns the sandbox ID. */
207
+ start(options?: StartOptions): Promise<string>;
208
+ /**
209
+ * Starts a turn and streams its records until its `end` record. Starting a turn whose
210
+ * `turnId` the runtime already has resumes it instead of running it again.
211
+ */
212
+ prompt(sandboxId: string, turn: StartTurnRequest, options?: TurnStreamOptions): AsyncGenerator<TurnRecord<TEvent>>;
213
+ /**
214
+ * Runs a Pi turn to its end and returns its final assistant text, or null when it had none.
215
+ * Throws `ExecutionError` when the turn did not complete or its model did not stop on its own.
216
+ * Running a turn again with the same `turnId` replays its records from the start.
217
+ */
218
+ run(sandboxId: string, turn: StartTurnRequest, options?: RunOptions<TEvent>): Promise<string | null>;
219
+ /**
220
+ * Streams a turn's records after `options.after` until its `end` record, reconnecting when
221
+ * the connection drops. Throws `TurnLostError` when the runtime no longer has the turn.
222
+ */
223
+ events(sandboxId: string, turnId: string, options?: TurnStreamOptions): AsyncGenerator<TurnRecord<TEvent>>;
224
+ /** Asks the runtime to stop the turn; its stream then ends with an `aborted` record. */
225
+ abort(sandboxId: string, turnId: string, signal?: AbortSignal): Promise<void>;
226
+ health(sandboxId: string, signal?: AbortSignal): Promise<TurnHealth>;
227
+ /** Waits until no turn runs, for example before reading files a turn writes. */
228
+ waitForIdle(sandboxId: string, options?: {
229
+ timeoutMs?: number;
230
+ signal?: AbortSignal;
231
+ }): Promise<void>;
232
+ /**
233
+ * Deletes the sandbox without starting it. One that is already gone counts as deleted; any other
234
+ * failure throws, so cleanup can be retried, since a Daytona sandbox need not expire on its own.
235
+ */
236
+ kill(sandboxId: string): Promise<void>;
237
+ /** File and command access to a sandbox, for staging inputs and reading results. */
238
+ sandbox(sandboxId: string): Promise<SandboxClient>;
239
+ /**
240
+ * Deletes this agent's Daytona snapshots or E2B templates except the newest `keep` and the
241
+ * current one. Returns the names it deleted.
242
+ */
243
+ gc(options?: {
244
+ keep?: number;
245
+ alsoKeep?: string[];
246
+ }): Promise<string[]>;
247
+ private createSandbox;
248
+ private startE2bRuntime;
249
+ private waitForRuntime;
250
+ private endpoint;
251
+ private request;
252
+ private prepareDaytonaSnapshot;
253
+ private prepareE2bTemplate;
254
+ private listDaytonaSnapshots;
255
+ private e2bTemplates;
256
+ private listE2bTemplates;
257
+ }
258
+
259
+ /** Where `neckbeard build` installs an agent's skills in its image. */
260
+ declare const SKILLS_DIR = "/app/.agents/skills";
261
+ /**
262
+ * The image tag a host should run: `NECKBEARD_IMAGE_TAG`, else the commit its platform deployed,
263
+ * which is the commit CI tagged the image with.
264
+ */
265
+ declare function resolveImageTag(env?: NodeJS.ProcessEnv): string | undefined;
266
+ type ThinkingLevel = 'off' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
267
+ /** A Pi session for `defineAgent()` to create in the sandbox. */
268
+ interface PiSessionConfig {
269
+ /** `provider/model`, such as `openai/gpt-6.1-sol`. */
270
+ model: string;
271
+ thinkingLevel?: ThinkingLevel;
272
+ /** Pi's built-in tools to enable, such as `read` and `bash`. */
273
+ tools?: string[];
274
+ systemPrompt: string;
275
+ /**
276
+ * The working directory, relative to the sandbox user's home unless absolute. Created before the
277
+ * session, and exported to the agent's commands as `NECKBEARD_CWD`. Defaults to `workspace`.
278
+ */
279
+ cwd?: string;
280
+ /**
281
+ * Keeps the conversation in a file named for the `sessionId` passed to `start()`, so a restarted
282
+ * runtime, or a sandbox restored from a copy of the file, continues it. See `sessionFilePath()`.
283
+ * Otherwise the conversation lives in memory for the sandbox's life.
284
+ */
285
+ persist?: boolean;
286
+ }
287
+ /** An agent: its image, sandbox, and either a Pi session config or its own session factory. */
288
+ interface AgentDefinition {
289
+ /** Names the image and the provider's snapshots or templates; lowercase letters, digits, and dashes. */
290
+ name: string;
291
+ /** Registry the image lives under, such as `ghcr.io/acme`; the image is `<registry>/<name>:<tag>`. */
292
+ registry?: string;
293
+ /** A full image reference instead of `registry`, such as one built elsewhere. */
294
+ image?: string;
295
+ /** The sandbox, or a function returning it, read only on the host. */
296
+ sandbox: AgentSandbox | (() => AgentSandbox);
297
+ /**
298
+ * Environment of every sandbox, or a function returning it, read only on the host, so the image
299
+ * needs none of the host's configuration. Never secrets in the image. A `pi` agent is traced in
300
+ * Braintrust when this has BRAINTRUST_API_KEY and BRAINTRUST_PROJECT_NAME; see docs/AGENT.md#tracing.
301
+ */
302
+ envs?: Record<string, string | undefined> | (() => Record<string, string | undefined>);
303
+ /** The image's main process. Defaults to `node /app/agent.mjs`, the entry point `neckbeard build` writes. */
304
+ command?: string[];
305
+ /** The port the runtime listens on, given to it as NECKBEARD_PORT. Defaults to 8080. */
306
+ port?: number;
307
+ /** How long `start()` waits for the runtime to answer. Defaults to two minutes. */
308
+ startTimeoutMs?: number;
309
+ /** How long `prepare()` may take to create a Daytona snapshot or E2B template. Defaults to 30 minutes. */
310
+ prepareTimeoutMs?: number;
311
+ /** Ends a turn that runs longer as failed. */
312
+ maxTurnDurationMs?: number;
313
+ /** See `ServeOptions.abortGraceMs`. */
314
+ abortGraceMs?: number;
315
+ /** The agent's Pi session. */
316
+ pi?: PiSessionConfig;
317
+ /** Creates the session instead of `pi`, for one that config can't express. */
318
+ createSession?: () => Promise<ServedSession>;
319
+ build?: {
320
+ /** Packages the image installs instead of bundling; Pi's always are, and for a `pi` agent Braintrust when its package depends on it. */
321
+ external?: string[];
322
+ /** The Dockerfile `neckbeard push` builds the image with, relative to the package. Defaults to `sandbox/Dockerfile`. */
323
+ dockerfile?: string;
324
+ };
325
+ }
326
+ declare const definedAgentMarker: unique symbol;
327
+ /**
328
+ * An agent defined once for both sides. On the host it starts sandboxes and runs turns, building
329
+ * its `Agent` the first time one is needed, so importing it in the image requires no image tag or
330
+ * host configuration. In the image, `serve()` serves its session.
331
+ */
332
+ declare class DefinedAgent<TEvent = unknown> {
333
+ readonly definition: AgentDefinition;
334
+ readonly [definedAgentMarker] = true;
335
+ private client?;
336
+ private braintrustChecked;
337
+ constructor(definition: AgentDefinition);
338
+ get name(): string;
339
+ /** The image this host runs: `image`, else `<registry>/<name>:<tag>` with the tag `resolveImageTag()` finds. */
340
+ imageRef(tag?: string | undefined): string;
341
+ /** The `Agent` for an image, by default the one this host runs. */
342
+ forImage(image?: string): Agent<TEvent>;
343
+ private get agent();
344
+ get artifactName(): string;
345
+ prepare(options?: Parameters<Agent<TEvent>['prepare']>[0]): Promise<void>;
346
+ start(options?: StartOptions): Promise<string>;
347
+ prompt(sandboxId: string, turn: StartTurnRequest, options?: TurnStreamOptions): AsyncGenerator<TurnRecord<TEvent>>;
348
+ run(sandboxId: string, turn: StartTurnRequest, options?: RunOptions<TEvent>): Promise<string | null>;
349
+ events(sandboxId: string, turnId: string, options?: TurnStreamOptions): AsyncGenerator<TurnRecord<TEvent>>;
350
+ abort(sandboxId: string, turnId: string, signal?: AbortSignal): Promise<void>;
351
+ health(sandboxId: string, signal?: AbortSignal): Promise<TurnHealth>;
352
+ waitForIdle(sandboxId: string, options?: {
353
+ timeoutMs?: number;
354
+ signal?: AbortSignal;
355
+ }): Promise<void>;
356
+ kill(sandboxId: string): Promise<void>;
357
+ sandbox(sandboxId: string): ReturnType<Agent<TEvent>['sandbox']>;
358
+ gc(options?: {
359
+ keep?: number;
360
+ alsoKeep?: string[];
361
+ }): Promise<string[]>;
362
+ /** Where a persisted session's file is in a sandbox whose home is `homeDir`, as for copying it out and back. */
363
+ sessionFilePath(homeDir: string, sessionId: string): string;
364
+ /** Serves the agent's session; the image's entry point, which `neckbeard build` generates, calls it. */
365
+ serve(options?: {
366
+ port?: number;
367
+ host?: string;
368
+ }): Promise<ServeHandle>;
369
+ }
370
+ declare function defineAgent<TEvent = unknown>(definition: AgentDefinition): DefinedAgent<TEvent>;
371
+ declare function isDefinedAgent(value: unknown): value is DefinedAgent<unknown>;
372
+
98
373
  interface DockerSandboxConfig {
99
374
  provider: 'docker';
100
375
  /** Debian-compatible image with Node.js/npm for `Agent`; defaults to node:22-bookworm. */
@@ -137,7 +412,9 @@ declare class NeckbeardError extends Error {
137
412
  */
138
413
  declare class DeploymentError extends NeckbeardError {
139
414
  readonly cause?: Error | undefined;
140
- constructor(message: string, cause?: Error | undefined);
415
+ readonly sandboxId?: string | undefined;
416
+ /** A sandbox the failure left behind, for `kill()`. */
417
+ constructor(message: string, cause?: Error | undefined, sandboxId?: string | undefined);
141
418
  }
142
419
  /**
143
420
  * Error thrown when input or output schema validation fails.
@@ -160,6 +437,13 @@ declare class ExecutionError extends NeckbeardError {
160
437
  declare class RuntimeBusyError extends ExecutionError {
161
438
  constructor(message: string);
162
439
  }
440
+ /**
441
+ * Thrown when a sandbox's runtime no longer knows a turn, because the sandbox restarted or was
442
+ * replaced. The turn's outcome is unknown.
443
+ */
444
+ declare class TurnLostError extends ExecutionError {
445
+ constructor(message: string);
446
+ }
163
447
  /**
164
448
  * Error thrown when required environment variables are missing.
165
449
  */
@@ -247,6 +531,9 @@ interface ResolveAgentSourceFileOptions {
247
531
  */
248
532
  sandboxSourceFile?: string;
249
533
  }
534
+ /**
535
+ * @deprecated Only `LegacyBundledAgent` needs it; `Agent` runs a prebuilt image.
536
+ */
250
537
  declare function resolveAgentSourceFile(candidates: string[], options?: ResolveAgentSourceFileOptions): string;
251
538
  type NextConfigObject = {
252
539
  outputFileTracingIncludes?: Record<string, unknown>;
@@ -265,6 +552,9 @@ type NextWebpackContext = Record<string, unknown> & {
265
552
  isServer?: boolean;
266
553
  };
267
554
  type NextWebpackFunction = (config: NextWebpackConfig, context: NextWebpackContext) => NextWebpackConfig;
555
+ /**
556
+ * @deprecated Only `LegacyBundledAgent` needs it; `Agent` runs a prebuilt image.
557
+ */
268
558
  declare function withNeckbeardNextConfig<TConfig extends NextConfigObject>(nextConfig: TConfig, options: NeckbeardNextConfigOptions): TConfig & NextConfigObject;
269
559
  /**
270
560
  * Configuration for downloading a file into the sandbox filesystem.
@@ -394,7 +684,7 @@ interface AgentSessionHandler<TInput, TFrame> {
394
684
  }
395
685
  /**
396
686
  * Attached-session agent config. The sandbox runtime emits typed events for
397
- * sequential caller-owned turns created with `Agent.createSession()`.
687
+ * sequential caller-owned turns created with `LegacyBundledAgent.createSession()`.
398
688
  */
399
689
  interface SessionAgentConfig<TInput, TFrame> extends AgentSharedConfig<TInput> {
400
690
  session: AgentSessionHandler<TInput, TFrame>;
@@ -465,10 +755,12 @@ interface DaytonaSandboxConfig {
465
755
  }
466
756
  type SandboxConfig = E2BSandboxConfig | DaytonaSandboxConfig | ModalSandboxConfig | DockerSandboxConfig;
467
757
  /**
468
- * Agent config accepted by `new Agent(config)`. Can be either a structured task
758
+ * Agent config accepted by `new LegacyBundledAgent(config)`. Can be either a structured task
469
759
  * (`run`) or an attached-session handler (`session.handler`). Both run behind
470
760
  * the same persistent in-sandbox HTTP server.
471
761
  * The deprecated `server.handler` spelling remains accepted.
762
+ *
763
+ * @deprecated Use `Agent` with a prebuilt image and its `AgentOptions`.
472
764
  */
473
765
  type AgentConfig<TInput, TOutput, TFrame = unknown> = RunAgentConfig<TInput, TOutput> | SessionAgentConfig<TInput, TFrame> | ServerAgentConfig<TInput, TFrame>;
474
766
  type SandboxClientCreateOptions = ModalSandboxCreateOptions | DockerSandboxCreateOptions | {
@@ -503,6 +795,11 @@ type SandboxClientConnectOptions = ModalSandboxConnectOptions | DockerSandboxCon
503
795
  apiKey?: string;
504
796
  createTimeoutSec?: number;
505
797
  };
798
+ interface SandboxServerEndpoint {
799
+ url: string;
800
+ headers: Record<string, string>;
801
+ query: Record<string, string>;
802
+ }
506
803
  declare class SandboxClient {
507
804
  private readonly handle;
508
805
  private constructor();
@@ -584,6 +881,11 @@ declare class SandboxClient {
584
881
  */
585
882
  disposeSessionArtifacts(command: SandboxDetachedCommand): Promise<void>;
586
883
  setTimeout(timeoutMs: number): Promise<void>;
884
+ /**
885
+ * Where to reach an HTTP server the sandbox runs on `port`, with the provider's auth: send
886
+ * `headers` with every request and add `query` to every URL.
887
+ */
888
+ getServerEndpoint(port: number): Promise<SandboxServerEndpoint>;
587
889
  kill(): Promise<void>;
588
890
  destroy(): Promise<void>;
589
891
  }
@@ -592,7 +894,11 @@ type AgentMode = 'run' | 'stream';
592
894
  type AgentKind = 'task' | 'session';
593
895
  /** @deprecated Durable sessions use the separate, deprecated supervisor deployment API. */
594
896
  type SessionDurability = 'attached' | 'durable';
595
- declare class Agent<TInput, TOutput = unknown, TFrame = unknown> {
897
+ /**
898
+ * @deprecated Bundles the agent's code on the host and uploads it, its dependencies, and its
899
+ * local directories at every deploy. Use `Agent` with a prebuilt image instead.
900
+ */
901
+ declare class LegacyBundledAgent<TInput, TOutput = unknown, TFrame = unknown> {
596
902
  readonly sandbox: SandboxConfig;
597
903
  readonly provider: SandboxProvider;
598
904
  readonly template: string;
@@ -661,7 +967,7 @@ declare class Agent<TInput, TOutput = unknown, TFrame = unknown> {
661
967
  *
662
968
  * @example
663
969
  * ```typescript
664
- * const agent = new Agent({ ... });
970
+ * const agent = new LegacyBundledAgent({ ... });
665
971
  * const sandboxId = await agent.deploy();
666
972
  * console.log(`Deployed to sandbox: ${sandboxId}`);
667
973
  *
@@ -729,4 +1035,4 @@ declare class Agent<TInput, TOutput = unknown, TFrame = unknown> {
729
1035
  }): AsyncGenerator<TFrame>;
730
1036
  }
731
1037
 
732
- export { Agent, type AgentConfig, type AgentKind, type AgentMode, type AgentRunContext, type AgentRunResult, type AgentSandboxContext, type AgentSessionHandler, type AttachedAgentSession, type BuildOptions, ConfigurationError, type CreateAttachedSessionOptions, DEFAULT_DEPENDENCIES, type DaytonaSandboxConfig, DeploymentError, type DockerSandboxConfig, type E2BSandboxConfig, ExecutionError, type FileDownload, type LocalDirectoryUpload, type ModalSandboxConfig, NeckbeardError, type NeckbeardNextConfigOptions, type OsDependencies, type ResolveAgentSourceFileOptions, type RunAgentConfig, RuntimeBusyError, SandboxClient, type SandboxClientConnectOptions, type SandboxClientCreateOptions, SandboxCommandOptions, SandboxCommandResult, type SandboxConfig, SandboxDetachedCommand, SandboxDetachedCommandOptions, type SandboxFileContent, type SandboxProvider, type ServerAgentConfig, type SessionAgentConfig, type SessionDurability, ValidationError, resolveAgentSourceFile, withNeckbeardNextConfig };
1038
+ export { Agent, type AgentConfig, type AgentDefinition, type AgentKind, type AgentMode, type AgentOptions, type AgentRunContext, type AgentRunResult, type AgentSandbox, type AgentSandboxContext, type AgentSessionHandler, type AttachedAgentSession, type BuildOptions, ConfigurationError, type CreateAttachedSessionOptions, DEFAULT_DEPENDENCIES, type DaytonaAgentSandbox, type DaytonaSandboxConfig, DefinedAgent, DeploymentError, type DockerSandboxConfig, type E2BSandboxConfig, type E2bAgentSandbox, ExecutionError, type FileDownload, LegacyBundledAgent, type LocalDirectoryUpload, type ModalAgentSandbox, type ModalSandboxConfig, NeckbeardError, type NeckbeardNextConfigOptions, type OsDependencies, type PiSessionConfig, type ResolveAgentSourceFileOptions, type RunAgentConfig, type RunOptions, RuntimeBusyError, SKILLS_DIR, SandboxClient, type SandboxClientConnectOptions, type SandboxClientCreateOptions, SandboxCommandOptions, SandboxCommandResult, type SandboxConfig, SandboxDetachedCommand, SandboxDetachedCommandOptions, type SandboxFileContent, type SandboxProvider, type SandboxServerEndpoint, type ServerAgentConfig, type SessionAgentConfig, type SessionDurability, type StartOptions, StartTurnRequest, TurnHealth, TurnLostError, TurnRecord, type TurnStreamOptions, ValidationError, defineAgent, isDefinedAgent, resolveAgentSourceFile, resolveImageTag, withNeckbeardNextConfig };