Source-owned registry for workspace shells.
The active editor shell is read on input and render hot paths, so the registry stores a validated, sorted snapshot in persistent_term. Registration and cleanup may do validation work; reads are simple map/list lookups and never call extension code.
Summary
Functions
Returns true when the id is currently registered.
Returns the default shell entry, falling back to Traditional when the registry is empty.
Returns a shell entry by id.
Returns the shell id registered for a module, or nil.
Returns registered shells in deterministic display order.
Returns the registered module for an id, or nil.
Registers a shell contribution.
Resets registry state. Intended for tests that need isolated registry setup.
Registers the built-in shell contributions. Safe to call more than once.
Returns true when the shell supports a capability atom.
Unregisters a shell by id. Built-in shells are intentionally preserved. Extension shells must use unregister/2.
Unregisters a shell owned by the given source.
Unregisters all shells owned by a source. Built-in shells are intentionally preserved.
Types
@type shell_id() :: atom()
@type source() :: Minga.Extension.ContributionCleanup.contribution_source()
Functions
Returns true when the id is currently registered.
@spec default() :: MingaEditor.Shell.Entry.t()
Returns the default shell entry, falling back to Traditional when the registry is empty.
@spec get(shell_id()) :: MingaEditor.Shell.Entry.t() | nil
Returns a shell entry by id.
Returns the shell id registered for a module, or nil.
@spec list() :: [MingaEditor.Shell.Entry.t()]
Returns registered shells in deterministic display order.
Returns the registered module for an id, or nil.
@spec register(source(), register_attrs()) :: :ok | {:error, register_error()}
Registers a shell contribution.
@spec reset_for_test([MingaEditor.Shell.Entry.t()]) :: :ok
Resets registry state. Intended for tests that need isolated registry setup.
@spec seed_builtin() :: :ok
Registers the built-in shell contributions. Safe to call more than once.
Returns true when the shell supports a capability atom.
@spec unregister(shell_id()) :: :ok | {:error, :builtin_shell | :source_required}
Unregisters a shell by id. Built-in shells are intentionally preserved. Extension shells must use unregister/2.
Unregisters a shell owned by the given source.
@spec unregister_source(source()) :: :ok
Unregisters all shells owned by a source. Built-in shells are intentionally preserved.