Ragex.Plugin.Registry (Ragex v0.31.0)

View Source

Manages the lifecycle, discovery, topological dependency sorting, tool aggregation, destruction-level safety checks, parallel execution scheduling, and execution routing for Ragex plugins.

Summary

Functions

Returns a specification to start this module under a supervisor.

Disables a registered plugin.

Dispatches a single tool call.

Dispatches multiple tool calls in parallel for non-destructive tools (:destruction_level == :none). Accepts a list of tool calls: [{"tool1", %{...}}, {"tool2", %{...}}] or [%{name: "tool1", args: %{...}}].

Enables a registered plugin.

Returns dependency mapping for all registered plugins.

Lists all registered plugins ordered topologically by dependency and priority.

Lists currently running tools executing in parallel.

Returns aggregated tool schemas across all active plugins in priority order.

Registers a plugin module dynamically.

Starts the plugin registry GenServer.

Unregisters a plugin by its ID.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

disable_plugin(plugin_id)

@spec disable_plugin(atom()) :: :ok | {:error, term()}

Disables a registered plugin.

dispatch_tool(tool_name, args)

@spec dispatch_tool(String.t(), map()) :: term()

Dispatches a single tool call.

dispatch_tools(tool_requests, opts \\ [])

@spec dispatch_tools(
  [tuple() | map()],
  keyword()
) :: {:ok, list()}

Dispatches multiple tool calls in parallel for non-destructive tools (:destruction_level == :none). Accepts a list of tool calls: [{"tool1", %{...}}, {"tool2", %{...}}] or [%{name: "tool1", args: %{...}}].

enable_plugin(plugin_id)

@spec enable_plugin(atom()) :: :ok | {:error, term()}

Enables a registered plugin.

list_plugin_dependencies()

@spec list_plugin_dependencies() :: %{required(atom()) => [atom()]}

Returns dependency mapping for all registered plugins.

list_plugins()

@spec list_plugins() :: [map()]

Lists all registered plugins ordered topologically by dependency and priority.

list_running_tools()

@spec list_running_tools() :: [map()]

Lists currently running tools executing in parallel.

list_tools()

@spec list_tools() :: [map()]

Returns aggregated tool schemas across all active plugins in priority order.

register_plugin(plugin_module, opts \\ [])

@spec register_plugin(
  module(),
  keyword()
) :: :ok | {:error, term()}

Registers a plugin module dynamically.

start_link(opts \\ [])

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

Starts the plugin registry GenServer.

unregister_plugin(plugin_id)

@spec unregister_plugin(atom()) :: :ok | {:error, term()}

Unregisters a plugin by its ID.