java.lang.Object
com.mulesoft.modules.agent.broker.internal.tool.a2a.A2AService
All Implemented Interfaces:
org.mule.runtime.api.lifecycle.Initialisable

public class A2AService extends Object implements org.mule.runtime.api.lifecycle.Initialisable
Service responsible for managing A2A tools in the Agent Broker. This service discovers agent capabilities and creates tool handlers for A2A tools.
  • Constructor Details

    • A2AService

      public A2AService()
  • Method Details

    • initialise

      public void initialise() throws org.mule.runtime.api.lifecycle.InitialisationException
      Specified by:
      initialise in interface org.mule.runtime.api.lifecycle.Initialisable
      Throws:
      org.mule.runtime.api.lifecycle.InitialisationException
    • getTools

      public CompletableFuture<Map<String,Tool>> getTools(List<A2AClient> a2aClients, org.mule.runtime.extension.api.client.ExtensionsClient extensionsClient)
      Retrieves A2A servers and creates tools for each A2A server provided.
      Parameters:
      a2aClients - List of A2A client configurations
      extensionsClient - The ExtensionClient to hit the A2A connector
      Returns:
      CompletableFuture containing a map of tool handlers
    • completedJsonResult

      public org.mule.runtime.extension.api.runtime.operation.Result<String,Void> completedJsonResult(Conversation conversation, TaskContext taskContext, String output)
    • inputRequiredJsonResult

      public org.mule.runtime.extension.api.runtime.operation.Result<String,Void> inputRequiredJsonResult(Conversation conversation, TaskContext taskContext, List<io.a2a.spec.Part<?>> messageParts, List<io.a2a.spec.Artifact> artifacts)
    • authRequiredJsonResult

      public org.mule.runtime.extension.api.runtime.operation.Result<String,Void> authRequiredJsonResult(Conversation conversation, TaskContext taskContext, List<io.a2a.spec.Part<?>> messageParts, List<io.a2a.spec.Artifact> artifacts)
      Builds an auth-required JSON response following A2A spec. The upstream agent's original message parts are passed through transparently so the client receives the full auth challenge (e.g., authChallenge with provider, endpoints, scopes).
      Parameters:
      conversation - the current conversation
      taskContext - the current task context
      messageParts - the original message parts from the upstream auth-required response
      artifacts - the original artifacts from the upstream auth-required response
    • asJsonResult

      public org.mule.runtime.extension.api.runtime.operation.Result<String,Void> asJsonResult(io.a2a.spec.Task task)
    • unmarshall

      public <T> T unmarshall(InputStream json, Class<T> type)