@oliverpople/agency-x
Version:
🚀 **Transform feature requests into production-ready code in seconds**
29 lines (22 loc) • 1.05 kB
text/typescript
import { createLogger } from '../utils/logger';
import { getContext, updateContext } from '../utils/contextStore';
import { getLlmClient } from '../llm/llmRouter';
import { infraEngineerPrompt } from '../utils/promptTemplates';
const logger = createLogger('infraEngineer');
export const runInfraEngineer = async () => {
logger.start();
const context = getContext();
const { agents = {} } = context;
// Safely access agent outputs with fallbacks
const backendOutput = agents.backendDeveloper?.output || 'No backend code generated yet';
const frontendOutput = agents.frontendDeveloper?.output || 'No frontend code generated yet';
const llmClient = getLlmClient();
const prompt = infraEngineerPrompt
.replace('{{backendCode}}', backendOutput)
.replace('{{frontendCode}}', frontendOutput);
const dockerfile = await llmClient.generate(prompt);
updateContext({ agents: { ...agents, infraEngineer: { output: dockerfile, completed: true } } });
logger.stop();
logger.success('Generated Dockerfile.');
return dockerfile;
};