/** * Index caching for O(1) label/phase/hierarchy lookups. * Ported from lib/data/cache.sh * * @epic T4454 * @task T4530 */ import type { Task } from '@cleocode/contracts'; /** Cache index mapping labels/phases to task IDs. */ export type IndexMap = Map; /** * In-memory cache for task indices with checksum-based staleness detection. */ export declare class TaskCache { private labelIndex; private phaseIndex; private parentIndex; private childrenIndex; private depthIndex; private checksum; private initialized; /** * Compute a checksum from task data for staleness detection. */ private computeChecksum; /** * Initialize or rebuild cache from tasks. * Returns true if cache was rebuilt, false if already valid. */ init(tasks: Task[]): boolean; private buildLabelIndex; private buildPhaseIndex; private buildHierarchyIndex; /** Get task IDs by label. */ getTasksByLabel(label: string): string[]; /** Get task IDs by phase. */ getTasksByPhase(phase: string): string[]; /** Get all labels. */ getAllLabels(): string[]; /** Get all phases. */ getAllPhases(): string[]; /** Get label count for a specific label. */ getLabelCount(label: string): number; /** Get parent ID for a task. */ getParent(taskId: string): string | null; /** Get children IDs for a task. */ getChildren(taskId: string): string[]; /** Get depth for a task. */ getDepth(taskId: string): number; /** Get child count. */ getChildCount(taskId: string): number; /** Get root tasks (no parent). */ getRootTasks(): string[]; /** Get leaf tasks (no children). */ getLeafTasks(): string[]; /** Force invalidation and rebuild. */ invalidate(): void; /** Get cache statistics. */ getStats(): { initialized: boolean; labelCount: number; phaseCount: number; taskCount: number; maxDepth: number; }; } //# sourceMappingURL=cache.d.ts.map