MingaAgent.RuntimeState (Minga v0.1.0)

Copy Markdown View Source

Domain-only agent session state, independent of any UI.

Tracks the active session identity, lifecycle status, and model/provider info. This struct lives in Layer 1 and can be consumed by both the Editor (Layer 2) and headless runtime clients without pulling in presentation concerns.

Presentation state (spinner timers, buffer PIDs, session history) lives in MingaEditor.State.Agent, which composes this struct.

Summary

Types

Agent lifecycle status.

t()

Domain-only agent runtime state.

Functions

Returns true if the agent is actively working.

Sets the model name.

Sets the provider name.

Sets the active session ID.

Sets the agent lifecycle status.

Types

status()

@type status() :: :idle | :thinking | :tool_executing | :error | nil

Agent lifecycle status.

t()

@type t() :: %MingaAgent.RuntimeState{
  active_session_id: String.t() | nil,
  model_name: String.t() | nil,
  provider_name: String.t() | nil,
  status: status()
}

Domain-only agent runtime state.

Functions

busy?(runtime_state)

@spec busy?(t()) :: boolean()

Returns true if the agent is actively working.

set_model(rt, name)

@spec set_model(t(), String.t() | nil) :: t()

Sets the model name.

set_provider(rt, name)

@spec set_provider(t(), String.t() | nil) :: t()

Sets the provider name.

set_session_id(rt, id)

@spec set_session_id(t(), String.t() | nil) :: t()

Sets the active session ID.

set_status(rt, status)

@spec set_status(t(), status()) :: t()

Sets the agent lifecycle status.