Skip to content

smelt.mode

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

Visibility: Public - Stable Lua API intended for user config and plugins.

This namespace mixes Host and UiHost functions; each function below lists its exact tier.

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): table|nil

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

smelt.mode.icon

fun(name: string): string

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

smelt.mode.list

fun(): table[]

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

smelt.mode.note

fun(name: string): string

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

smelt.mode.permission_behaviors

fun(): table<string, table>

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

smelt.mode.register

fun(spec: table): nil

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

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.

smelt.mode.set_icon

fun(name: string, icon: string): nil

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

smelt.mode.style

fun(name: string): table

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