import { motion, AnimatePresence } from 'framer-motion' /* ── Ease ──────────────────────────────────────────────── */ const EASE_OUT = [0.25, 0.46, 0.45, 0.94] /* ── Badge config ─────────────────────────────────────── */ const DECISION_CONF = { needs_search: { label: 'Search', color: 'text-blue', bg: 'bg-blue-soft', icon: '⌕' }, direct_answer: { label: 'Direct', color: 'text-emerald', bg: 'bg-emerald-soft', icon: '↯' }, memory_sufficient:{ label: 'Memory', color: 'text-accent', bg: 'bg-accent-soft', icon: '◎' }, } const CONFIDENCE_WIDTH = { high: '100%', medium: '60%', low: '28%' } /* ── Stat row ─────────────────────────────────────────── */ function Stat({ label, value }) { return (
{label} {value}
) } /* ── Plan steps ───────────────────────────────────────── */ function PlanTimeline({ steps }) { if (!steps?.length) return null return (

Execution plan

{steps.map((step, i) => (
{step} ))}
) } /* ── Main panel ───────────────────────────────────────── */ export default function AgentPanel({ isOpen, onClose, metadata }) { if (!metadata) return null const decision = DECISION_CONF[metadata.decision] || DECISION_CONF.needs_search const conf = metadata.confidence || 'medium' return ( {isOpen && ( <> {/* Backdrop */} {/* Panel */} {/* Header */}

Insights

{/* Content */}
{/* Decision + confidence */}
{decision.icon} {decision.label}
routing
Confidence {conf}
{/* Metrics */}

Metrics

{(metadata.steps_skipped > 0 || metadata.early_stopped) && ( <> )}

{metadata.source || 'planner_executor'}

)} ) }