sig
  type json = Json.t
  type kind = [ `EXEC | `GET | `SET ]
  val string_of_kind : Server.Main.kind -> string
  val pp_kind : Stdlib.Format.formatter -> Server.Main.kind -> unit
  val register :
    Server.Main.kind ->
    string -> (Server.Main.json -> Server.Main.json) -> unit
  val find :
    string ->
    (Server.Main.kind * (Server.Main.json -> Server.Main.json)) option
  val exec : string -> Server.Main.json -> Server.Main.json
  type signal
  val signal : string -> Server.Main.signal
  val signal_name : Server.Main.signal -> string
  type 'a request =
      [ `Kill of 'a
      | `Poll
      | `Request of 'a * string * Server.Main.json
      | `Shutdown
      | `SigOff of string
      | `SigOn of string ]
  type 'a response =
      [ `CmdLineOff
      | `CmdLineOn
      | `Data of 'a * Server.Main.json
      | `Error of 'a * string
      | `Killed of 'a
      | `Rejected of 'a
      | `Signal of string ]
  type 'a message = {
    requests : 'Server.Main.request list;
    callback : 'Server.Main.response list -> unit;
  }
  type 'a server
  val create :
    pretty:(Stdlib.Format.formatter -> '-> unit) ->
    ?equal:('-> '-> bool) ->
    fetch:(unit -> 'Server.Main.message option) ->
    unit -> 'Server.Main.server
  val start : 'Server.Main.server -> unit
  val stop : 'Server.Main.server -> unit
  val run : 'Server.Main.server -> unit
  val kill : unit -> 'a
  val emit : Server.Main.signal -> unit
  val on_signal : Server.Main.signal -> (bool -> unit) -> unit
  val on : (bool -> unit) -> unit
end