add A2A transport to agent-core - #31
Open
talktogina-developer wants to merge 1 commit into
Open
Conversation
Implements `createA2ATransport` — an `AgentTransport` that routes the GenOffice AI panel to any A2A-protocol-compatible agent over HTTP SSE (https://github.com/a2aproject/A2A). The full conversation context (system prompt + message history) is encoded into a single A2A user message on each `tasks/sendSubscribe` call; streamed artifact text parts are forwarded as `onDelta` events. Error paths — HTTP errors, JSON-RPC error objects, task failed/canceled status, and network failures — all surface via `onError`. Cancellation aborts the in-flight fetch via `AbortController`. Exports `createA2ATransport` and `A2ATransportOptions` from the package root alongside the existing `createIpcTransport`. 11 unit tests cover: correct JSON-RPC wire format, auth/session headers, SSE streaming deltas, status-completion, error paths, abort, multi-turn history encoding, and URL normalisation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
createA2ATransport— anAgentTransportimplementation that routes the GenOffice AI panel to any A2A-protocol-compatible remote agent over HTTP SSE (tasks/sendSubscribe)onDeltaevents; cancellation usesAbortControllercreateA2ATransportandA2ATransportOptionsfrom@genoffice/agent-corealongside the existingcreateIpcTransportTest plan
npm run test -w @genoffice/agent-core— 11 new unit tests (57 total, all pass); covers JSON-RPC wire format, auth/session headers, SSE streaming deltas, status-completion, error paths (HTTP, JSON-RPC, task failed/canceled, network), abort, multi-turn history encoding, and URL normalisationnpm run typecheck -w @genoffice/agent-core— cleannpm run format:check— clean (Prettier)npm run lint— 0 errors (pre-existing warnings only, none in new files)