From a90b1cb38db7dcb979bb9433581168b30c5f6f2f Mon Sep 17 00:00:00 2001 From: Abhishek Deepak Date: Mon, 5 Oct 2026 22:02:37 +0530 Subject: [PATCH 1/3] fix(output): show protocol version in card Interfaces formatCard printed only ProtocolBinding and URL, so a card exposing JSONRPC at both 0.3 and 1.0 looked like two identical lines. Include ProtocolVersion when present. Fixes #88 --- internal/output/output.go | 8 +++++++- internal/output/output_test.go | 19 +++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/internal/output/output.go b/internal/output/output.go index 4b94a3b..edbe98e 100644 --- a/internal/output/output.go +++ b/internal/output/output.go @@ -219,7 +219,13 @@ func formatCard(card *a2a.AgentCard) string { if len(card.SupportedInterfaces) > 0 { sb.WriteString("Interfaces:\n") for _, iface := range card.SupportedInterfaces { - fmt.Fprintf(&sb, " %-12s %s\n", iface.ProtocolBinding, iface.URL) + // Include protocol version so cards that expose more than one + // (e.g. 0.3 and 1.0 JSONRPC) are distinguishable (#88). + if iface.ProtocolVersion != "" { + fmt.Fprintf(&sb, " %-12s %-6s %s\n", iface.ProtocolBinding, iface.ProtocolVersion, iface.URL) + } else { + fmt.Fprintf(&sb, " %-12s %s\n", iface.ProtocolBinding, iface.URL) + } } } diff --git a/internal/output/output_test.go b/internal/output/output_test.go index d41a1f8..ad24ab8 100644 --- a/internal/output/output_test.go +++ b/internal/output/output_test.go @@ -16,6 +16,7 @@ package output import ( "bytes" + "strings" "testing" "github.com/google/go-cmp/cmp" @@ -111,3 +112,21 @@ func TestMessageTextFileParts(t *testing.T) { }) } } + +func TestFormatCard_InterfacesIncludeProtocolVersion(t *testing.T) { + card := &a2a.AgentCard{ + Name: "ADEXTO Launchpad", + Version: "1.0.0", + SupportedInterfaces: []*a2a.AgentInterface{ + {URL: "https://adexto.xyz/api/a2a/v03", ProtocolBinding: a2a.TransportProtocolJSONRPC, ProtocolVersion: "0.3"}, + {URL: "https://adexto.xyz/api/a2a", ProtocolBinding: a2a.TransportProtocolJSONRPC, ProtocolVersion: a2a.Version}, + }, + } + out := formatCard(card) + if !strings.Contains(out, "JSONRPC") || !strings.Contains(out, "0.3") || !strings.Contains(out, "1.0") { + t.Fatalf("Interfaces output missing protocol versions:\n%s", out) + } + if !strings.Contains(out, "https://adexto.xyz/api/a2a/v03") { + t.Fatalf("missing interface URL:\n%s", out) + } +} From 37874e1cb06dfc82cb7da0e6574ed04ddf15d240 Mon Sep 17 00:00:00 2001 From: Sampath Kumar Date: Mon, 12 Oct 2026 19:40:24 +0200 Subject: [PATCH 2/3] Update test URLs in output_test.go Use generic domain name like `example.com` --- internal/output/output_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/output/output_test.go b/internal/output/output_test.go index ad24ab8..e5c7283 100644 --- a/internal/output/output_test.go +++ b/internal/output/output_test.go @@ -118,15 +118,15 @@ func TestFormatCard_InterfacesIncludeProtocolVersion(t *testing.T) { Name: "ADEXTO Launchpad", Version: "1.0.0", SupportedInterfaces: []*a2a.AgentInterface{ - {URL: "https://adexto.xyz/api/a2a/v03", ProtocolBinding: a2a.TransportProtocolJSONRPC, ProtocolVersion: "0.3"}, - {URL: "https://adexto.xyz/api/a2a", ProtocolBinding: a2a.TransportProtocolJSONRPC, ProtocolVersion: a2a.Version}, + {URL: "https://example.com/a2a/v03", ProtocolBinding: a2a.TransportProtocolJSONRPC, ProtocolVersion: "0.3"}, + {URL: "https://example.com/a2a", ProtocolBinding: a2a.TransportProtocolJSONRPC, ProtocolVersion: a2a.Version}, }, } out := formatCard(card) if !strings.Contains(out, "JSONRPC") || !strings.Contains(out, "0.3") || !strings.Contains(out, "1.0") { t.Fatalf("Interfaces output missing protocol versions:\n%s", out) } - if !strings.Contains(out, "https://adexto.xyz/api/a2a/v03") { + if !strings.Contains(out, "https://example.com/a2a/v03") { t.Fatalf("missing interface URL:\n%s", out) } } From d229bf423649cc554e88eaa5171c1839a41b53f1 Mon Sep 17 00:00:00 2001 From: Sampath Kumar Date: Mon, 12 Oct 2026 19:41:19 +0200 Subject: [PATCH 3/3] Update agent card name in test case --- internal/output/output_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/output/output_test.go b/internal/output/output_test.go index e5c7283..0387134 100644 --- a/internal/output/output_test.go +++ b/internal/output/output_test.go @@ -115,7 +115,7 @@ func TestMessageTextFileParts(t *testing.T) { func TestFormatCard_InterfacesIncludeProtocolVersion(t *testing.T) { card := &a2a.AgentCard{ - Name: "ADEXTO Launchpad", + Name: "Example Agent", Version: "1.0.0", SupportedInterfaces: []*a2a.AgentInterface{ {URL: "https://example.com/a2a/v03", ProtocolBinding: a2a.TransportProtocolJSONRPC, ProtocolVersion: "0.3"},