/** Shared helpers for mocking SSE streams in demos, previews, and tests. */ interface MockSSEFrame { type: string; [key: string]: unknown; } interface CreateMockSSEStreamOptions { /** Delay in ms between emitted frames. Default: 100. */ delayMs?: number; /** * Named event name. When set, each frame is emitted as `event: \ndata: ...\n\n`. * Omit for bare `data: ...\n\n` form (both are valid SSE and the widget parser accepts either). */ eventName?: string; } declare function createMockSSEStream(frames: ReadonlyArray, options?: CreateMockSSEStreamOptions): ReadableStream; interface AssistantTurnFramesOptions { /** Execution id shared across the turn's frames. */ executionId: string; /** Turn id. Default: `turn-1`. */ turnId?: string; /** Assistant text content to stream. */ text: string; /** Approximate characters per `agent_turn_delta` frame. Default: 32. */ chunkSize?: number; } /** * Builds the standard `agent_turn_start` → many `agent_turn_delta` → `agent_turn_complete` * frame sequence for simulating a streaming assistant reply. The frames drive the same * client pipeline as real SSE, so stream animations (typewriter, word-fade, etc.) engage. */ declare function buildAssistantTurnFrames(options: AssistantTurnFramesOptions): MockSSEFrame[]; interface MockSSEResponseOptions extends CreateMockSSEStreamOptions { status?: number; headers?: Record; } /** Convenience wrapper: returns a `Response` ready to hand back from a `customFetch` implementation. */ declare function createMockSSEResponse(frames: ReadonlyArray, options?: MockSSEResponseOptions): Response; export { type AssistantTurnFramesOptions, type CreateMockSSEStreamOptions, type MockSSEFrame, type MockSSEResponseOptions, buildAssistantTurnFrames, createMockSSEResponse, createMockSSEStream };