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

This commit is contained in:
Dax
2026-06-21 10:34:57 -04:00
committed by GitHub
parent ca006a2d20
commit fb43c15f88
15 changed files with 231 additions and 569 deletions
+3 -3
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 } }])
}),
)