export const AGENT_ROLE_OPTIONS = [
  "Generalist",
  "Backend Code",
  "UI",
  "Security Review",
  "Code Review",
  "QA",
  "DevOps",
  "Data",
  "Documentation",
  "Product",
  "Triage",
] as const;

export const PRIMARY_AGENT_ROLE_OPTIONS = [
  "Backend Code",
  "UI",
  "Security Review",
  "Code Review",
] as const;

export const getAgentRole = (
  identityProfile: unknown,
  fallback = "Unassigned",
): string => {
  if (!identityProfile || typeof identityProfile !== "object") {
    return fallback;
  }
  const role = (identityProfile as Record<string, unknown>).role;
  return typeof role === "string" && role.trim() ? role.trim() : fallback;
};
