{
  "$defs": {
    "ParticipantExternalRefs": {
      "additionalProperties": false,
      "description": "Optional cross-channel identity references for a ParticipantIdentity.",
      "properties": {
        "slack_team_id": {
          "anyOf": [
            {
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Slack Team Id"
        },
        "slack_user_id": {
          "anyOf": [
            {
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Slack User Id"
        },
        "teamspace_member_id": {
          "anyOf": [
            {
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Teamspace Member Id"
        }
      },
      "title": "ParticipantExternalRefs",
      "type": "object"
    },
    "ParticipantIdentity": {
      "description": "SaaS-minted, mission-scoped participant identity.",
      "properties": {
        "display_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Human-readable name for display",
          "title": "Display Name"
        },
        "external_refs": {
          "anyOf": [
            {
              "$ref": "#/$defs/ParticipantExternalRefs"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Optional cross-channel identity references (V1)"
        },
        "participant_id": {
          "description": "SaaS-minted, mission-scoped unique identifier",
          "minLength": 1,
          "title": "Participant Id",
          "type": "string"
        },
        "participant_type": {
          "description": "Participant category",
          "enum": [
            "human",
            "llm_context"
          ],
          "title": "Participant Type",
          "type": "string"
        },
        "session_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "SaaS-issued session identifier",
          "title": "Session Id"
        }
      },
      "required": [
        "participant_id",
        "participant_type"
      ],
      "title": "ParticipantIdentity",
      "type": "object"
    }
  },
  "$id": "spec-kitty-events/participant_joined_payload",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "Typed payload for ParticipantJoined events.",
  "properties": {
    "auth_principal_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Auth principal bound at join time (present in live traffic)",
      "title": "Auth Principal Id"
    },
    "mission_id": {
      "description": "Target mission",
      "minLength": 1,
      "title": "Mission Id",
      "type": "string"
    },
    "participant_id": {
      "description": "Joining participant",
      "minLength": 1,
      "title": "Participant Id",
      "type": "string"
    },
    "participant_identity": {
      "$ref": "#/$defs/ParticipantIdentity",
      "description": "Full structured identity"
    }
  },
  "required": [
    "participant_id",
    "participant_identity",
    "mission_id"
  ],
  "title": "ParticipantJoinedPayload",
  "type": "object"
}
