{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://openeik.org/schemas/0.6/agentInterface/capabilities.schema.json",
  "$comment": "OpenEik 0.6: folded by tools/fold-schemas-0.6.mjs from the proposal agentInterface, which 0.6 makes a rule (open questions, 146). Written by hand, not generated.",
  "title": "What an agent host offers",
  "description": "The answer of capabilities (Part VII, 10.1): the model's format and the formats the host reads and writes, each operation it offers with whether it writes and whether it answers here, the command kinds it runs on the model and the profiles it runs whole, the proposals for a later version it reads the model by, its envelopes, whether it holds an agent's writes for review, and its budget and pages.",
  "type": "object",
  "properties": {
    "format": {
      "description": "The format of the model the host holds, as the model states it (Part I, 9.2), or null while it holds none.",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^openeik/(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(-[0-9A-Za-z.-]+)?$"
        },
        {
          "type": "null"
        }
      ]
    },
    "reads": {
      "description": "The formats the host reads, each openeik/<major>.<minor>.",
      "$ref": "#/$defs/formats"
    },
    "writes": {
      "description": "The formats the host writes, each openeik/<major>.<minor>.",
      "$ref": "#/$defs/formats"
    },
    "operations": {
      "description": "Each operation the host offers, by its name in Part VII, with whether it changes the model and whether it answers here; one that does not says why.",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "writes": {
            "type": "boolean"
          },
          "available": {
            "type": "boolean"
          },
          "why": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          }
        },
        "required": [
          "name",
          "writes",
          "available"
        ],
        "if": {
          "properties": {
            "available": {
              "const": false
            }
          }
        },
        "then": {
          "required": [
            "why"
          ]
        }
      }
    },
    "commands": {
      "description": "Each command kind the host's processor runs on the model it holds (Part V, 2, and the kinds the parts that add commands add), sorted by code units.",
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64
      },
      "uniqueItems": true
    },
    "profiles": {
      "description": "Those of Part V, 2's three profiles whose every kind the host runs.",
      "type": "array",
      "items": {
        "enum": [
          "core",
          "documentation",
          "domain"
        ]
      },
      "uniqueItems": true
    },
    "proposals": {
      "description": "The proposals for a later version than the model's that the host reads the model by, each by its name: none its version makes a rule.",
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[a-z][A-Za-z0-9-]*$",
        "maxLength": 64
      },
      "uniqueItems": true
    },
    "envelopes": {
      "description": "Whether the host takes an envelope of Part XVII on the model it holds; whether it takes an agent's commands only in one (Part XVII, 8, rule 3); the modes it takes one in; and the id of the person it serves, where it serves one by an id (Part XVII, 4.2.1), else null.",
      "type": "object",
      "properties": {
        "taken": {
          "type": "boolean"
        },
        "required": {
          "type": "boolean"
        },
        "modes": {
          "type": "array",
          "items": {
            "enum": [
              "apply",
              "dryRun",
              "propose"
            ]
          },
          "uniqueItems": true
        },
        "person": {
          "oneOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "taken",
        "required",
        "modes",
        "person"
      ]
    },
    "review": {
      "description": "Whether the host holds every write of an agent for a person to review (Part VII, 10.2).",
      "type": "object",
      "properties": {
        "held": {
          "type": "boolean"
        }
      },
      "required": [
        "held"
      ]
    },
    "budget": {
      "description": "The budget the host holds each answer under (Part VII, 5, rule 1), or null where it holds none.",
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "tokens": {
              "type": "integer",
              "minimum": 1
            },
            "charsPerToken": {
              "type": "number",
              "exclusiveMinimum": 0
            }
          },
          "required": [
            "tokens",
            "charsPerToken"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "pages": {
      "description": "The most and the default limit of a page (Part VII, 3, rule 2).",
      "type": "object",
      "properties": {
        "most": {
          "type": "integer",
          "minimum": 1
        },
        "default": {
          "type": "integer",
          "minimum": 1
        }
      },
      "required": [
        "most",
        "default"
      ]
    }
  },
  "required": [
    "format",
    "reads",
    "writes",
    "operations",
    "commands",
    "profiles",
    "proposals",
    "envelopes",
    "review",
    "budget",
    "pages"
  ],
  "$defs": {
    "formats": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^openeik/(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)$"
      },
      "uniqueItems": true
    }
  }
}
