UNPKG

vibe-coder-mcp

Version:

Production-ready MCP server with complete agent integration, multi-transport support, and comprehensive development automation tools for AI-assisted workflows.

281 lines (280 loc) 9.06 kB
import chalk from 'chalk'; const defaultTheme = { name: 'default', description: 'Default balanced color scheme', colors: { primary: chalk.blue, secondary: chalk.cyan, accent: chalk.magenta, success: chalk.green, error: chalk.red, warning: chalk.yellow, info: chalk.cyan, text: chalk.white, textMuted: chalk.gray, textBright: chalk.whiteBright, prompt: chalk.green, command: chalk.cyan, response: chalk.white, border: chalk.gray, background: chalk.black, codeKeyword: chalk.blue, codeString: chalk.green, codeComment: chalk.gray, codeFunction: chalk.yellow, codeVariable: chalk.cyan, heading1: chalk.bold.cyan.underline, heading2: chalk.bold.yellow, heading3: chalk.bold.green, bold: chalk.bold, italic: chalk.italic, link: chalk.blue.underline, code: chalk.cyan, blockquote: chalk.gray.italic, listMarker: chalk.cyan, spinner: chalk.cyan, progressBar: chalk.blue, badge: chalk.bgBlue.white, highlight: chalk.bgYellow.black } }; const darkTheme = { name: 'dark', description: 'High contrast theme for dark terminals', colors: { primary: chalk.blueBright, secondary: chalk.cyanBright, accent: chalk.magentaBright, success: chalk.greenBright, error: chalk.redBright, warning: chalk.yellowBright, info: chalk.cyanBright, text: chalk.whiteBright, textMuted: chalk.gray, textBright: chalk.whiteBright, prompt: chalk.greenBright, command: chalk.cyanBright, response: chalk.whiteBright, border: chalk.gray, background: chalk.black, codeKeyword: chalk.blueBright, codeString: chalk.greenBright, codeComment: chalk.gray, codeFunction: chalk.yellowBright, codeVariable: chalk.cyanBright, heading1: chalk.bold.cyanBright.underline, heading2: chalk.bold.yellowBright, heading3: chalk.bold.greenBright, bold: chalk.bold.whiteBright, italic: chalk.italic.white, link: chalk.blueBright.underline, code: chalk.cyanBright, blockquote: chalk.gray.italic, listMarker: chalk.cyanBright, spinner: chalk.cyanBright, progressBar: chalk.blueBright, badge: chalk.bgBlueBright.white, highlight: chalk.bgYellowBright.black } }; const lightTheme = { name: 'light', description: 'Soft colors optimized for light terminals', colors: { primary: chalk.blue, secondary: chalk.cyan, accent: chalk.magenta, success: chalk.green, error: chalk.red, warning: chalk.hex('#FFA500'), info: chalk.blue, text: chalk.black, textMuted: chalk.gray, textBright: chalk.blackBright, prompt: chalk.green, command: chalk.blue, response: chalk.black, border: chalk.gray, background: chalk.white, codeKeyword: chalk.blue, codeString: chalk.green, codeComment: chalk.gray, codeFunction: chalk.magenta, codeVariable: chalk.cyan, heading1: chalk.bold.blue.underline, heading2: chalk.bold.magenta, heading3: chalk.bold.green, bold: chalk.bold.black, italic: chalk.italic.blackBright, link: chalk.blue.underline, code: chalk.blue, blockquote: chalk.gray.italic, listMarker: chalk.blue, spinner: chalk.blue, progressBar: chalk.green, badge: chalk.bgBlue.white, highlight: chalk.bgYellow.black } }; const oceanTheme = { name: 'ocean', description: 'Ocean-inspired blue and aqua color scheme', colors: { primary: chalk.hex('#006994'), secondary: chalk.hex('#00A8CC'), accent: chalk.hex('#00D4FF'), success: chalk.hex('#00FF88'), error: chalk.hex('#FF6B6B'), warning: chalk.hex('#FFD93D'), info: chalk.hex('#6BCEFF'), text: chalk.hex('#E8F5FF'), textMuted: chalk.hex('#7FCDFF'), textBright: chalk.white, prompt: chalk.hex('#00FF88'), command: chalk.hex('#00D4FF'), response: chalk.hex('#E8F5FF'), border: chalk.hex('#4A90A4'), background: chalk.hex('#001F3F'), codeKeyword: chalk.hex('#00A8CC'), codeString: chalk.hex('#00FF88'), codeComment: chalk.hex('#7FCDFF'), codeFunction: chalk.hex('#FFD93D'), codeVariable: chalk.hex('#00D4FF'), heading1: chalk.bold.hex('#00D4FF').underline, heading2: chalk.bold.hex('#00A8CC'), heading3: chalk.bold.hex('#00FF88'), bold: chalk.bold.hex('#E8F5FF'), italic: chalk.italic.hex('#E8F5FF'), link: chalk.hex('#6BCEFF').underline, code: chalk.hex('#00D4FF'), blockquote: chalk.hex('#7FCDFF').italic, listMarker: chalk.hex('#00A8CC'), spinner: chalk.hex('#00D4FF'), progressBar: chalk.hex('#00A8CC'), badge: chalk.bgHex('#006994').hex('#E8F5FF'), highlight: chalk.bgHex('#FFD93D').hex('#001F3F') } }; const forestTheme = { name: 'forest', description: 'Forest-inspired green and earth color scheme', colors: { primary: chalk.hex('#2D5016'), secondary: chalk.hex('#73A942'), accent: chalk.hex('#AAD576'), success: chalk.hex('#5CB85C'), error: chalk.hex('#D9534F'), warning: chalk.hex('#F0AD4E'), info: chalk.hex('#5BC0DE'), text: chalk.hex('#F5F5DC'), textMuted: chalk.hex('#8B7355'), textBright: chalk.hex('#FFFACD'), prompt: chalk.hex('#73A942'), command: chalk.hex('#AAD576'), response: chalk.hex('#F5F5DC'), border: chalk.hex('#5D4E37'), background: chalk.hex('#1B1B0F'), codeKeyword: chalk.hex('#73A942'), codeString: chalk.hex('#AAD576'), codeComment: chalk.hex('#8B7355'), codeFunction: chalk.hex('#F0AD4E'), codeVariable: chalk.hex('#5BC0DE'), heading1: chalk.bold.hex('#AAD576').underline, heading2: chalk.bold.hex('#73A942'), heading3: chalk.bold.hex('#5CB85C'), bold: chalk.bold.hex('#F5F5DC'), italic: chalk.italic.hex('#F5F5DC'), link: chalk.hex('#5BC0DE').underline, code: chalk.hex('#AAD576'), blockquote: chalk.hex('#8B7355').italic, listMarker: chalk.hex('#73A942'), spinner: chalk.hex('#AAD576'), progressBar: chalk.hex('#73A942'), badge: chalk.bgHex('#2D5016').hex('#F5F5DC'), highlight: chalk.bgHex('#F0AD4E').hex('#1B1B0F') } }; export const themes = { default: defaultTheme, dark: darkTheme, light: lightTheme, ocean: oceanTheme, forest: forestTheme }; export class ThemeManager { static instance; currentTheme = defaultTheme; themeOverrides = {}; constructor() { } static getInstance() { if (!ThemeManager.instance) { ThemeManager.instance = new ThemeManager(); } return ThemeManager.instance; } setTheme(themeName) { if (themeName in themes) { this.currentTheme = themes[themeName]; return true; } return false; } getCurrentTheme() { return this.currentTheme; } getCurrentThemeName() { return this.currentTheme.name; } getColors() { return { ...this.currentTheme.colors, ...this.themeOverrides }; } getColor(colorName) { const colors = this.getColors(); return colors[colorName]; } setColorOverride(colorName, color) { this.themeOverrides[colorName] = color; } clearOverrides() { this.themeOverrides = {}; } getAvailableThemes() { return Object.keys(themes); } getThemeDescription(themeName) { return themes[themeName]?.description; } applyTheme() { } createCustomTheme(name, description, colors) { const customTheme = { name, description, colors: { ...defaultTheme.colors, ...colors } }; themes[name] = customTheme; return customTheme; } exportTheme(themeName) { const theme = themeName ? themes[themeName] : this.currentTheme; if (!theme) { throw new Error(`Theme '${themeName}' not found`); } const exportableTheme = { name: theme.name, description: theme.description, colors: Object.entries(theme.colors).reduce((acc, [key, _value]) => { acc[key] = key; return acc; }, {}) }; return JSON.stringify(exportableTheme, null, 2); } } export const themeManager = ThemeManager.getInstance();