Skip to content

Agent Mesh

bridge: keep per-skill input/output modes in the trimmed card

Tomas Tormo28a84c4a3695
diff --git a/cmd/sam-a2a-bridge/a2a.go b/cmd/sam-a2a-bridge/a2a.go
index 124d2a05..0964998a 100644
--- a/cmd/sam-a2a-bridge/a2a.go
+++ b/cmd/sam-a2a-bridge/a2a.go
@@ -67,6 +67,8 @@ type agentCardSkill struct {
Description string `json:"description,omitempty"`
Tags []string `json:"tags,omitempty"`
Examples []string `json:"examples,omitempty"`
+ InputModes []string `json:"input_modes,omitempty"`
+ OutputModes []string `json:"output_modes,omitempty"`
}
func handleGetAgentCard(ctx context.Context, cfg bridgeConfig, p getAgentCardParams) (agentCardSummary, error) {
@@ -104,6 +106,8 @@ func handleGetAgentCard(ctx context.Context, cfg bridgeConfig, p getAgentCardPar
Description: skill.Description,
Tags: skill.Tags,
Examples: skill.Examples,
+ InputModes: skill.InputModes,
+ OutputModes: skill.OutputModes,
})
}
return summary, nil
diff --git a/cmd/sam-a2a-bridge/a2a_test.go b/cmd/sam-a2a-bridge/a2a_test.go
index ac258448..236bb841 100644
--- a/cmd/sam-a2a-bridge/a2a_test.go
+++ b/cmd/sam-a2a-bridge/a2a_test.go
@@ -321,7 +321,7 @@ func TestGetAgentCardTrims(t *testing.T) {
`"securitySchemes":{"corp":{"apiKeySecurityScheme":{"location":"cookie","name":"session"}}},` +
`"provider":{"organization":"acme"},` +
`"skills":[{"id":"echo","name":"Echo","description":"repeats input",` +
- `"tags":["test"],"examples":["say hi"]}]}`
+ `"tags":["test"],"examples":["say hi"],"inputModes":["audio/mpeg"],"outputModes":["text/plain"]}]}`
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if r.Method != http.MethodGet || !strings.HasSuffix(r.URL.Path, "/.well-known/agent-card.json") {
http.Error(w, "not found", http.StatusNotFound)
@@ -340,7 +340,8 @@ func TestGetAgentCardTrims(t *testing.T) {
if got.Name != "echo-agent" || got.Version != "1.2.0" {
t.Errorf("identity fields: %+v", got)
}
- if len(got.Skills) != 1 || got.Skills[0].ID != "echo" || got.Skills[0].Examples[0] != "say hi" {
+ if len(got.Skills) != 1 || got.Skills[0].ID != "echo" || got.Skills[0].Examples[0] != "say hi" ||
+ len(got.Skills[0].InputModes) != 1 || got.Skills[0].InputModes[0] != "audio/mpeg" {
t.Errorf("skills not carried: %+v", got.Skills)
}
if len(got.DefaultInputModes) != 2 {