{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/multi-agent-ecosystem/multi-agent-pipeline/pipeline/schemas/routines.schema.json",
  "title": "Routines",
  "description": "What GET /v1/routines returns (`routine-registry.mjs list --json`): the routines saved with /multi-agent:save. Description and source are scrubbed.",
  "type": "object",
  "additionalProperties": false,
  "required": ["contractVersion", "routines"],
  "properties": {
    "contractVersion": {
      "type": "string",
      "pattern": "^1\\.[0-9]+\\.[0-9]+$",
      "x-sensitivity": "none"
    },
    "routines": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["name", "description", "createdAt", "source"],
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "createdAt": {
            "type": ["string", "null"]
          },
          "source": {
            "type": ["string", "null"]
          }
        }
      }
    }
  }
}
