MCPcopy
hub / github.com/callstack/agent-device / tryReadLineMessage

Method tryReadLineMessage

src/mcp/server.ts:147–153  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

145 }
146
147 private tryReadLineMessage(): string | undefined {
148 const newline = this.buffer.indexOf('\n');
149 if (newline === -1) return undefined;
150 const line = this.buffer.slice(0, newline).trim();
151 this.buffer = this.buffer.slice(newline + 1);
152 return line.length > 0 ? line : undefined;
153 }
154
155 private emit(raw: string): void {
156 // JSON.parse failures propagate to the stdin handler as a -32700 parse error.

Callers 1

pushMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected