/** * WorkflowScheduler - Manages DAG execution order and parallel scheduling */ import type { Workflow, WorkflowState } from '@cogitator-ai/types'; interface DependencyGraph { dependencies: Map>; dependents: Map>; } export declare class WorkflowScheduler { /** * Build dependency graph from workflow edges */ buildDependencyGraph(workflow: Workflow): DependencyGraph; /** * Get nodes ready to execute (all dependencies completed) */ getReadyNodes(graph: DependencyGraph, completed: Set, pending: Set): string[]; /** * Get topological order of nodes (grouped by execution level) * Returns array of arrays, where each inner array can be executed in parallel */ getExecutionLevels(workflow: Workflow): string[][]; /** * Find the next node(s) to execute based on current state and edge conditions */ getNextNodes(workflow: Workflow, currentNode: string, state: S): string[]; /** * Run multiple async tasks with concurrency limit */ runWithConcurrency(tasks: (() => Promise)[], maxConcurrency: number): Promise; /** * Simpler parallel execution with Promise.all and concurrency via chunking */ runParallel(tasks: (() => Promise)[], maxConcurrency: number): Promise; /** * Run parallel tasks with per-completion callback * Uses pool-based execution to respect concurrency while allowing immediate callbacks */ runParallelWithCallback(tasks: (() => Promise)[], maxConcurrency: number, onComplete: (result: T, index: number) => Promise): Promise; } export {}; //# sourceMappingURL=scheduler.d.ts.map