{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "version": {
      "const": "ridley.persona/1",
      "type": "string"
    },
    "personaId": {
      "type": "string"
    },
    "profileId": {
      "type": "string"
    },
    "parentId": {
      "anyOf": [
        {
          "type": "null"
        },
        {
          "type": "string"
        }
      ]
    },
    "revision": {
      "type": "number"
    },
    "createdAt": {
      "type": "string"
    },
    "sha256": {
      "type": "string"
    },
    "description": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "role": {
          "type": "string"
        },
        "instructions": {
          "type": "string"
        },
        "knowledge": {
          "type": "string"
        },
        "speakingStyle": {
          "type": "string"
        },
        "language": {
          "type": "string"
        },
        "allowedTopics": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "forbiddenTopics": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "emotionalBaseline": {
          "type": "string"
        },
        "memory": {
          "anyOf": [
            {
              "const": "none",
              "type": "string"
            },
            {
              "const": "session",
              "type": "string"
            }
          ]
        },
        "maxTurns": {
          "type": "number"
        },
        "maxHistoryChars": {
          "type": "number"
        }
      },
      "required": [
        "name",
        "role",
        "instructions",
        "knowledge",
        "speakingStyle",
        "language",
        "allowedTopics",
        "forbiddenTopics",
        "emotionalBaseline",
        "memory",
        "maxTurns",
        "maxHistoryChars"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "version",
    "personaId",
    "profileId",
    "parentId",
    "revision",
    "createdAt",
    "sha256",
    "description"
  ],
  "additionalProperties": false
}
