Raxol.Terminal.Extension.ExtensionServer (Raxol Terminal v2.6.0)

Copy Markdown View Source

Unified extension management GenServer that provides a single interface for loading, unloading, and managing terminal extensions.

Summary

Functions

Activates an extension.

Returns a specification to start this module under a supervisor.

Deactivates an extension.

Executes a command for an extension.

Exports an extension to a specified path.

Gets the configuration of an extension.

Gets all hooks for an extension.

Gets the state of a specific extension.

Gets all extensions, optionally filtered.

Imports an extension from a specified path.

Lists all loaded extensions with optional filters.

Loads an extension from the specified path.

Registers a hook for an extension.

Starts the UnifiedExtension server.

Triggers a hook for an extension.

Unloads an extension by ID.

Unregisters a hook for an extension.

Updates the configuration for an extension.

Functions

activate_extension(extension_id)

@spec activate_extension(String.t()) :: :ok | {:error, term()}

Activates an extension.

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

configure_extension(extension_id, config)

@spec configure_extension(String.t(), map()) :: :ok | {:error, term()}

Configures an extension.

deactivate_extension(extension_id)

@spec deactivate_extension(String.t()) :: :ok | {:error, term()}

Deactivates an extension.

execute_command(extension_id, command)

Executes a command for an extension.

execute_command(extension_id, command, args)

@spec execute_command(String.t(), String.t(), list()) ::
  {:ok, term()} | {:error, term()}

export_extension(extension_id, path)

@spec export_extension(String.t(), String.t()) :: :ok | {:error, term()}

Exports an extension to a specified path.

get_extension_config(extension_id)

@spec get_extension_config(String.t()) ::
  {:ok, map()} | {:error, :extension_not_found}

Gets the configuration of an extension.

get_extension_hooks(extension_id)

@spec get_extension_hooks(String.t()) ::
  {:ok, [atom()]} | {:error, :extension_not_found}

Gets all hooks for an extension.

get_extension_state(extension_id)

@spec get_extension_state(String.t()) :: {:ok, map()} | {:error, :extension_not_found}

Gets the state of a specific extension.

get_extensions(filters \\ [])

@spec get_extensions(keyword()) :: {:ok, [map()]}

Gets all extensions, optionally filtered.

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.

import_extension(path)

@spec import_extension(String.t()) :: {:ok, String.t()} | {:error, term()}

Imports an extension from a specified path.

list_extensions(filters \\ [])

@spec list_extensions(keyword()) :: {:ok, [map()]}

Lists all loaded extensions with optional filters.

load_extension(path, type, metadata)

@spec load_extension(String.t(), atom(), map() | keyword()) ::
  {:ok, String.t()} | {:error, term()}

Loads an extension from the specified path.

register_hook(extension_id, hook_name, callback)

@spec register_hook(String.t(), atom(), function()) :: :ok | {:error, term()}

Registers a hook for an extension.

start_extension_manager(opts \\ [])

@spec start_extension_manager(keyword()) :: GenServer.on_start()

Starts the UnifiedExtension server.

start_link(init_opts \\ [])

trigger_hook(extension_id, hook_name, args \\ [])

@spec trigger_hook(String.t(), atom(), list()) :: {:ok, term()} | {:error, term()}

Triggers a hook for an extension.

unload_extension(extension_id)

@spec unload_extension(String.t()) :: :ok | {:error, term()}

Unloads an extension by ID.

unregister_hook(extension_id, hook_name)

@spec unregister_hook(String.t(), atom()) :: :ok | {:error, term()}

Unregisters a hook for an extension.

update_extension_config(extension_id, config)

@spec update_extension_config(String.t(), map()) :: :ok | {:error, term()}

Updates the configuration for an extension.