UNPKG

agency-x

Version:

This project is a Claude-compatible, LLM-agnostic sub-agent framework that simulates a complete SaaS product team. It is delivered as a reusable, developer-ready NPM package.

58 lines (49 loc) 1.97 kB
import chalk from 'chalk'; const agentStyles = { productManager: chalk.bold.blue, frontendDeveloper: chalk.green, backendDeveloper: chalk.yellow.italic, qaEngineer: chalk.red.underline, documentationAgent: chalk.cyan, fullstackIntegrator: chalk.magenta, infraEngineer: chalk.gray, securityEngineer: chalk.yellow, uxDesigner: chalk.blue, copywriter: chalk.green, releaseManager: chalk.magenta.bold, aiPromptEngineer: chalk.blue.italic, dataEngineer: chalk.yellow, orchestratorAgent: chalk.bold.magenta, voiceNarratorAgent: chalk.italic.gray, reviewerAgent: chalk.bold.yellow, assumptionChallenger: chalk.bold.red, userEmpathyAgent: chalk.bold.green, }; type AgentName = keyof typeof agentStyles; const log = (agentName: AgentName, message: string) => { const style = agentStyles[agentName] || ((str: string) => str); console.log(`${style(`[${agentName}]`)}: ${message}`); }; const spinner = ['\u280B', '\u2819', '\u2839', '\u2838', '\u283C', '\u2834', '\u2826', '\u2827', '\u2807', '\u280F']; let interval: NodeJS.Timeout; const startThinking = (agentName: AgentName) => { let i = 0; const thinkingMessage = `is thinking...`; interval = setInterval(() => { i = (i + 1) % spinner.length; process.stdout.write(`\r${agentStyles[agentName](`[${agentName}]`)}: ${spinner[i]} ${thinkingMessage}`); }, 100); }; const stopThinking = () => { clearInterval(interval); process.stdout.write('\r' + ' '.repeat(50) + '\r'); // Clear the line }; export const createLogger = (agentName: AgentName) => ({ log: (message: string) => log(agentName, message), start: () => startThinking(agentName), stop: () => stopThinking(), info: (message: string) => log(agentName, chalk.white(message)), success: (message: string) => log(agentName, chalk.greenBright(message)), error: (message: string) => log(agentName, chalk.redBright(message)), }); export const orchestratorLogger = createLogger('orchestratorAgent');