import type { Task, ArchivedTask } from "../types.js"; export interface AutoArchiveConfig { /** Minimum age in days before a task can be auto-archived */ minAgeDays: number; /** Maximum number of recent completed tasks to keep (not auto-archive) */ keepRecentCount: number; } export declare const DEFAULT_AUTO_ARCHIVE_CONFIG: AutoArchiveConfig; export interface CollectedArchiveTasks { /** The root task to archive */ root: Task; /** All descendant tasks (children, grandchildren, etc.) */ descendants: Task[]; } /** * Convert a full Task to a compacted ArchivedTask. * * Strips: blockedBy, blocks, children, created_at, updated_at, priority * Preserves: id, parent_id, name, description, completed_at, result, metadata.github, metadata.commit * Adds: archived_at, archived_children (rolled up from children) * * @param task The task to compact * @param children Direct child tasks to roll up into archived_children * @returns Compacted ArchivedTask */ export declare function compactTask(task: Task, children?: Task[]): ArchivedTask; /** * Collect a task and all its descendants for archival. * Validates that all collected tasks are completed and have no active ancestors. * * @param taskId The root task ID to archive * @param allTasks All tasks in the store * @returns Object with root task and descendants, or null if validation fails * @throws Error if task not found or validation fails */ export declare function collectArchivableTasks(taskId: string, allTasks: Task[]): CollectedArchiveTasks | null; /** * Check if a task meets auto-archive criteria. * * Criteria: * - Task is completed * - All descendants are completed * - No active (incomplete) ancestors * - Task is older than config.minAgeDays * - Task is not in the most recent config.keepRecentCount completed tasks * * @param task The task to check * @param allTasks All tasks in the store * @param config Auto-archive configuration * @returns true if task can be auto-archived */ export declare function canAutoArchive(task: Task, allTasks: Task[], config?: AutoArchiveConfig): boolean; /** * Find all tasks that are eligible for auto-archiving. * * @param allTasks All tasks in the store * @param config Auto-archive configuration * @returns Array of tasks eligible for auto-archiving */ export declare function findAutoArchivableTasks(allTasks: Task[], config?: AutoArchiveConfig): Task[]; //# sourceMappingURL=archive-compactor.d.ts.map