import { Server } from "@modelcontextprotocol/sdk/server/index.js"; import { RequestId, CallToolRequest, Result } from "@modelcontextprotocol/sdk/types.js"; import { InMemoryTaskStore } from "@modelcontextprotocol/sdk/experimental/index.js"; export declare const TASK_CAPABLE_TOOLS: Set; declare const taskStore: InMemoryTaskStore; export declare function registerTaskHandlers(server: Server): void; type ToolHandler = (args: Record) => Promise>; /** * Creates a task, then runs `handler` detached from the current request so the MCP * connection is free to serve tasks/get polls (and anything else) while it's in flight. * Returns the CreateTaskResult (`{ task }`) to send back immediately as the tools/call * response. `onSettled` lets the caller do its usual receipt/telemetry bookkeeping once the * background work actually finishes, since none of that can happen on the synchronous path * for a task-augmented call. */ export declare function runAsTask(name: string, args: Record, request: CallToolRequest, requestId: RequestId, handler: ToolHandler, onSettled: (result: Result | null, error: unknown) => void): Promise<{ task: Awaited>; }>; export {}; //# sourceMappingURL=tasks.d.ts.map