{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/multi-agent-ecosystem/multi-agent-pipeline/pipeline/schemas/steer.schema.json",
  "title": "Steer queued",
  "description": "What POST /v1/runs/{id}/steer returns (`steer-run.mjs`). Step one: preview {text, status, currentPhase, replaces} with confirmToken and expiresAt, nothing written. Step two: the instruction is queued as the run's pendingSteer and applied at the entry to its next phase; replaced is the unconsumed instruction it replaced, or null.",
  "type": "object",
  "additionalProperties": false,
  "required": ["contractVersion", "taskId"],
  "properties": {
    "contractVersion": {
      "type": "string",
      "pattern": "^1\\.[0-9]+\\.[0-9]+$",
      "x-sensitivity": "none"
    },
    "taskId": {
      "type": "string"
    },
    "queuedAt": {
      "type": "string",
      "format": "date-time"
    },
    "replaced": {
      "type": ["string", "null"]
    },
    "status": {
      "type": ["string", "null"]
    },
    "currentPhase": {
      "type": ["integer", "null"]
    },
    "preview": {
      "type": "object",
      "additionalProperties": false,
      "required": ["text", "status", "currentPhase", "replaces"],
      "properties": {
        "text": {
          "type": "string"
        },
        "status": {
          "type": ["string", "null"]
        },
        "currentPhase": {
          "type": ["integer", "null"]
        },
        "replaces": {
          "type": ["string", "null"]
        }
      }
    },
    "confirmToken": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{16,128}$"
    },
    "expiresAt": {
      "type": "string",
      "format": "date-time"
    }
  }
}
