{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/multi-agent-ecosystem/multi-agent-pipeline/pipeline/schemas/routine-delete.schema.json",
  "title": "Routine removal",
  "description": "What DELETE /v1/routines/{name} returns. Without ?confirm: preview (the routine) with confirmToken and expiresAt. With it: removed, from `routine-registry.mjs remove`. A shipped command is never removed.",
  "type": "object",
  "additionalProperties": false,
  "required": ["contractVersion"],
  "properties": {
    "contractVersion": {
      "type": "string",
      "pattern": "^1\\.[0-9]+\\.[0-9]+$",
      "x-sensitivity": "none"
    },
    "preview": {
      "type": "object",
      "additionalProperties": false,
      "required": ["name", "description", "createdAt", "source"],
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "createdAt": {
          "type": ["string", "null"]
        },
        "source": {
          "type": ["string", "null"]
        }
      }
    },
    "confirmToken": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{16,128}$"
    },
    "expiresAt": {
      "type": "string",
      "format": "date-time"
    },
    "removed": {
      "type": "object",
      "additionalProperties": false,
      "required": ["name", "removedDir", "removedEntry"],
      "properties": {
        "name": {
          "type": "string"
        },
        "removedDir": {
          "type": "boolean"
        },
        "removedEntry": {
          "type": "boolean"
        }
      }
    }
  }
}
