{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/acp-variables-file/latest.json",
  "title": "ACP Variables File",
  "description": "AI Context Protocol variables file format (.acp.vars.json)",
  "x-lintel": {
    "source": "https://acp-protocol.dev/schemas/v1/vars.schema.json",
    "sourceSha256": "59f88ebfa1d8b90534fd99530e4e10a2381ae48e337abfbdc39a40235ed511d9",
    "fileMatch": [
      ".acp.vars.json"
    ],
    "parsers": [
      "json"
    ]
  },
  "type": "object",
  "properties": {
    "version": {
      "type": "string",
      "description": "ACP specification version",
      "pattern": "^\\d+\\.\\d+\\.\\d+",
      "examples": [
        "1.0.0"
      ]
    },
    "variables": {
      "type": "object",
      "description": "Map of variable names to variable entries",
      "additionalProperties": {
        "$ref": "#/$defs/variable_entry"
      }
    }
  },
  "required": [
    "version",
    "variables"
  ],
  "$defs": {
    "variable_entry": {
      "type": "object",
      "required": [
        "type",
        "value"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "symbol",
            "file",
            "domain",
            "layer",
            "pattern",
            "context"
          ],
          "description": "Variable type"
        },
        "value": {
          "type": "string",
          "description": "Reference value (qualified name, path, etc.)"
        },
        "description": {
          "type": "string",
          "description": "Human-readable description"
        },
        "refs": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": [],
          "description": "References to other variables (for inheritance chains)"
        },
        "source": {
          "type": "string",
          "description": "Source file path where the variable is defined"
        },
        "lines": {
          "type": "array",
          "items": {
            "type": "integer"
          },
          "minItems": 2,
          "maxItems": 2,
          "description": "[start_line, end_line] range in source file"
        }
      }
    }
  }
}
