@oliverpople/agency-x
Version:
🚀 **Transform feature requests into production-ready code in seconds**
28 lines (21 loc) • 990 B
text/typescript
import { createLogger } from '../utils/logger';
import { getContext, updateContext } from '../utils/contextStore';
import { getLlmClient } from '../llm/llmRouter';
import { userEmpathyAgentPrompt } from '../utils/promptTemplates';
const logger = createLogger('userEmpathyAgent');
export const runUserEmpathyAgent = async () => {
logger.start();
const context = getContext();
const { spec, agents = {} } = context;
// Safely access agent outputs with fallbacks
const frontendOutput = agents.frontendDeveloper?.output || 'No frontend code generated yet';
const llmClient = getLlmClient();
const prompt = userEmpathyAgentPrompt
.replace('{{spec}}', JSON.stringify(spec, null, 2))
.replace('{{frontendCode}}', frontendOutput);
const report = await llmClient.generate(prompt);
updateContext({ agents: { ...agents, userEmpathyAgent: { output: report, completed: true } } });
logger.stop();
logger.success('Generated user empathy report.');
return report;
};