Raxol.Core.Runtime.Plugins.CommandRegistry (Raxol v0.4.0)
View SourceManages command registration and execution for plugins.
Summary
Functions
Executes a command with proper error handling and timeout.
Looks up the handler for a command name and namespace (plugin module). Returns {:ok, {module, function, arity}} or {:error, :not_found}.
Creates a new command registry table (as a map). Returns the new, empty command table.
Registers a command for a plugin namespace (module). Adds the command to the command table if not already present. Returns :ok or {:error, :already_registered}.
Registers commands for a plugin.
Unregisters all commands for a plugin.
Types
@type command() :: {command_name(), command_handler(), command_metadata()}
@type command_handler() :: function()
@type command_metadata() :: %{ optional(:description) => String.t(), optional(:usage) => String.t(), optional(:aliases) => [String.t()], optional(:timeout) => non_neg_integer() }
@type command_name() :: String.t()
Functions
Executes a command with proper error handling and timeout.
Looks up the handler for a command name and namespace (plugin module). Returns {:ok, {module, function, arity}} or {:error, :not_found}.
Creates a new command registry table (as a map). Returns the new, empty command table.
Registers a command for a plugin namespace (module). Adds the command to the command table if not already present. Returns :ok or {:error, :already_registered}.
Registers commands for a plugin.
Unregisters all commands for a plugin.