Raxol.Terminal.Plugin.PluginServer (Raxol Terminal v2.6.0)

Copy Markdown View Source

Unified plugin system for the Raxol terminal emulator. Handles themes, scripting, and extensions.

Refactored version with pure functional error handling patterns. All try/catch blocks have been replaced with with statements and proper error tuples.

Summary

Functions

Returns a specification to start this module under a supervisor.

Gets the state of a plugin.

Gets all loaded plugins.

Loads a plugin from a file or directory.

Reloads a plugin.

Unloads a plugin by ID.

Updates a plugin's configuration.

Types

plugin_id()

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

plugin_state()

@type plugin_state() :: %{
  id: plugin_id(),
  type: plugin_type(),
  name: String.t(),
  version: String.t(),
  description: String.t(),
  author: String.t(),
  dependencies: [String.t()],
  config: map(),
  status: :active | :inactive | :error,
  error: String.t() | nil
}

plugin_type()

@type plugin_type() :: :theme | :script | :extension

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

execute_plugin_function(plugin_id, function, args \\ [])

Executes a plugin function.

get_plugin_state(plugin_id)

Gets the state of a plugin.

get_plugins(opts \\ [])

Gets all loaded plugins.

handle_manager_cast(msg, state)

Callback implementation for Raxol.Core.Behaviours.BaseManager.handle_manager_cast/2.

handle_manager_info(msg, state)

Callback implementation for Raxol.Core.Behaviours.BaseManager.handle_manager_info/2.

load_plugin(path, type, opts \\ [])

Loads a plugin from a file or directory.

reload_plugin(plugin_id)

Reloads a plugin.

start_link(init_opts \\ [])

unload_plugin(plugin_id)

Unloads a plugin by ID.

update_plugin_config(plugin_id, config)

Updates a plugin's configuration.