{
  "$defs": {
    "BundledSource": {
      "additionalProperties": false,
      "properties": {
        "module": {
          "title": "Module",
          "type": "string"
        },
        "source_path": {
          "title": "Source Path",
          "type": "string"
        },
        "bundle_path": {
          "title": "Bundle Path",
          "type": "string"
        },
        "source_digest": {
          "$ref": "#/$defs/Digest"
        },
        "size": {
          "minimum": 0,
          "title": "Size",
          "type": "integer"
        },
        "is_package": {
          "title": "Is Package",
          "type": "boolean"
        }
      },
      "required": [
        "module",
        "source_path",
        "bundle_path",
        "source_digest",
        "size",
        "is_package"
      ],
      "title": "BundledSource",
      "type": "object"
    },
    "Capability": {
      "additionalProperties": false,
      "properties": {
        "capability_id": {
          "title": "Capability Id",
          "type": "string"
        },
        "public_name": {
          "title": "Public Name",
          "type": "string"
        },
        "module": {
          "title": "Module",
          "type": "string"
        },
        "invocation": {
          "$ref": "#/$defs/InvocationContract"
        }
      },
      "required": [
        "capability_id",
        "public_name",
        "module",
        "invocation"
      ],
      "title": "Capability",
      "type": "object"
    },
    "Digest": {
      "additionalProperties": false,
      "properties": {
        "algorithm": {
          "const": "sha256",
          "default": "sha256",
          "title": "Algorithm",
          "type": "string"
        },
        "value": {
          "pattern": "^[0-9a-f]{64}$",
          "title": "Value",
          "type": "string"
        }
      },
      "required": [
        "value"
      ],
      "title": "Digest",
      "type": "object"
    },
    "Input": {
      "additionalProperties": false,
      "properties": {
        "name": {
          "title": "Name",
          "type": "string"
        },
        "kind": {
          "$ref": "#/$defs/ParameterKind"
        },
        "required": {
          "title": "Required",
          "type": "boolean"
        },
        "type": {
          "$ref": "#/$defs/TypeSpec"
        }
      },
      "required": [
        "name",
        "kind",
        "required",
        "type"
      ],
      "title": "Input",
      "type": "object"
    },
    "InvocationContract": {
      "additionalProperties": false,
      "properties": {
        "capability_id": {
          "title": "Capability Id",
          "type": "string"
        },
        "name": {
          "title": "Name",
          "type": "string"
        },
        "execution": {
          "enum": [
            "sync",
            "async"
          ],
          "title": "Execution",
          "type": "string"
        },
        "parameters": {
          "items": {
            "$ref": "#/$defs/Input"
          },
          "title": "Parameters",
          "type": "array"
        },
        "returns": {
          "$ref": "#/$defs/TypeSpec"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Description"
        }
      },
      "required": [
        "capability_id",
        "name",
        "execution",
        "parameters",
        "returns"
      ],
      "title": "InvocationContract",
      "type": "object"
    },
    "ParameterKind": {
      "enum": [
        "positional_only",
        "positional_or_keyword",
        "keyword_only"
      ],
      "title": "ParameterKind",
      "type": "string"
    },
    "TypeSpec": {
      "additionalProperties": false,
      "properties": {
        "kind": {
          "enum": [
            "any",
            "int",
            "str",
            "float",
            "bool",
            "null",
            "list",
            "dict",
            "tuple",
            "set",
            "union",
            "literal"
          ],
          "title": "Kind",
          "type": "string"
        },
        "items": {
          "default": [],
          "items": {
            "$ref": "#/$defs/TypeSpec"
          },
          "title": "Items",
          "type": "array"
        },
        "values": {
          "default": [],
          "items": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          },
          "title": "Values",
          "type": "array"
        },
        "variadic": {
          "default": false,
          "title": "Variadic",
          "type": "boolean"
        }
      },
      "required": [
        "kind"
      ],
      "title": "TypeSpec",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "schema_version": {
      "const": "apizr.repository-interface/v1",
      "default": "apizr.repository-interface/v1",
      "title": "Schema Version",
      "type": "string"
    },
    "exposure_plan_digest": {
      "$ref": "#/$defs/Digest"
    },
    "repository_digest": {
      "$ref": "#/$defs/Digest"
    },
    "catalog_digest": {
      "$ref": "#/$defs/Digest"
    },
    "graph_digest": {
      "$ref": "#/$defs/Digest"
    },
    "repository_readiness_digest": {
      "$ref": "#/$defs/Digest"
    },
    "interface": {
      "enum": [
        "rest",
        "mcp"
      ],
      "title": "Interface",
      "type": "string"
    },
    "sources": {
      "items": {
        "$ref": "#/$defs/BundledSource"
      },
      "title": "Sources",
      "type": "array"
    },
    "capabilities": {
      "items": {
        "$ref": "#/$defs/Capability"
      },
      "title": "Capabilities",
      "type": "array"
    }
  },
  "required": [
    "exposure_plan_digest",
    "repository_digest",
    "catalog_digest",
    "graph_digest",
    "repository_readiness_digest",
    "interface",
    "sources",
    "capabilities"
  ],
  "title": "RepositoryInterface",
  "type": "object"
}
