# .NET workspace builder API

Source: https://libtmux.org/en/dotnet/latest/workspace/reference/

> Internal reference for the .NET workspace builder and configuration APIs.

The `LibTmux.Workspace` namespace provides configuration objects and a builder
that uses a caller-supplied LibTmux `Server`.

## Configuration

[`WorkspaceFile`](./libtmux-workspace-workspacefile/) parses
YAML and holds the session description. `WorkspaceWindow` and `WorkspacePane`
hold nested configuration. `WorkspaceFormatException` identifies unsupported
or invalid configuration.

## Builder options

[`WorkspaceBuilder`](./libtmux-workspace-workspacebuilder/)
accepts a server, an optional positive readiness timeout, and a
[`PaneReadiness`](./libtmux-workspace-panereadiness/) policy.
Its `BuildAsync` accepts the configuration and an optional cancellation token.

The default timeout is ten seconds. `Auto`, `Always`, and `Never` select which
panes wait before command delivery. [Topics](../topics/) explains the prompt
heuristic and its limitations.

## Results and failures

[`WorkspaceResult`](./libtmux-workspace-workspaceresult/)
contains the created session, windows, and rejected layouts. A rejected layout
does not discard its window.

[`WorkspaceBuildException`](./libtmux-workspace-workspacebuildexception/)
keeps a `PartialResult` when state could be materialized before failure. It
can be null when no such result could be read. Inspect live tmux state before
retrying; a missing result does not prove that no command reached tmux.

[Result contract](https://github.com/libtmux/libtmux-dotnet/blob/6656a563ec9e07ab52e0c3ac96f7704fc94cc0c0/src/LibTmux.Workspace/WorkspaceResult.cs); [Failure contract](https://github.com/libtmux/libtmux-dotnet/blob/6656a563ec9e07ab52e0c3ac96f7704fc94cc0c0/src/LibTmux.Workspace/WorkspaceBuildException.cs).

## API declarations

- [LibTmux.Workspace.PaneReadiness](https://libtmux.org/en/dotnet/latest/workspace/reference/libtmux-workspace-panereadiness/)
- [LibTmux.Workspace.WorkspaceBuilder](https://libtmux.org/en/dotnet/latest/workspace/reference/libtmux-workspace-workspacebuilder/)
- [LibTmux.Workspace.WorkspaceBuildException](https://libtmux.org/en/dotnet/latest/workspace/reference/libtmux-workspace-workspacebuildexception/)
- [LibTmux.Workspace.WorkspaceFile](https://libtmux.org/en/dotnet/latest/workspace/reference/libtmux-workspace-workspacefile/)
- [LibTmux.Workspace.WorkspaceFormatException](https://libtmux.org/en/dotnet/latest/workspace/reference/libtmux-workspace-workspaceformatexception/)
- [LibTmux.Workspace.WorkspacePane](https://libtmux.org/en/dotnet/latest/workspace/reference/libtmux-workspace-workspacepane/)
- [LibTmux.Workspace.WorkspaceResult](https://libtmux.org/en/dotnet/latest/workspace/reference/libtmux-workspace-workspaceresult/)
- [LibTmux.Workspace.WorkspaceWindow](https://libtmux.org/en/dotnet/latest/workspace/reference/libtmux-workspace-workspacewindow/)
