Skip to main content

Module envelope

Module envelope 

Source
Expand description

JSON success/error envelopes for agents. JSON envelope helpers (schema_version = 1).

Success and error envelopes are written to stdout for agent parsing. Human diagnostics stay on stderr.

§Success shape

{"schema_version":1,"ok":true,"data":{}}

§Error shape

{"schema_version":1,"ok":false,"error":{"kind":"unavailable","message":"...","exit_code":69}}

Functions§

print_error_json
Print an error envelope derived from CliError.
print_success_json
Print a success envelope with arbitrary JSON data and flush a single line.