/** * TaskRegistry, in-memory index for RuntimeTask lookup by ID, kind, status, * and parent/child relationships. * * This is a pure data structure with no side effects. The UnifiedTaskManager * owns the registry instance and is responsible for keeping it consistent with * the Zustand store. */ import type { RuntimeTask, TaskKind } from '../store/domains/tasks.js'; /** * TaskRegistry, provides O(1) task lookup by ID and O(k) lookup by kind, * running status, and parent task. * * All mutation methods return `this` for chaining. */ export declare class TaskRegistry { /** Primary task index keyed by task ID. */ private readonly _tasks; /** * Registers a task in the registry. If a task with the same ID already * exists it is replaced (treated as an update). * * @param task - The RuntimeTask to register. */ register(task: RuntimeTask): this; /** * Removes a task from the registry by ID. * * @param id - The task ID to remove. * @returns `true` if the task existed and was removed; `false` otherwise. */ deregister(id: string): boolean; /** * Retrieves a task by its unique ID. * * @param id - The task ID to look up. * @returns The RuntimeTask if found, or `undefined`. */ get(id: string): RuntimeTask | undefined; /** * Returns all tasks of a given kind. * * @param kind - The TaskKind to filter by. * @returns Array of matching RuntimeTask records (may be empty). */ getByKind(kind: TaskKind): RuntimeTask[]; /** * Returns all currently running tasks (status === 'running'). * * @returns Array of RuntimeTask records with status 'running'. */ getRunning(): RuntimeTask[]; /** * Returns all tasks that are direct children of the given parent task ID. * * @param parentId - The parent task ID. * @returns Array of child RuntimeTask records (may be empty). */ getChildren(parentId: string): RuntimeTask[]; /** * Returns all tasks matching the given status. * * @param status - The lifecycle status to filter by. * @returns Array of RuntimeTask records with the given status. */ getByStatus(status: RuntimeTask['status']): RuntimeTask[]; /** * Returns the total number of tasks currently tracked in the registry. */ get size(): number; /** * Returns a snapshot of all tasks as a new Map. * Mutations to the returned Map do not affect the registry. */ snapshot(): Map; } //# sourceMappingURL=registry.d.ts.map