UNPKG

@earendil-works/pi-coding-agent

Version:

Coding agent CLI with read, bash, edit, write tools and session management

37 lines • 1.56 kB
import { backgroundAnsi, foregroundAnsi, isAppleTerminalSession, rgbColor } from "@earendil-works/pi-tui"; import { theme } from "../theme/theme.js"; const CORAL = rgbColor(228, 138, 122); const BLUE = rgbColor(79, 142, 179); const YELLOW = rgbColor(234, 182, 93); const RESET = "\x1b[0m"; /** * The pi logo: 4 cells wide and 2 lines tall. Each cell shows two square pixels with half blocks: * * coral coral coral . * blue . coral . * blue blue . yellow * blue . . yellow * * The brand colors stay fixed across themes; they follow the terminal's color mode. */ export function piLogoLines() { const mode = theme.getColorMode(); const fg = (color) => foregroundAnsi(color, mode); // The fourth cell of the top line is empty, so it is padded to the same width as the bottom line. const top = `${fg(CORAL)}${backgroundAnsi(BLUE, mode)}▀${RESET}${fg(CORAL)}▀█${RESET} `; const bottom = `${fg(BLUE)}█▀${RESET} ${fg(YELLOW)}█${RESET}`; return [top, bottom]; } /** * Whether the terminal renders the half-block logo correctly. Apple Terminal draws gaps between rows and * misaligns the half blocks, so it gets the text wordmark instead. */ export function supportsPiLogo() { return !isAppleTerminalSession(); } /** Text fallback for the logo: "Pi" with the logo's coral and yellow. */ export function piWordmark() { const mode = theme.getColorMode(); return `${foregroundAnsi(CORAL, mode)}P${RESET}${foregroundAnsi(YELLOW, mode)}i${RESET}`; } //# sourceMappingURL=pi-logo.js.map