import { Box, Typography } from '@mui/material'; import { keyframes } from '@mui/system'; import { useAgentStore, type ActivityStatus } from '@/store/agentStore'; const shimmer = keyframes` 0% { background-position: -100% center; } 50% { background-position: 200% center; } 100% { background-position: -100% center; } `; const TOOL_LABELS: Record = { sandbox_create: 'Creating sandbox for code development, this might take 1-2 minutes', bash: 'Running command in sandbox', hf_jobs: 'Running a GPU job, this might take a while', hf_repo_files: 'Uploading file', hf_repo_git: 'Git operation', hf_inspect_dataset: 'Inspecting dataset', hf_search: 'Searching', plan_tool: 'Planning', research: 'Researching', }; function statusLabel(status: ActivityStatus): string { switch (status.type) { case 'thinking': return 'Thinking'; case 'streaming': return 'Writing'; case 'tool': { const base = status.description || TOOL_LABELS[status.toolName] || `Running ${status.toolName}`; if (status.toolName === 'bash' && status.description && /install/i.test(status.description)) { return `${base} — this can take a few minutes, sit tight`; } return base; } case 'waiting-approval': return 'Waiting for approval'; case 'cancelled': return 'What should the agent do instead?'; default: return ''; } } export default function ActivityStatusBar() { const activityStatus = useAgentStore(s => s.activityStatus); if (activityStatus.type === 'idle') return null; const label = statusLabel(activityStatus); return ( {label}{activityStatus.type !== 'cancelled' && '…'} ); }