Skip to content
Français

CreatedWorkspace

import type { CreatedWorkspace } from "@elie-laloum/outpost/workspaces";

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

  • kindRequired
    "ephemeral" | "directory" | "git"
    Discriminant selecting Git, a directory source or an initially empty workspace.
  • sourceVariant-dependent
    FileWorkspaceSource
    Declared source for an owned resource; mutually exclusive with borrowing an open workspace.
  • checkpointVariant-dependent
    () => Promise<FileWorkspaceRecord>
    Synchronizes and verifies a settled generation before returning its durable description; refuses active operations.
  • sandboxRequired
    (options: FileSandboxSettings) => Promise<FileSandbox> | (options?: Omit<SandboxOptions, Exclude<keyof WorkspaceOptions, "hooks" | "label"> | "workspace">) => Promise<Sandbox>
    Sandbox bound to this workspace; closing it leaves a borrowed workspace open.
  • dispatchRequired
    <T = undefined>(options: FileSandboxSettings & DispatchOptions<T> & { readonly agent: DispatchAgent; }) => Promise<FileDispatchResult<T>> | <T = undefined>(options: Omit<SandboxOptions, Exclude<keyof WorkspaceOptions, "hooks" | "label"> | "workspace"> & DispatchOptions<T> & { readonly agent: DispatchAgent; }) => Promise<DispatchResult<T>>
    Runs an agent against the current files, preserving the workspace across repairs and steering passes.
  • idRequired
    string
    Stable identifier of this resource, independent of its materialization path.
  • directoryRequired
    string
    Absolute local materialization or source directory; it is not a portable resource identity.
  • runtimeRequired
    WorkspaceRuntime
    Control directory and logical namespace, separate from the workspace files.
  • closeRequired
    (options?: { readonly preserve?: boolean; }) => Promise<Disposal>
    Idempotent closure; preserves recoverable work and never removes a borrowed source.
  • [Symbol.asyncDispose]Variant-dependent
    () => Promise<void>
    Idempotent closure; preserves recoverable work and never removes a borrowed source.
  • gitVariant-dependent
    Workspace
    Dedicated legacy Git capability, exposing branches, commits, guards and integration.
  • attachVariant-dependent
    (options: Omit<SandboxOptions, Exclude<keyof WorkspaceOptions, "hooks" | "label"> | "workspace"> & AttachOptions & { readonly agent: Agent; }) => Promise<AttachResult>
    Open an interactive agent terminal in a new sandbox on this workspace. When the terminal exits with status 0 it merges an integrate branch; the sandbox closes and the workspace stays open.
  • integrateVariant-dependent
    { (): Promise<void>; (options: IntegrationOptions): Promise<ConflictResolution | void>; }
    Merge the work branch only in integrate mode. Without onConflict, uses the existing direct host merge and returns no value. With onConflict, requires a closed sandbox, preflights frozen commits, invokes the strategy only for an actual Git conflict, checks final ancestry and guard, then integrates the exact verified commit. Returns ConflictResolution when the strategy ran; refusals retain source and resolution worktrees.
  • repositoryVariant-dependent
    string
    Real path of the host checkout’s top-level directory.
  • branchVariant-dependent
    string
    Work branch name. In current mode, the checked-out branch, or HEAD when detached.
  • baseBranchVariant-dependent
    string
    Branch checked out in the host checkout when the workspace opened, and the target of integrate(). Empty when HEAD was detached.
  • baselineVariant-dependent
    string
    Commit checked out in the workspace when it opened. Each dispatch lists commits from its own starting commit, not from this one.
  • gitDirectoriesVariant-dependent
    readonly string[]
    Host paths of the worktree’s Git directory and the repository’s common Git directory. Container providers mount them unless repositoryMode is isolated.
  • policyVariant-dependent
    BranchPolicy
    Branch policy in effect, { mode: “current” } when none was given.
export type CreatedWorkspace = GitWorkspace | FileWorkspace;