Source:
Local role: Canonical command payload consumed by AuthorityCommandHandler.
Big-picture role: Transport object that standardizes authoritative world mutation requests targeting World.
Inheritance:
- frozen dataclass
Parameters and fields:
command_id: stractor_id: ObjectIdcommand_type: strpayload: JsonMapsequence: intissued_at: str
Methods:
to_dict() -> JsonMap- from_dict(data) -> CommandEnvelope
Example:
from ometeotl_core.generic.authority import CommandEnvelope
import datetime
envelope = CommandEnvelope(
command_id="cmd-001",
actor_id="actor-1",
command_type="add_space",
payload={"space": space.to_dict()},
sequence=1,
issued_at=datetime.datetime.utcnow().isoformat(),
)
data = envelope.to_dict()
envelope2 = CommandEnvelope.from_dict(data)
See also:
