{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://pcp-protocol.github.io/pcp/schemas/0.3/profile.core.schema.json",
  "title": "PCP Core Profile",
  "description": "Low-sensitivity, high-utility personal context. Everything sensitive belongs in an extension namespace, never here.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "pcp_version",
    "name"
  ],
  "properties": {
    "pcp_version": {
      "enum": [
        "0.1",
        "0.2",
        "0.3"
      ],
      "description": "The PCP version the document was written for. Servers accept every listed version."
    },
    "name": {
      "type": "string",
      "description": "Full name"
    },
    "preferred_name": {
      "type": "string"
    },
    "pronouns": {
      "type": "string"
    },
    "languages": {
      "type": "array",
      "description": "Ordered by preference.",
      "items": {
        "type": "object",
        "required": [
          "code"
        ],
        "additionalProperties": false,
        "properties": {
          "code": {
            "type": "string",
            "description": "BCP 47, e.g. 'de', 'en-US'"
          },
          "proficiency": {
            "enum": [
              "native",
              "fluent",
              "conversational",
              "basic"
            ]
          },
          "contexts": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "When to use this language, e.g. ['family', 'informal']"
          }
        }
      }
    },
    "locale": {
      "type": "string",
      "description": "BCP 47, drives date/number formats"
    },
    "timezone": {
      "type": "string",
      "description": "IANA, e.g. 'Europe/Madrid'"
    },
    "location": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "city": {
          "type": "string"
        },
        "country": {
          "type": "string",
          "description": "ISO 3166-1 alpha-2"
        }
      },
      "description": "Coarse only. Street addresses belong in pcp.home."
    },
    "communication": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "tone": {
          "type": "string",
          "description": "e.g. 'direct, warm, no fluff'"
        },
        "verbosity": {
          "enum": [
            "minimal",
            "concise",
            "balanced",
            "detailed"
          ]
        },
        "formatting": {
          "type": "string",
          "description": "e.g. 'prose over bullets; action items at end'"
        }
      }
    },
    "work": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "role": {
          "type": "string"
        },
        "organization": {
          "type": "string"
        },
        "field": {
          "type": "string"
        },
        "context": {
          "type": "string",
          "description": "Free text professional context"
        }
      }
    },
    "interests": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "ai_instructions": {
      "type": "string",
      "description": "Standing free-text instructions to any AI assistant."
    },
    "updated": {
      "type": "string",
      "description": "RFC 3339 date-time in UTC.",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{1,9})?Z$"
    }
  }
}
