import { generateInfrastructure } from "../../../../../scripts/generate-infrastructure.js";
function generateInfra(context) {
  const { spec, implType, outputDir } = context;
  if (!spec) {
    throw new Error("Specification is required in template context");
  }
  const config = implType.configuration || {};
  const options = {
    docker: config.docker || {},
    kubernetes: config.kubernetes || {},
    cicd: config.cicd || {}
  };
  const result = generateInfrastructure(spec, outputDir || "./infrastructure", options);
  return JSON.stringify({
    message: "Infrastructure code generated successfully",
    dockerFiles: result.dockerFiles,
    kubernetesFiles: result.kubernetesFiles,
    cicdFiles: result.cicdFiles,
    outputDir: result.outputDir,
    files: result.files
  }, null, 2);
}
export {
  generateInfra as default
};
