IF Commons GitHub

surfaces/mcp/stdio

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0013-mcp-surface FR-006

The standard streams as the transport of a tool server (commons headless 0013-mcp-surface FR-006): lines from standard input, lines to standard output, and nothing else on standard output. linesOf is the pure framing (chunks of bytes into lines, a partial line kept for the next chunk), so a test drives it with no stream.

import { framer } from "./stdio.ts";
const f = framer();
f.push("a\nb"); // ["a"]
f.push("c\n"); // ["bc"]

Source: commons/headless/src/surfaces/mcp/stdio.ts

1 of 2 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

framerfunction
function framer(): { readonly push: (chunk: string) => readonly string[]; readonly end: () => readonly string[]; }

Chunks of text into lines: each push gives the lines it completed and keeps the rest; end gives what is left. A \r before the line break is not part of the line.

Imported by 6 tests of the run (6 passed, 0 failed): the library's results

stdioTransportfunctionno test imports it
function stdioTransport(): Transport

The transport of this process: standard input in lines, a line and its break written to standard output.

Titles, headings, exports, tables, columns and requirements. Esc closes.