MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / read_json_lines

Function read_json_lines

scripts/test_mcp_interactive.py:51–63  ·  view source on GitHub ↗
(
    stream: BinaryIO,
    responses: "queue.Queue[dict[str, Any]]",
    transcript: list[dict[str, Any]],
)

Source from the content-addressed store, hash-verified

49
50
51def read_json_lines(
52 stream: BinaryIO,
53 responses: "queue.Queue[dict[str, Any]]",
54 transcript: list[dict[str, Any]],
55) -> None:
56 for raw_line in iter(stream.readline, b""):
57 try:
58 message = json.loads(raw_line.decode("utf-8"))
59 except (UnicodeDecodeError, json.JSONDecodeError):
60 continue
61 if isinstance(message, dict):
62 transcript.append(message)
63 responses.put(message)
64
65
66def drain(stream: BinaryIO, chunks: list[bytes]) -> None:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected