agent-first-data 0.41.0

Self-describing data and structured CLI contracts for AI agents — field-name suffixes for units and secrets, the afdata CLI for rendering, validation, path guards, and reading or editing structured documents (JSON, TOML, YAML, dotenv, INI, Markdown), plus libraries for Rust, Go, Python, TypeScript, and Bash.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
"""Python closed-reader probe: write a large raw payload to the process stdout,
then finish with an error event and the intended exit code 3.

tests/closed_reader_e2e.sh pipes it into `head -c 10` and expects exit 0: a
reader that stopped reading is not a failure of the command.
"""

import sys

from agent_first_data import CliEmitter, OutputFormat, OutputTo, json_error

emitter = CliEmitter.from_output_to(OutputTo.SPLIT, OutputFormat.JSON)
try:
    emitter.write_raw(b"x" * (2 * 1024 * 1024))
except Exception:
    pass
sys.exit(emitter.finish(json_error("probe", "intended failure").build(), 3))