export type Message = {
    session?: string
    id?: string
    type: MessageType
    data?: CommandResult | CommandOutput
}

export type MessageType = "error" | "input" | "output" | "commands" | "save-file"
    | "game:start"
    | "stream:start" | "stream:end" | "stream:append" | "stream:replace"

export type CommandOutput = string | string[]
    | { text: string, script?: string }
    | { html: string, script?: string }
    | { script: string }
    | { game: string }

export type CommandResult = {
    status: "ok" | "error"
    output: CommandOutput
}
