/
Alex_Ural
/
opencode
Обзор
Документация
Войти
/
Alex_Ural
/
opencode
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
packages/schema/src/session-status-event.ts
51 строка
1 KB
Kit Langton
refactor(schema): tighten public contracts (#33771)
25 июн 2026, 20:10
Не верифицирован
25 июн 2026, 20:10
9e9d405
Код
Авторство
О чём код?
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)