@hugsylabs/hugsy-compiler
Version:
Configuration compiler for Claude Code settings
42 lines • 1.29 kB
TypeScript
/**
* Dependency graph utilities for detecting circular dependencies
*/
import type { HugsyConfig } from '@hugsylabs/hugsy-types';
export interface CycleError {
message: string;
cycle: string[];
path: string;
}
export declare class DependencyGraph {
private adjacencyList;
private visiting;
private visited;
private cycleDetected;
/**
* Build dependency graph from config
*/
private buildGraph;
/**
* Detect cycles in the dependency graph using DFS
*/
detectCycles(dependencies: Map<string, string | string[]>): CycleError | null;
/**
* DFS traversal to detect cycles
*/
private dfs;
/**
* Get load order using topological sort
* Returns null if there's a cycle
* The order is such that dependencies come before their dependents
*/
getLoadOrder(dependencies: Map<string, string | string[]>): string[] | null;
/**
* Static helper to detect cycles in HugsyConfig
*/
static detectConfigCycles(configPath: string, configs: Map<string, HugsyConfig>, visited?: Set<string>): CycleError | null;
/**
* Format cycle error for user-friendly display
*/
static formatCycleError(error: CycleError): string;
}
//# sourceMappingURL=dependency-graph.d.ts.map