MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / parseSseFrame

Function parseSseFrame

deployments/desktop/static/desktop.js:4514–4524  ·  view source on GitHub ↗
(frame)

Source from the content-addressed store, hash-verified

4512 }
4513
4514 function parseSseFrame(frame) {
4515 const lines = frame.split(/\r?\n/);
4516 let event = "message";
4517 const dataLines = [];
4518 lines.forEach((line) => {
4519 if (line.startsWith("event:")) event = line.slice(6).trim();
4520 if (line.startsWith("data:")) dataLines.push(line.slice(5).trimStart());
4521 });
4522 if (!dataLines.length) return null;
4523 return { event, data: JSON.parse(dataLines.join("\n")) };
4524 }
4525
4526 async function streamWikiAsk(payload, answerTarget, message) {
4527 const response = await fetch("/api/wiki/ask/stream", {

Callers 1

processFrameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected