{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://docs.flashnerd.com/examples/flashnerd-format/schemas/manifest.schema.json",
  "title": "Flashnerd manifest",
  "description": "Metadata emitted by exports. Import ignores this file completely; it is not needed for a hand-authored package.",
  "type": "object",
  "additionalProperties": true,
  "required": [
    "format",
    "version",
    "profile",
    "packageId",
    "createdAt",
    "generator",
    "requiredFeatures",
    "counts",
    "shards",
    "sizes"
  ],
  "properties": {
    "format": { "const": "flashnerd" },
    "version": { "const": 1 },
    "profile": { "enum": ["content", "backup"] },
    "packageId": { "type": "string", "minLength": 1 },
    "createdAt": { "type": "string", "format": "date-time" },
    "generator": {
      "type": "object",
      "additionalProperties": true,
      "required": ["name", "version"],
      "properties": {
        "name": { "type": "string" },
        "version": { "type": "string" }
      }
    },
    "requiredFeatures": {
      "type": "array",
      "items": { "type": "string" }
    },
    "counts": {
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "reviewFolders": { "type": "integer", "minimum": 0 },
        "decks": { "type": "integer", "minimum": 0 },
        "tags": { "type": "integer", "minimum": 0 },
        "cards": { "type": "integer", "minimum": 0 },
        "srsFolders": { "type": "integer", "minimum": 0 },
        "srsSets": { "type": "integer", "minimum": 0 },
        "schedules": { "type": "integer", "minimum": 0 },
        "srsReviews": { "type": "integer", "minimum": 0 },
        "normalReviews": { "type": "integer", "minimum": 0 },
        "cardTemplatePresets": { "type": "integer", "minimum": 0 },
        "srsPresets": { "type": "integer", "minimum": 0 },
        "searchPresets": { "type": "integer", "minimum": 0 },
        "aiInstructionPresets": { "type": "integer", "minimum": 0 }
      }
    },
    "shards": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true,
        "required": ["path", "records", "sha256", "uncompressedBytes"],
        "properties": {
          "path": { "type": "string" },
          "records": { "type": "integer", "minimum": 0 },
          "sha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" },
          "uncompressedBytes": { "type": "integer", "minimum": 0 }
        }
      }
    },
    "sizes": {
      "type": "object",
      "additionalProperties": true,
      "required": ["compressedBytes", "uncompressedBytes"],
      "properties": {
        "compressedBytes": { "type": "integer", "minimum": 0 },
        "uncompressedBytes": { "type": "integer", "minimum": 0 }
      }
    }
  }
}
