{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://aap-protocol.org/schemas/aap-task.schema.json",
  "title": "AAP Task Claim",
  "description": "Schema for the 'task' claim in AAP tokens, binding authorization to a specific task",
  "type": "object",
  "required": ["id", "purpose"],
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique identifier for the task. SHOULD be a UUID or similar unique value.",
      "examples": [
        "550e8400-e29b-41d4-a716-446655440000",
        "task-2024-001",
        "urn:task:research:abc123"
      ]
    },
    "purpose": {
      "type": "string",
      "description": "Human-readable description of the task's purpose",
      "minLength": 1,
      "maxLength": 500,
      "examples": [
        "Research climate change impacts for Q2 2024 report",
        "Create draft blog post about product launch",
        "Analyze customer feedback from support tickets"
      ]
    },
    "created_by": {
      "type": "string",
      "description": "Identifier of the user or system that created the task. Use pseudonymous IDs for privacy.",
      "examples": [
        "user:alice",
        "urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6",
        "system:scheduler"
      ]
    },
    "created_at": {
      "type": "integer",
      "description": "Unix timestamp when the task was created",
      "minimum": 0
    },
    "expires_at": {
      "type": "integer",
      "description": "Unix timestamp when the task expires (optional, for time-bounded tasks)",
      "minimum": 0
    },
    "priority": {
      "type": "string",
      "enum": ["low", "medium", "high", "critical"],
      "description": "Priority level of the task"
    },
    "category": {
      "type": "string",
      "description": "Task category for classification",
      "examples": [
        "research",
        "content-creation",
        "data-analysis",
        "customer-support"
      ]
    },
    "metadata": {
      "type": "object",
      "description": "Additional task-specific metadata",
      "additionalProperties": true
    }
  }
}
