donobu
Version:
Create browser automations with an LLM agent and replay them as Playwright scripts.
40 lines • 1.55 kB
TypeScript
import type { FlowMetadata } from '../models/FlowMetadata';
export interface DependencyGraph {
flows: Map<string, FlowMetadata>;
dependencies: Map<string, string[]>;
dependents: Map<string, string[]>;
independentFlows: string[];
executionOrder: string[][];
}
export declare class FlowDependencyAnalyzer {
/**
* Analyzes a collection of flows and builds a dependency graph based on browser state references.
*/
static analyzeDependencies(flows: FlowMetadata[]): DependencyGraph;
/**
* Extracts dependencies for a single flow by analyzing its browser.initialState
*/
private static extractDependencies;
/**
* Determines if a new flow should replace an existing flow when they have the same name.
* Prefers flows with later completedAt times, treating null completedAt as "never completed".
*/
static shouldReplaceFlow(existingFlow: FlowMetadata, newFlow: FlowMetadata): boolean;
/**
* Detects circular dependencies using DFS
*/
private static detectCircularDependencies;
/**
* Calculates execution order using topological sort with parallel execution support
*/
private static calculateExecutionOrder;
/**
* Validates that all flow dependencies can be resolved
*/
static validateDependencies(flows: FlowMetadata[]): void;
/**
* Gets a human-readable summary of the dependency graph
*/
static getDependencySummary(graph: DependencyGraph): string;
}
//# sourceMappingURL=FlowDependencyAnalyzer.d.ts.map