1import * as Schema from "effect/Schema";
2
3export const DesktopTerminalRequest = Schema.Union([
4 Schema.Struct({
5 type: Schema.Literal("open"),
6 id: Schema.String,
7 environmentId: Schema.String,
8 url: Schema.String,
9 }),
10 Schema.Struct({ type: Schema.Literal("message"), id: Schema.String, data: Schema.String }),
11 Schema.Struct({ type: Schema.Literal("close"), id: Schema.String }),
12]);
13export type DesktopTerminalRequest = typeof DesktopTerminalRequest.Type;
14
15export const DesktopTerminalResponse = Schema.Union([
16 Schema.Struct({ type: Schema.Literal("ready"), environmentId: Schema.String }),
17 Schema.Struct({ type: Schema.Literal("message"), id: Schema.String, data: Schema.String }),
18 Schema.Struct({ type: Schema.Literal("close"), id: Schema.String }),
19]);
20export type DesktopTerminalResponse = typeof DesktopTerminalResponse.Type;
21
22export interface DesktopTerminalConnection {
23 readonly send: (data: string) => void;
24 readonly close: () => void;
25}