import type { config as configType } from '../../../config/index.js';
import type { StorageService } from '../../../storage/core/StorageService.js';
import type { RequestContext } from '../../../utils/internal/requestContext.js';
import { type TaskMessageQueue, type TaskStore } from './taskTypes.js';
/**
 * Singleton service that manages task state and message queues for the MCP server.
 *
 * The TaskManager provides:
 * - A shared TaskStore for creating, tracking, and completing tasks
 * - A shared TaskMessageQueue for side-channel message delivery
 * - Cleanup methods for graceful shutdown
 *
 * The store type is determined by configuration:
 * - `in-memory`: Fast, suitable for development (data lost on restart)
 * - `storage`: Persistent, uses configured StorageService backend
 *
 * @example
 * ```typescript
 * // Inject via DI
 * constructor(@inject(TaskManagerToken) private taskManager: TaskManager) {}
 *
 * // Access stores
 * const taskStore = this.taskManager.getTaskStore();
 * const messageQueue = this.taskManager.getMessageQueue();
 * ```
 *
 * @experimental
 */
export declare class TaskManager {
    private readonly taskStore;
    private readonly inMemoryTaskStore;
    private readonly messageQueue;
    private readonly storeType;
    private isShuttingDown;
    constructor(config: typeof configType, storageService: StorageService);
    /**
     * Returns the TaskStore instance for managing task lifecycle.
     *
     * The TaskStore handles:
     * - Task creation with TTL and poll intervals
     * - Status updates (working, input_required, completed, failed, cancelled)
     * - Result storage and retrieval
     * - Task listing with pagination
     *
     * @returns The singleton TaskStore instance
     */
    getTaskStore(): TaskStore;
    /**
     * Returns the TaskMessageQueue instance for side-channel messaging.
     *
     * The message queue enables:
     * - Queuing requests/notifications for delivery via tasks/result
     * - FIFO ordering per task
     * - Atomic enqueue with size limits
     *
     * @returns The singleton TaskMessageQueue instance
     */
    getMessageQueue(): TaskMessageQueue;
    /**
     * Returns the store type currently in use.
     *
     * @returns 'in-memory' or 'storage'
     */
    getStoreType(): 'in-memory' | 'storage';
    /**
     * Performs cleanup of task resources.
     *
     * Should be called during graceful server shutdown to:
     * - Cancel cleanup timers in the in-memory task store
     * - Clear any pending message queues
     *
     * Note: Storage-backed task stores don't require cleanup as data persists.
     *
     * @param context - Request context for logging
     */
    cleanup(context?: RequestContext): void;
    /**
     * Returns the current task count (for debugging/monitoring).
     * Only available for in-memory store; returns `null` for storage-backed store.
     *
     * @returns The number of tasks currently tracked, or `null` if unavailable
     */
    getTaskCount(): number | null;
    /**
     * Checks if the TaskManager is shutting down.
     *
     * @returns True if cleanup has been initiated
     */
    isCleaningUp(): boolean;
}
//# sourceMappingURL=taskManager.d.ts.map