Skip to content

@usine/core/event

One deduplicated fact the engine may react to: a trigger match or an operator approval. Trigger payloads retain the snapshot that selection expressions and prompt interpolation use; retries keep that recorded snapshot.

  • Schema.Class

new Event(…args): Event

Parameter Type
…args [props: object, options?: MakeOptions]

Event

readonly dedupKey: string & Brand<"DedupKey">

readonly id: string & Brand<"EventId">

readonly payload: Json

readonly receivedAt: Utc

DedupKey = typeof DedupKey.Type

Idempotency key the engine derives from watched state, timestamps excluded. The same state is the same Event forever, so a loop file never sets it (ADR 0002).


EventId = typeof EventId.Type

Identity of one recorded fact; repeated sightings are matched through its dedup key.

const DedupKey: Schema.brand<Schema.NonEmptyString, "DedupKey">

Idempotency key the engine derives from watched state, timestamps excluded. The same state is the same Event forever, so a loop file never sets it (ADR 0002).


const EventId: Schema.brand<Schema.NonEmptyString, "EventId">

Identity of one recorded fact; repeated sightings are matched through its dedup key.