Skip to content
Français

FileWorkspace

import type { FileWorkspace } from "@elie-laloum/outpost/workspaces";
  • kindRequired
    "ephemeral" | "directory"
    Discriminant selecting Git, a directory source or an initially empty workspace.
  • sourceRequired
    FileWorkspaceSource
    Declared source for an owned resource; mutually exclusive with borrowing an open workspace.
  • checkpointRequired
    () => Promise<FileWorkspaceRecord>
    Synchronizes and verifies a settled generation before returning its durable description; refuses active operations.
  • sandboxRequired
    (options: FileSandboxSettings) => Promise<FileSandbox>
    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>>
    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]Required
    () => Promise<void>
    Idempotent closure; preserves recoverable work and never removes a borrowed source.
export interface FileWorkspace extends WorkspaceSession {
  readonly kind: "directory" | "ephemeral";
  readonly source: FileWorkspaceSource;
  checkpoint(): Promise<FileWorkspaceRecord>;
  sandbox(options: FileSandboxSettings): Promise<FileSandbox>;
  dispatch<T = undefined>(
    options: FileSandboxSettings &
      DispatchOptions<T> & {
        readonly agent: DispatchAgent;
      },
  ): Promise<FileDispatchResult<T>>;
}