Jido.Memory.Capabilities (Jido Memory v1.0.1)

View Source

Helpers for normalizing and querying structured provider capability maps.

Summary

Functions

Returns the default structured capability map.

Returns the legacy capability names supported by a structured map.

Converts legacy flat capability names into a structured capability map.

Gets a value from a normalized capability map at the given path.

Returns the mapping from legacy flat capability names to structured paths.

Normalizes a provider capability map by merging it with the defaults.

Checks whether a capability path is marked as supported.

Functions

default()

@spec default() :: map()

Returns the default structured capability map.

flatten_supported(capabilities)

@spec flatten_supported(map() | nil) :: [atom()]

Returns the legacy capability names supported by a structured map.

from_flat_list(capabilities)

@spec from_flat_list([atom()]) :: map()

Converts legacy flat capability names into a structured capability map.

get(capabilities, path)

@spec get(map() | nil, [atom()]) :: term()

Gets a value from a normalized capability map at the given path.

legacy_paths()

@spec legacy_paths() :: %{optional(atom()) => [atom()]}

Returns the mapping from legacy flat capability names to structured paths.

normalize(capabilities)

@spec normalize(map() | nil) :: map()

Normalizes a provider capability map by merging it with the defaults.

supported?(capabilities, path)

@spec supported?(map() | nil, atom() | [atom()]) :: boolean()

Checks whether a capability path is marked as supported.