sig
  type plugin = Kernel | Plugin of string
  type ident = private {
    plugin : Server.Package.plugin;
    package : string list;
    name : string;
  }
  type jtype =
      Jany
    | Jnull
    | Jboolean
    | Jnumber
    | Jstring
    | Jalpha
    | Jtag of string
    | Jkey of string
    | Jindex of string
    | Joption of Server.Package.jtype
    | Jdict of Server.Package.jtype
    | Jlist of Server.Package.jtype
    | Jarray of Server.Package.jtype
    | Jtuple of Server.Package.jtype list
    | Junion of Server.Package.jtype list
    | Jrecord of (string * Server.Package.jtype) list
    | Jdata of Server.Package.ident
    | Jenum of Server.Package.ident
    | Jself
  type fieldInfo = {
    fd_name : string;
    fd_type : Server.Package.jtype;
    fd_descr : Markdown.text;
  }
  type tagInfo = {
    tg_name : string;
    tg_label : Markdown.text;
    tg_descr : Markdown.text;
  }
  type paramInfo =
      P_value of Server.Package.jtype
    | P_named of Server.Package.fieldInfo list
  type requestInfo = {
    rq_kind : [ `EXEC | `GET | `SET ];
    rq_input : Server.Package.paramInfo;
    rq_output : Server.Package.paramInfo;
  }
  type arrayInfo = { arr_key : string; arr_kind : Server.Package.jtype; }
  type declKindInfo =
      D_signal
    | D_type of Server.Package.jtype
    | D_enum of Server.Package.tagInfo list
    | D_record of Server.Package.fieldInfo list
    | D_request of Server.Package.requestInfo
    | D_value of Server.Package.jtype
    | D_state of Server.Package.jtype
    | D_array of Server.Package.arrayInfo
    | D_safe of Server.Package.ident * Server.Package.jtype
    | D_loose of Server.Package.ident * Server.Package.jtype
    | D_order of Server.Package.ident * Server.Package.jtype
  type declInfo = {
    d_ident : Server.Package.ident;
    d_descr : Markdown.text;
    d_kind : Server.Package.declKindInfo;
  }
  type packageInfo = {
    p_plugin : Server.Package.plugin;
    p_package : string list;
    p_title : string;
    p_descr : Markdown.text;
    p_readme : string option;
    p_content : Server.Package.declInfo list;
  }
  val pp_plugin : Stdlib.Format.formatter -> Server.Package.plugin -> unit
  val pp_pkgname :
    Stdlib.Format.formatter -> Server.Package.packageInfo -> unit
  val pp_ident : Stdlib.Format.formatter -> Server.Package.ident -> unit
  val pp_jtype : Stdlib.Format.formatter -> Server.Package.jtype -> unit
  val derived :
    ?prefix:string ->
    ?suffix:string -> Server.Package.ident -> Server.Package.ident
  module Derived :
    sig
      val signal : Server.Package.ident -> Server.Package.ident
      val getter : Server.Package.ident -> Server.Package.ident
      val setter : Server.Package.ident -> Server.Package.ident
      val data : Server.Package.ident -> Server.Package.ident
      val fetch : Server.Package.ident -> Server.Package.ident
      val reload : Server.Package.ident -> Server.Package.ident
      val safe : Server.Package.ident -> Server.Package.ident
      val loose : Server.Package.ident -> Server.Package.ident
      val order : Server.Package.ident -> Server.Package.ident
      val decode : safe:bool -> Server.Package.ident -> Server.Package.ident
    end
  module IdMap :
    sig
      type key = ident
      type +'a t
      val empty : 'a t
      val is_empty : 'a t -> bool
      val mem : key -> 'a t -> bool
      val add : key -> '-> 'a t -> 'a t
      val update : key -> ('a option -> 'a option) -> 'a t -> 'a t
      val singleton : key -> '-> 'a t
      val remove : key -> 'a t -> 'a t
      val merge :
        (key -> 'a option -> 'b option -> 'c option) -> 'a t -> 'b t -> 'c t
      val union : (key -> '-> '-> 'a option) -> 'a t -> 'a t -> 'a t
      val compare : ('-> '-> int) -> 'a t -> 'a t -> int
      val equal : ('-> '-> bool) -> 'a t -> 'a t -> bool
      val iter : (key -> '-> unit) -> 'a t -> unit
      val fold : (key -> '-> '-> 'b) -> 'a t -> '-> 'b
      val for_all : (key -> '-> bool) -> 'a t -> bool
      val exists : (key -> '-> bool) -> 'a t -> bool
      val filter : (key -> '-> bool) -> 'a t -> 'a t
      val filter_map : (key -> '-> 'b option) -> 'a t -> 'b t
      val partition : (key -> '-> bool) -> 'a t -> 'a t * 'a t
      val cardinal : 'a t -> int
      val bindings : 'a t -> (key * 'a) list
      val min_binding : 'a t -> key * 'a
      val min_binding_opt : 'a t -> (key * 'a) option
      val max_binding : 'a t -> key * 'a
      val max_binding_opt : 'a t -> (key * 'a) option
      val choose : 'a t -> key * 'a
      val choose_opt : 'a t -> (key * 'a) option
      val split : key -> 'a t -> 'a t * 'a option * 'a t
      val find : key -> 'a t -> 'a
      val find_opt : key -> 'a t -> 'a option
      val find_first : (key -> bool) -> 'a t -> key * 'a
      val find_first_opt : (key -> bool) -> 'a t -> (key * 'a) option
      val find_last : (key -> bool) -> 'a t -> key * 'a
      val find_last_opt : (key -> bool) -> 'a t -> (key * 'a) option
      val map : ('-> 'b) -> 'a t -> 'b t
      val mapi : (key -> '-> 'b) -> 'a t -> 'b t
      val to_seq : 'a t -> (key * 'a) Seq.t
      val to_seq_from : key -> 'a t -> (key * 'a) Seq.t
      val add_seq : (key * 'a) Seq.t -> 'a t -> 'a t
      val of_seq : (key * 'a) Seq.t -> 'a t
    end
  module Scope :
    sig
      type t
      val create : Server.Package.plugin -> Server.Package.Scope.t
      val reserve : Server.Package.Scope.t -> string -> unit
      val declare : Server.Package.Scope.t -> Server.Package.ident -> unit
      val use : Server.Package.Scope.t -> Server.Package.ident -> unit
      val resolve : Server.Package.Scope.t -> string Server.Package.IdMap.t
    end
  val isRecursive : Server.Package.jtype -> bool
  val visit_jtype :
    (Server.Package.ident -> unit) -> Server.Package.jtype -> unit
  val visit_field :
    (Server.Package.ident -> unit) -> Server.Package.fieldInfo -> unit
  val visit_param :
    (Server.Package.ident -> unit) -> Server.Package.paramInfo -> unit
  val visit_request :
    (Server.Package.ident -> unit) -> Server.Package.requestInfo -> unit
  val visit_dkind :
    (Server.Package.ident -> unit) -> Server.Package.declKindInfo -> unit
  val visit_decl :
    (Server.Package.ident -> unit) -> Server.Package.declInfo -> unit
  val visit_package_decl :
    (Server.Package.ident -> unit) -> Server.Package.packageInfo -> unit
  val visit_package_used :
    (Server.Package.ident -> unit) -> Server.Package.packageInfo -> unit
  type package
  val package :
    ?plugin:string ->
    ?name:string ->
    title:string ->
    ?descr:Markdown.text -> ?readme:string -> unit -> Server.Package.package
  val declare :
    package:Server.Package.package ->
    name:string ->
    ?descr:Markdown.text -> Server.Package.declKindInfo -> unit
  val declare_id :
    package:Server.Package.package ->
    name:string ->
    ?descr:Markdown.text ->
    Server.Package.declKindInfo -> Server.Package.ident
  val update :
    package:Server.Package.package ->
    name:string -> Server.Package.declKindInfo -> unit
  val iter : (Server.Package.packageInfo -> unit) -> unit
  val resolve :
    ?keywords:string list ->
    Server.Package.packageInfo -> string Server.Package.IdMap.t
  val field : Server.Package.fieldInfo -> string * Server.Package.jtype
  val name_of_pkg :
    ?sep:string -> Server.Package.plugin -> string list -> string
  val name_of_pkginfo : ?sep:string -> Server.Package.packageInfo -> string
  val name_of_package : ?sep:string -> Server.Package.package -> string
  val name_of_ident : ?sep:string -> Server.Package.ident -> string
  type pp = {
    self : Markdown.text;
    ident : Server.Package.ident -> Markdown.text;
  }
  val litteral : string -> Markdown.text
  val md_jtype : Server.Package.pp -> Server.Package.jtype -> Markdown.text
  val md_tags :
    ?title:string -> Server.Package.tagInfo list -> Markdown.table
  val md_fields :
    ?title:string ->
    Server.Package.pp -> Server.Package.fieldInfo list -> Markdown.table
end