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..0387134 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: "Example Agent", + Version: "1.0.0", + SupportedInterfaces: []*a2a.AgentInterface{ + {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://example.com/a2a/v03") { + t.Fatalf("missing interface URL:\n%s", out) + } +}