Helpers for the A2A-Version HTTP header (A2A v1.0 spec §3.6).
Versions are negotiated as Major.Minor strings. Patch components are
not significant and are stripped during normalization. Per spec §3.6.2
an empty or missing version is interpreted as "0.3".
Summary
Functions
Default version a client sends in the A2A-Version request header.
Normalizes a version string to its Major.Minor form.
Parses a Plug-style header value (list of strings, single string, or nil)
into a normalized Major.Minor version. An empty list or missing value
becomes "0.3".
Default list of versions a server accepts.
Returns :ok when version is in the supported list, otherwise
{:error, version} with the rejected value so the caller can surface it
in a VersionNotSupportedError.
Functions
@spec default() :: String.t()
Default version a client sends in the A2A-Version request header.
Normalizes a version string to its Major.Minor form.
niland""→"0.3"(per spec §3.6.2)"1.0.3"→"1.0"" 0.3 "→"0.3"
Values that can't be parsed as Major.Minor are returned trimmed so the
caller can include them in an error response.
Parses a Plug-style header value (list of strings, single string, or nil)
into a normalized Major.Minor version. An empty list or missing value
becomes "0.3".
@spec supported_default() :: [String.t()]
Default list of versions a server accepts.
Returns :ok when version is in the supported list, otherwise
{:error, version} with the rejected value so the caller can surface it
in a VersionNotSupportedError.