automagik-cli
Version:
Automagik CLI - A powerful command-line interface for interacting with Automagik Hive multi-agent AI systems
28 lines (27 loc) • 2.05 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Box, Text } from 'ink';
export const Header = ({ terminalWidth, version, connectionStatus, selectedTarget, availableTargets, onTargetChange, }) => {
const getConnectionStatusColor = () => {
switch (connectionStatus) {
case 'connected': return 'green';
case 'connecting': return 'yellow';
case 'error': return 'red';
default: return 'gray';
}
};
const getConnectionStatusText = () => {
switch (connectionStatus) {
case 'connected': return '● Connected';
case 'connecting': return '○ Connecting...';
case 'error': return '✗ Connection Error';
default: return '○ Unknown';
}
};
const formatTargetDisplay = () => {
if (!selectedTarget) {
return 'No target selected';
}
return `${selectedTarget.type.toUpperCase()}: ${selectedTarget.name}`;
};
return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsxs(Box, { justifyContent: "space-between", width: terminalWidth, children: [_jsxs(Box, { children: [_jsx(Text, { bold: true, color: "blue", children: "\uD83E\uDDDE Automagik Local CLI" }), _jsxs(Text, { color: "gray", children: [" v", version] })] }), _jsx(Text, { color: getConnectionStatusColor(), children: getConnectionStatusText() })] }), _jsx(Box, { marginTop: 1, marginBottom: 1, children: _jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { color: "cyan", children: "Current Target: " }), _jsx(Text, { bold: true, children: formatTargetDisplay() }), connectionStatus === 'connected' && (_jsx(Box, { marginTop: 1, children: _jsxs(Text, { color: "gray", children: ["Available: ", availableTargets.agents.length, " agents, ", availableTargets.teams.length, " teams, ", availableTargets.workflows.length, " workflows"] }) }))] }) }), _jsx(Box, { children: _jsx(Text, { color: "gray", children: '─'.repeat(Math.min(terminalWidth, 80)) }) })] }));
};