import { type Contract } from "@runapi.ai/mcp-core/web"; import type { BusinessToolClient } from "../business-tools.js"; import type { RunApiTaskResponse } from "../types.js"; export declare const COMPLETION_WAIT_DEADLINE_MS = 300000; export declare const COMPLETION_WAIT_POLL_INTERVAL_MS = 5000; export declare class CompletionWaitUnavailableError extends Error { constructor(); } export declare class HybridTaskResolutionError extends Error { readonly taskId: string; readonly created: RunApiTaskResponse; readonly resolutionError: unknown; constructor(taskId: string, created: RunApiTaskResponse, resolutionError: unknown); } export type ProgressSender = (message: { progressToken: string | number; progress: number; total: number; message: string; }) => Promise | void; export type ErrorFormatter = (error: unknown) => string; export declare function checkBalanceHandler(client: Pick, formatError: ErrorFormatter): Promise; export declare function createTaskHandler(input: { service: string; action: string; model?: string; params?: Record; idempotency_key?: string; wait?: boolean; timeout_ms?: number; poll_interval_ms?: number; }, client: Pick, contract: Contract, formatError: ErrorFormatter, sendProgress?: ProgressSender, progressToken?: string | number): Promise; export declare function getTaskHandler(input: { service: string; action?: string; task_id: string; }, client: Pick, contract: Contract, formatError: ErrorFormatter): Promise<{ task_id: string; status: string; task: RunApiTaskResponse; error?: undefined; } | { error: string; task_id?: undefined; status?: undefined; task?: undefined; }>; export declare function defaultTimeout(_action: string): number;