The raw wire response object.
Optionaloptions: LegacyEnvelopeStatusOptionsOptional task context. Pass toolName when normalizing a
tool response so task-specific legacy body-status shims can run.
A new object with status injected when the legacy-leniency
rules apply; the same reference otherwise.
AdCP 3.1.0-beta.2 made envelope
statusREQUIRED. Pre-3.1 sellers may omit it. When the response declares itself as 3.0.x (or doesn't declare a version), inject a synthetic envelope status so strict validators don't reject otherwise-conformant 3.0 responses.Never overwrites an existing task-status. Legacy media-buy lifecycle statuses are moved to
media_buy_statusand replaced with the envelope statuscompletedwhenoptions.toolNameiscreate_media_buyorupdate_media_buy. Pure function; safe to call before validation.