import type { TaskStore } from '@modelcontextprotocol/sdk/experimental/tasks/interfaces.js';
import type { ApifyClient } from 'apify-client';
import type { ActorStore, Input } from '../types.js';
import { ServerMode } from '../types.js';
/**
 * Process input parameters from URL and get tools
 * If URL contains query parameter `actors`, return tools from Actors otherwise return null.
 * @param url The URL to process
 * @param apifyClient The Apify client instance
 * @param mode Server mode for tool variant resolution
 * @param actorStore
 */
export declare function processParamsGetTools(url: string, apifyClient: ApifyClient, mode?: ServerMode, actorStore?: ActorStore): Promise<import("../types.js").ToolEntry[]>;
export declare function parseInputParamsFromUrl(url: string): Input;
/**
 * Checks if a task was cancelled, preventing state transitions from terminal states.
 * Critical for task execution: prevents SDK errors when trying to transition from 'cancelled' to 'working'.
 * @param taskId - The task identifier
 * @param mcpSessionId - The MCP session ID
 * @param taskStore - The task store instance
 * @returns true if task is cancelled, false otherwise
 */
export declare function isTaskCancelled(taskId: string, mcpSessionId: string | undefined, taskStore: TaskStore): Promise<boolean>;
/**
 * Polls the TaskStore and returns a signal that aborts only when an MCP task
 * is cancelled via `tasks/cancel`. Caller MUST invoke `dispose()` once the
 * tool handler returns or the polling interval leaks.
 *
 * See {@link ../../res/tasks_cancel_abort_flow.md} for the full design:
 * why the request's `extra.signal` is intentionally NOT chained, why polling
 * (not a callback), and how it composes with the existing handler-side abort.
 */
export declare function createTaskCancellationWatcher(opts: {
    taskId: string;
    mcpSessionId: string | undefined;
    taskStore: TaskStore;
    pollIntervalMs?: number;
}): {
    signal: AbortSignal;
    dispose: () => void;
};
//# sourceMappingURL=utils.d.ts.map