Minga.Mode.ToolConfirmState (Minga v0.1.0)

Copy Markdown View Source

FSM state for the tool install confirmation prompt.

Holds a queue of missing tool names to prompt about sequentially, the display label for each (resolved by the caller from Minga.Tool.Recipe.Registry.labels/1, so this Layer 0 state never reads the registry), plus the set of tools the user has declined this session.

Summary

Functions

Display label for a tool, falling back to its name when the caller supplied none.

Types

t()

@type t() :: %Minga.Mode.ToolConfirmState{
  count: non_neg_integer() | nil,
  current: non_neg_integer(),
  declined: MapSet.t(atom()),
  labels: %{required(atom()) => String.t()},
  pending: [atom()]
}

Functions

label(tool_confirm_state, name)

@spec label(t(), atom()) :: String.t()

Display label for a tool, falling back to its name when the caller supplied none.