package umari:command@0.1.0;
interface executor {
use types.{error};
use umari:common/types@0.1.0.{event-type, json, uuid};
record command-context {
correlation-id: option<uuid>,
triggering-event-id: option<uuid>,
idempotency-key: option<uuid>,
}
record command-receipt {
position: option<u64>,
events: list<emitted-event>,
}
record emitted-event {
id: uuid,
event-type: event-type,
tags: list<string>,
}
execute: func(command: string, input: json, context: command-context) -> result<command-receipt, string>;
}