a2ui-project / a2ui-project/a2ui
Refactor all client samples to use @a2a-js/sdk for agent communication
- Lingua principale
- TypeScript
- Stelle
- 16.4k
- Fork
- 1.3k
- Merge medio
- 3g 15h
- PR unite (30g)
- 134
Descrizione
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.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
La issue riguarda gli esempi client Angular e Lit (contact, restaurant, rizzcharts, mcp_calculator, component_gallery). Per prima cosa, esamina il codice manuale esistente fetch/SSE in questi esempi e confrontalo con l’esempio Lit Shell che usa @a2a-js/sdk. Installa l’SDK, sostituisci la comunicazione personalizzata con A2AClient e assicurati che le risposte tipizzate e i metadati siano gestiti correttamente. Verifica che gli esempi continuino a funzionare dopo il refactoring.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- angular, javascript, typescript
- Ambito
- frontend, tooling
- Tipo di issue
- Refactoring
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 65/100