Packages
Multi-surface application runtime for Elixir. One TEA module renders to terminal, browser (LiveView), SSH, and MCP (agents). 30+ widgets, flexbox + CSS grid, AI agent runtime, distributed swarm with CRDTs, time-travel debugging, session recording, sandboxed REPL, and agentic commerce.
Current section
Files
Jump to
Current section
Files
lib/raxol/plugins/plugin_dependency.ex
defmodule Raxol.Plugins.PluginDependency do
@moduledoc """
Provides utilities for plugin dependency and API compatibility checks.
"""
@doc """
Checks if the plugin's API version is compatible with the manager's API version.
Returns :ok if compatible, {:error, :api_incompatible} otherwise.
Compatibility is defined as matching major version (e.g., 1.x.x == 1.y.z).
"""
def check_api_compatibility(plugin_api_version, manager_api_version)
when is_binary(plugin_api_version) and is_binary(manager_api_version) do
case {parse_major(plugin_api_version), parse_major(manager_api_version)} do
{major, major} when is_integer(major) -> :ok
{_plugin_major, _manager_major} -> {:error, :api_incompatible}
end
end
defp parse_major(version) do
case String.split(version, ".") do
[major | _] ->
case Integer.parse(major) do
{int, _} -> int
:error -> nil
end
_ ->
nil
end
end
end