OCaml Claude SDK using Eio and Jsont
1(*---------------------------------------------------------------------------
2 Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>. All rights reserved.
3 SPDX-License-Identifier: ISC
4 ---------------------------------------------------------------------------*)
5
6(** Outgoing messages to the Claude CLI. *)
7
8type t =
9 | Message of Message.t
10 | Control_request of Control.control_request
11 | Control_response of Control.control_response
12
13val json : t Json.codec
14(** Codec for outgoing messages. *)
15
16val pp : Format.formatter -> t -> unit
17(** [pp ppf t] pretty-prints the outgoing message. *)
18
19val to_json : t -> Json.t
20(** [to_json t] converts an outgoing message to JSON. *)
21
22val of_json : Json.t -> t
23(** [of_json json] parses an outgoing message from JSON.
24 @raise Invalid_argument if parsing fails. *)