Dashboard › opencode › Distillation
5880088e-e878-4c56-8f1e-a0068e0edfa5["lore_tm_v1_x-Ka-DQ1pD2H0yPl0ZReUK6fa3r3ftvUwr79IFwyB8A"]
Date: Sep 16, 2026
packages/core/src/event.ts exports EventV2 from "./event" and re-exports Data, Definition, and Payload from @opencode-ai/schema/event; it aliases ID to Event.ID.packages/core/src/event.ts imports Effect primitives Cause, Context, Effect, Layer, Option, PubSub, Queue, Schema, and Stream, plus Drizzle operators and, asc, eq, gt, and inArray.packages/core/src/event.ts uses EventSequenceTable and EventTable from ./event/sql, Database from ./database/database, Location from ./location, makeGlobalNode from ./effect/app-node, isDeepStrictEqual from node:util, and Durable from @opencode-ai/schema/durable-event-manifest.Subscriber<D extends Definition = Definition> as (event: Payload<D>) => Effect.Effect<void> and Unsubscribe as Effect.Effect<void>.latestSequence is declared with Effect.fn("EventV2.latestSequence") and accepts db: Database.Interface["db"] plus aggregateID: string.Durable.get(event.type).page with rows.slice(0, input.limit).versionedType is directly aliased to Event.versionedType.replayAll and listener unsubscription through events.listen(...); listeners are stored as new Array<Subscriber>().latest as row?.seq ?? -1, checks if (input && input.seq <= latest), and can fail with InvalidDurableEventError.{ aggregate_id: aggregateID, seq, owner_id: input?.ownerID }, preserving an optional owner ID alongside the aggregate sequence.