{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/multi-agent-ecosystem/multi-agent-pipeline/pipeline/schemas/activity-roles.schema.json",
  "title": "Office role table",
  "description": "The shape of activity-roles.json: the role label per agent type, the agent types whose role follows the run phase, the phase-to-role map and one fixed sprite and color per role.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "contractVersion",
    "orchestrator",
    "agentTypes",
    "untyped",
    "phaseRoles",
    "styles",
    "unknownStyle"
  ],
  "properties": {
    "$schema": { "type": "string" },
    "contractVersion": { "type": "string", "pattern": "^1\\.[0-9]+\\.[0-9]+$" },
    "description": { "type": "string" },
    "orchestrator": { "type": "string", "minLength": 1 },
    "agentTypes": {
      "type": "object",
      "additionalProperties": { "type": "string", "minLength": 1 }
    },
    "untyped": { "type": "array", "items": { "type": "string", "minLength": 1 } },
    "phaseRoles": {
      "type": "object",
      "propertyNames": { "pattern": "^[0-9]+$" },
      "additionalProperties": { "type": "string", "minLength": 1 }
    },
    "styles": {
      "type": "object",
      "additionalProperties": { "$ref": "#/$defs/style" }
    },
    "unknownStyle": { "$ref": "#/$defs/style" }
  },
  "$defs": {
    "style": {
      "type": "object",
      "additionalProperties": false,
      "required": ["sprite", "color"],
      "properties": {
        "sprite": { "type": "integer", "minimum": 0, "maximum": 15 },
        "color": { "type": "string", "pattern": "^#[0-9a-f]{6}$" }
      }
    }
  }
}
