{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://schemas.mentenaz-server.com/forge/v1/lsp/schema.json",
  "title": "ForgeLspRegistry",
  "description": "forge-registry.json — the generated index Forge fetches to discover LSP language server packages and pick the correct release asset for the current platform.",
  "type": "object",
  "additionalProperties": { "$ref": "#/$defs/LspPackage" },
  "$defs": {
    "Platform": {
      "type": "string",
      "enum": [
        "linux-aarch64",
        "linux-x86_64",
        "macos-aarch64",
        "macos-x86_64",
        "windows-aarch64",
        "windows-x86_64"
      ]
    },
    "AssetEntry": {
      "type": "object",
      "required": ["archive", "binary"],
      "additionalProperties": false,
      "properties": {
        "archive": {
          "type": "string",
          "description": "The zip filename attached to the GitHub Release, e.g. forge-lsp-json-linux-x86_64.zip"
        },
        "binary": {
          "type": "string",
          "description": "The executable filename inside the extracted archive, e.g. forge-lsp-json or forge-lsp-json.exe"
        }
      }
    },
    "LspPackage": {
      "type": "object",
      "required": [
        "name",
        "description",
        "version",
        "repo",
        "language_id",
        "file_extensions",
        "args",
        "assets"
      ],
      "additionalProperties": false,
      "properties": {
        "name": {
          "type": "string",
          "description": "Human-readable display name, e.g. \"Rust\", \"C/C++\""
        },
        "description": {
          "type": "string"
        },
        "version": {
          "type": "string",
          "description": "Package version, e.g. \"0.1.0\" — independent of the overall repo release tag"
        },
        "repo": {
          "type": "string",
          "description": "GitHub owner/repo this package's release assets are attached to, e.g. \"mentenaz/Forge.Rust.LSP\""
        },
        "language_id": {
          "type": "string",
          "description": "LSP languageId Forge matches against an open file's language"
        },
        "file_extensions": {
          "type": "array",
          "items": { "type": "string" },
          "minItems": 1,
          "description": "File extensions (without the leading dot) that trigger this server"
        },
        "args": {
          "type": "array",
          "items": { "type": "string" },
          "description": "Extra CLI arguments passed to the binary on launch (empty in every current entry, but the field is always present)"
        },
        "assets": {
          "type": "object",
          "description": "Per-platform release asset info. Not every package ships every platform — see e.g. 'sql', 'markdown', 'lua', 'terraform' which omit some.",
          "additionalProperties": false,
          "properties": {
            "linux-aarch64": { "$ref": "#/$defs/AssetEntry" },
            "linux-x86_64": { "$ref": "#/$defs/AssetEntry" },
            "macos-aarch64": { "$ref": "#/$defs/AssetEntry" },
            "macos-x86_64": { "$ref": "#/$defs/AssetEntry" },
            "windows-aarch64": { "$ref": "#/$defs/AssetEntry" },
            "windows-x86_64": { "$ref": "#/$defs/AssetEntry" }
          },
          "minProperties": 1
        }
      }
    }
  }
}