refactor(core): simplify event model (#33238)

This commit is contained in:
Dax 2026-06-21 16:34:57 +02:00 committed by GitHub
commit fb43c15f88
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 231 additions and 569 deletions

View file

@ -220,8 +220,8 @@ describe("SessionV2.create", () => {
expect(
Array.from(yield* session.events({ sessionID: created.id }).pipe(Stream.take(2), Stream.runCollect)),
).toMatchObject([
{ cursor: 1, event: { type: "session.next.prompt.admitted", data: { prompt: { text: "Hello" } } } },
{ cursor: 2, event: { type: "session.next.prompt.promoted" } },
{ durable: { seq: 1 }, type: "session.next.prompt.admitted", data: { prompt: { text: "Hello" } } },
{ durable: { seq: 2 }, type: "session.next.prompt.promoted" },
])
}),
)
@ -355,7 +355,7 @@ describe("SessionV2.create", () => {
expect(yield* session.get(created.id)).toMatchObject({ model })
expect(
Array.from(yield* session.events({ sessionID: created.id }).pipe(Stream.take(1), Stream.runCollect)),
).toMatchObject([{ event: { type: "session.next.model.switched", data: { model } } }])
).toMatchObject([{ type: "session.next.model.switched", data: { model } }])
}),
)