chore: merge origin/dev into v2
Brings the latest dev (45 commits) into v2. Conflict resolutions: - core/src/session.ts: keep v2's Service (BusyError active-checks in revert.stage/clear/commit, rename method + Renamed event) and add dev's history method. v2's Renamed event flows through the merged SessionEvent.Definitions into the OpenCodeEvent union, so it encodes correctly on the SSE stream. - server/src/handlers/event.ts: take dev's OpenCodeEvent encoder, which supersedes v2's PublicEventManifest handler wiring. This also brings dev's live event stream (allBounded + heartbeat + keepalive headers) onto v2. - Removed the now-orphaned public-event-manifest.ts (only self-referenced after taking dev's handler). - Generated client + sdk types regenerated via codegen (not hand-merged); they pick up dev's effect SSE OpenAPI-naming patch (V2EventStream).
This commit is contained in:
commit
727f9f46a0
207 changed files with 9806 additions and 6648 deletions
|
|
@ -4,6 +4,11 @@ import { Event } from "./event"
|
|||
import { SessionEvent } from "./session-event"
|
||||
import { SessionV1 } from "./session-v1"
|
||||
|
||||
export const SessionDurable = {
|
||||
definitions: Event.durable(SessionEvent.DurableDefinitions),
|
||||
schema: SessionEvent.Durable,
|
||||
} as const
|
||||
|
||||
export const Durable = Event.durable([
|
||||
...SessionV1.Event.Definitions.filter((definition) => definition.durable !== undefined),
|
||||
...SessionEvent.DurableDefinitions,
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ export function define<
|
|||
id: ID,
|
||||
metadata: optional(Schema.Record(Schema.String, Schema.Unknown)),
|
||||
type: Schema.Literal(input.type),
|
||||
durable: optional(Schema.Struct({ aggregateID: Schema.String, seq: Schema.Number, version: Schema.Number })),
|
||||
durable: optional(Schema.Struct({ aggregateID: Schema.String, seq: Schema.Int, version: Schema.Int })),
|
||||
location: optional(Location.Ref),
|
||||
data,
|
||||
})
|
||||
|
|
@ -95,7 +95,7 @@ export function versionedType(type: string, version: number) {
|
|||
return `${type}.${version}`
|
||||
}
|
||||
|
||||
export function durable(definitions: ReadonlyArray<Definition>) {
|
||||
export function durable<const Definitions extends ReadonlyArray<Definition>>(definitions: Definitions) {
|
||||
return readonlyMap(
|
||||
definitions.reduce((result, definition) => {
|
||||
if (!definition.durable) return result
|
||||
|
|
@ -103,7 +103,7 @@ export function durable(definitions: ReadonlyArray<Definition>) {
|
|||
if (result.has(key)) throw new Error(`Duplicate durable event definition for ${key}`)
|
||||
result.set(key, definition)
|
||||
return result
|
||||
}, new Map<string, Definition>()),
|
||||
}, new Map<string, Definitions[number]>()),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -523,7 +523,9 @@ export const Definitions = Event.inventory(
|
|||
RevertEvent.Committed,
|
||||
)
|
||||
|
||||
export const Durable = Schema.Union(DurableDefinitions, { mode: "oneOf" }).pipe(Schema.toTaggedUnion("type"))
|
||||
export const Durable = Schema.Union(DurableDefinitions, { mode: "oneOf" })
|
||||
.pipe(Schema.toTaggedUnion("type"))
|
||||
.annotate({ identifier: "SessionDurableEvent" })
|
||||
export type DurableEvent = typeof Durable.Type
|
||||
|
||||
export const All = Schema.Union(Definitions, { mode: "oneOf" }).pipe(Schema.toTaggedUnion("type"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue