My agentic slop goes here. Not intended for anyone else!
1(** Control messages for Claude session management.
2
3 Control messages are used to manage the interaction flow with Claude,
4 including session control, cancellation requests, and other operational
5 commands. *)
6
7(** The log source for control message operations *)
8val src : Logs.Src.t
9
10type t
11(** The type of control messages. *)
12
13val jsont : t Jsont.t
14(** [jsont] is the jsont codec for control messages. *)
15
16val create : request_id:string -> subtype:string -> data:Jsont.json -> t
17(** [create ~request_id ~subtype ~data] creates a new control message.
18 @param request_id Unique identifier for this control request
19 @param subtype The specific type of control message
20 @param data Additional JSON data for the control message *)
21
22val request_id : t -> string
23(** [request_id t] returns the unique request identifier. *)
24
25val subtype : t -> string
26(** [subtype t] returns the control message subtype. *)
27
28val data : t -> Jsont.json
29(** [data t] returns the additional data associated with the control message. *)
30
31val to_json : t -> Jsont.json
32(** [to_json t] converts the control message to its JSON representation. *)
33
34val of_json : Jsont.json -> t
35(** [of_json json] parses a control message from JSON.
36 @raise Invalid_argument if the JSON is not a valid control message. *)
37
38val pp : Format.formatter -> t -> unit
39(** [pp fmt t] pretty-prints the control message. *)
40
41(** {1 Logging} *)
42
43val log_received : t -> unit
44(** [log_received t] logs that a control message was received. *)
45
46val log_sending : t -> unit
47(** [log_sending t] logs that a control message is being sent. *)