import type { SessionStreamEventType } from '../../contracts/session/api.js'; import type { SessionEvent } from '../../types/session/events.js'; export interface MappedStreamEvent { wire: SessionStreamEventType; data: Record; /** * The cursor a client resubscribes at, as `:`. * * Not a bare number, and the reason is structural: a parent's stream also * carries its children's events, each numbered in its OWN session's log, so * one scalar over a mixed stream would compare positions from two different * sequences. The session id is what makes the position addressable — a * client keeps one cursor per session id and sends the right one back. * * This is what an SSE `id:` line should carry, which is why it sits beside * the payload rather than inside it: a framer writes it without having to * understand what kind of event it is. * * Absent when the event is not recoverable — every ephemeral event, every * event whose durable write failed, and every delegation-lifecycle event * that never passed through the session's log at all. A client must not advance * its cursor on one, and the absence is how it knows. */ id?: string; } /** * One session event as an SSE frame, or `null` for an event the wire does not * carry. * * Every payload names the session the event belongs to (`session_id`) and, * when it happened inside a turn, the turn (`turn_id`). Both come from the * event itself, so a child session's event relayed on its parent's stream * names the child, which is the session whose log numbers it. */ export declare function mapSessionEventToStreamEvent(event: SessionEvent): MappedStreamEvent | null; /** @deprecated Use mapSessionEventToStreamEvent */ export declare const mapSessionToStreamEvent: typeof mapSessionEventToStreamEvent; //# sourceMappingURL=mapper.d.ts.map