feat: add concurrent agents with dependency system and delightful UI

Major feature implementation for parallel agent execution with dependency-aware
scheduling and an engaging multi-agent UI experience.

Backend Changes:
- Add parallel_orchestrator.py for concurrent feature processing
- Add api/dependency_resolver.py with cycle detection (Kahn's algorithm + DFS)
- Add atomic feature_claim_next() with retry limit and exponential backoff
- Fix circular dependency check arguments in 4 locations
- Add AgentTracker class for parsing agent output and emitting updates
- Add browser isolation with --isolated flag for Playwright MCP
- Extend WebSocket protocol with agent_update messages and log attribution
- Add WSAgentUpdateMessage schema with agent states and mascot names
- Fix WSProgressMessage to include in_progress field

New UI Components:
- AgentMissionControl: Dashboard showing active agents with collapsible activity
- AgentCard: Individual agent status with avatar and thought bubble
- AgentAvatar: SVG mascots (Spark, Fizz, Octo, Hoot, Buzz) with animations
- ActivityFeed: Recent activity stream with stable keys (no flickering)
- CelebrationOverlay: Confetti animation with click/Escape dismiss
- DependencyGraph: Interactive node graph visualization with dagre layout
- DependencyBadge: Visual indicator for feature dependencies
- ViewToggle: Switch between Kanban and Graph views
- KeyboardShortcutsHelp: Help overlay accessible via ? key

UI/UX Improvements:
- Celebration queue system to handle rapid success messages
- Accessibility attributes on AgentAvatar (role, aria-label, aria-live)
- Collapsible Recent Activity section with persisted preference
- Agent count display in header
- Keyboard shortcut G to toggle Kanban/Graph view
- Real-time thought bubbles and state animations

Bug Fixes:
- Fix circular dependency validation (swapped source/target arguments)
- Add MAX_CLAIM_RETRIES=10 to prevent stack overflow under contention
- Fix THOUGHT_PATTERNS to match actual [Tool: name] format
- Fix ActivityFeed key prop to prevent re-renders on new items
- Add featureId/agentIndex to log messages for proper attribution

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Auto
2026-01-17 12:59:42 +02:00
parent 91cc00a9d0
commit 85f6940a54
39 changed files with 4532 additions and 157 deletions

View File

@@ -0,0 +1,93 @@
import { Activity } from 'lucide-react'
import { AgentAvatar } from './AgentAvatar'
import type { AgentMascot } from '../lib/types'
interface ActivityItem {
agentName: string
thought: string
timestamp: string
featureId: number
}
interface ActivityFeedProps {
activities: ActivityItem[]
maxItems?: number
showHeader?: boolean
}
function formatTimestamp(timestamp: string): string {
const date = new Date(timestamp)
const now = new Date()
const diffMs = now.getTime() - date.getTime()
const diffSec = Math.floor(diffMs / 1000)
if (diffSec < 5) return 'just now'
if (diffSec < 60) return `${diffSec}s ago`
if (diffSec < 3600) return `${Math.floor(diffSec / 60)}m ago`
return date.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })
}
export function ActivityFeed({ activities, maxItems = 5, showHeader = true }: ActivityFeedProps) {
const displayedActivities = activities.slice(0, maxItems)
if (displayedActivities.length === 0) {
return null
}
return (
<div>
{showHeader && (
<div className="flex items-center gap-2 mb-2">
<Activity size={14} className="text-neo-text-secondary" />
<span className="text-xs font-bold text-neo-text-secondary uppercase tracking-wide">
Recent Activity
</span>
</div>
)}
<div className="space-y-2">
{displayedActivities.map((activity) => (
<div
key={`${activity.featureId}-${activity.timestamp}-${activity.thought.slice(0, 20)}`}
className="flex items-start gap-2 py-1.5 px-2 rounded bg-[var(--color-neo-bg)] border border-neo-border/20"
>
<AgentAvatar
name={activity.agentName as AgentMascot}
state="working"
size="sm"
/>
<div className="flex-1 min-w-0">
<div className="flex items-center gap-2">
<span className="text-xs font-bold" style={{
color: getMascotColor(activity.agentName as AgentMascot)
}}>
{activity.agentName}
</span>
<span className="text-[10px] text-neo-text-muted">
#{activity.featureId}
</span>
<span className="text-[10px] text-neo-text-muted ml-auto">
{formatTimestamp(activity.timestamp)}
</span>
</div>
<p className="text-xs text-neo-text-secondary truncate" title={activity.thought}>
{activity.thought}
</p>
</div>
</div>
))}
</div>
</div>
)
}
function getMascotColor(name: AgentMascot): string {
const colors: Record<AgentMascot, string> = {
Spark: '#3B82F6',
Fizz: '#F97316',
Octo: '#8B5CF6',
Hoot: '#22C55E',
Buzz: '#EAB308',
}
return colors[name] || '#6B7280'
}