Skip to main content

Module envelope

Module envelope 

Source
Expand description

Typed JSON envelopes for the agent contract (success, dry-run, error).

Every envelope serializes directly from a typed struct — no intermediate serde_json::Value on the write path. Optional fields are omitted on None (skip_serializing_if) rather than emitted as JSON null.

Structs§

DryRunData
Dry-run data object (planned_url + typed planned_params).
DryRunEnvelope
JSON dry-run success envelope with planned URL and params.
ErrorBody
Error body fields inside the envelope.
ErrorEnvelope
JSON error envelope for agents.
SuccessEnvelope
JSON success envelope for agents (schema_version, ok, command, data, duration_ms).

Functions§

dry_run_envelope
Build a typed dry-run success envelope with planned URL/params.
error_envelope
Build an error envelope. SIGINT/SIGTERM surface as kind canceled with exit 130/143.
success_envelope
Build a typed success envelope (schema_version, ok, command, data, duration_ms).
success_envelope_with_ok
Build a success-shaped envelope with an explicit top-level ok (used by doctor).
usage_error
Map clap parse failures to usage errors.