package a2a-client

  1. Overview
  2. Docs
A2A (Agent2Agent) protocol client for OCaml 5 / Eio (v1.0, v0.3 compatible)

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.2.2.tar.gz
md5=b0961f30b39b3be91f00c55fc09dd508
sha512=3d8d2438221c1f3783d24e421212c222af7529076e3e20f65cf1ebab06db5a4c46e636c24a911aaa7d86ee51e89096846299b2b510866b185c6f26603eca7fb6

doc/CHANGES.html

0.2.2

  • The HTTP and connection pool tests run over an in-memory Eio network instead of loopback TCP sockets, so they pass where binding a socket is not permitted (e.g. in the opam sandbox on macOS).

0.2.1

  • Require cohttp-eio, cohttp and http >= 6.2.1. Earlier versions have a different Cohttp_eio.Client.make ~https type and do not compile.

0.2.0

  • HTTP+JSON (REST) binding for protocol 1.0, selected from the Agent Card (~bindings) or with create ~binding:Http_json. REST errors (google.rpc.Status with an ErrorInfo reason) become Rpc_errors with the same codes as JSON-RPC errors. New module Protocol_binding, new binding accessor, and Error.Code.of_reason.
  • list_tasks (ListTasks) with filters and cursor pagination.
  • Push notification configs: create_task_push_notification_config, get_…, list_…, delete_…, and push_notification_config in Send_message_configuration (also with protocol 0.3).
  • get_extended_agent_card (GetExtendedAgentCard, 0.3 agent/getAuthenticatedExtendedCard) and with_agent_card.
  • Stream resumption: ~reconnect:(Reconnect.make ()) re-attaches a broken stream with SubscribeToTask (with Last-Event-ID and backoff), and falls back to GetTask if the task ended meanwhile. Off by default.
  • Transport.pooled: HTTP/1.1 keep-alive connection pool scoped to a Switch, with a retry on stale connections. Responses not read to the end are drained in the background so their connections can be reused.
  • Transport.meth gains `DELETE; Transport has an interface file.
  • Capability checks against the Agent Card also cover push notifications and the extended Agent Card.
  • Error.Code.to_string (Other n) is now "error n", as it also covers REST errors.
  • Behaviour change: connect, of_agent_card and select_interface now also pick HTTP+JSON interfaces, in the card's order. Pass ~bindings:[ Jsonrpc ] to keep JSON-RPC only.
  • Breaking: Send_message_configuration.t has a new field push_notification_config; build the record with make.
  • Backward compatibility with A2A v0.3. The protocol version is negotiated from the Agent Card (1.x preferred, then 0.3.x) or set with ~protocol_version. Existing code needs no changes.
  • Agent Cards in the v0.3 layout (url, preferredTransport, additionalInterfaces, security, type-tagged security schemes, supportsAuthenticatedExtendedCard) are decoded.
  • New modules Protocol_version and Codec_v0_3; new version accessor.
  • select_interface falls back to a v0.3 JSON-RPC interface instead of failing with No_compatible_interface.
  • Breaking: the public API is narrowed to what applications use. Jsonrpc and Sse are no longer exported, and Codec exposes only the protocol conversions (internal helpers and Codec.to_string are gone; use Codec.decode_json / decode_string). Lifecycle exposes Outcome and apply.

0.1.0

Initial release.

  • A2A protocol v1.0 client over the JSON-RPC binding (cohttp-eio, Eio).
  • Agent Card discovery and JSON-RPC interface selection.
  • SendMessage, GetTask, CancelTask, SendStreamingMessage, SubscribeToTask.
  • Incremental Server-Sent Events parser.
  • Task lifecycle helpers: Outcome, wait_for_task, send_message_and_wait.