Skip to content
Français

SandboxContext

import type { SandboxContext } from "@elie-laloum/outpost";
  • registerRecoveryOptional
    ((resourceId: string) => Promise<void>) | undefined
    Records a stable resource ID, at most 1024 characters, so recover() can remove the resource after a crash. Outpost supplies it only during durable speculation: await it once before allocating, and do not allocate if it rejects.
  • repositoryRequired
    string
    Host path of the target Git repository.
  • directoryRequired
    string
    Host path of the worktree this sandbox works on; a mounted provider exposes it at the lease root.
  • gitDirectoriesRequired
    readonly string[]
    Host Git directories the worktree needs, its own first and the common directory last. A mounted provider exposes them so git works in the sandbox.
  • variablesRequired
    Readonly<Record<string, string>>
    Environment for every command: resolved .outpost/.env values, the provider’s variables and the Git author and committer identity. Agent variables are added per command.
  • signalOptional
    AbortSignal | undefined
    Aborts the acquisition; release anything already allocated before rejecting.
export interface SandboxContext {
  readonly registerRecovery?: (resourceId: string) => Promise<void>;
  readonly repository: string;
  readonly directory: string;
  readonly gitDirectories: readonly string[];
  readonly variables: Variables;
  readonly signal?: AbortSignal;
}