{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://rehearse.kurvball.ca/schema/v1/people.schema.json",
  "title": "Rehearse v1: rehearse people --json",
  "description": "Who you can sign in as. people keeps the sign-in shape: each signed-in person's token, with the fields the sign-in gave beside it (each field becomes a <name>_<key> variable). Everyone the manifest declares, signed in or not, is described in about. Tokens appear only with --json, and only when the sign-in ran.",
  "type": "object",
  "required": ["v", "people", "variables", "about"],
  "properties": {
    "v": {
      "$ref": "common.schema.json#/$defs/v"
    },
    "people": {
      "type": "object",
      "propertyNames": {
        "pattern": "^[A-Za-z_][A-Za-z0-9_-]*$",
        "not": {
          "enum": ["you", "nobody", "api"]
        }
      },
      "additionalProperties": {
        "oneOf": [
          {
            "type": "string",
            "description": "The person's token."
          },
          {
            "type": "object",
            "required": ["token"],
            "properties": {
              "token": {
                "type": "string"
              }
            },
            "additionalProperties": {
              "type": ["string", "number", "boolean"]
            }
          }
        ]
      }
    },
    "variables": {
      "description": "Values the sign-in gave beside the people, such as an organization's id.",
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    },
    "signedIn": {
      "description": "Whether the sign-in command ran and gave tokens.",
      "type": "boolean"
    },
    "said": {
      "description": "Why there are no tokens, when there are none.",
      "type": ["string", "null"]
    },
    "about": {
      "description": "Every person, signed in or not: how real they are, whether scenarios run as them by default, and who they are.",
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "required": ["real", "default", "signedIn"],
        "properties": {
          "real": {
            "description": "local (a sign-in the local services trust), stand-in (a fake identity), real (a real account). More may come.",
            "type": "string",
            "examples": ["local", "stand-in", "real"]
          },
          "default": {
            "type": "boolean"
          },
          "describe": {
            "type": ["string", "null"]
          },
          "signedIn": {
            "description": "Whether the sign-in gave this person a token.",
            "type": "boolean"
          }
        }
      },
      "propertyNames": {
        "pattern": "^[A-Za-z_][A-Za-z0-9_-]*$",
        "not": {
          "enum": ["you", "nobody", "api"]
        }
      }
    }
  }
}
