{
  "$id": "https://comitiva.dev/schema/Agent.json",
  "title": "Agent",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "minLength": 1
    },
    "name": {
      "type": "string",
      "minLength": 1
    },
    "avatar": {
      "type": "object",
      "properties": {
        "color": {
          "type": "string",
          "enum": [
            "indigo",
            "violet",
            "pink",
            "rose",
            "orange",
            "amber",
            "emerald",
            "teal",
            "sky",
            "slate"
          ]
        },
        "emoji": {
          "type": "string",
          "minLength": 1,
          "maxLength": 16
        }
      },
      "required": [
        "color"
      ]
    },
    "connectionId": {
      "type": "string",
      "minLength": 1
    },
    "model": {
      "type": [
        "string",
        "null"
      ]
    },
    "role": {
      "type": "string"
    },
    "params": {
      "type": "object",
      "properties": {
        "temperature": {
          "type": "number",
          "minimum": 0,
          "maximum": 2
        },
        "maxTokens": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 9007199254740991
        },
        "topP": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "maxToolIterations": {
          "type": "integer",
          "minimum": 1,
          "maximum": 200
        }
      }
    },
    "toolServerIds": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "roots": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "path": {
            "type": "string",
            "minLength": 1
          },
          "mode": {
            "type": "string",
            "enum": [
              "read",
              "readwrite"
            ]
          }
        },
        "required": [
          "path",
          "mode"
        ]
      }
    },
    "permissionPolicy": {
      "type": "string",
      "enum": [
        "ask",
        "allow-writes",
        "read-only"
      ]
    },
    "fallbackConnectionIds": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "tags": {
      "maxItems": 20,
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 32
      }
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
    }
  },
  "required": [
    "id",
    "name",
    "avatar",
    "connectionId",
    "model",
    "role",
    "params",
    "toolServerIds",
    "roots",
    "permissionPolicy",
    "fallbackConnectionIds",
    "tags",
    "createdAt",
    "updatedAt"
  ]
}
