{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/multi-agent-ecosystem/multi-agent-pipeline/pipeline/schemas/autopilot-on.schema.json",
  "title": "Autopilot on",
  "description": "What POST /v1/autopilot/on returns (`autopilot-control.mjs on-preview`, then `on`). Step one: preview {keep, drop, probe, configureOnly} with confirmToken and expiresAt. Step two: enabled and scheduled say whether the schedule was loaded; it is not when configureOnly was asked or a credential probe failed, and probe says which.",
  "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": ["keep", "drop", "probe", "configureOnly"],
      "properties": {
        "keep": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "drop": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "probe": {
          "type": "object",
          "additionalProperties": false,
          "required": ["ready", "problems", "warnings"],
          "properties": {
            "ready": {
              "type": "boolean"
            },
            "problems": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "warnings": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        },
        "configureOnly": {
          "type": "boolean"
        }
      }
    },
    "confirmToken": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{16,128}$"
    },
    "expiresAt": {
      "type": "string",
      "format": "date-time"
    },
    "enabled": {
      "type": "boolean"
    },
    "scheduled": {
      "type": "boolean"
    },
    "awake": {
      "type": ["boolean", "null"]
    },
    "repos": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "dropped": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "probe": {
      "type": "object",
      "additionalProperties": false,
      "required": ["ready", "problems", "warnings"],
      "properties": {
        "ready": {
          "type": "boolean"
        },
        "problems": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "warnings": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    }
  }
}
