feat(sdk): unify session event stream
This commit is contained in:
parent
8de238aaf6
commit
20975b9434
20 changed files with 583 additions and 95 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue