Handles plugin command registration and dispatch for the Plugin Manager.
Summary
Functions
Finds a command handler in the command table, normalizing the command name.
Finds the plugin ID for a given module in the plugins map.
Dispatches a command, looking it up in the table and executing the handler.
Registers commands from a plugin module's get_commands/0 callback.
Returns the updated command table.
Removes all commands for a module from the command table.
Validates that command arguments are a list of strings or numbers.
Functions
@spec find_plugin_for_command( map(), atom() | String.t(), module() | nil, non_neg_integer() ) :: {:ok, {module(), atom(), non_neg_integer()}} | :not_found
Finds a command handler in the command table, normalizing the command name.
Finds the plugin ID for a given module in the plugins map.
@spec handle_command(map(), String.t(), module() | nil, list() | nil, map()) :: {:ok, map()} | {:error, atom()} | {:error, atom(), map()}
Dispatches a command, looking it up in the table and executing the handler.
Registers commands from a plugin module's get_commands/0 callback.
Returns the updated command table.
Removes all commands for a module from the command table.
@spec validate_command_args(term()) :: :ok | {:error, :invalid_args}
Validates that command arguments are a list of strings or numbers.