Skip to content

Refactor all client samples to use @a2a-js/sdk for agent communication #966

@jacobsimionato

Description

@jacobsimionato

Currently, several client samples (Angular and Lit) implement manual fetch calls and custom SSE parsing to communicate with agents via a proxy. This introduces significant boilerplate and maintenance overhead. We should refactor these samples to use the @a2a-js/sdk A2AClient directly in the browser, matching the standard pattern used in the Lit Shell sample.

Benefits:

  • Eliminates Manual SSE Logic: Removes the need for ReadableStream, TextDecoder, and manual line parsing in every client.
  • Typed Responses: Standardizes response handling using SDK types (Message, Task, Artifact) instead of manual filtering of parts.
  • Simplified Middlewares: backend middlewares can transition from protocol converters to simple transparent proxies.
  • Robust Metadata: Centralizes the management of a2uiClientCapabilities and inlineCatalogs using the SDK's message metadata structure.

Scope:

  • Angular Samples: contact, restaurant, rizzcharts, mcp_calculator.
  • Lit Samples: contact, component_gallery.

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: ergonomicsEfficiency and simplicity of the protocol adoption.component: samplesRelevant to the agent or client samplesjavascriptPull requests that update javascript codesprint readyThis issue should be included in sprint planning views

    Type

    No type

    Projects

    Status

    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions