{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "CLARA NEXUS signed release (runtime additionally verifies endpoints and signature)",
  "type": "object",
  "properties": {
    "format": {
      "const": "CLARA-NEXUS-1"
    },
    "namespace": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9-]{0,39}$"
    },
    "name": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9-]{0,39}$"
    },
    "version": {
      "type": "string",
      "pattern": "^(0|[1-9][0-9]{0,5})\\.(0|[1-9][0-9]{0,5})\\.(0|[1-9][0-9]{0,5})$"
    },
    "visibility": {
      "enum": [
        "public",
        "private"
      ]
    },
    "kind": {
      "enum": [
        "app",
        "library",
        "agent",
        "service"
      ]
    },
    "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 100,
      "pattern": "^[ -~]*$"
    },
    "description": {
      "type": "string",
      "maxLength": 500,
      "pattern": "^[ -~]*$"
    },
    "packageHash": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "endpoints": {
      "type": "array",
      "maxItems": 8,
      "items": {
        "type": "array",
        "prefixItems": [
          {
            "enum": [
              "https",
              "ipfs",
              "mcp"
            ]
          },
          {
            "type": "string",
            "maxLength": 512
          }
        ],
        "minItems": 2,
        "maxItems": 2
      }
    },
    "dependencies": {
      "type": "array",
      "maxItems": 16,
      "uniqueItems": true,
      "items": {
        "type": "string",
        "pattern": "^clara://[a-z][a-z0-9-]{0,39}/[a-z][a-z0-9-]{0,39}@(0|[1-9][0-9]{0,5})\\.(0|[1-9][0-9]{0,5})\\.(0|[1-9][0-9]{0,5})$"
      }
    },
    "publicKey": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "signature": {
      "type": "string",
      "pattern": "^[a-f0-9]{128}$"
    }
  },
  "required": [
    "format",
    "namespace",
    "name",
    "version",
    "visibility",
    "kind",
    "title",
    "description",
    "packageHash",
    "endpoints",
    "dependencies",
    "publicKey",
    "signature"
  ],
  "additionalProperties": false
}
