import type { TaskMessageQueue, TaskStore } from '@modelcontextprotocol/sdk/experimental/tasks/interfaces.js'; import { type OnModuleDestroy } from '@nestjs/common'; /** * Manages task lifecycle and session-scoped task tracking. * * Wraps the SDK's in-memory task store and message queue, adding * session-to-task tracking so tasks can be cleaned up when a session closes. * * The underlying `TaskStore` and `TaskMessageQueue` are passed to the * SDK's `McpServer` constructor, which automatically registers handlers * for `tasks/get`, `tasks/list`, `tasks/cancel`, and `tasks/result`. */ export declare class TaskManager implements OnModuleDestroy { private readonly logger; private readonly taskStore; private readonly messageQueue; /** sessionId -> Set of taskIds created in that session */ private readonly sessionTasks; get store(): TaskStore; get queue(): TaskMessageQueue; /** Associate a task with a session for cleanup tracking. */ trackTask(taskId: string, sessionId: string): void; /** * Remove all tasks for a session. Non-terminal tasks are cancelled. * Called when a transport session closes. */ removeSession(sessionId: string): Promise; onModuleDestroy(): void; } //# sourceMappingURL=task.manager.d.ts.map