Install-time and load-time dependency resolution for plugins.
Uses Kahn's algorithm for topological sort with cycle detection, conflict checking, and capability matching. The sort is stable: plugins that are ready at the same time keep their input order, so the result is deterministic for a given manifest list.
Raxol.Plugins.Lifecycle.Dependencies delegates its ordering and cycle
detection here; this module is the only Kahn/DFS implementation.
Summary
Functions
Checks for conflicts between manifests.
Depth-first walk of graph (%{node => [successor]}) from start.
Resolves load order for a set of manifests using topological sort.
Resolves load order for new manifests given already-loaded plugin ids.
Checks that all requires capabilities are satisfied by some plugin's provides.
Types
Functions
@spec check_conflicts([Raxol.Core.Runtime.Plugins.Manifest.t()]) :: :ok | {:error, {:conflict, atom(), atom()}}
Checks for conflicts between manifests.
Depth-first walk of graph (%{node => [successor]}) from start.
Returns the cycle path as a list starting and ending with the same node
([:a, :b, :a]), or nil when no cycle is reachable from start.
@spec resolve([Raxol.Core.Runtime.Plugins.Manifest.t()]) :: resolution()
Resolves load order for a set of manifests using topological sort.
Returns {:ok, [plugin_id]} in dependency order (dependencies first),
or {:error, reason} on failure.
@spec resolve_incremental( [Raxol.Core.Runtime.Plugins.Manifest.t()], already_loaded :: [atom()] ) :: resolution()
Resolves load order for new manifests given already-loaded plugin ids.
Treats already_loaded as satisfied dependencies that don't need ordering.
@spec satisfy_capabilities([Raxol.Core.Runtime.Plugins.Manifest.t()]) :: :ok | {:error, {:unmet_capability, atom(), atom()}}
Checks that all requires capabilities are satisfied by some plugin's provides.