Skip to main content

Module envelope

Module envelope 

Source
Expand description

Protocol envelope writer.

Every afhttp command emits one structured value per invocation: a single line of AFDATA JSON, wrapped with a top-level code field ("fetch", "health", "error", etc.) and a trailing newline. JSON is the only output format โ€” one request in, one line of structured JSON out.

Functionsยง

emit
Emit a single envelope payload to writer. The payload is wrapped with a top-level code field and written as one line of JSON followed by a newline.
emit_error
Convenience: emit an Error value with code: "error".
emit_unredacted
Emit a payload without AFDATA redaction. Use only for commands that require an explicit reveal flag and whose payload contains no unrelated secrets.