Module Proto.Message

Messages exchanged with Claude wire format.

This module defines the wire format types for messages that can be sent to and received from Claude, including user input, assistant responses, system messages, and result metadata.

User Messages

module User : sig ... end

Messages sent by the user.

Assistant Messages

module Assistant : sig ... end

Messages from Claude assistant.

System Messages

module System : sig ... end

System control and status messages.

Result Messages

module Result : sig ... end

Final result messages with metadata about the conversation.

Message Union Type

type t =
  1. | User of User.t
  2. | Assistant of Assistant.t
  3. | System of System.t
  4. | Result of Result.t
    (*

    The type of messages, which can be user, assistant, system, or result.

    *)
val jsont : t Jsont.t

jsont is the Jsont codec for messages.