mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-27 10:43:36 +00:00
32 lines
866 B
TypeScript
32 lines
866 B
TypeScript
export * as WorkspaceEvent from "./workspace-event"
|
|
|
|
import { Schema } from "effect"
|
|
import { Event } from "./event"
|
|
import { WorkspaceID } from "./workspace-id"
|
|
|
|
export const ConnectionStatus = Schema.Struct({
|
|
workspaceID: WorkspaceID,
|
|
status: Schema.Literals(["connected", "connecting", "disconnected", "error"]),
|
|
}).annotate({ identifier: "WorkspaceEvent.ConnectionStatus" })
|
|
export interface ConnectionStatus extends Schema.Schema.Type<typeof ConnectionStatus> {}
|
|
|
|
export const Ready = Event.define({
|
|
type: "workspace.ready",
|
|
schema: {
|
|
name: Schema.String,
|
|
},
|
|
})
|
|
|
|
export const Failed = Event.define({
|
|
type: "workspace.failed",
|
|
schema: {
|
|
message: Schema.String,
|
|
},
|
|
})
|
|
|
|
export const Status = Event.define({
|
|
type: "workspace.status",
|
|
schema: ConnectionStatus.fields,
|
|
})
|
|
|
|
export const Definitions = Event.inventory(Ready, Failed, Status)
|