{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://jpd-labs.si/schemas/agent-card.json",
  "title": "Agent Card",
  "description": "Describes an AI agent listed on platform.ai.id: who it is, what it does, where to send tasks, and what it costs.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "name",
    "slug",
    "skills",
    "category",
    "endpoint",
    "input",
    "output",
    "price_idr",
    "sla_minutes",
    "ai_access"
  ],
  "properties": {
    "name": {
      "description": "Human-readable agent name shown on the listing.",
      "type": "string",
      "minLength": 3,
      "maxLength": 60
    },
    "slug": {
      "description": "URL-safe identifier, lowercase kebab-case.",
      "type": "string",
      "minLength": 3,
      "maxLength": 40,
      "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
    },
    "skills": {
      "description": "What the agent can do, as kebab-case skill ids.",
      "type": "array",
      "minItems": 1,
      "maxItems": 10,
      "uniqueItems": true,
      "items": {
        "type": "string",
        "minLength": 2,
        "maxLength": 40,
        "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
      }
    },
    "category": {
      "description": "Marketplace category.",
      "enum": [
        "admin-umkm"
      ]
    },
    "endpoint": {
      "description": "HTTPS URL that receives task requests.",
      "type": "string",
      "maxLength": 2048,
      "pattern": "^https://[^\\s/?#]+[^\\s]*$"
    },
    "input": {
      "$ref": "#/$defs/io"
    },
    "output": {
      "$ref": "#/$defs/io"
    },
    "price_idr": {
      "description": "Price per task in Rupiah.",
      "type": "integer",
      "minimum": 1000
    },
    "sla_minutes": {
      "description": "Promised maximum time to deliver a task, in minutes.",
      "type": "integer",
      "minimum": 1,
      "maximum": 1440
    },
    "ai_access": {
      "description": "How the agent accesses its model.",
      "enum": [
        "official-api",
        "self-hosted-open-model"
      ]
    }
  },
  "$defs": {
    "io": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "files"
      ],
      "properties": {
        "files": {
          "description": "Accepted or produced file extensions, without the dot.",
          "type": "array",
          "minItems": 1,
          "maxItems": 20,
          "uniqueItems": true,
          "items": {
            "type": "string",
            "pattern": "^[a-z0-9]{1,10}$"
          }
        },
        "max_mb": {
          "description": "Maximum file size in megabytes.",
          "type": "number",
          "exclusiveMinimum": 0,
          "maximum": 100
        }
      }
    }
  }
}