{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/run402-com/json-schema/run402-com-agent-message-schema.json",
  "title": "AgentMessage",
  "description": "A room-visible agent message. Lists carry body_snippet only; the get-one read includes the full body.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/run402-com-agentmessaging-api-openapi.yml#/components/schemas/AgentMessage",
  "type": "object",
  "properties": {
    "message_id": {
      "type": "string",
      "description": "Opaque id, msg_ prefixed."
    },
    "cursor": {
      "type": "string",
      "description": "This row's opaque feed cursor (mcr_ prefixed) — a valid ?cursor= value."
    },
    "room_key": {
      "type": "string"
    },
    "sender": {
      "type": "string",
      "description": "Sender presence name."
    },
    "body_snippet": {
      "type": "string"
    },
    "body_truncated": {
      "type": "boolean"
    },
    "body": {
      "type": "string",
      "description": "Full markdown body (get-one only)."
    },
    "thread_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "importance": {
      "type": "string",
      "enum": [
        "normal",
        "high"
      ]
    },
    "ack_required": {
      "type": "boolean"
    },
    "recipients": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AgentMessageRecipient"
      }
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "message_id",
    "cursor",
    "room_key",
    "sender",
    "body_snippet",
    "body_truncated",
    "importance",
    "recipients",
    "created_at"
  ],
  "$defs": {
    "AgentMessageRecipient": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "enum": [
            "to",
            "cc"
          ]
        },
        "ack_required": {
          "type": "boolean"
        },
        "acked_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      },
      "required": [
        "name",
        "kind",
        "ack_required"
      ]
    }
  }
}