Add one shared encoder for the server's event stream lines
Mantenedores costumam responder em até 1 dia
@kachamsiddarth já está trabalhando nisso.
Desde 20/10/2026.
Avaliação
Esta issue ainda não foi avaliada.
Descrição
Each server adapter builds its own SSE lines and writes its own data: [DONE] (packages/server/src/adapters/express.ts, lines 59 and 61, vercel.ts, lines 55 and 57, cloudflare.ts, lines 72 and 74), and their headers differ slightly. For protocol v1, one module will own the format so the adapters only move bytes. This issue is that module.
What to do
Create packages/core/src/protocol/sse.ts:
/** One event: `data: <json>` and a blank line. */
export function encodeSSE(part: WirePart | Record<string, unknown>): string;
/** A comment line that keeps the connection busy while nothing else is sent. */
export const SSE_PING: string; // ': ping\n\n'
/** Ends the stream. */
export const SSE_DONE: string; // 'data: [DONE]\n\n'
export const SSE_HEADERS: Readonly<Record<string, string>>;
SSE_HEADERS:Content-Type: text/event-stream; charset=utf-8,Cache-Control: no-cache, no-transform(stops proxies from compressing and buffering),X-Accel-Buffering: no(nginx). Leave outConnection. HTTP/2 doesn't allow it, and the runtimes handle it themselves.encodeSSEmust never produce a raw line break inside the data line.JSON.stringifyalready escapes\nand\r, so test that a part with line breaks in its text stays on one line. Also test that U+2028 and U+2029 survive.
Where to look
packages/core/src/protocol/v1.ts- The SSE format on MDN
Acceptance criteria
- New
packages/core/src/protocol/sse.ts, exported frompackages/core/src/protocol/index.tsand from@chatcops/core - Tests for the line format, line breaks in text, U+2028/U+2029, and the exact header values
- The adapters aren't changed in this PR (I switch them over in the protocol PR)
- Changeset for
@chatcops/core(minor) -
pnpm test:coverageandpnpm lintpass
Want to work on this? Comment below and I'll assign it to you. Please take one issue at a time, branch off dev, and open your PR against dev with Closes #<this issue number>. Setup notes (pnpm, build before test) are in CONTRIBUTING.md.
- Linguagem predominante
- TypeScript
- Estrelas
- 13
- Forks
- 7
- Merge médio
- 4h 11min
- PRs com merge (30d)
- 122
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de codercops/chatcops
-
enhancement hacktoberfest help wanted server
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
Mantenedores costumam responder em até 1 dia
-
Document the pre-chat formTalvez já em andamento @masyarakatai assumiu há 5 dias. Abertadocumentation good first issue hacktoberfest widget
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
codercops/chatcops#70 · 3 comentários · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
enhancement hacktoberfest help wanted server
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 25/100
Mantenedores costumam responder em até 1 dia
-
Create @chatcops/store-redis for Upstash and other Redis clientsTalvez já em andamento @bhushan4work assumiu há 1 dia. Abertaenhancement hacktoberfest help wanted server
codercops/chatcops#248 · 2 comentários · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
Create @chatcops/store-sqlite, a store for single-server setupsTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Abertaenhancement hacktoberfest help wanted server
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
Mantenedores costumam responder em até 1 dia
Todas as issues de codercops/chatcops
Issues semelhantes
-
[BUG] rag: sentence content can cross the reported sentence boundariesTalvez já em andamento @LJK-ikun assumiu hoje. Abertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
Mantenedores costumam responder em até 1 dia
-
bug needs-triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
Mantenedores costumam responder em até 1 dia
-
README: the Resource URI Schemas example's file://documents/* pattern only matches that literal URIAberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
platformatic/mcp#361 ·
Mantenedores costumam responder em até 1 dia
-
frontend
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
Push: sem service worker ou sem VAPID, o interruptor de Notificações fica ligado sem avisar nadaAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
melgarafael/DeskcommCRM#3164 ·
Mantenedores costumam responder em até 1 dia