MCPcopy
hub / github.com/lightningpixel/modly / recv

Function recv

api/runner.py:57–66  ·  view source on GitHub ↗

Yields parsed JSON messages from stdin, one per line.

()

Source from the content-addressed store, hash-verified

55
56
57def recv():
58 """Yields parsed JSON messages from stdin, one per line."""
59 for raw in sys.stdin:
60 raw = raw.strip()
61 if raw:
62 try:
63 yield json.loads(raw)
64 except json.JSONDecodeError as exc:
65 send({"type": "log", "level": "error",
66 "message": f"Runner: invalid JSON on stdin: {exc}"})
67
68
69# ------------------------------------------------------------------ #

Callers 1

mainFunction · 0.85

Calls 1

sendFunction · 0.85

Tested by

no test coverage detected