{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "data": {
      "additionalProperties": false,
      "properties": {
        "source": {
          "oneOf": [
            {
              "additionalProperties": false,
              "properties": {
                "kind": {
                  "const": "inline-lua",
                  "type": "string"
                },
                "source": {
                  "type": "string"
                }
              },
              "required": [
                "kind",
                "source"
              ],
              "type": "object"
            },
            {
              "additionalProperties": false,
              "properties": {
                "kind": {
                  "const": "project-file",
                  "type": "string"
                },
                "path": {
                  "pattern": "^scripts\\/(?!.*(?:^|\\/)\\.\\.(?:\\/|$))(?!.*\\\\)(?!.*\\/\\/)[^/].*\\.lua$",
                  "type": "string"
                }
              },
              "required": [
                "kind",
                "path"
              ],
              "type": "object"
            }
          ]
        }
      },
      "required": [
        "source"
      ],
      "type": "object"
    },
    "description": {
      "type": "string"
    },
    "id": {
      "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
      "title": "EntityId",
      "type": "string"
    },
    "label": {
      "minLength": 1,
      "type": "string"
    },
    "narrativeRefs": {
      "items": {
        "pattern": "^(?:creative-direction|arc|milestone|event|character|fact|world-entity|relationship|revelation|choice-point|puzzle|authored-content|narrative-position)\\.[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
        "type": "string"
      },
      "type": "array"
    }
  },
  "required": [
    "id",
    "label",
    "data"
  ],
  "type": "object"
}
