UNPKG

@code-yeongyu/senpi

Version:

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

27 lines • 1.33 kB
import { getThemeExportColors, theme } from "../theme/theme.js"; function backgroundFromThemeExport(hex) { const match = /^#([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i.exec(hex); if (!match) return undefined; const [, red, green, blue] = match; return (text) => `\x1b[48;2;${parseInt(red, 16)};${parseInt(green, 16)};${parseInt(blue, 16)}m${text}\x1b[49m`; } export function getGrokChromeTokens() { const themeExport = getThemeExportColors(); const panelBackground = themeExport.cardBg; const pageBackground = themeExport.pageBg; return { inputBorder: (text) => theme.fg("borderAccent", text), inputInterior: backgroundFromThemeExport(panelBackground ?? "") ?? ((text) => theme.bg("toolPendingBg", text)), surface: backgroundFromThemeExport(pageBackground ?? "") ?? ((text) => text), cardBorder: (text) => theme.fg("borderMuted", text), modelLabel: (text) => theme.fg("thinkingText", text), cwd: (text) => theme.fg("dim", text), primaryText: (text) => theme.fg("text", text), mutedText: (text) => theme.fg("muted", text), success: (text) => theme.fg("success", text), error: (text) => theme.fg("error", text), warning: (text) => theme.fg("warning", text), }; } //# sourceMappingURL=chrome-tokens.js.map