{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://docs.spectrokernel.io/ai/schemas/algorithms.schema.json",
  "title": "spectro-kernel algorithm catalogue",
  "description": "Machine-readable catalogue generated from the spectro-kernel registry.",
  "type": "object",
  "required": [
    "schema_version",
    "spectrokernel_version",
    "site_url",
    "count",
    "categories",
    "algorithms"
  ],
  "properties": {
    "schema_version": {
      "type": "string",
      "const": "1"
    },
    "spectrokernel_version": {
      "type": "string"
    },
    "site_url": {
      "type": "string",
      "format": "uri"
    },
    "count": {
      "type": "integer",
      "minimum": 0
    },
    "categories": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    },
    "algorithms": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "name",
          "summary",
          "description",
          "category",
          "category_title",
          "version",
          "backend",
          "inputs",
          "outputs",
          "parameters",
          "references",
          "related",
          "interfaces",
          "docs_url"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z0-9_]+$"
          },
          "name": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "category_title": {
            "type": "string"
          },
          "version": {
            "type": "string",
            "pattern": "^\\d+\\.\\d+\\.\\d+$"
          },
          "backend": {
            "type": "string"
          },
          "inputs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "outputs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "parameters": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "name",
                "default",
                "required",
                "description"
              ],
              "properties": {
                "name": {
                  "type": "string"
                },
                "default": {},
                "required": {
                  "type": "boolean"
                },
                "description": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            }
          },
          "references": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "related": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "interfaces": {
            "type": "object",
            "required": [
              "python",
              "cli",
              "mcp"
            ],
            "properties": {
              "python": {
                "type": "object",
                "required": [
                  "call"
                ],
                "properties": {
                  "call": {
                    "type": "string"
                  }
                }
              },
              "cli": {
                "type": "object",
                "required": [
                  "available",
                  "command"
                ],
                "properties": {
                  "available": {
                    "type": "boolean"
                  },
                  "command": {
                    "type": "string"
                  }
                }
              },
              "mcp": {
                "type": "object",
                "required": [
                  "tool",
                  "arguments"
                ],
                "properties": {
                  "tool": {
                    "type": "string"
                  },
                  "arguments": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "docs_url": {
            "type": "string",
            "format": "uri"
          }
        },
        "additionalProperties": false
      }
    }
  },
  "additionalProperties": false
}
