Negotiates the catalogs that are active for one renderer.
A renderer sends its capabilities keyed by protocol version, for
example %{"v1.0" => %{"supportedCatalogIds" => [...], "inlineCatalogs" => [...]}}.
resolve/3 returns the agent's catalogs that the renderer names, in the
renderer's order of preference, ignoring ids the agent does not hold.
When the agent accepts inline catalogs, each inline catalog becomes an active catalog of its own after the registered ones, unless an active catalog already has its id. Otherwise inline catalogs are dropped, but they are still checked, since a malformed one makes the capabilities malformed whether or not the agent uses it.
Registered catalogs resolve to their transformed form; inline catalogs are not transformed.
Summary
Functions
Returns the active catalogs.
Functions
@spec resolve([A2UIAgent.CatalogConfig.t()], map() | nil, keyword()) :: {:ok, [A2UICore.Catalog.t()]} | {:error, A2UICore.Error.t()}
Returns the active catalogs.
capabilities of nil (a request that carries none) activates every
registered catalog in registration order. Option:
:accepts_inline_catalogs (default false).
Errors:
:catalog— capabilities are given and no catalog is active (the renderer names none of the registered catalogs, or none are registered);inlineCatalogsis not a list of catalog objects, or an inline catalog has no non-emptycatalogId; the registered catalogs span protocol versions that read different capabilities entries;:validation— the capabilities have no valid entry for the registered catalogs' protocol version.