MingaEditor.State.AgentAccess (Minga v0.1.0)

Copy Markdown View Source

Direct accessors for agent state on EditorState.

Agent lifecycle data is workspace-owned for the Traditional shell. The active agent workspace stores its session pid and MingaEditor.Agent.UIState; state.workspace.agent_ui is only a live mirror for renderers that still read the current workspace struct directly.

Extension shells may own session pids on shell-specific surfaces until they move to the same workspace model.

Summary

Functions

Returns the agent session lifecycle state.

Returns the full agent UI state (wrapping Panel and View).

Returns the agent UI focus.

Returns true if the agent panel input is focused.

Returns the agent panel state (prompt editing and chat display).

Returns the agent session pid for the user's current view, or nil.

Updates agent session lifecycle state via a transform function.

Updates the full agent UI state. Prefer update_panel/2 or update_view/2.

Updates just the panel sub-struct via a transform function.

Updates just the view sub-struct via a transform function.

Returns the agent view state (layout, search, preview, toasts).

Functions

agent(arg1)

Returns the agent session lifecycle state.

agent_ui(state)

Returns the full agent UI state (wrapping Panel and View).

focus(state)

@spec focus(MingaEditor.State.t() | map()) :: atom()

Returns the agent UI focus.

input_focused?(state)

@spec input_focused?(MingaEditor.State.t() | map()) :: boolean()

Returns true if the agent panel input is focused.

panel(state)

Returns the agent panel state (prompt editing and chat display).

session(state)

@spec session(MingaEditor.State.t() | map()) :: pid() | nil

Returns the agent session pid for the user's current view, or nil.

Traditional reads the active workspace. Extension shells read through shell behaviours until they move onto the same workspace model.

update_agent(state, fun)

Updates agent session lifecycle state via a transform function.

update_agent_ui(state, fun)

This function is deprecated. Use update_panel/2 or update_view/2 for targeted sub-struct updates.

Updates the full agent UI state. Prefer update_panel/2 or update_view/2.

update_panel(state, fun)

Updates just the panel sub-struct via a transform function.

update_view(state, fun)

Updates just the view sub-struct via a transform function.

view(state)

Returns the agent view state (layout, search, preview, toasts).