/**
 * Bangstack - Comprehensive Workflow Creator
 * Main entry point
 */

// Parser exports
export { WorkflowParser } from './parser/workflow-parser';
export { WorkflowSchema } from './parser/workflow-schema';

// Engine exports
export { WorkflowEngine } from './engine/workflow-engine';
export { DAG } from './engine/dag';
export type {
  ExecutionPlan,
  ActionExecutionPlan,
  ImplementationExecutionPlan,
  ValidationResult,
} from './engine/workflow-engine';
export type { DAGNode } from './engine/dag';

// Generator exports
export {
  GeneratorRegistry,
  globalRegistry,
  FileWriter,
  CodeGenerator,
} from './generators';
export type {
  Generator,
  FrontendGenerator,
  BackendGenerator,
  DocumentationGenerator,
  DatabaseGenerator,
  TestGenerator,
  GeneratorContext,
  GeneratorOptions,
  GenerationResult,
  GeneratedFile,
  CodeGenerationOptions,
  CodeGenerationResult,
} from './generators';

// Type exports
export * from './types/workflow';

// Re-export for convenience
import { WorkflowParser } from './parser/workflow-parser';
import { WorkflowEngine } from './engine/workflow-engine';

/**
 * Parse a workflow file
 */
export function parseWorkflow(filePath: string) {
  const parser = new WorkflowParser();
  return parser.parseFile(filePath);
}

/**
 * Parse multiple workflow files from a directory
 */
export function parseWorkflowDirectory(dirPath: string) {
  const parser = new WorkflowParser();
  return parser.parseDirectory(dirPath);
}

/**
 * Analyze a workflow and create an execution plan
 */
export function analyzeWorkflow(workflow: any) {
  const engine = new WorkflowEngine();
  return engine.analyze(workflow);
}

/**
 * Validate a workflow
 */
export function validateWorkflow(workflow: any) {
  const engine = new WorkflowEngine();
  return engine.validate(workflow);
}
