import type { SseEvent } from './sse-events'; type ParsedPayload = { /** Authoritative event name (lowercased), or '' if neither layer carried one. */ event: string; /** Original (un-lowercased) event name — used to preserve casing for unknown events. */ originalEvent?: string; /** Inner data payload (could be string, object, array, …). */ data: unknown; /** True if the data string was a plain (non-JSON) literal — usually a token. */ isPlainText: boolean; }; /** * Parse a single SSE frame into the wrapped/native form, returning the * inner event name and data. Does NOT classify into the SseEvent union * yet — that's `parseFrame`'s job. Kept separate so callers can inspect * raw payloads (e.g. for debug logging). */ export declare function parsePayload(sseEvent: string | undefined, rawData: string): ParsedPayload; /** * A flat `{ type: 'SCREAMING_SNAKE', ... }` object with no `event` key — the shape every * AG-UI frame takes, and one no legacy TORUK frame uses. Recognised structurally so the * streaming layer stays ignorant of AG-UI's semantics: it only decides that the frame * belongs to someone else, and `onEvent` hands it to whoever does understand it. */ export declare function isPassthroughFrame(payload: unknown): payload is Record; /** * Parse a single SSE frame into a typed `SseEvent`, or `null` if the * frame carries no usable payload (empty data, no event name resolvable). * * The 10-path `extractTokenText` fallback is applied for token-bearing * events so callers get a string directly, not the raw heterogeneous * payload shape from the backend. */ export declare function parseFrame(sseEvent: string | undefined, rawData: string): SseEvent | null; export declare function extractTokenText(data: unknown): string; export {};