feat(sdk): unify session event stream

This commit is contained in:
Kit Langton 2026-06-25 23:26:07 -04:00
commit 20975b9434
20 changed files with 583 additions and 95 deletions

View file

@ -55,6 +55,15 @@ export type ProviderError = SessionMessage.ProviderError
export const Error = SessionMessage.Error
export type Error = SessionMessage.Error
export const Activity = Event.define({
type: "session.activity",
schema: {
sessionID: SessionID,
active: Schema.Boolean,
},
})
export type Activity = typeof Activity.Type
export const AgentSwitched = Event.define({
type: "session.next.agent.switched",
...options,
@ -521,3 +530,6 @@ export type DurableEvent = typeof Durable.Type
export const All = Schema.Union(Definitions, { mode: "oneOf" }).pipe(Schema.toTaggedUnion("type"))
export type Event = typeof All.Type
export type Type = Event["type"]
export const Stream = Schema.Union([Activity, All], { mode: "oneOf" }).pipe(Schema.toTaggedUnion("type"))
export type StreamEvent = typeof Stream.Type