import { type AgentMascot, type AgentState } from '../lib/types' interface AgentAvatarProps { name: AgentMascot state: AgentState size?: 'sm' | 'md' | 'lg' showName?: boolean } const AVATAR_COLORS: Record = { // Original 5 Spark: { primary: '#3B82F6', secondary: '#60A5FA', accent: '#DBEAFE' }, // Blue robot Fizz: { primary: '#F97316', secondary: '#FB923C', accent: '#FFEDD5' }, // Orange fox Octo: { primary: '#8B5CF6', secondary: '#A78BFA', accent: '#EDE9FE' }, // Purple octopus Hoot: { primary: '#22C55E', secondary: '#4ADE80', accent: '#DCFCE7' }, // Green owl Buzz: { primary: '#EAB308', secondary: '#FACC15', accent: '#FEF9C3' }, // Yellow bee // Tech-inspired Pixel: { primary: '#EC4899', secondary: '#F472B6', accent: '#FCE7F3' }, // Pink Byte: { primary: '#06B6D4', secondary: '#22D3EE', accent: '#CFFAFE' }, // Cyan Nova: { primary: '#F43F5E', secondary: '#FB7185', accent: '#FFE4E6' }, // Rose Chip: { primary: '#84CC16', secondary: '#A3E635', accent: '#ECFCCB' }, // Lime Bolt: { primary: '#FBBF24', secondary: '#FCD34D', accent: '#FEF3C7' }, // Amber // Energetic Dash: { primary: '#14B8A6', secondary: '#2DD4BF', accent: '#CCFBF1' }, // Teal Zap: { primary: '#A855F7', secondary: '#C084FC', accent: '#F3E8FF' }, // Violet Gizmo: { primary: '#64748B', secondary: '#94A3B8', accent: '#F1F5F9' }, // Slate Turbo: { primary: '#EF4444', secondary: '#F87171', accent: '#FEE2E2' }, // Red Blip: { primary: '#10B981', secondary: '#34D399', accent: '#D1FAE5' }, // Emerald // Playful Neon: { primary: '#D946EF', secondary: '#E879F9', accent: '#FAE8FF' }, // Fuchsia Widget: { primary: '#6366F1', secondary: '#818CF8', accent: '#E0E7FF' }, // Indigo Zippy: { primary: '#F59E0B', secondary: '#FBBF24', accent: '#FEF3C7' }, // Orange-yellow Quirk: { primary: '#0EA5E9', secondary: '#38BDF8', accent: '#E0F2FE' }, // Sky Flux: { primary: '#7C3AED', secondary: '#8B5CF6', accent: '#EDE9FE' }, // Purple } const SIZES = { sm: { svg: 32, font: 'text-xs' }, md: { svg: 48, font: 'text-sm' }, lg: { svg: 64, font: 'text-base' }, } // SVG mascot definitions - simple cute characters function SparkSVG({ colors, size }: { colors: typeof AVATAR_COLORS.Spark; size: number }) { return ( {/* Robot body */} {/* Robot head */} {/* Antenna */} {/* Eyes */} {/* Mouth */} {/* Arms */} ) } function FizzSVG({ colors, size }: { colors: typeof AVATAR_COLORS.Fizz; size: number }) { return ( {/* Ears */} {/* Head */} {/* Face */} {/* Eyes */} {/* Nose */} {/* Whiskers */} ) } function OctoSVG({ colors, size }: { colors: typeof AVATAR_COLORS.Octo; size: number }) { return ( {/* Tentacles */} {/* Head */} {/* Eyes */} {/* Smile */} ) } function HootSVG({ colors, size }: { colors: typeof AVATAR_COLORS.Hoot; size: number }) { return ( {/* Ear tufts */} {/* Body */} {/* Head */} {/* Eye circles */} {/* Eyes */} {/* Beak */} {/* Belly */} ) } function BuzzSVG({ colors, size }: { colors: typeof AVATAR_COLORS.Buzz; size: number }) { return ( {/* Wings */} {/* Body stripes */} {/* Head */} {/* Antennae */} {/* Eyes */} {/* Smile */} ) } // Pixel - cute pixel art style character function PixelSVG({ colors, size }: { colors: typeof AVATAR_COLORS.Pixel; size: number }) { return ( {/* Blocky body */} {/* Head */} {/* Eyes */} {/* Mouth */} ) } // Byte - data cube character function ByteSVG({ colors, size }: { colors: typeof AVATAR_COLORS.Byte; size: number }) { return ( {/* 3D cube body */} {/* Face */} ) } // Nova - star character function NovaSVG({ colors, size }: { colors: typeof AVATAR_COLORS.Nova; size: number }) { return ( {/* Star points */} {/* Face */} ) } // Chip - circuit board character function ChipSVG({ colors, size }: { colors: typeof AVATAR_COLORS.Chip; size: number }) { return ( {/* Chip body */} {/* Pins */} {/* Face */} ) } // Bolt - lightning character function BoltSVG({ colors, size }: { colors: typeof AVATAR_COLORS.Bolt; size: number }) { return ( {/* Lightning bolt body */} {/* Face */} ) } // Dash - speedy character function DashSVG({ colors, size }: { colors: typeof AVATAR_COLORS.Dash; size: number }) { return ( {/* Speed lines */} {/* Aerodynamic body */} {/* Face */} ) } // Zap - electric orb function ZapSVG({ colors, size }: { colors: typeof AVATAR_COLORS.Zap; size: number }) { return ( {/* Electric sparks */} {/* Orb */} {/* Face */} ) } // Gizmo - gear character function GizmoSVG({ colors, size }: { colors: typeof AVATAR_COLORS.Gizmo; size: number }) { return ( {/* Gear teeth */} {/* Gear body */} {/* Face */} ) } // Turbo - rocket character function TurboSVG({ colors, size }: { colors: typeof AVATAR_COLORS.Turbo; size: number }) { return ( {/* Flames */} {/* Rocket body */} {/* Nose cone */} {/* Fins */} {/* Window/Face */} ) } // Blip - radar dot character function BlipSVG({ colors, size }: { colors: typeof AVATAR_COLORS.Blip; size: number }) { return ( {/* Radar rings */} {/* Main dot */} {/* Face */} ) } // Neon - glowing character function NeonSVG({ colors, size }: { colors: typeof AVATAR_COLORS.Neon; size: number }) { return ( {/* Glow effect */} {/* Body */} {/* Inner glow */} {/* Face */} ) } // Widget - UI component character function WidgetSVG({ colors, size }: { colors: typeof AVATAR_COLORS.Widget; size: number }) { return ( {/* Window frame */} {/* Title bar */} {/* Content area / Face */} ) } // Zippy - fast bunny-like character function ZippySVG({ colors, size }: { colors: typeof AVATAR_COLORS.Zippy; size: number }) { return ( {/* Ears */} {/* Head */} {/* Face */} {/* Nose and mouth */} ) } // Quirk - question mark character function QuirkSVG({ colors, size }: { colors: typeof AVATAR_COLORS.Quirk; size: number }) { return ( {/* Question mark body */} {/* Face on the dot */} {/* Decorative swirl */} ) } // Flux - flowing wave character function FluxSVG({ colors, size }: { colors: typeof AVATAR_COLORS.Flux; size: number }) { return ( {/* Wave body */} {/* Face */} {/* Sparkles */} ) } const MASCOT_SVGS: Record = { // Original 5 Spark: SparkSVG, Fizz: FizzSVG, Octo: OctoSVG, Hoot: HootSVG, Buzz: BuzzSVG, // Tech-inspired Pixel: PixelSVG, Byte: ByteSVG, Nova: NovaSVG, Chip: ChipSVG, Bolt: BoltSVG, // Energetic Dash: DashSVG, Zap: ZapSVG, Gizmo: GizmoSVG, Turbo: TurboSVG, Blip: BlipSVG, // Playful Neon: NeonSVG, Widget: WidgetSVG, Zippy: ZippySVG, Quirk: QuirkSVG, Flux: FluxSVG, } // Animation classes based on state function getStateAnimation(state: AgentState): string { switch (state) { case 'idle': return 'animate-bounce-gentle' case 'thinking': return 'animate-thinking' case 'working': return 'animate-working' case 'testing': return 'animate-testing' case 'success': return 'animate-celebrate' case 'error': case 'struggling': return 'animate-shake-gentle' default: return '' } } // Glow effect based on state function getStateGlow(state: AgentState): string { switch (state) { case 'working': return 'shadow-[0_0_12px_rgba(0,180,216,0.5)]' case 'thinking': return 'shadow-[0_0_8px_rgba(255,214,10,0.4)]' case 'success': return 'shadow-[0_0_16px_rgba(112,224,0,0.6)]' case 'error': case 'struggling': return 'shadow-[0_0_12px_rgba(255,84,0,0.5)]' default: return '' } } // Get human-readable state description for accessibility function getStateDescription(state: AgentState): string { switch (state) { case 'idle': return 'waiting' case 'thinking': return 'analyzing' case 'working': return 'coding' case 'testing': return 'running tests' case 'success': return 'completed successfully' case 'error': return 'encountered an error' case 'struggling': return 'having difficulty' default: return state } } export function AgentAvatar({ name, state, size = 'md', showName = false }: AgentAvatarProps) { const colors = AVATAR_COLORS[name] const { svg: svgSize, font } = SIZES[size] const SvgComponent = MASCOT_SVGS[name] const stateDesc = getStateDescription(state) const ariaLabel = `Agent ${name} is ${stateDesc}` return (
{showName && ( {name} )}
) }