{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/multi-agent-ecosystem/multi-agent-pipeline/pipeline/schemas/plugins-pin.schema.json",
  "version": "1.0.0",
  "title": "Multi-Agent Pipeline  -  stack plugin pin",
  "description": "Shape of pipeline/schemas/plugins-pin.json, generated by pipeline/scripts/gen-plugins-pin.mjs from a marketplace checkout. Per plugin a minimum version and the knowledge skills that version carries, so install can decide offline whether a copy of the marketplace on this machine is stale (below the minimum) or incomplete (missing a named skill). The knowledge skills are published by the plugins, not by this package; the pin is what the package knows about them.",
  "type": "object",
  "additionalProperties": false,
  "required": ["plugins"],
  "properties": {
    "$comment": { "type": "string" },
    "plugins": {
      "type": "object",
      "description": "Keyed by plugin directory name inside the marketplace's plugins/.",
      "minProperties": 1,
      "propertyNames": { "pattern": "^[a-z0-9][a-z0-9-]*$" },
      "additionalProperties": {
        "type": "object",
        "additionalProperties": false,
        "required": ["minVersion", "knowledge"],
        "properties": {
          "minVersion": {
            "type": "string",
            "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$",
            "description": "The version the pin was measured against. A plugin only gains knowledge skills, so this is the floor: a copy declaring less is stale."
          },
          "knowledge": {
            "type": "array",
            "description": "Skill directory names under the plugin's skills/knowledge/. A copy missing one is incomplete, whatever its version.",
            "minItems": 1,
            "uniqueItems": true,
            "items": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]*$" }
          }
        }
      }
    }
  }
}
