{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "contract": {
      "type": "string",
      "const": "ViewProviderDescriptor"
    },
    "providerId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 256
    },
    "providerVersion": {
      "type": "string",
      "minLength": 1,
      "maxLength": 256
    },
    "runtimeContractVersion": {
      "type": "string",
      "minLength": 1,
      "maxLength": 256
    },
    "ownerRepo": {
      "type": "string",
      "minLength": 1,
      "maxLength": 256
    },
    "capabilityRef": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "version": {
          "anyOf": [
            {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "string",
              "minLength": 1
            }
          ]
        },
        "ownerRepo": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        }
      },
      "required": [
        "kind",
        "id"
      ],
      "additionalProperties": false
    },
    "rendererKey": {
      "type": "string",
      "minLength": 1,
      "maxLength": 256
    },
    "renderModelSchemaRef": {
      "type": "string",
      "minLength": 1,
      "maxLength": 256
    },
    "intentSchemaRef": {
      "type": "string",
      "minLength": 1,
      "maxLength": 256
    },
    "loading": {
      "type": "string",
      "enum": [
        "eager",
        "lazy",
        "viewport",
        "on-activation"
      ]
    },
    "stateOwner": {
      "type": "string",
      "enum": [
        "host",
        "provider",
        "external"
      ]
    },
    "supportedPageTypes": {
      "minItems": 1,
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 256
      }
    },
    "supportedSurfaces": {
      "minItems": 1,
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "page",
          "workspace",
          "view",
          "record",
          "action",
          "overlay",
          "agent"
        ]
      }
    },
    "frameOwner": {
      "type": "string",
      "enum": [
        "host",
        "provider",
        "none"
      ]
    },
    "sideEffects": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "network",
          "storage",
          "navigation",
          "clipboard",
          "worker",
          "websocket"
        ]
      }
    },
    "sideEffectAdapterRef": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "version": {
          "anyOf": [
            {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "string",
              "minLength": 1
            }
          ]
        },
        "ownerRepo": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        }
      },
      "required": [
        "kind",
        "id"
      ],
      "additionalProperties": false
    },
    "lifecycle": {
      "type": "object",
      "properties": {
        "preserveMount": {
          "type": "boolean"
        },
        "preserveScroll": {
          "type": "boolean"
        },
        "focusModel": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        }
      },
      "required": [
        "preserveMount",
        "preserveScroll",
        "focusModel"
      ],
      "additionalProperties": false
    },
    "performance": {
      "type": "object",
      "properties": {
        "lazy": {
          "type": "boolean"
        },
        "virtualized": {
          "type": "boolean"
        },
        "budgetMs": {
          "type": "number",
          "exclusiveMinimum": 0
        }
      },
      "required": [
        "lazy",
        "virtualized"
      ],
      "additionalProperties": false
    },
    "accessRef": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "version": {
          "anyOf": [
            {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "string",
              "minLength": 1
            }
          ]
        },
        "ownerRepo": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        }
      },
      "required": [
        "kind",
        "id"
      ],
      "additionalProperties": false
    },
    "evidenceRef": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        },
        "version": {
          "anyOf": [
            {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "string",
              "minLength": 1
            }
          ]
        },
        "ownerRepo": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256
        }
      },
      "required": [
        "kind",
        "id"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "contract",
    "providerId",
    "providerVersion",
    "ownerRepo",
    "capabilityRef",
    "rendererKey",
    "renderModelSchemaRef",
    "loading",
    "stateOwner",
    "supportedPageTypes",
    "supportedSurfaces",
    "frameOwner",
    "sideEffects",
    "lifecycle",
    "performance"
  ],
  "additionalProperties": false,
  "$id": "https://schemas.infmonkeys.com/contracts/view-provider-descriptor.schema.json",
  "title": "view-provider-descriptor"
}
