OCaml Claude SDK using Eio and Jsont
at main 48 lines 1.7 kB view raw
1(*--------------------------------------------------------------------------- 2 Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>. All rights reserved. 3 SPDX-License-Identifier: ISC 4 ---------------------------------------------------------------------------*) 5 6(** Server capabilities and metadata. 7 8 This module provides a high-level interface for querying server capabilities 9 and metadata. It wraps the underlying protocol representation and provides 10 convenient accessors and capability checks. *) 11 12(** {1 Server Information} *) 13 14type t 15(** Server metadata and capabilities. *) 16 17val version : t -> string 18(** [version t] returns the server version string. *) 19 20val capabilities : t -> string list 21(** [capabilities t] returns the list of available server capabilities. *) 22 23val commands : t -> string list 24(** [commands t] returns the list of available CLI commands. *) 25 26val output_styles : t -> string list 27(** [output_styles t] returns the list of supported output formats. *) 28 29(** {1 Capability Checks} *) 30 31val has_capability : t -> string -> bool 32(** [has_capability t cap] returns true if the specified capability is 33 available. *) 34 35val supports_hooks : t -> bool 36(** [supports_hooks t] checks if the hooks capability is available. *) 37 38val supports_structured_output : t -> bool 39(** [supports_structured_output t] checks if the structured output capability is 40 available. *) 41 42(** {1 Internal} *) 43 44val of_proto : Proto.Control.Server_info.t -> t 45(** [of_proto proto] converts from the protocol representation. *) 46 47val of_sdk_control : Sdk_control.Server_info.t -> t 48(** [of_sdk_control sdk] converts from the SDK control representation. *)