import { Terminal, Bot, Code } from "lucide-react"; import type { AgentStatus } from "../../server/acp/types.js"; export interface ActiveProcessesProps { terminals: Array<{ id: string; name: string }>; agents: Array<{ id: string; status: AgentStatus; type: "claude"; currentModeId?: string; availableModes?: Array<{ id: string; name: string; description?: string | null }>; }>; commands: Array<{ id: string; name: string; workingDirectory: string; currentCommand: string; isDead: boolean; exitCode: number | null; }>; activeProcessId: string | null; activeProcessType: "terminal" | "agent" | null; onSelectProcess: (id: string, type: "terminal" | "agent") => void; onBackToOrchestrator: () => void; } function getAgentStatusColor(status: AgentStatus): string { switch (status) { case "initializing": return "#f59e0b"; // orange case "ready": return "#3b82f6"; // blue case "processing": return "#fbbf24"; // yellow case "completed": return "#22c55e"; // green case "failed": return "#ef4444"; // red case "killed": return "#9ca3af"; // gray default: return "#9ca3af"; } } function getAgentStatusLabel(status: AgentStatus): string { return status; } function getModeName(modeId?: string, availableModes?: Array<{ id: string; name: string }>): string { if (!modeId) return "unknown"; const mode = availableModes?.find(m => m.id === modeId); return mode?.name || modeId; } function getModeColor(modeId?: string): string { if (!modeId) return "#9ca3af"; // gray // Color based on common mode types if (modeId.includes("ask")) return "#f59e0b"; // orange - asks permission if (modeId.includes("code")) return "#22c55e"; // green - writes code if (modeId.includes("architect") || modeId.includes("plan")) return "#3b82f6"; // blue - plans return "#9ca3af"; // gray - unknown } export function ActiveProcesses({ terminals, agents, commands, activeProcessId, activeProcessType, onSelectProcess, onBackToOrchestrator, }: ActiveProcessesProps) { const hasActiveProcess = activeProcessId !== null && activeProcessType !== null; return (
{command.name || command.currentCommand.substring(0, 20)}