namespace Nexus.Api.Services; public static class AgentIdentityCatalog { public static readonly string[] DefaultConfiguredAgentIds = [ "main", "iris", "product-owner", "programmer", "programmer-fast", "reviewer", "architekt", "researcher", "executor" ]; private static readonly string[] WorkflowActorIds = [ "bao", "nexus-system" ]; public static IReadOnlySet BuildAllowedActorIds(IEnumerable configuredAgentIds) { var ids = new HashSet(WorkflowActorIds, StringComparer.OrdinalIgnoreCase); foreach (var configuredAgentId in configuredAgentIds) { if (!string.IsNullOrWhiteSpace(configuredAgentId)) ids.Add(configuredAgentId.Trim().ToLowerInvariant()); } return ids; } public static string? NormalizeActorId(string? actorId, IReadOnlySet allowedActorIds) { if (string.IsNullOrWhiteSpace(actorId)) return null; var normalized = actorId.Trim().ToLowerInvariant(); return allowedActorIds.Contains(normalized) ? normalized : null; } }