import { EventEmitter } from 'node:events'; import type { AppDescription, AppCreateOptions, AppCreateResult, PlanSummary, PlanApprovalResult, PlanAnswer } from './types.js'; export declare class AppCreateOrchestrator extends EventEmitter { private description; private options; private auditTrail; private startTime; private planSummaryCache; private approvalResolve; private answersResolve; private chatResolve; private conversationHistory; private modelRouter; constructor(description: AppDescription, options: AppCreateOptions); /** Get the current plan summary (available after planning phase). */ getPlanSummary(): PlanSummary | null; /** Approve or reject the plan. Resolves the blocked pipeline. */ approvePlan(result: PlanApprovalResult): void; /** Submit answers to plan questions. Resolves the waiting questioning loop. */ submitAnswers(answers: PlanAnswer[]): void; /** Submit a chat message. Resolves the waiting conversation loop. */ submitChatMessage(message: string, cardAnswers?: PlanAnswer[]): void; /** Run the full app creation pipeline. */ run(): Promise; private runPlanningPhase; private verifyPlanStructure; private isAcyclic; private runScaffoldingPhase; private buildFeature; private runCrossVerification; /** * Group features into waves based on dependency graph. * Wave 0: features with no dependencies * Wave N: features whose deps are all in waves < N */ private computeWaves; /** * Build a feature using a single CodeAgent call — bypasses MultiAgentLoop. * Used for trivial/small features where full team coordination is overkill. */ private buildFeatureDirect; /** Whether to use direct generation (single CodeAgent) vs full MultiAgentLoop. * For app creation (greenfield), direct mode is used for ALL features by default * since there's no existing codebase to review against and the architecture plan * already provides full context. Multi-agent mode adds overhead without proportional value. */ private shouldUseDirect; /** Determine verification tier based on feature characteristics. */ private getVerificationTier; /** Build the goal string for a feature (shared between buildFeature and buildFeatureDirect). */ private buildFeatureGoal; /** * Scan all generated source files for imports and ensure every * external package is listed in package.json. Also merges any * "package.additions.json" files that feature agents may have created. */ private reconcileDependencies; /** * Generate .env.local from the architecture plan's deployConfig.envVars. * When real Supabase credentials are available, overwrites any existing * placeholder file and emits code_generated so WebContainer receives it. */ private generateEnvFile; /** Map env var names to real Supabase provisioned values. */ private getSupabaseEnvValue; /** Return a sensible placeholder value for known env var patterns. */ private getEnvPlaceholder; /** Recursively collect files with given extensions (or exact filename). */ private collectFiles; private emitPhase; private makeResult; private audit; private inferLanguage; private slugify; /** Get framework-specific directory convention instruction for agent prompts. */ private getDirectoryConvention; /** Map an IPC channel name to its expected handler file path. e.g. "db:query" -> "src/main/ipc/db.ts" */ private ipcChannelToFilePath; private routeToFilePath; private pageToFilePath; private fileExists; private searchForSchemaEntity; /** * Scan generated page files for href/Link targets and verify * each internal route has a corresponding page file. * Catches hallucinated links like href="/categories" when * no /categories/page.tsx exists. */ private checkLinkIntegrity; /** * Check A1: Verify all import paths resolve to actual files. * Catches: broken relative imports, unresolvable @/ aliases. */ private checkImportResolution; /** * Check A2: Verify all imported packages exist in package.json. * Also detects invalid alias entries (e.g. "@/lib": "latest"). */ private checkPackageDepsComplete; /** * Check A3: Detect server components that fetch their own API routes (deadlock risk). * Only applies to Next.js apps. */ private checkNoSelfFetch; /** * Check A4: Verify TypeScript compiles without errors. * Uses `npx tsc --noEmit` with 60s timeout. */ private checkTypescriptCompiles; /** * Check A5: Verify all referenced environment variables are defined in .env files. */ private checkEnvVarsComplete; /** * Check A6: Verify asset references (images, CSS, icons) point to existing files. */ private checkAssetRefsValid; }