import type { UIMessage } from './types'; export declare function generateId(): string; export declare function lastAssistantMessageIsCompleteWithToolCalls({ messages, }: { messages: UIMessage[]; }): boolean; export declare class SerialJobExecutor { private queue; private isRunning; run(job: () => Promise): Promise; private processQueue; } export declare function resolveValue(value: T | (() => T) | (() => Promise) | undefined): Promise; /** * Error raised when the upstream stream emits a `data-guardrail-violation` * chunk. The `message` carries the service-provided `fallbackResponse`, which * is intentionally surfaced verbatim through the chat error UI (unlike * generic cost-control / 4xx errors, where the raw API message is hidden * behind a friendly default). * * Detection across package boundaries should rely on `error.name` rather than * `instanceof` to avoid issues with mixed module copies in bundled apps. */ export declare class GuardrailViolationError extends Error { constructor(message: string); } /** * Reads a non-empty `message` field off a JSON-serialized error envelope. * * Both transports backing `AbstractChat` (stream `error` chunks and HTTP error * responses) serialize errors as `{"message": "...", ...}` — the same shape as * the shared `ErrorResponse` on the API side. Returns the trimmed message if * the input is such a JSON object, otherwise `undefined`. */ export declare function tryParseErrorMessage(text: string): string | undefined;