fix: align agent registration contract

This commit is contained in:
ZacharyZhang-NY committed 2026-07-19 14:16:49 -04:00
1 parent eae9015a61
commit c9d1075585
4 files changed
+71 -4

No files matched your search

+1
View File
@@ -193,6 +193,7 @@ agent, err := client.RegisterAgent(&elydora.RegisterAgentRequest{
AgentID: "my-agent", AgentID: "my-agent",
DisplayName: "My Agent", DisplayName: "My Agent",
ResponsibleEntity: "team@example.com", ResponsibleEntity: "team@example.com",
IntegrationType: elydora.IntegrationTypeSDK,
Keys: []elydora.RegisterAgentKeyInput{ Keys: []elydora.RegisterAgentKeyInput{
{KID: "key-v1", PublicKey: "<base64url>", Algorithm: "ed25519"}, {KID: "key-v1", PublicKey: "<base64url>", Algorithm: "ed25519"},
}, },
+1
View File
@@ -106,6 +106,7 @@ func TestSDKCompatibilityAgainstLatestAPI(t *testing.T) {
AgentID: agentID, AgentID: agentID,
DisplayName: "Go SDK Compat Agent", DisplayName: "Go SDK Compat Agent",
ResponsibleEntity: "sdk-matrix", ResponsibleEntity: "sdk-matrix",
IntegrationType: elydora.IntegrationTypeSDK,
Keys: []elydora.RegisterAgentKeyInput{ Keys: []elydora.RegisterAgentKeyInput{
{ {
KID: kid, KID: kid,
+10 -4
View File
@@ -23,16 +23,21 @@ const (
type IntegrationType string type IntegrationType string
const ( const (
IntegrationTypeAugment IntegrationType = "augment"
IntegrationTypeClaudecode IntegrationType = "claudecode" IntegrationTypeClaudecode IntegrationType = "claudecode"
IntegrationTypeCline IntegrationType = "cline"
IntegrationTypeCodex IntegrationType = "codex"
IntegrationTypeCopilot IntegrationType = "copilot"
IntegrationTypeCursor IntegrationType = "cursor" IntegrationTypeCursor IntegrationType = "cursor"
IntegrationTypeDroid IntegrationType = "droid"
IntegrationTypeGemini IntegrationType = "gemini" IntegrationTypeGemini IntegrationType = "gemini"
IntegrationTypeGrok IntegrationType = "grok"
IntegrationTypeKimi IntegrationType = "kimi"
IntegrationTypeKiroCLI IntegrationType = "kirocli" IntegrationTypeKiroCLI IntegrationType = "kirocli"
IntegrationTypeKiroIDE IntegrationType = "kiroide" IntegrationTypeKiroIDE IntegrationType = "kiroide"
IntegrationTypeOpenCode IntegrationType = "opencode"
IntegrationTypeCopilot IntegrationType = "copilot"
IntegrationTypeLetta IntegrationType = "letta" IntegrationTypeLetta IntegrationType = "letta"
IntegrationTypeCodex IntegrationType = "codex" IntegrationTypeOpenCode IntegrationType = "opencode"
IntegrationTypeKimi IntegrationType = "kimi" IntegrationTypeQwen IntegrationType = "qwen"
IntegrationTypeEnterprise IntegrationType = "enterprise" IntegrationTypeEnterprise IntegrationType = "enterprise"
IntegrationTypeGUI IntegrationType = "gui" IntegrationTypeGUI IntegrationType = "gui"
IntegrationTypeSDK IntegrationType = "sdk" IntegrationTypeSDK IntegrationType = "sdk"
@@ -230,6 +235,7 @@ type RegisterAgentRequest struct {
AgentID string `json:"agent_id"` AgentID string `json:"agent_id"`
DisplayName string `json:"display_name,omitempty"` DisplayName string `json:"display_name,omitempty"`
ResponsibleEntity string `json:"responsible_entity,omitempty"` ResponsibleEntity string `json:"responsible_entity,omitempty"`
IntegrationType IntegrationType `json:"integration_type"`
Keys []RegisterAgentKeyInput `json:"keys"` Keys []RegisterAgentKeyInput `json:"keys"`
} }
+59
View File
@@ -0,0 +1,59 @@
package elydora
import (
"encoding/json"
"reflect"
"testing"
)
func TestRegisterAgentRequestIncludesIntegrationType(t *testing.T) {
payload, err := json.Marshal(RegisterAgentRequest{
AgentID: "agent-1",
IntegrationType: IntegrationTypeSDK,
Keys: []RegisterAgentKeyInput{},
})
if err != nil {
t.Fatalf("marshal register agent request: %v", err)
}
var decoded map[string]any
if err := json.Unmarshal(payload, &decoded); err != nil {
t.Fatalf("unmarshal register agent request: %v", err)
}
if got := decoded["integration_type"]; got != "sdk" {
t.Fatalf("integration_type = %v, want sdk", got)
}
}
func TestIntegrationTypesMatchPublicAPIContract(t *testing.T) {
got := []IntegrationType{
IntegrationTypeAugment,
IntegrationTypeClaudecode,
IntegrationTypeCline,
IntegrationTypeCodex,
IntegrationTypeCopilot,
IntegrationTypeCursor,
IntegrationTypeDroid,
IntegrationTypeGemini,
IntegrationTypeGrok,
IntegrationTypeKimi,
IntegrationTypeKiroCLI,
IntegrationTypeKiroIDE,
IntegrationTypeLetta,
IntegrationTypeOpenCode,
IntegrationTypeQwen,
IntegrationTypeEnterprise,
IntegrationTypeGUI,
IntegrationTypeSDK,
IntegrationTypeOther,
}
want := []IntegrationType{
"augment", "claudecode", "cline", "codex", "copilot", "cursor", "droid",
"gemini", "grok", "kimi", "kirocli", "kiroide", "letta", "opencode", "qwen",
"enterprise", "gui", "sdk", "other",
}
if !reflect.DeepEqual(got, want) {
t.Fatalf("integration types = %v, want %v", got, want)
}
}