Skip to content

smelt.mode

Tier: Mixed - Contains both Host and UiHost functions; each function below lists its exact tier.

Classification: Supported - Primary alpha facade for user config and plugins.

Agent-mode selector. smelt.mode.current() reads the active mode, smelt.mode.set(v) sets it in a TUI session, and smelt.mode.cycle_list() lists the configured cycle.

smelt.mode.current

fun(): string

Tier: Host - Available in every runtime, including headless mode.

Return the active agent mode name.

smelt.mode.cycle

fun(): nil

Tier: UiHost - Requires a terminal UI; calling these from headless mode raises.

Advance the active agent mode to the next entry in smelt.mode.cycle_list(), wrapping at the end. No-op when the cycle is empty.

smelt.mode.cycle_list

fun(): string[]

Tier: Host - Available in every runtime, including headless mode.

Return the configured agent-mode cycle; falls back to the built-in default when the user has not customized one.

smelt.mode.get

fun(name: string): smelt.mode.Mode?

Types: smelt.mode.Mode

Tier: Host - Available in every runtime, including headless mode.

Return a copy of the registered mode definition for name, or nil when unknown.

smelt.mode.list

fun(): smelt.mode.Mode[]

Types: smelt.mode.Mode

Tier: Host - Available in every runtime, including headless mode.

Return copies of registered mode definitions in registration order.

smelt.mode.register

fun(spec: table): nil

Tier: Host - Available in every runtime, including headless mode.

Register an agent mode from { name, label?, icon?, hl_group?, note?, permissions?, after? }. Registering a new name appends it, or inserts it after an existing after name. Registering an existing name replaces its definition without changing its position. Raises when name is missing.

smelt.mode.set

fun(mode: string): nil

Tier: UiHost - Requires a terminal UI; calling these from headless mode raises.

Set the active agent mode. The change is applied immediately to the UI and persisted according to the active remember policy.