{
  "$schema":                    "https://json-schema.org/draft/2020-12/schema",
  "$id":                        "https://schemas.mpai.community/PGM1/V1.0/data/CXEDirective.json",
  "title":                      "CXE Directive V1.0",
  "description":                "AUC Directive to initiate or configure Context Enhancement processing, including session identification, modality-specific sub-directives, and A-User Storage access instructions.",
  "type":                       "object",
  "required":                   ["Header", "SessionID", "CaptureIndex", "CXEDirectiveID", "DirectiveType", "AudioCXEDirective", "VisualCXEDirective", "UserCXEDirective"],
  "additionalProperties":       false,
  "properties":                 {
    "Header":                   {"type": "string", "const": "PGM-CED-V1.0", "description": "CXE Directive header identifier."},
    "MInstanceID":              {"description": "Identifier of the M-Instance in which the A-User operates.", "type": "string"},
    "UEnvironmentID":           {"description": "Identifier of the U-Environment related to the M-Instance.", "type": "string"},
    "SessionID":                {"description": "Identifier of the current A-User session, assigned by AUC.", "type": "string"},
    "CaptureIndex":             {"description": "Ordinal of the CXC capture to which this CXE invocation refers.", "type": "integer", "minimum": 0},
    "CXEDirectiveID":           {"description": "Unique identifier for this CXE Directive instance.", "type": "string"},
    "CXEDirectiveTime":         {"description": "Timestamp indicating when the directive was produced.", "$ref": "https://schemas.mpai.community/OSD/V1.5/data/SimpleTime.json"},
    "CXEDirectiveSpaceTime":    {"description": "Space-Time at which the directive was issued.", "$ref": "https://schemas.mpai.community/OSD/V1.5/data/SpaceTime.json"},
    "DirectiveType":            {"description": "Type of enhancement operation: full, update, or delta.", "type": "string", "enum": ["enhance_full", "enhance_update", "enhance_delta"]},
    "PriorityLevel":            {"description": "Specifies execution urgency (low, normal, high).", "type": "string", "enum": ["low", "normal", "high"]},
    "AudioCXEDirective":        {"description": "Sub-directive controlling Audio Scene Enhancement processing.", "$ref": "https://schemas.mpai.community/PGM1/V1.0/data/AudioCXEDirective.json"},
    "VisualCXEDirective":       {"description": "Sub-directive controlling Visual Scene Enhancement processing.", "$ref": "https://schemas.mpai.community/PGM1/V1.0/data/VisualCXEDirective.json"},
    "UserCXEDirective":         {"description": "Sub-directive controlling User State Description processing.", "$ref": "https://schemas.mpai.community/PGM1/V1.0/data/UserCXEDirective.json"},
    "AUSRead":                  {"description": "List of AUS content items AUC instructs CXE to retrieve before execution.", "type": "array", "items": {"type": "object", "additionalProperties": false, "required": ["ContentType"], "properties": {"ContentType": {"description": "Type of content to retrieve from AUS.", "type": "string", "enum": ["EnhancedAudioSceneDescriptors", "EnhancedVisualSceneDescriptors", "UserEntityState", "AudioVisualSceneGeometry", "Avatar", "SpatialAttitude"]}, "CaptureIndex": {"description": "Ordinal of the capture to retrieve. Omit for most recent.", "type": "integer", "minimum": 0}, "AUSReference": {"description": "Optional explicit AUS storage reference.", "type": "string"}}}},
    "AUSWrite":                 {"description": "List of AUS content items AUC instructs CXE to store after execution.", "type": "array", "items": {"type": "object", "additionalProperties": false, "required": ["ContentType"], "properties": {"ContentType": {"description": "Type of content to store in AUS.", "type": "string", "enum": ["EnhancedAudioSceneDescriptors", "EnhancedVisualSceneDescriptors", "UserEntityState", "AudioVisualSceneGeometry", "CXEStatus"]}, "AUSReference": {"description": "Optional explicit AUS storage reference.", "type": "string"}}}},
    "DataXMData":               {"$ref": "https://schemas.mpai.community/PTF/V1.0/data/DataExchangeMetadata.json"},
    "DescrMetadata":            {"type": "string", "maxLength": 2048}
  }
}
