Agent session lifecycle helpers for the Editor GenServer.
Handles agent session startup, auto-context loading, semantic transcript caching, and tab label updates. These are called by the Editor during init, file open, and surface effect processing.
All functions are pure state transformations (state -> state) that the Editor calls at the appropriate lifecycle points.
Summary
Functions
Caches semantic transcript metadata for an explicit message list.
Sets a file's content as the agentic preview pane if the agent pane is active and the preview is empty. Called when a file is opened while the agent view is already active.
Starts the agent session if the agent pane is visible during init.
Updates the active agent tab's label to the first user prompt (truncated).
Rebuilds the active agent presentation from its authoritative session snapshot.
Caches the semantic agent transcript metadata for the current session messages.
Re-computes cached styled messages for the semantic transcript.
Types
@type state() :: MingaEditor.State.t()
Functions
Caches semantic transcript metadata for an explicit message list.
Sets a file's content as the agentic preview pane if the agent pane is active and the preview is empty. Called when a file is opened while the agent view is already active.
Starts the agent session if the agent pane is visible during init.
Also loads auto-context if configured. Called once the port is ready.
Updates the active agent tab's label to the first user prompt (truncated).
Only updates if the current label is the default "New Agent" or "minga".
@spec rebuild_agent_from_session(state(), MingaEditor.State.Tab.t()) :: state()
Rebuilds the active agent presentation from its authoritative session snapshot.
Caches the semantic agent transcript metadata for the current session messages.
Called as a surface effect when the agent view receives new messages.
Re-computes cached styled messages for the semantic transcript.