Serialized source-owned registry for workspace shells.
One GenServer validates every duplicate decision, source-owned removal, generation assignment, and cleanup transition. It publishes the complete validated snapshot through one persistent_term key so input and render hot paths never observe separately updated module and source metadata.
Summary
Functions
Returns true when the id is currently registered.
Returns a specification to start this module under a supervisor.
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.
Resolves an id or implementation module from one coherent snapshot.
Registers the built-in shell contributions. Safe to call more than once.
Returns one coherent registry publication.
Starts the sole shell-registry publisher.
Returns true when the shell supports a capability atom.
Unregisters a shell by id. Built-in shells are preserved and extension shells require their source.
Unregisters a shell owned by the given source.
Unregisters all shells owned by a source as one publication.
Types
@type register_error() :: MingaEditor.Shell.Registry.Snapshot.register_error() | {:missing_default, term()} | {:invalid_entry, term()} | :source_required | :not_owner
@type server() :: GenServer.server()
@type shell_id() :: atom()
@type snapshot() :: MingaEditor.Shell.Registry.Snapshot.t()
@type source() :: Minga.Extension.ContributionCleanup.contribution_source()
Functions
Returns true when the id is currently registered.
Returns a specification to start this module under a supervisor.
See Supervisor.
@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 resolve(shell_id() | module()) :: MingaEditor.Shell.Entry.t() | nil
Resolves an id or implementation module from one coherent snapshot.
@spec seed_builtin() :: :ok
Registers the built-in shell contributions. Safe to call more than once.
@spec snapshot() :: snapshot()
Returns one coherent registry publication.
@spec start_link(keyword()) :: GenServer.on_start()
Starts the sole shell-registry publisher.
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 preserved and extension shells require their source.
Unregisters a shell owned by the given source.
@spec unregister_source(source()) :: :ok
Unregisters all shells owned by a source as one publication.