Add one shared encoder for the server's event stream lines
I maintainer di solito rispondono entro 1 giorno
@kachamsiddarth ci sta già lavorando.
Dal 20/10/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 13
- Fork
- 7
- Merge medio
- 4h 11m
- PR unite (30g)
- 122
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di codercops/chatcops
-
enhancement hacktoberfest help wanted server
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Document the pre-chat formForse già presa @masyarakatai l’ha presa 5 giorni fa. Apertadocumentation good first issue hacktoberfest widget
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
codercops/chatcops#70 · 3 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement hacktoberfest help wanted server
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
I maintainer di solito rispondono entro 1 giorno
-
Create @chatcops/store-redis for Upstash and other Redis clientsForse già presa @bhushan4work l’ha presa 1 giorno fa. Apertaenhancement hacktoberfest help wanted server
codercops/chatcops#248 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Create @chatcops/store-sqlite, a store for single-server setupsForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertaenhancement hacktoberfest help wanted server
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di codercops/chatcops
Issue simili
-
ready-for-agent
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
xavxyz/bei-shan-lin-shui#57 ·
I maintainer di solito rispondono entro 1 giorno
-
[BUG] rag: sentence content can cross the reported sentence boundariesForse già presa @LJK-ikun l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
bug needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
README: the Resource URI Schemas example's file://documents/* pattern only matches that literal URIAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
platformatic/mcp#361 ·
I maintainer di solito rispondono entro 1 giorno
-
最近文档这个弹窗,左右宽度没有最小宽度限制Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
siyuan-note/siyuan#20799 · 7 commenti ·
I maintainer di solito rispondono entro 1 giorno