Skip to content
Français

inspectExecution

import { inspectExecution } from "@elie-laloum/outpost/core";

Plans an execution from sandbox options without allocating, uploading files or starting an agent. For file workspaces it reports the binding the source needs, what the sandbox provider offers, each agent’s declared file features, the requirements of the optional dispatch settings and every incompatibility; createSandbox() and dispatch() refuse the first diagnostic with the same message. Git options return the sandbox and agents with no file requirements. Extension providers are read from their runtime capabilities.

Complete example and detailed rules.

The fields below cover all variants; the signature specifies their allowed combinations.

  • optionsRequired
    FileSandboxOptions | SandboxOptions
    Options that createSandbox() would receive: Git options with repository or workspace, or file options with workspaceSource or a file workspace. The agent declared here is inspected unless settings selects another one.
  • options.hooksOptional
    LifecycleHooks | undefined
    Declared workspaceReady, hostReady and sandboxReady preparation commands.
  • options.limitsOptional
    Pick<StageLimits, "copyMs" | "collectMs"> | undefined | StageLimits | undefined
    Copy and collection deadlines for file execution; Git preparation and integration limits are refused.
  • options.observationOptional
    ObservationHub | undefined
    Explicit observation hub preserving scoped delivery and synchronous usage accounting.
  • options.loggingOptional
    Logging | undefined
    Declared execution journal; replayable file effects are refused when reproduction is unsupported.
  • options.activityTransportOptional
    Transport | undefined
    Transport for bounded resource activity observations; liveness does not authorize recovery.
  • options.recoveryTransportOptional
    Transport | undefined
    Explicit Transport retaining sandbox recovery evidence independently of file snapshots.
  • options.sandboxProviderVariant-dependent
    SandboxProvider | SandboxProvider | undefined
    Execution provider with the required file binding capability; legacy providers remain usable for Git.
  • options.agentOptional
    DispatchAgent | undefined
    Explicitly composed agent compatible with the selected file execution and conversation capabilities.
  • options.signalOptional
    AbortSignal | undefined
    Cancellation signal propagated to the operation and its process group; reusable sandboxes remain usable.
  • options.variablesVariant-dependent
    Readonly<Record<string, string>> | undefined
    Only explicitly declared environment variables reach the sandbox; no implicit .env loading.
  • options.workspaceVariant-dependent
    FileWorkspace | undefined | Workspace | undefined
    Open workspace borrowed for this operation; its caller remains responsible for closing it.
  • options.workspaceSourceVariant-dependent
    undefined | FileWorkspaceSource
    Declared source for an owned resource; mutually exclusive with borrowing an open workspace.
  • options.recoveryVariant-dependent
    FileWorkspaceRecoveryAuthorization | undefined
    Explicit stopped-process recovery authorization; interrupted replay remains a separate workflow decision.
  • options.storageQuotaVariant-dependent
    Omit<StorageReservationOptions, "signal"> | undefined
    Admission reservation through Transport; coordinates cooperating writers without enforcing a physical disk quota.
  • options.inputsVariant-dependent
    readonly WorkspaceInput[] | undefined
    Explicit file inputs; JSON workflow parameters are never implicitly written to disk.
  • options.runtimeVariant-dependent
    WorkspaceRuntimeOptions | undefined
    Control directory and logical namespace, separate from the workspace files.
  • options.pathsVariant-dependent
    readonly string[] | undefined
    Explicit relative path selection; copy selection does not implicitly apply .gitignore.
  • options.retentionVariant-dependent
    WorkspaceRetention | undefined
    run cleans successful owned work, local retains it, portable additionally requires an explicit Transport and namespace.
  • options.includeUncommittedVariant-dependent
    boolean | undefined
    Remote providers only: also send the managed worktree’s uncommitted changes and untracked, non-ignored files, default false. Without it, synchronization fails with code workspace when the sandbox touches one of those files, which includes any copies entry not ignored by a committed .gitignore.
  • options.bootstrapVariant-dependent
    boolean | undefined
    Install a built-in CLI agent missing from a remote sandbox, at its pinned version, before its first use; default true. Mounted and host providers never install: the CLI must be in the image or on the host.
  • options.conversationHomeVariant-dependent
    string | undefined
    Host directory used in place of your home directory to store and find captured native conversations. Default: your home directory for Claude and Codex transcripts, the repository for Copilot and Kimi session bundles.
  • options.guardVariant-dependent
    DiffGuard | undefined
    Optional committed-diff policy owned by this workspace and reused by every sandbox and agent. Requires named or integrate; current fails with code configuration before execution. Successful dispatches and terminal sessions check it after synchronization; integrate checks again under the merge lock. Refusal throws code guard and retains the branch and worktree when this workspace closes, even without preserve. Named workspaces compare their opening commit with the current commit across executions; integration workspaces compare the candidate with its unique merge base with the host, including inherited commits.
  • options.repositoryVariant-dependent
    string | undefined
    Path inside the host Git checkout, default the process working directory. Outpost works from the checkout’s top-level directory; an unavailable directory fails with code workspace.
  • options.branchVariant-dependent
    BranchPolicy | undefined
    Branch policy: current, named or integrate. Default { mode: “current” }; createSandbox() and dispatch() on a remote provider default to integrate.
  • options.copiesVariant-dependent
    readonly string[] | undefined
    Repository-relative files or directories copied from the host checkout into the new worktree before workspaceReady; missing entries are skipped. Requires named or integrate, and absolute, .. or .git paths fail with code configuration. An untracked or ignored copy keeps the worktree when it closes. On a remote provider without includeUncommitted, a copy not ignored by a committed .gitignore makes the first synchronization fail with code workspace.
  • options.labelVariant-dependent
    string | undefined
    Name used in the integrate branch (outpost/<label>-<id>), the worktree directory under .outpost/workspaces and the startup-failure journal; lowercased, other characters replaced by -, cut to 48.
  • settingsOptional
    ExecutionInspectionSettings | undefined
    Optional dispatch settings whose agent, continuation, response repairs and steering add the matching agent requirements. Defaults to a plain dispatch, which only requires file dispatch support.
  • settings.steeringOptional
    Steering | undefined
    Controller from createSteering(), attached for the whole dispatch and released when it ends. resume() and fork() do not reuse it.
  • settings.agentOptional
    DispatchAgent | undefined
    Agent that runs the brief: one from createAgent() or createReplayAgent(), or a createFallbackAgent() that moves to its next candidate on a listed quota or unavailable fault. A fallback agent cannot take continuation.
  • settings.responseOptional
    ResponseSpec<unknown> | undefined
    Typed response contract: appends final-answer format instructions and the JSON input schema after the rendered brief and steering messages included at turn start. Parses and validates the tagged answer, with up to repairs correction turns. Requires one pass; injection cannot be disabled.
  • settings.continuationOptional
    { readonly id: string; readonly fork?: boolean; } | undefined
    Native conversation to continue, by id; fork: true continues a copy and leaves the original unchanged. Requires one pass and an agent that supports resume.

ExecutionPlan

export declare function inspectExecution(
  options: SandboxOptions | FileSandboxOptions,
  settings?: ExecutionInspectionSettings,
): ExecutionPlan;