/** * Theme system for the Mastra Code TUI. * Simplified from pi-mono's theme system. */ import type { MarkdownTheme, EditorTheme, SettingsListTheme, SelectListTheme } from '@mariozechner/pi-tui'; export type ThemeMode = 'dark' | 'light'; export declare function getThemeMode(): ThemeMode; export declare const mastraBrand: { readonly purple: "#7f45e0"; readonly green: "#16c858"; readonly orange: "#fdac53"; readonly pink: "#ff69cc"; readonly blue: "#2563eb"; readonly red: "#DC5663"; readonly yellow: "#e7e67b"; }; export declare const extendedColors: { readonly teal: "#14b8a6"; readonly cyan: "#06b6d4"; readonly lightCyan: "#22d3ee"; readonly skyBlue: "#38bdf8"; readonly indigo: "#6366f1"; readonly violet: "#a855f7"; readonly lavender: "#c084fc"; readonly fuchsia: "#d946ef"; readonly rose: "#f472b6"; readonly coral: "#fb7185"; readonly amber: "#fb923c"; readonly lime: "#a3e635"; readonly gold: "#facc15"; readonly stone: "#a8a29e"; readonly warmGray: "#78716c"; readonly copper: "#b45309"; }; export declare const greens: { readonly emerald: "#4ade80"; readonly seafoam: "#34d399"; readonly jade: "#10b981"; readonly springGreen: "#00ff7f"; readonly neonGreen: "#50fa7b"; readonly chartreuse: "#84cc16"; readonly lightLime: "#bef264"; readonly electricLime: "#caff33"; readonly aquamarine: "#2dd4bf"; readonly mint: "#5eead4"; readonly pastelMint: "#6ee7b7"; readonly forest: "#16a34a"; readonly deepForest: "#15803d"; readonly sage: "#059669"; readonly pine: "#047857"; readonly evergreen: "#065f46"; readonly neonLime: "#39ff14"; readonly pureGreen: "#00ff00"; readonly hacker: "#00ff41"; readonly lawnGreen: "#66ff00"; }; interface MastraSurface { bg: string; antiGrid: string; elevationSm: string; elevationLg: string; hover: string; white: string; specialGray: string; mainGray: string; darkGray: string; borderAntiGrid: string; borderElevation: string; } type MastraPalette = typeof mastraBrand & MastraSurface; export declare const TUI_MIN_CONTRAST = 5.5; /** Terminal width buffer applied at the framework level to prevent wrapping in nested terminals */ export declare const TERM_WIDTH_BUFFER = 3; /** Get the effective terminal width (matching the framework's reduced width) */ export declare const getTermWidth: () => number; /** Left indent (in spaces) applied to assistant text (Markdown body) */ export declare const CHAT_INDENT = 2; /** Precomputed indent string for assistant text */ export declare const CHAT_INDENT_STR: string; /** Left indent (in spaces) applied to user messages and tool call boxes */ export declare const BOX_INDENT = 0; /** Precomputed indent string for boxes */ export declare const BOX_INDENT_STR = ""; /** Mastra palette — brand + text surface colors are contrast-adapted, other surface colors adapt to theme mode. */ export declare const mastra: MastraPalette; /** Tint a hex color by a brightness factor (0–1). e.g. tintHex("#ff8800", 0.15) → near-black orange */ export declare function tintHex(hex: string, factor: number): string; export type ThemeColor = 'accent' | 'border' | 'borderAccent' | 'borderMuted' | 'success' | 'error' | 'warning' | 'muted' | 'dim' | 'text' | 'thinkingText' | 'userMessageText' | 'toolTitle' | 'toolArgs' | 'toolOutput' | 'textHighlight' | 'toolBorderPending' | 'toolBorderSuccess' | 'toolBorderError' | 'function' | 'path' | 'number'; export type ThemeBg = 'selectedBg' | 'userMessageBg' | 'systemReminderBg' | 'toolPendingBg' | 'toolSuccessBg' | 'toolErrorBg' | 'overlayBg' | 'errorBg'; export interface ThemeColors { accent: string; border: string; borderAccent: string; borderMuted: string; success: string; error: string; warning: string; muted: string; dim: string; text: string; thinkingText: string; userMessageBg: string; userMessageText: string; systemReminderBg: string; toolPendingBg: string; toolSuccessBg: string; toolErrorBg: string; toolBorderPending: string; toolBorderSuccess: string; toolBorderError: string; toolTitle: string; toolArgs: string; toolOutput: string; textHighlight: string; selectedBg: string; overlayBg: string; errorBg: string; path: string; number: string; function: string; } export declare const darkTheme: ThemeColors; export declare const lightTheme: ThemeColors; /** * Get the current theme colors. */ declare function getTheme(): ThemeColors; /** * Set the current theme. */ declare function setTheme(colors: ThemeColors): void; /** * Apply a theme mode, updating both the surface palette and the theme colors. */ export declare function applyThemeMode(mode: ThemeMode, terminalBgHex?: string): void; /** * Restore terminal foreground to default. Call on exit to undo OSC 10 changes. */ export declare function restoreTerminalForeground(): void; /** * Apply foreground color from theme. */ declare function fg(color: ThemeColor, text: string): string; /** * Apply background color from theme. */ declare function bg(color: ThemeBg, text: string): string; /** * Apply bold styling. */ declare function bold(text: string): string; /** * Apply italic styling. */ declare function italic(text: string): string; /** * Apply dim styling. */ declare function dim(text: string): string; /** WCAG relative luminance of a hex color. Returns 0 (black) to 1 (white). */ export declare function luminance(hex: string): number; /** WCAG contrast ratio between two hex colors. Returns 1 (identical) to 21 (black/white). */ export declare function contrastRatio(hex1: string, hex2: string): number; /** * Adjust a foreground color to ensure sufficient contrast against a background. * Adjusts lightness in HSL space to preserve hue and saturation. * Returns the original color if it already has sufficient contrast. */ export declare function ensureContrast(fgHex: string, bgHex: string, minRatio?: number): string; /** * Returns "#ffffff" or "#000000" depending on which has better contrast * against the given hex background color (WCAG relative luminance). */ export declare function getContrastText(hexBg: string): string; /** * Keep deliberately subdued glyph colors on black/nearly-black backgrounds, * but contrast-adapt them on brighter terminal backgrounds. */ export declare function ensureContrastUnlessNearBlack(fgHex: string, minRatio?: number): string; /** * Terminal glyphs need a little extra visibility even on black backgrounds. * Keep them subdued on near-black terminals, but do not let them get too faint. */ export declare function ensureTerminalGlyphContrast(fgHex: string, minRatio?: number): string; export declare const theme: { fg: typeof fg; bg: typeof bg; bold: typeof bold; italic: typeof italic; dim: typeof dim; getTheme: typeof getTheme; setTheme: typeof setTheme; }; export declare function getMarkdownTheme(): MarkdownTheme; export declare function getEditorTheme(): EditorTheme; export declare function getSettingsListTheme(): SettingsListTheme; export declare function getSelectListTheme(): SelectListTheme; export {}; //# sourceMappingURL=theme.d.ts.map