import type { Action, Observation, Reasoning } from '../types' interface Props { observation: Observation reasoning: Reasoning currentAction: Action | null taskName: string } function summarizeObservation(observation: Observation): string { const activeZones = observation.zones.filter((zone) => zone.casualties_remaining > 0 || zone.supply_gap > 0) const blocked = activeZones.filter((zone) => zone.road_blocked).map((zone) => zone.zone_id) const critical = activeZones .filter((zone) => zone.severity >= 0.75) .map((zone) => zone.zone_id) const parts = [ `${activeZones.length} active zone${activeZones.length === 1 ? '' : 's'}`, critical.length > 0 ? `critical: ${critical.join(', ')}` : 'no critical zones', blocked.length > 0 ? `blocked: ${blocked.join(', ')}` : 'roads mostly open', ] return parts.join(' | ') } export function CopilotQaPanel({ observation, reasoning, currentAction, taskName }: Props) { const actionLabel = currentAction ? `${currentAction.action}${currentAction.to_zone ? ` -> ${currentAction.to_zone}` : currentAction.from_zone ? ` <- ${currentAction.from_zone}` : ''}` : 'No action selected' return (

Quick QA

{taskName}
{summarizeObservation(observation)}
Current action
{actionLabel}
Triage summary
{reasoning.triage_summary || 'No triage summary yet.'}
Planner summary
{reasoning.plan_decision || 'No planner summary yet.'}
) }