@tanstack/ai
Version:
Core TanStack AI library - Open source AI SDK
13 lines (12 loc) • 489 B
TypeScript
/**
* Shared error-narrowing helper for activities that convert thrown values
* into structured `RUN_ERROR` events.
*
* Accepts Error instances, objects with string-ish `message`/`code`, or bare
* strings; always returns a shape safe to serialize. Never leaks the full
* error object (which may carry request/response state from an SDK).
*/
export declare function toRunErrorPayload(error: unknown, fallbackMessage?: string): {
message: string;
code: string | undefined;
};