Module Message.System

System control and status messages.

System messages use a discriminated union on the "subtype" field:

type init = {
  1. session_id : string option;
  2. model : string option;
  3. cwd : string option;
  4. unknown : Unknown.t;
}

Init message fields.

type error = {
  1. error : string;
  2. unknown : Unknown.t;
}

Error message fields.

type status = {
  1. status : string;
  2. status_session_id : string option;
  3. uuid : string option;
  4. unknown : Unknown.t;
}

Status message fields.

type t =
  1. | Init of init
  2. | Error of error
  3. | Status of status
val jsont : t Jsont.t

jsont is the Jsont codec for system messages.

Constructors

val init : ?session_id:string -> ?model:string -> ?cwd:string -> unit -> t

init ?session_id ?model ?cwd () creates an init message.

val error : error:string -> t

error ~error creates an error message.

val status : status:string -> ?session_id:string -> ?uuid:string -> unit -> t

status ~status ?session_id ?uuid () creates a status message.

Accessors

val session_id : t -> string option

session_id t returns session_id from Init or Status, None otherwise.

val model : t -> string option

model t returns model from Init, None otherwise.

val cwd : t -> string option

cwd t returns cwd from Init, None otherwise.

val error_msg : t -> string option

error_msg t returns error from Error, None otherwise.

val status_value : t -> string option

status_value t returns status from Status, None otherwise.

val uuid : t -> string option

uuid t returns uuid from Status, None otherwise.

val unknown : t -> Unknown.t

unknown t returns the unknown fields.