An indexed immutable graph observed over a capture interval.
Construction and traversal perform no I/O. fields declares loaded fields
over the supplied entity IDs; complete declares complete server entity
sets. Missing declarations remain unloaded, including on empty sets.
Unavailable capabilities use a separate declaration. Relations require
complete join domains. A snapshot reserves no tmux objects.
Summary
Types
Declared entity sets and field availability; completeness is separate from an empty captured set.
Coverage of one captured entity domain; missing field entries are unloaded.
Maps each session ID to the IDs of its window links and clients, and each window ID to the IDs of its window links and panes. Traverse with related/4; the layout is not part of the contract.
Construction metadata: one server instance, ordered millisecond timestamps and explicit coverage declarations.
Observed rows grouped by canonical entity; construction validates and deduplicates their identities.
An immutable observation interval with indexed entities and explicit coverage.
Functions
Returns a materialized attached-client selection without I/O.
Looks up one exact observed ID without I/O.
Returns plain observed items in stable identity order without loading data.
Validates observed rows, rejecting conflicts, invalid fields and dangling covered references.
Returns a materialized physical pane selection without I/O.
Resolves one source's covered relation through captured indexes; never refreshes.
Requires a declared complete entity set, even when it has no rows.
Requires a loaded field over the captured entity domain before evaluation.
Requires relation coverage for the requested source IDs, including known-empty relations.
Returns a materialized session selection without I/O.
Returns a materialized membership selection without I/O.
Returns a materialized physical window selection without I/O.
Types
@type coverage() :: %{ entities: %{required(LibTmux.Schema.entity()) => entity_coverage()} }
Declared entity sets and field availability; completeness is separate from an empty captured set.
@type entity_coverage() :: %{ ids: MapSet.t(LibTmux.Ref.id()), complete: boolean(), fields: %{optional(atom()) => :loaded | :unavailable} }
Coverage of one captured entity domain; missing field entries are unloaded.
@opaque indexes()
Maps each session ID to the IDs of its window links and clients, and each window ID to the IDs of its window links and panes. Traverse with related/4; the layout is not part of the contract.
@type option() :: {:server_instance, String.t()} | {:captured_from, integer()} | {:captured_until, integer()} | {:fields, %{optional(LibTmux.Schema.entity()) => [atom()]}} | {:complete, [LibTmux.Schema.entity()]} | {:unavailable, %{optional(LibTmux.Schema.entity()) => [atom()]}}
Construction metadata: one server instance, ordered millisecond timestamps and explicit coverage declarations.
@type rows() :: %{ optional(LibTmux.Schema.entity()) => [map() | LibTmux.Schema.observation()] }
Observed rows grouped by canonical entity; construction validates and deduplicates their identities.
@type t() :: %LibTmux.Snapshot{ captured_from: integer(), captured_until: integer(), clients: %{optional(String.t()) => LibTmux.Client.t()}, coverage: coverage(), id: pos_integer(), indexes: indexes(), order: %{required(LibTmux.Schema.entity()) => [LibTmux.Ref.id()]}, panes: %{optional(String.t()) => LibTmux.Pane.t()}, schema_version: 1, server_instance: String.t(), sessions: %{optional(String.t()) => LibTmux.Session.t()}, window_links: %{optional(LibTmux.Ref.id()) => LibTmux.WindowLink.t()}, windows: %{optional(String.t()) => LibTmux.Window.t()} }
An immutable observation interval with indexed entities and explicit coverage.
Functions
@spec clients(t()) :: LibTmux.Selection.t(LibTmux.Client.t())
Returns a materialized attached-client selection without I/O.
See the worked example.
@spec fetch(t(), LibTmux.Schema.entity_selector(), LibTmux.Ref.id()) :: {:ok, LibTmux.Schema.observation()} | {:error, LibTmux.Error.t()}
Looks up one exact observed ID without I/O.
See the worked example.
@spec items(t(), LibTmux.Schema.entity_selector()) :: [LibTmux.Schema.observation()]
Returns plain observed items in stable identity order without loading data.
See the worked example.
@spec new(rows(), [option()]) :: {:ok, t()} | {:error, LibTmux.Error.t()}
Validates observed rows, rejecting conflicts, invalid fields and dangling covered references.
See the worked example.
@spec panes(t()) :: LibTmux.Selection.t(LibTmux.Pane.t())
Returns a materialized physical pane selection without I/O.
See the worked example.
@spec require_complete!(t(), LibTmux.Schema.entity_selector()) :: :ok
Requires a declared complete entity set, even when it has no rows.
See the worked example.
@spec require_field!(t(), LibTmux.Schema.entity_selector(), atom()) :: :ok
Requires a loaded field over the captured entity domain before evaluation.
See the worked example.
@spec require_relation!( t(), LibTmux.Schema.entity_selector(), atom(), :all | [LibTmux.Ref.id()] ) :: :ok
Requires relation coverage for the requested source IDs, including known-empty relations.
The default :all validates the entire captured source domain. An explicit
ID list does not resolve unrelated sources or their ambiguous relationships.
See the worked example.
@spec sessions(t()) :: LibTmux.Selection.t(LibTmux.Session.t())
Returns a materialized session selection without I/O.
See the worked example.
@spec window_links(t()) :: LibTmux.Selection.t(LibTmux.WindowLink.t())
Returns a materialized membership selection without I/O.
See the worked example.
@spec windows(t()) :: LibTmux.Selection.t(LibTmux.Window.t())
Returns a materialized physical window selection without I/O.
See the worked example.