{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "$id": "https://samas.school/api-docs/content-pack.schema.json",
 "title": "saMas School content pack (Draft)",
 "description": "pack.json at the root of a content pack: data only, no code. Draft, 29 October 2026. Imports open with the Learning API's content operations.",
 "type": "object",
 "additionalProperties": false,
 "required": [
  "pack",
  "version",
  "scope",
  "kind",
  "title",
  "languages",
  "licence",
  "items"
 ],
 "properties": {
  "pack": {
   "type": "string",
   "pattern": "^[a-z][a-z0-9-]{2,39}$"
  },
  "version": {
   "type": "string",
   "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$"
  },
  "scope": {
   "type": "string",
   "pattern": "^[a-z][a-z0-9_]{1,39}$",
   "description": "The course or add-on it belongs to, for example toefl or aigp."
  },
  "kind": {
   "type": "string",
   "enum": [
    "course",
    "deck",
    "rubric_set",
    "schedule_program",
    "encouragement_program",
    "help_set"
   ]
  },
  "title": {
   "type": "string",
   "maxLength": 120
  },
  "languages": {
   "type": "array",
   "minItems": 1,
   "uniqueItems": true,
   "items": {
    "type": "string",
    "enum": [
     "en",
     "ur",
     "ar"
    ]
   }
  },
  "licence": {
   "type": "string",
   "maxLength": 120
  },
  "registers_with": {
   "type": "array",
   "uniqueItems": true,
   "items": {
    "type": "string",
    "enum": [
     "learning",
     "pace",
     "assess",
     "encourage",
     "flashcards",
     "help"
    ]
   }
  },
  "media": {
   "type": "array",
   "maxItems": 2000,
   "items": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "path",
     "sha256"
    ],
    "properties": {
     "path": {
      "type": "string",
      "pattern": "^media/[A-Za-z0-9/_.-]{1,200}$"
     },
     "sha256": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
     },
     "alt": {
      "type": "string",
      "maxLength": 200
     }
    }
   }
  },
  "items": {
   "type": "array",
   "minItems": 1,
   "maxItems": 20000,
   "items": {
    "type": "object",
    "required": [
     "id",
     "type"
    ],
    "properties": {
     "id": {
      "type": "string",
      "pattern": "^[a-z0-9][a-z0-9-]{0,79}$"
     },
     "type": {
      "type": "string",
      "enum": [
       "lesson",
       "set",
       "item",
       "task",
       "card",
       "rubric",
       "program",
       "guide"
      ]
     }
    },
    "additionalProperties": true
   }
  }
 },
 "examples": [
  {
   "pack": "aigp-domain-1",
   "version": "1.0.0",
   "scope": "aigp",
   "kind": "course",
   "title": "AIGP Domain I",
   "languages": [
    "en",
    "ur"
   ],
   "licence": "saMas IT Services, all rights reserved",
   "registers_with": [
    "learning",
    "flashcards"
   ],
   "items": [
    {
     "id": "ch-01",
     "type": "lesson",
     "title": "What AI governance is for"
    },
    {
     "id": "ch-01-check",
     "type": "set",
     "items": [
      "q-01"
     ]
    },
    {
     "id": "q-01",
     "type": "item",
     "kind": "scenario"
    }
   ]
  }
 ]
}