UNPKG

@every-env/cli

Version:

Multi-agent orchestrator for AI-powered development workflows

38 lines 2.06 kB
import React, { useState, useEffect } from 'react'; import { Box, Text } from 'ink'; export function LogsView({ task, onClose: _onClose }) { const [logs, setLogs] = useState([]); useEffect(() => { // Simulate log entries for demo const sampleLogs = [ { timestamp: '14:23:01', message: 'Started claude-code' }, { timestamp: '14:23:05', message: 'Analyzing task requirements...' }, { timestamp: '14:23:12', message: 'Found relevant files in codebase' }, { timestamp: '14:23:45', message: 'Applying changes...' }, { timestamp: '14:24:32', message: `Running tests... ${task.progress || 0}% complete` } ]; setLogs(sampleLogs); // In a real implementation, this would connect to the agent's log stream const interval = setInterval(() => { const now = new Date(); const timestamp = `${now.getHours().toString().padStart(2, '0')}:${now.getMinutes().toString().padStart(2, '0')}:${now.getSeconds().toString().padStart(2, '0')}`; setLogs(prev => [...prev, { timestamp, message: `Processing... ${Math.floor(Math.random() * 100)}% complete` }]); }, 3000); return () => clearInterval(interval); }, [task]); return (React.createElement(Box, { flexDirection: "column", borderStyle: "single", borderColor: "gray", padding: 1 }, React.createElement(Text, { bold: true }, task.title, " logs:"), React.createElement(Box, { flexDirection: "column", marginTop: 1 }, logs.map((log, i) => (React.createElement(Box, { key: i }, React.createElement(Text, { color: "gray" }, log.timestamp, " "), React.createElement(Text, null, log.message))))), React.createElement(Box, { marginTop: 1 }, React.createElement(Text, { color: "gray" }, "[Esc]back \u2022 \u2191\u2193 scroll \u2022 [1-4]jump")))); } //# sourceMappingURL=LogsView.js.map