AgentBlueprintProtocol.Negotiation (Agent Blueprint Protocol v1.1.0)

Copy Markdown View Source

This module checks an artifact against a consumer support posture.

Use it when checking revision, required core fields, and registered extensions.

This module does not authorize operations.

Example

{:ok, blueprint} =
  AgentBlueprintProtocol.Blueprint.decode(
    File.read!(Application.app_dir(:agent_blueprint_protocol, "priv/examples/echo-blueprint.json"))
  )
support = %AgentBlueprintProtocol.Negotiation.Support{revisions: MapSet.new([1]), core_fields: MapSet.new([])}
match?(
  {:ok, %AgentBlueprintProtocol.Negotiation.Outcome{}},
  AgentBlueprintProtocol.Negotiation.negotiate(blueprint, support)
)

Summary

Functions

Checks an artifact against a consumer support posture.

Functions

negotiate(blueprint, support)

(since 1.0.0)

Checks an artifact against a consumer support posture.

Example

iex> with {:ok, blueprint} <- AgentBlueprintProtocol.Blueprint.decode(File.read!(Application.app_dir(:agent_blueprint_protocol, "priv/examples/echo-blueprint.json"))), support = %AgentBlueprintProtocol.Negotiation.Support{revisions: MapSet.new([1]), core_fields: MapSet.new([])}, do: match?({:ok, %AgentBlueprintProtocol.Negotiation.Outcome{}}, AgentBlueprintProtocol.Negotiation.negotiate(blueprint, support))
true