{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://static-agent-marketplace.org/schemas/draft/lock.schema.json",
  "title": "Static Agent Marketplace lock",
  "description": "The record of every archive ever published under a versioned path, kept in the source repository and never published; see section 11.2 of the specification.",
  "type": "object",
  "required": ["$schema", "specVersion", "releases"],
  "properties": {
    "$schema": {"const": "https://static-agent-marketplace.org/schemas/draft/lock.schema.json"},
    "specVersion": {"type": "string", "pattern": "^0\\.1\\.0(-draft)?$"},
    "releases": {
      "description": "One item per published (kind, name, version), sorted by kind, name, then version.",
      "type": "array",
      "items": {
        "type": "object",
        "required": ["kind", "name", "version", "archives"],
        "properties": {
          "kind": {"enum": ["plugin", "skill"]},
          "name": {"$ref": "entry.schema.json#/$defs/name"},
          "version": {"$ref": "entry.schema.json#/$defs/version"},
          "archives": {
            "description": "Site-relative archive path (no leading slash) to its lowercase hex SHA-256.",
            "type": "object",
            "minProperties": 1,
            "propertyNames": {"pattern": "^[A-Za-z0-9._-]+(/[A-Za-z0-9._-]+)*\\.zip$"},
            "additionalProperties": {"$ref": "entry.schema.json#/$defs/sha256"}
          },
          "yanked": {
            "description": "Present when the version was withdrawn. The reason is shown to users.",
            "type": "object",
            "required": ["reason"],
            "properties": {
              "reason": {"type": "string", "minLength": 1}
            },
            "additionalProperties": false
          },
          "removed": {
            "description": "True when the package left the input. The archives are no longer served.",
            "const": true
          }
        },
        "additionalProperties": false
      }
    }
  },
  "additionalProperties": false
}
