Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

1.2 KB
Raw Blame
import {
  HETEROGENEOUS_AGENT_CONFIGS,
  LOCAL_RUNTIME_HETEROGENEOUS_AGENT_CONFIGS,
  REMOTE_HETEROGENEOUS_AGENT_CONFIGS,
} from './config';

/**
 * Display-name mapping for all heterogeneous agent types (local CLI, local
 * runtime, remote platform).
 *
 * Keys mirror the registry keys in `registry.ts` (adapter type). UI layers
 * use this to render user-facing names (e.g. "Claude Code is running")
 * without knowing adapter-specific branding.
 * Add new types to HETEROGENEOUS_AGENT_CONFIGS, LOCAL_RUNTIME_HETEROGENEOUS_AGENT_CONFIGS
 * or REMOTE_HETEROGENEOUS_AGENT_CONFIGS in config.ts to automatically include them here.
 */
export const HETEROGENEOUS_TYPE_LABELS: Record<string, string> = Object.fromEntries([
  ...HETEROGENEOUS_AGENT_CONFIGS.map((config) => [config.type, config.title]),
  ...LOCAL_RUNTIME_HETEROGENEOUS_AGENT_CONFIGS.map((config) => [config.type, config.title]),
  ...REMOTE_HETEROGENEOUS_AGENT_CONFIGS.map((config) => [config.type, config.title]),
]);

export const getHeterogeneousTypeLabel = (type?: string | null): string | undefined => {
  if (!type) return undefined;

  return Object.hasOwn(HETEROGENEOUS_TYPE_LABELS, type) ? HETEROGENEOUS_TYPE_LABELS[type] : type;
};