Chat and SSE
Web transport
Section titled “Web transport”The web app uses server-sent events (SSE) for chat streaming.
This is implemented in:
apps/web/src/lib/api.tsapps/web/src/hooks/useSSEChat.tsapps/api/src/routes/chat.ts
Event types in the current implementation
Section titled “Event types in the current implementation”The current web client understands these event types:
progresschunkdoneerror
Typical progress messages
Section titled “Typical progress messages”The current API route explicitly describes staged updates such as:
- fetching jobs
- scoring matches
- drafting outreach
Why SSE was chosen
Section titled “Why SSE was chosen”SSE is a good fit for the current one-way streaming model:
- the client sends one request
- the platform streams progress and final content back
- the browser does not need a full duplex socket just to show staged progress
Important mental model
Section titled “Important mental model”Streaming belongs to the channel layer.
The skill logic still lives behind the platform API and worker path.