//#region ../ai/src/serve/stream-to-sse.d.ts /** * A streamable execution: an async iterable of typed events that also * exposes the final `result` promise — exactly the shape every primitive's * `stream()` returns ({@link StreamContract}). */ type StreamLike = AsyncIterable & { result?: Promise; }; /** * Convert a primitive's event stream into an SSE byte stream (A3): each * event becomes an SSE frame named by its `type`, then the final `result` * (or an `error` frame if it rejects) is emitted, and finally the * `[DONE]` sentinel. Pure and transport-agnostic — {@link serve} pipes it * to an HTTP response, but it works against any sink. * * @example * for await (const frame of streamToSSE(agent.stream("hi"))) { * res.write(frame); * } */ declare function streamToSSE(stream: StreamLike): AsyncIterable; //#endregion export { StreamLike, streamToSSE }; //# sourceMappingURL=stream-to-sse.d.mts.map