/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import React from 'react'; import { Box, Text } from 'ink'; import { Colors } from '../colors.js'; import { shortenPath, tildeifyPath, tokenLimit } from '@google/gemini-cli-core'; import { ConsoleSummaryDisplay } from './ConsoleSummaryDisplay.js'; import process from 'node:process'; import Gradient from 'ink-gradient'; import { MemoryUsageDisplay } from './MemoryUsageDisplay.js'; interface FooterProps { model: string; targetDir: string; branchName?: string; debugMode: boolean; debugMessage: string; corgiMode: boolean; errorCount: number; showErrorDetails: boolean; showMemoryUsage?: boolean; promptTokenCount: number; nightly: boolean; vimMode?: string; } export const Footer: React.FC = ({ model, targetDir, branchName, debugMode, debugMessage, corgiMode, errorCount, showErrorDetails, showMemoryUsage, promptTokenCount, nightly, vimMode, }) => { const limit = tokenLimit(model); const percentage = promptTokenCount / limit; return ( {vimMode && [{vimMode}] } {nightly ? ( {shortenPath(tildeifyPath(targetDir), 70)} {branchName && ({branchName}*)} ) : ( {shortenPath(tildeifyPath(targetDir), 70)} {branchName && ({branchName}*)} )} {debugMode && ( {' ' + (debugMessage || '--debug')} )} {/* Middle Section: Centered Sandbox Info */} {process.env.SANDBOX && process.env.SANDBOX !== 'sandbox-exec' ? ( {process.env.SANDBOX.replace(/^gemini-(?:cli-)?/, '')} ) : process.env.SANDBOX === 'sandbox-exec' ? ( macOS Seatbelt{' '} ({process.env.SEATBELT_PROFILE}) ) : ( no sandbox (see /docs) )} {/* Right Section: Gemini Label and Console Summary */} {' '} {model}{' '} ({((1 - percentage) * 100).toFixed(0)}% context left) {corgiMode && ( | `) )} {!showErrorDetails && errorCount > 0 && ( | )} {showMemoryUsage && } ); };