2026-01-06 15:52:12 -05:00
|
|
|
/**
|
|
|
|
|
* @license
|
|
|
|
|
* Copyright 2025 Google LLC
|
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import type React from 'react';
|
2026-02-25 17:27:05 -08:00
|
|
|
import { Box, Text } from 'ink';
|
2026-01-06 15:52:12 -05:00
|
|
|
import { theme } from '../semantic-colors.js';
|
|
|
|
|
import { useUIState } from '../contexts/UIStateContext.js';
|
|
|
|
|
import { useSettings } from '../contexts/SettingsContext.js';
|
|
|
|
|
import { useConfig } from '../contexts/ConfigContext.js';
|
|
|
|
|
import { ContextSummaryDisplay } from './ContextSummaryDisplay.js';
|
|
|
|
|
import { HookStatusDisplay } from './HookStatusDisplay.js';
|
|
|
|
|
|
|
|
|
|
interface StatusDisplayProps {
|
|
|
|
|
hideContextSummary: boolean;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const StatusDisplay: React.FC<StatusDisplayProps> = ({
|
|
|
|
|
hideContextSummary,
|
|
|
|
|
}) => {
|
|
|
|
|
const uiState = useUIState();
|
|
|
|
|
const settings = useSettings();
|
|
|
|
|
const config = useConfig();
|
|
|
|
|
|
2026-02-25 17:27:05 -08:00
|
|
|
const items: React.ReactNode[] = [];
|
|
|
|
|
|
2026-01-06 15:52:12 -05:00
|
|
|
if (process.env['GEMINI_SYSTEM_MD']) {
|
2026-02-25 17:27:05 -08:00
|
|
|
items.push(<Text color={theme.status.error}>|⌐■_■|</Text>);
|
2026-01-06 15:52:12 -05:00
|
|
|
}
|
|
|
|
|
|
2026-01-20 14:47:31 -08:00
|
|
|
if (
|
|
|
|
|
uiState.activeHooks.length > 0 &&
|
|
|
|
|
settings.merged.hooksConfig.notifications
|
|
|
|
|
) {
|
2026-02-25 17:27:05 -08:00
|
|
|
items.push(<HookStatusDisplay activeHooks={uiState.activeHooks} />);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (uiState.sisyphusSecondsRemaining !== null) {
|
|
|
|
|
const mins = Math.floor(uiState.sisyphusSecondsRemaining / 60);
|
|
|
|
|
const secs = uiState.sisyphusSecondsRemaining % 60;
|
|
|
|
|
const timerStr = `${mins.toString().padStart(2, '0')}:${secs
|
|
|
|
|
.toString()
|
|
|
|
|
.padStart(2, '0')}`;
|
|
|
|
|
items.push(
|
|
|
|
|
<Text color={theme.text.accent}>✦ Resuming work in {timerStr}</Text>,
|
|
|
|
|
);
|
2026-01-06 15:52:12 -05:00
|
|
|
}
|
|
|
|
|
|
2026-02-25 17:27:05 -08:00
|
|
|
if (
|
|
|
|
|
items.length === 0 &&
|
|
|
|
|
uiState.sisyphusSecondsRemaining === null &&
|
|
|
|
|
!settings.merged.ui.hideContextSummary &&
|
|
|
|
|
!hideContextSummary
|
|
|
|
|
) {
|
2026-01-06 15:52:12 -05:00
|
|
|
return (
|
|
|
|
|
<ContextSummaryDisplay
|
|
|
|
|
ideContext={uiState.ideContextState}
|
|
|
|
|
geminiMdFileCount={uiState.geminiMdFileCount}
|
|
|
|
|
contextFileNames={uiState.contextFileNames}
|
|
|
|
|
mcpServers={config.getMcpClientManager()?.getMcpServers() ?? {}}
|
|
|
|
|
blockedMcpServers={
|
|
|
|
|
config.getMcpClientManager()?.getBlockedMcpServers() ?? []
|
|
|
|
|
}
|
2026-01-09 22:26:58 -08:00
|
|
|
skillCount={config.getSkillManager().getDisplayableSkills().length}
|
2026-01-30 09:53:09 -08:00
|
|
|
backgroundProcessCount={uiState.backgroundShellCount}
|
2026-01-06 15:52:12 -05:00
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-25 17:27:05 -08:00
|
|
|
if (items.length === 0) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Box flexDirection="row">
|
|
|
|
|
{items.map((item, index) => (
|
|
|
|
|
<Box key={index} marginRight={index < items.length - 1 ? 1 : 0}>
|
|
|
|
|
{item}
|
|
|
|
|
</Box>
|
|
|
|
|
))}
|
|
|
|
|
</Box>
|
|
|
|
|
);
|
2026-01-06 15:52:12 -05:00
|
|
|
};
|