Metadata-Version: 2.3
Name: jsonl-exec
Version: 0.1.0
Summary: Run JSONL-emitting subprocesses with a consumable async channel
Author: thaut
Author-email: thaut <thaut@logic.cs.tsukuba.ac.jp>
Requires-Dist: anyio>=4.11.0
Requires-Dist: psutil>=7.1.0
Requires-Python: >=3.12
Description-Content-Type: text/markdown

# jsonl-exec

Tiny structured-concurrency helpers for running a subprocess that emits JSON
messages on stdout, reports text lines on stderr, and exposes stdout as a
consumable async channel.

It intentionally does not parse provider-specific schemas or agent events. It
just manages:

- process startup
- stdout JSON line parsing
- stderr callbacks
- async receive queue
- cancellation and process-tree cleanup

## Example

```python
from wm_jsonl_subprocess import JsonLineProcessOptions, open_json_line_process


async def main() -> None:
    async with open_json_line_process(
        JsonLineProcessOptions(
            cmd="claude",
            args=["-p", "Hello", "--output-format", "stream-json"],
            on_stderr=print,
        )
    ) as process:
        while True:
            message = await process.receive()
            if message is None:
                break
            print(message)
```
