UNPKG

mcp-chain-of-draft-prompt-tool

Version:

MCP Chain of Draft (CoD) Prompt Tool - A Model Context Protocol tool for efficient reasoning

40 lines (39 loc) 1.56 kB
import chalk from 'chalk'; export const logger = { info: (message, ...args) => { console.log(chalk.blue('ℹ'), chalk.blue(message), ...args); }, success: (message, ...args) => { console.log(chalk.green('✓'), chalk.green(message), ...args); }, warning: (message, ...args) => { console.warn(chalk.yellow('⚠'), chalk.yellow(message), ...args); }, error: (message, ...args) => { console.error(chalk.red('✖'), chalk.red(message), ...args); }, debug: (message, ...args) => { console.log(chalk.gray('🔍'), chalk.gray(message), ...args); }, highlight: (message, ...args) => { console.log(chalk.cyan('→'), chalk.cyan(message), ...args); }, devLog: (message, ...args) => { if (process.env.NODE_ENV === 'development') { console.log(chalk.gray('[DEV]'), chalk.gray(message), ...args); } }, // Special formatting for Chain of Draft outputs codOutput: { header: (text) => console.log(chalk.bold.magenta('\n=== ' + text + ' ===\n')), problem: (text) => console.log(chalk.yellow('Problem: ') + text), steps: (steps) => console.log(chalk.cyan('Reasoning Steps:\n') + steps), answer: (text) => console.log(chalk.green('\nFinal Answer: ') + text), stats: (stats) => { console.log(chalk.blue('\nStats:')); Object.entries(stats).forEach(([key, value]) => { console.log(chalk.blue(`- ${key}: `) + chalk.white(value)); }); } } };