MCPcopy Create free account
hub / github.com/diegosouzapw/OmniRoute / commandCodeStream

Function commandCodeStream

tests/unit/command-code-executor.test.ts:39–47  ·  view source on GitHub ↗
(lines: unknown[], { sse = false } = {})

Source from the content-addressed store, hash-verified

37];
38
39function commandCodeStream(lines: unknown[], { sse = false } = {}) {
40 const text = lines
41 .map((line) => {
42 const json = JSON.stringify(line);
43 return sse ? `data: ${json}\n\n` : `${json}\n`;
44 })
45 .join("");
46 return new Response(text, { status: 200, headers: { "Content-Type": "application/x-ndjson" } });
47}
48
49function toPlainHeaders(headers: Headers | Record<string, string>) {
50 if (headers instanceof Headers) return Object.fromEntries(headers.entries());

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected