Skip to content

E2bSandboxProvider

E2B sandboxes, resumed through provider-owned metadata and stopped with filesystem-only persistence so processes do not return on resume. E2B assigns its own machine IDs; logical IDs are metadata, not an atomic distributed name reservation. See the package README.

Since v0.1.0

Constructs the provider using Effect’s Crypto service for generated logical IDs. Templates prepare each sandbox before its requested network policy is applied.

Signature

declare const make: (
options: Options
) => Effect.Effect<
{
readonly create: <E = never>(
options?: SandboxProvider.CreateOptions<E>
) => Effect.Effect<Sandbox.Sandbox["Service"], SandboxError.SandboxError | E>
readonly createScoped: <E = never>(
options?: SandboxProvider.CreateOptions<E>
) => Effect.Effect<Sandbox.Sandbox["Service"], SandboxError.SandboxError | E, Scope>
readonly resume: (id: Sandbox.SandboxId) => Effect.Effect<Sandbox.Sandbox["Service"], SandboxError.SandboxError>
},
never,
Crypto.Crypto
>

Source

Since v0.1.0

Provides sandboxes through E2B using make.

Signature

declare const layer: (options: Options) => Layer.Layer<SandboxProvider.SandboxProvider, never, Crypto.Crypto>

Source

Since v0.1.0

Connection settings and defaults for machines created by this provider.

Signature

export interface Options {
readonly apiKey: Redacted.Redacted<string>
readonly apiUrl?: string
readonly domain?: string
/** E2B template or snapshot ID; defaults to E2B's base image. */
readonly template?: string
/** E2B's running lifetime; defaults to one hour, then pauses with files preserved. */
readonly timeoutMs?: number
readonly requestTimeoutMs?: number
}

Source

Since v0.1.0

Overrides under providerOptions.e2b. Invalid options fail before any allocation.

Signature

declare const ProviderOptions: Schema.Struct<{
readonly template: Schema.optionalKey<Schema.String>
readonly timeoutMs: Schema.optionalKey<Schema.Int>
}>

Source

Since v0.1.0

Signature

type ProviderOptions = typeof ProviderOptions.Type

Source

Since v0.1.0