Immutable owner of the editor's active shell runtime value.
A runtime contains one resolved registry entry, the state produced by that shell, and stashed states tied to exact registry identities. Registry lookup and every effectful policy decision stay outside this module. Callers resolve entries and initialize replacement states before invoking a transition.
Summary
Functions
Installs state returned by persistence for the exact active or stashed registration.
Installs shell state returned by a render for the exact active identity.
Activates a resolved entry, stashing the outgoing state and restoring only an exact identity match.
Returns true when a resolved entry is exactly the active registration.
Returns the active session through the active shell contract.
Returns the active tab through the active shell contract.
Returns the active tab kind through the active shell contract.
Routes bottom-panel blur through the active shell contract.
Returns the deterministic built-in entry used by raw Editor state construction.
Drops extension feature state through active and exact-identity stashed shell callbacks.
Drops one feature-state source through active and exact-identity stashed callbacks.
Returns the resolved active entry.
Falls back from a removed active registration without stashing its now-unresolvable value.
Finds a tab through the active shell contract.
Returns the active shell id.
Returns the exact identity of the active resolved entry.
Installs a value produced by a named Traditional.State transition when Traditional is active.
Returns true when an asynchronous identity belongs to the active entry.
Returns the active shell contract module.
Builds a runtime from an already-resolved entry and initialized shell state.
Returns whether the active or an exact-identity stashed entry owns a session.
Returns whether an exact-identity stashed value can restore the resolved entry.
Retires a dead buffer from active and exact-identity stashed Traditional values.
Routes an agent event through the active entry.
Routes workflow-prepared buffer metadata through the active shell outside root transitions.
Routes buffer-removal lifecycle through the active shell.
Routes buffer-switch lifecycle through the active shell.
Routes a shell event through the active entry's contract.
Routes a shell GUI action through the active entry's contract.
Routes a remote disconnect through the active entry.
Routes an optional active session-down transition through the active entry.
Routes a session restart through the active and exact-identity stashed entries.
Routes an agent event through exact-identity stashes using caller-resolved entries.
Routes a remote disconnect through the first exact-identity stash that owns it.
Routes session-down through the first exact-identity stash that owns it.
Associates a session with a shell tab through the active contract.
Returns the identity-keyed shell-state stash.
Returns the active shell state.
Routes an optional agent status update through active and stashed entries.
Routes optional agent-file tracking through active and stashed entries.
Accepts the currently resolved active entry or resets state when its registry identity changed.
Types
@type persistence_change() :: {MingaEditor.Shell.Entry.t(), shell_state(), shell_state()}
@type shell_state() :: MingaEditor.Shell.shell_state()
@type stash() :: %{ required(MingaEditor.Shell.Identity.t()) => MingaEditor.Shell.StateStash.t() }
@type t() :: %MingaEditor.Shell.Runtime{ entry: MingaEditor.Shell.Entry.t(), stash: stash(), state: shell_state() }
Functions
@spec accept_persisted_state(t(), MingaEditor.Shell.Entry.t(), shell_state()) :: t()
Installs state returned by persistence for the exact active or stashed registration.
@spec accept_rendered_state( t(), atom(), MingaEditor.Shell.Identity.t(), shell_state() ) :: t()
Installs shell state returned by a render for the exact active identity.
@spec activate(t(), MingaEditor.Shell.Entry.t(), shell_state()) :: t()
Activates a resolved entry, stashing the outgoing state and restoring only an exact identity match.
@spec active_entry?(t(), MingaEditor.Shell.Entry.t()) :: boolean()
Returns true when a resolved entry is exactly the active registration.
Returns the active session through the active shell contract.
@spec active_tab(t()) :: MingaEditor.State.Tab.t() | nil
Returns the active tab through the active shell contract.
Returns the active tab kind through the active shell contract.
Routes bottom-panel blur through the active shell contract.
@spec default_entry() :: MingaEditor.Shell.Entry.t()
Returns the deterministic built-in entry used by raw Editor state construction.
@spec drop_extension_feature_state_sources(t(), [MingaEditor.Shell.Entry.t()]) :: t()
Drops extension feature state through active and exact-identity stashed shell callbacks.
@spec drop_feature_state_source( t(), [MingaEditor.Shell.Entry.t()], MingaEditor.FeatureState.source() ) :: t()
Drops one feature-state source through active and exact-identity stashed callbacks.
@spec entry(t()) :: MingaEditor.Shell.Entry.t()
Returns the resolved active entry.
@spec fallback_from_removed(t(), MingaEditor.Shell.Entry.t(), shell_state()) :: t()
Falls back from a removed active registration without stashing its now-unresolvable value.
@spec find_tab_by_buffer(t(), pid()) :: MingaEditor.State.Tab.t() | nil
Finds a tab through the active shell contract.
Returns the active shell id.
@spec identity(t()) :: MingaEditor.Shell.Identity.t()
Returns the exact identity of the active resolved entry.
@spec install_traditional_state(t(), MingaEditor.Shell.Traditional.State.t()) :: t()
Installs a value produced by a named Traditional.State transition when Traditional is active.
@spec matches_identity?(t(), MingaEditor.Shell.Identity.t()) :: boolean()
Returns true when an asynchronous identity belongs to the active entry.
Returns the active shell contract module.
@spec new(MingaEditor.Shell.Entry.t(), shell_state()) :: t()
Builds a runtime from an already-resolved entry and initialized shell state.
@spec owns_agent_session?(t(), [MingaEditor.Shell.Entry.t()], pid()) :: boolean()
Returns whether the active or an exact-identity stashed entry owns a session.
@spec restorable?(t(), MingaEditor.Shell.Entry.t()) :: boolean()
Returns whether an exact-identity stashed value can restore the resolved entry.
Retires a dead buffer from active and exact-identity stashed Traditional values.
@spec route_agent_event(t(), MingaEditor.Shell.workspace(), pid(), term()) :: {t(), MingaEditor.Shell.workspace(), persistence_change() | nil}
Routes an agent event through the active entry.
@spec route_buffer_added( t(), MingaEditor.Shell.workspace(), MingaEditor.Shell.workspace(), MingaEditor.Shell.BufferMetadata.t() ) :: {t(), MingaEditor.Shell.workspace()}
Routes workflow-prepared buffer metadata through the active shell outside root transitions.
@spec route_buffer_died(t(), MingaEditor.Shell.workspace(), pid()) :: {t(), MingaEditor.Shell.workspace()}
Routes buffer-removal lifecycle through the active shell.
@spec route_buffer_switched(t(), MingaEditor.Shell.workspace()) :: {t(), MingaEditor.Shell.workspace()}
Routes buffer-switch lifecycle through the active shell.
@spec route_event(t(), MingaEditor.Shell.workspace(), term()) :: {t(), MingaEditor.Shell.workspace()}
Routes a shell event through the active entry's contract.
@spec route_gui_action(t(), MingaEditor.Shell.workspace(), term()) :: {t(), MingaEditor.Shell.workspace()}
Routes a shell GUI action through the active entry's contract.
@spec route_remote_session_disconnected(t(), pid()) :: {t(), boolean(), persistence_change() | nil}
Routes a remote disconnect through the active entry.
Routes an optional active session-down transition through the active entry.
@spec route_session_restarted( t(), [MingaEditor.Shell.Entry.t()], pid(), pid(), term() ) :: {t(), boolean(), [persistence_change()]}
Routes a session restart through the active and exact-identity stashed entries.
@spec route_stashed_agent_event( t(), [MingaEditor.Shell.Entry.t()], MingaEditor.Shell.workspace(), pid(), term() ) :: {t(), MingaEditor.Shell.workspace(), [persistence_change()]}
Routes an agent event through exact-identity stashes using caller-resolved entries.
@spec route_stashed_remote_session_disconnected( t(), [MingaEditor.Shell.Entry.t()], pid() ) :: {t(), boolean(), [persistence_change()]}
Routes a remote disconnect through the first exact-identity stash that owns it.
@spec route_stashed_session_down(t(), [MingaEditor.Shell.Entry.t()], pid(), term()) :: {t(), boolean(), [persistence_change()]}
Routes session-down through the first exact-identity stash that owns it.
Associates a session with a shell tab through the active contract.
Returns the identity-keyed shell-state stash.
@spec state(t()) :: shell_state()
Returns the active shell state.
@spec sync_agent_status(t(), [MingaEditor.Shell.Entry.t()], pid(), term()) :: t()
Routes an optional agent status update through active and stashed entries.
@spec track_agent_file(t(), [MingaEditor.Shell.Entry.t()], pid(), String.t()) :: t()
Routes optional agent-file tracking through active and stashed entries.
@spec validate_registration(t(), MingaEditor.Shell.Entry.t(), shell_state()) :: {t(), :current | :reset}
Accepts the currently resolved active entry or resets state when its registry identity changed.