/**
 * ${VOCAB.factory} - Main Export
 * The code generation pipeline that builds itself
 * 
 * Phase 2: Now includes RAG Router & Token Conservation
 */

// Core Pipeline
export { parseIntent, estimateComplexity } from './core/intent/parser';
export { generateSchemas, schemaToPrismaString } from './core/schema/generator';
export type { GeneratedSchema, PrismaModelDef, ApiEndpointDef, TypeDefinition } from './core/schema/generator';
export { generateApiRoutes } from './generators/api/route-generator';
export type { GeneratedRoute } from './generators/api/route-generator';
export { generatePrismaSchemaSection, generateTypeScriptTypes } from './generators/database/prisma-generator';
export { generateApiTests } from './generators/tests/test-generator';
export type { GeneratedTest } from './generators/tests/test-generator';
export { DarkFactoryPipeline, runDarkFactory, getTaskStatus } from './core/orchestrator/pipeline';
export type { PipelineResult } from './core/orchestrator/pipeline';

// RAG Router (Phase 1)
export { 
  routePrompt, 
  explainRouting, 
  logRoutingDecision,
  recordResponse,
  recordUsage,
  getRouterStats
} from './rag/router';
export type { RoutingDecision, RouterConfig } from './rag/router';
export { analyzePrompt, summarizeAnalysis } from './rag/prompt-analyzer';
export type { PromptAnalysis } from './rag/prompt-analyzer';
export { searchKnowledgeBase, MODEL_CAPABILITIES } from './rag/knowledge-base';
export type { KnowledgeEntry } from './rag/knowledge-base';

// Token Conservation (Phase 2)
export {
  compressPrompt,
  summarizeKnowledge,
  applyConservation,
  estimateTokenCount,
  formatTokenSavings,
  getTokenBudget,
  recordTokenUsage,
  hasBudgetRemaining,
  upgradeBudget,
  getCacheStats,
  getCachedResponse,
  cacheResponse
} from './rag/token-conservation';
export type {
  TokenBudget,
  CompressionResult,
  CacheEntry,
  ConservationStats,
  ConservationOptions
} from './rag/token-conservation';

// Generation Options (Language, Database, Expert Mode)
export type {
  TargetLanguage,
  TargetDatabase,
  GenerationOptions,
  ExpertModeSpec,
  LanguageOption,
  DatabaseOption,
} from './types/generation-options';
export {
  LANGUAGE_OPTIONS,
  DATABASE_OPTIONS,
  getLanguageOption,
  getDatabaseOption,
} from './types/generation-options';

// Template Library
export {
  TEMPLATES,
  TEMPLATE_CATEGORIES,
  getTemplateById,
  getTemplatesByCategory,
  searchTemplates,
} from './templates';
export type { DFTemplate, TemplateCategory, TemplateExpertSpec } from './templates';

// Multi-LLM Selection
export {
  LLM_MODELS,
  DEFAULT_STAGE_CONFIG,
  STAGE_INFO,
  getModelById,
  getModelsForStage,
} from './llm-models';
export type { LLMModelOption, LLMStageConfig, PipelineStage } from './llm-models';

// Version History & Diff
export { computeDiff, compareVersions } from './version-history';
export type { GenerationVersion, VersionArtifact, DiffLine, DiffResult, DiffHunk } from './version-history';

// Hybrid LLM Router (Phase 2)
export {
  checkLocalAvailability,
  getBestLocalModel,
  routeToEnvironment,
  callHybridLLM,
  recordHybridUsage,
  getHybridStats,
  formatHybridStats
} from './rag/hybrid-llm';
export type {
  LLMEnvironment,
  LocalLLMConfig,
  CloudLLMConfig,
  HybridRoutingDecision,
  HybridConfig
} from './rag/hybrid-llm';
import { VOCAB } from '@/lib/white-label/constants';
