Skip to content
Français

GitWorkspace

import type { GitWorkspace } from "@elie-laloum/outpost/workspaces";
  • kindRequired
    "git"
    Discriminant selecting Git, a directory source or an initially empty workspace.
  • gitRequired
    Workspace
    Dedicated legacy Git capability, exposing branches, commits, guards and integration.
  • dispatchRequired
    <T = undefined>(options: Omit<SandboxOptions, Exclude<keyof WorkspaceOptions, "hooks" | "label"> | "workspace"> & DispatchOptions<T> & { readonly agent: DispatchAgent; }) => Promise<DispatchResult<T>>
    Run a dispatch in a new sandbox on this workspace. On success it merges an integrate branch, then closes the sandbox and leaves the workspace open. Fails with code configuration while another sandbox holds the workspace or after close().
  • sandboxRequired
    (options?: Omit<SandboxOptions, Exclude<keyof WorkspaceOptions, "hooks" | "label"> | "workspace">) => Promise<Sandbox>
    Allocate a reusable sandbox on this workspace. Hooks passed to it replace the workspace’s hostReady and sandboxReady; closing it leaves the workspace open and never merges. A second open sandbox fails with code configuration.
  • attachRequired
    (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.
  • closeRequired
    (options?: { readonly preserve?: boolean; }) => Promise<Disposal>
    Release the lock and remove a clean managed worktree; an integrate branch is deleted once merged, a named branch is kept. After a diff guard refusal, with preserve: true, a detached HEAD or uncommitted, untracked or ignored files, the worktree stays and is returned as retainedDirectory. Fails with code configuration while a sandbox is open; later calls return the first result.
  • integrateRequired
    { (): 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.
  • [Symbol.asyncDispose]Required
    () => Promise<void>
    Close the workspace like close() without options, for await using.
  • repositoryRequired
    string
    Real path of the host checkout’s top-level directory.
  • directoryRequired
    string
    Host directory the agent works in: the worktree under .outpost/workspaces, or the checkout itself in current mode.
  • branchRequired
    string
    Work branch name. In current mode, the checked-out branch, or HEAD when detached.
  • baseBranchRequired
    string
    Branch checked out in the host checkout when the workspace opened, and the target of integrate(). Empty when HEAD was detached.
  • baselineRequired
    string
    Commit checked out in the workspace when it opened. Each dispatch lists commits from its own starting commit, not from this one.
  • gitDirectoriesRequired
    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.
  • policyRequired
    BranchPolicy
    Branch policy in effect, { mode: “current” } when none was given.
  • idRequired
    string
    Stable identifier of this resource, independent of its materialization path.
  • runtimeRequired
    WorkspaceRuntime
    Control directory and logical namespace, separate from the workspace files.
export interface GitWorkspace extends Workspace, WorkspaceSession {
  readonly kind: "git";
  readonly git: Workspace;
}