/**
 * TaskManager - Background task lifecycle service.
 *
 * Manages tasks with status tracking, dependency resolution,
 * and SharedStateBus event publishing.
 */
import type { SharedStateBus } from "./SharedStateBus.js";
export type TaskStatus = "pending" | "in_progress" | "completed" | "failed" | "blocked";
export interface Task {
    id: string;
    subject: string;
    description: string;
    status: TaskStatus;
    owner?: string;
    activeForm?: string;
    metadata?: Record<string, unknown>;
    blocks: string[];
    blockedBy: string[];
    createdAt: number;
    updatedAt: number;
}
export declare class TaskManager {
    private tasks;
    private bus;
    private maxTasks;
    private nextId;
    constructor(options?: {
        maxTasks?: number;
    });
    private generateId;
    setBus(bus: SharedStateBus): void;
    create(opts: {
        subject: string;
        description: string;
        owner?: string;
        activeForm?: string;
        metadata?: Record<string, unknown>;
    }): Task;
    get(id: string): Task | undefined;
    list(filter?: {
        status?: TaskStatus;
        owner?: string;
    }): Task[];
    update(id: string, changes: {
        subject?: string;
        description?: string;
        status?: TaskStatus;
        owner?: string;
        activeForm?: string;
        metadata?: Record<string, unknown>;
        addBlocks?: string[];
        addBlockedBy?: string[];
    }): Task;
    delete(id: string): boolean;
    private resolveBlockedTasks;
    private publishChange;
    toJSON(): Task[];
    loadFromJSON(tasks: Task[]): void;
}
