import type { TaskState, PendingQuestion } from '../task/task-state.js'; import type { WireState } from '../task/wire-state-mapper.js'; /** * Response shape for `tasks/get` — a single task's status snapshot. */ export interface TasksGetResponse { taskId: string; status: WireState; pollFrequency: number; keepAlive?: number; metadata?: { pendingQuestion?: PendingQuestion; }; error?: string; } /** * List item shape for `tasks/list` — lightweight summary per task. */ export interface TasksListItem { taskId: string; status: WireState; pollFrequency: number; createdAt: string; lastUpdatedAt: string; } /** * Returns the recommended poll interval in milliseconds based on task status. * * - WAITING_ANSWER → 2 000 ms (client should check frequently for input-required) * - PENDING, RUNNING → 5 000 ms * - All others (WAITING, RATE_LIMITED, terminal) → 30 000 ms */ export declare function computePollFrequency(task: TaskState): number; /** * Builds a SEP-1686 `tasks/get` response from internal TaskState. * * - Maps internal status to wire state via `mapToWireState` * - Computes poll frequency via `computePollFrequency` * - Includes `keepAlive` from task if present * - Includes first pending question in metadata when status is * WAITING_ANSWER and the queue is non-empty * - Includes error string if present */ export declare function buildTasksGetResponse(task: TaskState): TasksGetResponse; /** * Builds a SEP-1686 `tasks/list` response. * * - Filters by wire status if `statusFilter` is provided * - Sorts by `createdAt` descending (newest first) * - Paginates with page size 50; cursor is a string-encoded start index * - Returns `nextCursor` if more pages exist */ export declare function buildTasksListResponse(tasks: TaskState[], cursor?: string, statusFilter?: WireState): { tasks: TasksListItem[]; nextCursor?: string; };