| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- export * as SessionStatusEvent from "./session-status-event"
- import { Schema } from "effect"
- import { optional } from "./schema"
- import { Event } from "./event"
- import { NonNegativeInt } from "./schema"
- import { SessionID } from "./session-id"
- export const Info = Schema.Union([
- Schema.Struct({
- type: Schema.Literal("idle"),
- }),
- Schema.Struct({
- type: Schema.Literal("retry"),
- attempt: NonNegativeInt,
- message: Schema.String,
- action: optional(
- Schema.Struct({
- reason: Schema.String,
- provider: Schema.String,
- title: Schema.String,
- message: Schema.String,
- label: Schema.String,
- link: optional(Schema.String),
- }),
- ),
- next: NonNegativeInt,
- }),
- Schema.Struct({
- type: Schema.Literal("busy"),
- }),
- ]).annotate({ identifier: "SessionStatus" })
- export type Info = Schema.Schema.Type<typeof Info>
- export const Status = Event.define({
- type: "session.status",
- schema: {
- sessionID: SessionID,
- status: Info,
- },
- })
- // deprecated
- export const Idle = Event.define({
- type: "session.idle",
- schema: {
- sessionID: SessionID,
- },
- })
- export const Definitions = Event.inventory(Status, Idle)
|