2026-05-06 20:08:47 +02:00
|
|
|
"""Single-responsibility split of the streaming SSE protocol.
|
|
|
|
|
|
|
|
|
|
Layout:
|
|
|
|
|
* ``envelope/`` - SSE wire framing + ID generators
|
|
|
|
|
* ``emitter/`` - identity of the agent that emitted an event + runtime registry
|
|
|
|
|
* ``events/`` - one module per SSE event family
|
2026-05-07 19:25:20 +02:00
|
|
|
* ``service.py`` - composition root used when emitting chat SSE
|
2026-05-06 20:08:47 +02:00
|
|
|
* ``interrupt_correlation.py`` - id-aware lookup over LangGraph state
|
|
|
|
|
|
|
|
|
|
Naming on the wire:
|
|
|
|
|
* AI SDK protocol fields keep their existing camelCase
|
|
|
|
|
(``toolCallId``, ``messageId``, ``inputTextDelta``, ``langchainToolCallId``).
|
|
|
|
|
* Every SurfSense-added field uses ``snake_case``, including the
|
|
|
|
|
top-level ``emitted_by`` envelope and all inner ``data`` payloads.
|
|
|
|
|
|
2026-05-07 19:25:20 +02:00
|
|
|
Production chat uses ``app.services.new_streaming_service`` from
|
|
|
|
|
``app.tasks.chat.stream_new_chat`` and related routes.
|
2026-05-06 20:08:47 +02:00
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
from __future__ import annotations
|