Raxol.Core.Runtime.Plugins.Manager (Raxol v0.4.0)

View Source

Manages the loading, initialization, and lifecycle of plugins in the Raxol runtime.

This module is responsible for:

  • Discovering available plugins
  • Loading and initializing plugins
  • Managing plugin lifecycle events
  • Providing access to loaded plugins
  • Handling plugin dependencies and conflicts
  • Optionally watching plugin source files for changes and reloading them (dev only).

Summary

Functions

Returns a specification to start this module under a supervisor.

Disable a plugin temporarily without unloading it.

Enable a plugin that was previously disabled.

Stub: execute_command/4 not yet implemented.

Placeholder for allowing plugins to filter events.

Get a specific plugin by its ID.

Initialize the plugin system and load all available plugins.

Get a list of all loaded plugins with their metadata.

Load a plugin with a given configuration.

Loads a plugin by ID with config and state maps (for test/mocking).

Catch-all for load_plugin/4 to prevent UndefinedFunctionError. Raises a clear error if called.

Stub: process_input/2 not yet implemented.

Stub: process_mouse/3 not yet implemented.

Stub: process_output/2 not yet implemented.

Stub: process_placeholder/4 not yet implemented.

Reload a plugin by unloading and then loading it again.

Starts the Plugin Manager GenServer.

Stops the Plugin Manager GenServer.

Types

plugin_id()

@type plugin_id() :: String.t()

plugin_metadata()

@type plugin_metadata() :: map()

plugin_state()

@type plugin_state() :: map()

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

disable_plugin(plugin_id)

Disable a plugin temporarily without unloading it.

enable_plugin(plugin_id)

Enable a plugin that was previously disabled.

execute_command(manager, command, arg1, arg2)

Stub: execute_command/4 not yet implemented.

filter_event(plugin_manager_state, event)

@spec filter_event(any(), Raxol.Core.Runtime.Events.Event.t()) ::
  {:ok, Raxol.Core.Runtime.Events.Event.t()} | :halt | any()

Placeholder for allowing plugins to filter events.

get_plugin(plugin_id)

Get a specific plugin by its ID.

initialize()

Initialize the plugin system and load all available plugins.

list_plugins()

Get a list of all loaded plugins with their metadata.

load_plugin(plugin_id, config)

Load a plugin with a given configuration.

load_plugin(plugin_id, config, state)

Loads a plugin by ID with config and state maps (for test/mocking).

load_plugin(a, b, c, d)

Catch-all for load_plugin/4 to prevent UndefinedFunctionError. Raises a clear error if called.

process_input(manager, input)

Stub: process_input/2 not yet implemented.

process_mouse(manager, event, emulator_state)

Stub: process_mouse/3 not yet implemented.

process_output(manager, output)

Stub: process_output/2 not yet implemented.

process_placeholder(manager, arg1, arg2, arg3)

Stub: process_placeholder/4 not yet implemented.

reload_plugin(plugin_id)

Reload a plugin by unloading and then loading it again.

start_link(opts \\ [])

Starts the Plugin Manager GenServer.

stop(pid \\ __MODULE__)

Stops the Plugin Manager GenServer.