Skip to content
Français

createMemorySandboxProvider

import { createMemorySandboxProvider } from "@elie-laloum/outpost/testing";

Create a provider that simulates sandbox commands without starting an agent CLI or arbitrary subprocess. Scripted agent turns bypass the command queue; other invocations consume commands in order across all acquired leases, matching executable and arguments exactly. Unexpected commands throw code provider without consuming an entry. Git workspaces and scripted commits use the real host filesystem and Git. File transfers, terminals, live input and elevation are refused. Invocation honors cancellation, deadlines and output retention. Release cancels active work and is idempotent; no container or network isolation is provided.

Complete example and detailed rules.

  • optionsOptional
    MemorySandboxOptions | undefined
    Optional predefined command results. A fresh provider starts with an unconsumed command queue.
  • options.commandsOptional
    readonly MemoryCommand[] | undefined
    Ordered queue of exact executable/argument matches and their simulated results, shared across leases of this provider. Defaults to empty; scripted agent requests do not consume it.

SandboxProvider

export declare function createMemorySandboxProvider(
  options?: MemorySandboxOptions,
): SandboxProvider;