{
  "asyncapi": "3.1.0",
  "id": "urn:waraps.decentralized-swarm",
  "info": {
    "title": "WARA-PS Decentralized Swarm MQTT Extension",
    "version": "1.1.2",
    "description": "Defines the Swarm extension MQTT channels, operations, and payload schemas, with the fail-reason strings and key constraints each one carries. The longer runtime rules and their reasoning are in the companion Swarm protocol guide, docs/waraps-api-swarm-protocol.md in the api-specs repository (also served next to this spec as [/specs/waraps-api-swarm-protocol.md](/specs/waraps-api-swarm-protocol.md)). Machine-readable timing: x-swarm-sensor-interval-seconds; a member MUST NOT treat the Swarm Leader as dead before the Swarm Unit sensors leader, members and reference have all been stale for 3 sensor intervals."
  },
  "defaultContentType": "application/json",
  "servers": {
    "localhost": {
      "host": "localhost:{port}",
      "protocol": "mqtt",
      "protocolVersion": "3.1.1+",
      "description": "Development MQTT broker",
      "variables": {
        "port": {
          "enum": [
            "1882",
            "1883"
          ],
          "default": "1883",
          "description": "The port used for connecting to the locally hosted MQTT broker"
        }
      },
      "security": []
    },
    "production": {
      "host": "broker.waraps.org:{port}",
      "protocol": "mqtt",
      "protocolVersion": "3.1.1+",
      "description": "Production MQTT broker",
      "variables": {
        "port": {
          "enum": [
            "8883"
          ],
          "default": "8883",
          "description": "The port used for connecting to the production MQTT broker"
        }
      },
      "security": [
        {
          "$ref": "#/components/securitySchemes/tls"
        }
      ]
    }
  },
  "channels": {
    "admissionCommand": {
      "address": "{agent-base-topic}/exec/command",
      "description": "Admission request messages.",
      "bindings": {
        "$ref": "#/components/channelBindings/SwarmMqttSettings"
      },
      "messages": {
        "request": {
          "$ref": "#/components/messages/AdmissionRequest"
        }
      },
      "parameters": {
        "agent-base-topic": {
          "$ref": "#/components/parameters/agent-base-topic"
        }
      }
    },
    "admissionResponse": {
      "address": "{agent-base-topic}/exec/response",
      "description": "Admission decision messages.",
      "bindings": {
        "$ref": "#/components/channelBindings/SwarmMqttSettings"
      },
      "messages": {
        "invite": {
          "$ref": "#/components/messages/AdmissionInvite"
        },
        "reject": {
          "$ref": "#/components/messages/AdmissionReject"
        }
      },
      "parameters": {
        "agent-base-topic": {
          "$ref": "#/components/parameters/agent-base-topic"
        }
      }
    },
    "electionCandidate": {
      "address": "{agent-base-topic}/sensor/election",
      "description": "Election candidate messages.",
      "bindings": {
        "$ref": "#/components/channelBindings/SwarmMqttSettings"
      },
      "messages": {
        "candidate": {
          "$ref": "#/components/messages/ElectionCandidate"
        }
      },
      "parameters": {
        "agent-base-topic": {
          "$ref": "#/components/parameters/agent-base-topic"
        }
      }
    },
    "electionResult": {
      "address": "{agent-base-topic}/sensor/election",
      "description": "Election result messages.",
      "bindings": {
        "$ref": "#/components/channelBindings/SwarmMqttSettings"
      },
      "messages": {
        "result": {
          "$ref": "#/components/messages/ElectionResult"
        }
      },
      "parameters": {
        "agent-base-topic": {
          "$ref": "#/components/parameters/agent-base-topic"
        }
      }
    },
    "roster": {
      "address": "{agent-base-topic}/sensor/members",
      "description": "Swarm roster snapshots.",
      "bindings": {
        "$ref": "#/components/channelBindings/SwarmSensorMqttSettings"
      },
      "messages": {
        "roster": {
          "$ref": "#/components/messages/SwarmRoster"
        }
      },
      "parameters": {
        "agent-base-topic": {
          "$ref": "#/components/parameters/agent-base-topic"
        }
      }
    },
    "leaderSignal": {
      "address": "{agent-base-topic}/sensor/leader",
      "description": "Swarm leader identity and leadership-start timestamp.",
      "bindings": {
        "$ref": "#/components/channelBindings/SwarmSensorMqttSettings"
      },
      "messages": {
        "leader": {
          "$ref": "#/components/messages/LeaderSignal"
        }
      },
      "parameters": {
        "agent-base-topic": {
          "$ref": "#/components/parameters/agent-base-topic"
        }
      }
    },
    "formationCommand": {
      "address": "{agent-base-topic}/exec/command",
      "description": "set-formation task commands.",
      "bindings": {
        "$ref": "#/components/channelBindings/SwarmMqttSettings"
      },
      "messages": {
        "command": {
          "$ref": "#/components/messages/SetFormationTaskCommand"
        }
      },
      "parameters": {
        "agent-base-topic": {
          "$ref": "#/components/parameters/agent-base-topic"
        }
      }
    },
    "formationResponse": {
      "address": "{agent-base-topic}/exec/response",
      "description": "set-formation task responses.",
      "bindings": {
        "$ref": "#/components/channelBindings/SwarmMqttSettings"
      },
      "messages": {
        "response": {
          "$ref": "#/components/messages/WaraTaskResponse"
        }
      },
      "parameters": {
        "agent-base-topic": {
          "$ref": "#/components/parameters/agent-base-topic"
        }
      }
    },
    "formationFeedback": {
      "address": "{agent-base-topic}/exec/feedback",
      "description": "set-formation task feedback.",
      "bindings": {
        "$ref": "#/components/channelBindings/SwarmMqttSettings"
      },
      "messages": {
        "feedback": {
          "$ref": "#/components/messages/WaraTaskFeedback"
        }
      },
      "parameters": {
        "agent-base-topic": {
          "$ref": "#/components/parameters/agent-base-topic"
        }
      }
    },
    "formationState": {
      "address": "{agent-base-topic}/sensor/formation",
      "description": "Current formation configuration.",
      "bindings": {
        "$ref": "#/components/channelBindings/SwarmSensorMqttSettings"
      },
      "messages": {
        "state": {
          "$ref": "#/components/messages/FormationState"
        }
      },
      "parameters": {
        "agent-base-topic": {
          "$ref": "#/components/parameters/agent-base-topic"
        }
      }
    },
    "formationReference": {
      "address": "{agent-base-topic}/sensor/reference",
      "description": "Formation anchor position and leader speed.",
      "bindings": {
        "$ref": "#/components/channelBindings/SwarmSensorMqttSettings"
      },
      "messages": {
        "reference": {
          "$ref": "#/components/messages/FormationReference"
        }
      },
      "parameters": {
        "agent-base-topic": {
          "$ref": "#/components/parameters/agent-base-topic"
        }
      }
    },
    "taskIngress": {
      "address": "{agent-base-topic}/exec/command",
      "description": "Move-to, search-area, and move-path task commands addressed to the Swarm Unit.",
      "bindings": {
        "$ref": "#/components/channelBindings/SwarmMqttSettings"
      },
      "messages": {
        "command": {
          "$ref": "#/components/messages/WaraMoveToCommand"
        },
        "searchArea": {
          "$ref": "#/components/messages/WaraSearchAreaCommand"
        },
        "movePath": {
          "$ref": "#/components/messages/WaraMovePathCommand"
        }
      },
      "parameters": {
        "agent-base-topic": {
          "$ref": "#/components/parameters/agent-base-topic"
        }
      }
    },
    "taskAnnouncement": {
      "address": "{agent-base-topic}/sensor/task/{task-id}/announce",
      "description": "The elected Swarm Leader announces the oldest pending ingress task to eligible members for bidding. A member bids the distance to the task's first destination: the waypoint of a move-to, params.waypoints[0] of a move-path, or the first waypoint of a search-area route. A Sub-Task of a move-to or move-path Parent Task carries the Parent Task's params unchanged, so a move-path Sub-Task flies the whole route. See the Swarm protocol guide, section taskAnnouncement.",
      "bindings": {
        "$ref": "#/components/channelBindings/SwarmMqttSettings"
      },
      "messages": {
        "announcement": {
          "$ref": "#/components/messages/TaskAnnouncement"
        }
      },
      "parameters": {
        "task-id": {
          "$ref": "#/components/parameters/task-id"
        },
        "agent-base-topic": {
          "$ref": "#/components/parameters/agent-base-topic"
        }
      }
    },
    "taskBid": {
      "address": "{agent-base-topic}/sensor/task/{task-id}/bid",
      "description": "Member cost bids for a task.",
      "bindings": {
        "$ref": "#/components/channelBindings/SwarmMqttSettings"
      },
      "messages": {
        "bid": {
          "$ref": "#/components/messages/TaskBid"
        }
      },
      "parameters": {
        "task-id": {
          "$ref": "#/components/parameters/task-id"
        },
        "agent-base-topic": {
          "$ref": "#/components/parameters/agent-base-topic"
        }
      }
    },
    "taskAssignment": {
      "address": "{agent-base-topic}/task/{task-id}/assignment",
      "description": "Task executor assignment or delegation result.",
      "bindings": {
        "$ref": "#/components/channelBindings/SwarmMqttSettings"
      },
      "messages": {
        "assignment": {
          "$ref": "#/components/messages/TaskAssignment"
        }
      },
      "parameters": {
        "task-id": {
          "$ref": "#/components/parameters/task-id"
        },
        "agent-base-topic": {
          "$ref": "#/components/parameters/agent-base-topic"
        }
      }
    },
    "parentTaskDecision": {
      "address": "{agent-base-topic}/task/{task-id}/decision",
      "description": "Parent-task allocation decision.",
      "bindings": {
        "$ref": "#/components/channelBindings/SwarmMqttSettings"
      },
      "messages": {
        "decision": {
          "$ref": "#/components/messages/ParentTaskDecision"
        }
      },
      "parameters": {
        "task-id": {
          "$ref": "#/components/parameters/task-id"
        },
        "agent-base-topic": {
          "$ref": "#/components/parameters/agent-base-topic"
        }
      }
    },
    "taskResponse": {
      "address": "{agent-base-topic}/exec/response",
      "description": "The Swarm Leader relays the selected executor's task response on the Swarm Unit's exec/response, preserving correlation identifiers. fail-reason values the Swarm Unit itself sets: 'pending task capacity exceeded', 'leader warming up', 'signal not applicable before assignment', 'invalid task payload', 'no formation', 'task-already-running', 'invalid-agent-count', 'agent-count-unsupported', 'insufficient-agents', 'area-too-small', 'inactive task', 'leader lost', and the delegation failure-reasons 'no-bid', 'missing executor topic', 'executor acknowledgement timeout', 'executor refused' and 'task aborted by commander'. See the Swarm protocol guide, section taskResponse.",
      "bindings": {
        "$ref": "#/components/channelBindings/SwarmMqttSettings"
      },
      "messages": {
        "response": {
          "$ref": "#/components/messages/WaraTaskResponse"
        }
      },
      "parameters": {
        "agent-base-topic": {
          "$ref": "#/components/parameters/agent-base-topic"
        }
      }
    },
    "taskSignal": {
      "address": "{agent-base-topic}/task/{task-id}/signal",
      "description": "Task signals addressed to the Swarm Unit.",
      "bindings": {
        "$ref": "#/components/channelBindings/SwarmMqttSettings"
      },
      "messages": {
        "signal": {
          "$ref": "#/components/messages/SwarmTaskSignal"
        }
      },
      "parameters": {
        "task-id": {
          "$ref": "#/components/parameters/task-id"
        },
        "agent-base-topic": {
          "$ref": "#/components/parameters/agent-base-topic"
        }
      }
    },
    "taskFeedback": {
      "address": "{agent-base-topic}/exec/feedback",
      "description": "The Swarm Leader relays the selected executor's task feedback on the Swarm Unit's exec/feedback. A task the Swarm Unit refuses is also reported here with status failed and the same fail-reason as its response: 'pending task capacity exceeded', 'leader warming up', 'invalid task payload', 'no formation', 'task-already-running', 'invalid-agent-count', 'agent-count-unsupported', 'insufficient-agents', 'area-too-small', 'leader lost', or a delegation failure-reason. Aborting a queued task reports status aborted. See the Swarm protocol guide, section taskFeedback.",
      "bindings": {
        "$ref": "#/components/channelBindings/SwarmMqttSettings"
      },
      "messages": {
        "feedback": {
          "$ref": "#/components/messages/WaraTaskFeedback"
        }
      },
      "parameters": {
        "agent-base-topic": {
          "$ref": "#/components/parameters/agent-base-topic"
        }
      }
    },
    "memberTaskIngress": {
      "address": "{agent-base-topic}/exec/command",
      "description": "A move-to, search-area or move-path sent to an admitted member is handed unchanged to the Swarm Unit, params.swarm and params.agent-count included. The member instead fails it on its own execution boundary, without handing it on, with fail-reason 'no swarm leader', 'no formation', 'task-already-running', 'invalid-agent-count', 'agent-count-unsupported', 'insufficient-agents' or 'area-too-small'. See the Swarm protocol guide, section memberTaskIngress.",
      "bindings": {
        "$ref": "#/components/channelBindings/SwarmMqttSettings"
      },
      "messages": {
        "command": {
          "$ref": "#/components/messages/WaraMoveToCommand"
        },
        "searchArea": {
          "$ref": "#/components/messages/WaraSearchAreaCommand"
        },
        "movePath": {
          "$ref": "#/components/messages/WaraMovePathCommand"
        }
      },
      "parameters": {
        "agent-base-topic": {
          "$ref": "#/components/parameters/agent-base-topic"
        }
      }
    },
    "memberTaskSignal": {
      "address": "{agent-base-topic}/exec/command",
      "description": "Task signals addressed to a Swarm member.",
      "bindings": {
        "$ref": "#/components/channelBindings/SwarmMqttSettings"
      },
      "messages": {
        "signal": {
          "$ref": "#/components/messages/WaraTaskSignal"
        }
      },
      "parameters": {
        "agent-base-topic": {
          "$ref": "#/components/parameters/agent-base-topic"
        }
      }
    },
    "executorTaskCommand": {
      "address": "{agent-base-topic}/exec/command",
      "description": "The selected executor receives the task assignment or forwarded signal on its own exec/command, with sender set to the Swarm Leader's agent-id. A start-task or signal-task whose sender is the elected Swarm Leader is executed locally; any other start-task is member task ingress, except that a start-task carrying parent-task-uuid is never ingress: from any other sender, or with no sender, it fails with 'inactive task'. The executor fails a command with fail-reason 'parsing error', 'invalid task payload', 'task-already-running', 'inactive task' or 'unsupported signal'. See the Swarm protocol guide, section executorTaskCommand.",
      "bindings": {
        "$ref": "#/components/channelBindings/SwarmMqttSettings"
      },
      "messages": {
        "startTask": {
          "$ref": "#/components/messages/WaraMoveToCommand"
        },
        "searchArea": {
          "$ref": "#/components/messages/WaraSearchAreaCommand"
        },
        "movePath": {
          "$ref": "#/components/messages/WaraMovePathCommand"
        },
        "signal": {
          "$ref": "#/components/messages/WaraTaskSignal"
        }
      },
      "parameters": {
        "agent-base-topic": {
          "$ref": "#/components/parameters/agent-base-topic"
        }
      }
    },
    "memberTaskResponse": {
      "address": "{agent-base-topic}/exec/response",
      "description": "Task responses associated with member task ingress.",
      "bindings": {
        "$ref": "#/components/channelBindings/SwarmMqttSettings"
      },
      "messages": {
        "response": {
          "$ref": "#/components/messages/WaraTaskResponse"
        }
      },
      "parameters": {
        "agent-base-topic": {
          "$ref": "#/components/parameters/agent-base-topic"
        }
      }
    },
    "memberTaskFeedback": {
      "address": "{agent-base-topic}/exec/feedback",
      "description": "Task feedback associated with member task ingress.",
      "bindings": {
        "$ref": "#/components/channelBindings/SwarmMqttSettings"
      },
      "messages": {
        "feedback": {
          "$ref": "#/components/messages/WaraTaskFeedback"
        }
      },
      "parameters": {
        "agent-base-topic": {
          "$ref": "#/components/parameters/agent-base-topic"
        }
      }
    },
    "swarmIntentCommand": {
      "address": "{agent-base-topic}/exec/command",
      "description": "set-swarm-intent task commands.",
      "bindings": {
        "$ref": "#/components/channelBindings/SwarmMqttSettings"
      },
      "messages": {
        "command": {
          "$ref": "#/components/messages/SetSwarmIntentCommand"
        }
      },
      "parameters": {
        "agent-base-topic": {
          "$ref": "#/components/parameters/agent-base-topic"
        }
      }
    },
    "swarmIntentResponse": {
      "address": "{agent-base-topic}/exec/response",
      "description": "set-swarm-intent task responses.",
      "bindings": {
        "$ref": "#/components/channelBindings/SwarmMqttSettings"
      },
      "messages": {
        "response": {
          "$ref": "#/components/messages/SetSwarmIntentResponse"
        }
      },
      "parameters": {
        "agent-base-topic": {
          "$ref": "#/components/parameters/agent-base-topic"
        }
      }
    },
    "swarmIntentFeedback": {
      "address": "{agent-base-topic}/exec/feedback",
      "description": "set-swarm-intent task feedback.",
      "bindings": {
        "$ref": "#/components/channelBindings/SwarmMqttSettings"
      },
      "messages": {
        "feedback": {
          "$ref": "#/components/messages/SetSwarmIntentFeedback"
        }
      },
      "parameters": {
        "agent-base-topic": {
          "$ref": "#/components/parameters/agent-base-topic"
        }
      }
    },
    "agentSwarmMembership": {
      "address": "{agent-base-topic}/sensor/swarm_membership",
      "description": "Swarm membership and role sensor messages.",
      "bindings": {
        "$ref": "#/components/channelBindings/PresenceMqttSettings"
      },
      "messages": {
        "membership": {
          "$ref": "#/components/messages/SwarmMembershipSensor"
        }
      },
      "parameters": {
        "agent-base-topic": {
          "$ref": "#/components/parameters/agent-base-topic"
        }
      }
    },
    "agentSensorInfo": {
      "address": "{agent-base-topic}/sensor_info",
      "description": "Sensor declarations for Swarm members.",
      "bindings": {
        "$ref": "#/components/channelBindings/PresenceMqttSettings"
      },
      "messages": {
        "sensorInfo": {
          "$ref": "#/components/messages/SwarmSensorInfo"
        }
      },
      "parameters": {
        "agent-base-topic": {
          "$ref": "#/components/parameters/agent-base-topic"
        }
      }
    },
    "agentDirectExecutionInfo": {
      "address": "{agent-base-topic}/direct_execution_info",
      "description": "Direct-execution declarations for Swarm members.",
      "bindings": {
        "$ref": "#/components/channelBindings/PresenceMqttSettings"
      },
      "messages": {
        "directExecutionInfo": {
          "$ref": "#/components/messages/AgentDirectExecutionInfo"
        }
      },
      "parameters": {
        "agent-base-topic": {
          "$ref": "#/components/parameters/agent-base-topic"
        }
      }
    },
    "swarmUnitHeartbeat": {
      "address": "{agent-base-topic}/heartbeat",
      "description": "Swarm Unit heartbeat messages.",
      "bindings": {
        "$ref": "#/components/channelBindings/PresenceMqttSettings"
      },
      "messages": {
        "heartbeat": {
          "$ref": "./waraps-api-declarations.json#/components/messages/HeartbeatMessage"
        }
      },
      "parameters": {
        "agent-base-topic": {
          "$ref": "#/components/parameters/agent-base-topic"
        }
      }
    },
    "swarmUnitSensorInfo": {
      "address": "{agent-base-topic}/sensor_info",
      "description": "Swarm Unit sensor declarations.",
      "bindings": {
        "$ref": "#/components/channelBindings/PresenceMqttSettings"
      },
      "messages": {
        "sensorInfo": {
          "$ref": "#/components/messages/SwarmSensorInfo"
        }
      },
      "parameters": {
        "agent-base-topic": {
          "$ref": "#/components/parameters/agent-base-topic"
        }
      }
    },
    "swarmUnitDirectExecutionInfo": {
      "address": "{agent-base-topic}/direct_execution_info",
      "description": "Swarm Unit direct-execution declarations.",
      "bindings": {
        "$ref": "#/components/channelBindings/PresenceMqttSettings"
      },
      "messages": {
        "directExecutionInfo": {
          "$ref": "#/components/messages/SwarmDirectExecutionInfo"
        }
      },
      "parameters": {
        "agent-base-topic": {
          "$ref": "#/components/parameters/agent-base-topic"
        }
      }
    }
  },
  "operations": {
    "sendAdmissionCommand": {
      "action": "send",
      "title": "Sends admission command",
      "channel": {
        "$ref": "#/channels/admissionCommand"
      },
      "summary": "Sends admission command (role: applicant)",
      "tags": [
        {
          "name": "applicant"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/admissionCommand/messages/request"
        }
      ]
    },
    "receiveAdmissionCommand": {
      "action": "receive",
      "title": "Receives admission command",
      "channel": {
        "$ref": "#/channels/admissionCommand"
      },
      "summary": "Receives admission command (role: leader)",
      "tags": [
        {
          "name": "leader"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/admissionCommand/messages/request"
        }
      ]
    },
    "sendAdmissionResponse": {
      "action": "send",
      "title": "Sends admission response",
      "channel": {
        "$ref": "#/channels/admissionResponse"
      },
      "summary": "Sends admission response (role: leader)",
      "tags": [
        {
          "name": "leader"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/admissionResponse/messages/invite"
        },
        {
          "$ref": "#/channels/admissionResponse/messages/reject"
        }
      ]
    },
    "receiveAdmissionResponse": {
      "action": "receive",
      "title": "Receives admission response",
      "channel": {
        "$ref": "#/channels/admissionResponse"
      },
      "summary": "Receives admission response (role: applicant)",
      "tags": [
        {
          "name": "applicant"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/admissionResponse/messages/invite"
        },
        {
          "$ref": "#/channels/admissionResponse/messages/reject"
        }
      ]
    },
    "sendElectionCandidate": {
      "action": "send",
      "title": "Sends election candidate",
      "channel": {
        "$ref": "#/channels/electionCandidate"
      },
      "summary": "Sends election candidate (role: member)",
      "tags": [
        {
          "name": "member"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/electionCandidate/messages/candidate"
        }
      ]
    },
    "receiveElectionCandidate": {
      "action": "receive",
      "title": "Receives election candidate",
      "channel": {
        "$ref": "#/channels/electionCandidate"
      },
      "summary": "Receives election candidate (role: member)",
      "tags": [
        {
          "name": "member"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/electionCandidate/messages/candidate"
        }
      ]
    },
    "sendElectionResult": {
      "action": "send",
      "title": "Sends election result",
      "channel": {
        "$ref": "#/channels/electionResult"
      },
      "summary": "Sends election result (role: member)",
      "tags": [
        {
          "name": "member"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/electionResult/messages/result"
        }
      ]
    },
    "receiveElectionResult": {
      "action": "receive",
      "title": "Receives election result",
      "channel": {
        "$ref": "#/channels/electionResult"
      },
      "summary": "Receives election result (role: member)",
      "tags": [
        {
          "name": "member"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/electionResult/messages/result"
        }
      ]
    },
    "sendRoster": {
      "action": "send",
      "title": "Sends roster",
      "channel": {
        "$ref": "#/channels/roster"
      },
      "summary": "Sends roster (role: leader)",
      "tags": [
        {
          "name": "leader"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/roster/messages/roster"
        }
      ]
    },
    "receiveRoster": {
      "action": "receive",
      "title": "Receives roster",
      "channel": {
        "$ref": "#/channels/roster"
      },
      "summary": "Receives roster (role: member)",
      "tags": [
        {
          "name": "member"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/roster/messages/roster"
        }
      ]
    },
    "sendLeaderSignal": {
      "action": "send",
      "title": "Sends leader signal",
      "channel": {
        "$ref": "#/channels/leaderSignal"
      },
      "summary": "Sends leader signal (role: leader)",
      "tags": [
        {
          "name": "leader"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/leaderSignal/messages/leader"
        }
      ]
    },
    "receiveLeaderSignal": {
      "action": "receive",
      "title": "Receives leader signal",
      "channel": {
        "$ref": "#/channels/leaderSignal"
      },
      "summary": "Receives leader signal (role: member)",
      "tags": [
        {
          "name": "member"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/leaderSignal/messages/leader"
        }
      ]
    },
    "receiveFormationCommand": {
      "action": "receive",
      "title": "Receives formation command",
      "channel": {
        "$ref": "#/channels/formationCommand"
      },
      "summary": "Receives formation command (role: leader)",
      "tags": [
        {
          "name": "leader"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/formationCommand/messages/command"
        }
      ]
    },
    "sendFormationResponse": {
      "action": "send",
      "title": "Sends formation response",
      "channel": {
        "$ref": "#/channels/formationResponse"
      },
      "summary": "Sends formation response (role: leader)",
      "tags": [
        {
          "name": "leader"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/formationResponse/messages/response"
        }
      ]
    },
    "sendFormationFeedback": {
      "action": "send",
      "title": "Sends formation feedback",
      "channel": {
        "$ref": "#/channels/formationFeedback"
      },
      "summary": "Sends formation feedback (role: leader)",
      "tags": [
        {
          "name": "leader"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/formationFeedback/messages/feedback"
        }
      ]
    },
    "sendFormationState": {
      "action": "send",
      "title": "Sends formation state",
      "channel": {
        "$ref": "#/channels/formationState"
      },
      "summary": "Sends formation state (role: leader)",
      "tags": [
        {
          "name": "leader"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/formationState/messages/state"
        }
      ]
    },
    "receiveFormationState": {
      "action": "receive",
      "title": "Receives formation state",
      "channel": {
        "$ref": "#/channels/formationState"
      },
      "summary": "Receives formation state (role: member)",
      "tags": [
        {
          "name": "member"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/formationState/messages/state"
        }
      ]
    },
    "sendFormationReference": {
      "action": "send",
      "title": "Sends formation reference",
      "channel": {
        "$ref": "#/channels/formationReference"
      },
      "summary": "Sends formation reference (role: leader)",
      "tags": [
        {
          "name": "leader"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/formationReference/messages/reference"
        }
      ]
    },
    "receiveFormationReference": {
      "action": "receive",
      "title": "Receives formation reference",
      "channel": {
        "$ref": "#/channels/formationReference"
      },
      "summary": "Receives formation reference (role: member)",
      "tags": [
        {
          "name": "member"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/formationReference/messages/reference"
        }
      ]
    },
    "receiveTaskIngress": {
      "action": "receive",
      "title": "Receives task ingress",
      "channel": {
        "$ref": "#/channels/taskIngress"
      },
      "summary": "Receives task ingress (role: leader)",
      "tags": [
        {
          "name": "leader"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/taskIngress/messages/command"
        },
        {
          "$ref": "#/channels/taskIngress/messages/searchArea"
        },
        {
          "$ref": "#/channels/taskIngress/messages/movePath"
        }
      ]
    },
    "sendTaskAnnouncement": {
      "action": "send",
      "title": "Sends task announcement",
      "channel": {
        "$ref": "#/channels/taskAnnouncement"
      },
      "summary": "Sends task announcement (role: leader)",
      "tags": [
        {
          "name": "leader"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/taskAnnouncement/messages/announcement"
        }
      ]
    },
    "receiveTaskAnnouncement": {
      "action": "receive",
      "title": "Receives task announcement",
      "channel": {
        "$ref": "#/channels/taskAnnouncement"
      },
      "summary": "Receives task announcement (role: member)",
      "tags": [
        {
          "name": "member"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/taskAnnouncement/messages/announcement"
        }
      ]
    },
    "sendTaskBid": {
      "action": "send",
      "title": "Sends task bid",
      "channel": {
        "$ref": "#/channels/taskBid"
      },
      "summary": "Sends task bid (role: member)",
      "tags": [
        {
          "name": "member"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/taskBid/messages/bid"
        }
      ]
    },
    "receiveTaskBid": {
      "action": "receive",
      "title": "Receives task bid",
      "channel": {
        "$ref": "#/channels/taskBid"
      },
      "summary": "Receives task bid (role: leader)",
      "tags": [
        {
          "name": "leader"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/taskBid/messages/bid"
        }
      ]
    },
    "sendTaskAssignment": {
      "action": "send",
      "title": "Sends task assignment",
      "channel": {
        "$ref": "#/channels/taskAssignment"
      },
      "summary": "Sends task assignment (role: leader)",
      "tags": [
        {
          "name": "leader"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/taskAssignment/messages/assignment"
        }
      ]
    },
    "receiveTaskAssignment": {
      "action": "receive",
      "title": "Receives task assignment",
      "channel": {
        "$ref": "#/channels/taskAssignment"
      },
      "summary": "Receives task assignment (role: member)",
      "tags": [
        {
          "name": "member"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/taskAssignment/messages/assignment"
        }
      ]
    },
    "sendParentTaskDecision": {
      "action": "send",
      "title": "Sends parent task decision",
      "channel": {
        "$ref": "#/channels/parentTaskDecision"
      },
      "summary": "Parent-task decision (role: leader)",
      "tags": [
        {
          "name": "leader"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/parentTaskDecision/messages/decision"
        }
      ]
    },
    "receiveParentTaskDecision": {
      "action": "receive",
      "title": "Receives parent task decision",
      "channel": {
        "$ref": "#/channels/parentTaskDecision"
      },
      "summary": "Parent-task decision (role: member)",
      "tags": [
        {
          "name": "member"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/parentTaskDecision/messages/decision"
        }
      ]
    },
    "sendTaskResponse": {
      "action": "send",
      "title": "Sends task response",
      "channel": {
        "$ref": "#/channels/taskResponse"
      },
      "summary": "Sends task response (role: leader)",
      "tags": [
        {
          "name": "leader"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/taskResponse/messages/response"
        }
      ]
    },
    "sendTaskFeedback": {
      "action": "send",
      "title": "Sends task feedback",
      "channel": {
        "$ref": "#/channels/taskFeedback"
      },
      "summary": "Sends task feedback (role: leader)",
      "tags": [
        {
          "name": "leader"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/taskFeedback/messages/feedback"
        }
      ]
    },
    "sendTaskSignal": {
      "action": "send",
      "title": "Sends task signal",
      "channel": {
        "$ref": "#/channels/taskSignal"
      },
      "summary": "Sends task signal (role: member)",
      "tags": [
        {
          "name": "member"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/taskSignal/messages/signal"
        }
      ]
    },
    "receiveTaskSignal": {
      "action": "receive",
      "title": "Receives task signal",
      "channel": {
        "$ref": "#/channels/taskSignal"
      },
      "summary": "Receives task signal (role: leader)",
      "tags": [
        {
          "name": "leader"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/taskSignal/messages/signal"
        }
      ]
    },
    "receiveMemberTaskIngress": {
      "action": "receive",
      "title": "Receives member task ingress",
      "channel": {
        "$ref": "#/channels/memberTaskIngress"
      },
      "summary": "Receives member task ingress (role: member)",
      "tags": [
        {
          "name": "member"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/memberTaskIngress/messages/command"
        },
        {
          "$ref": "#/channels/memberTaskIngress/messages/searchArea"
        },
        {
          "$ref": "#/channels/memberTaskIngress/messages/movePath"
        }
      ]
    },
    "receiveMemberTaskSignal": {
      "action": "receive",
      "title": "Receives member task signal",
      "channel": {
        "$ref": "#/channels/memberTaskSignal"
      },
      "summary": "Receives member task signal (role: member)",
      "tags": [
        {
          "name": "member"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/memberTaskSignal/messages/signal"
        }
      ]
    },
    "receiveExecutorTaskCommand": {
      "action": "receive",
      "title": "Receives executor task command",
      "channel": {
        "$ref": "#/channels/executorTaskCommand"
      },
      "summary": "Receives executor task command (role: executor)",
      "tags": [
        {
          "name": "executor"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/executorTaskCommand/messages/startTask"
        },
        {
          "$ref": "#/channels/executorTaskCommand/messages/searchArea"
        },
        {
          "$ref": "#/channels/executorTaskCommand/messages/movePath"
        },
        {
          "$ref": "#/channels/executorTaskCommand/messages/signal"
        }
      ]
    },
    "sendMemberTaskResponse": {
      "action": "send",
      "title": "Sends member task response",
      "channel": {
        "$ref": "#/channels/memberTaskResponse"
      },
      "summary": "Sends member task response (role: member)",
      "tags": [
        {
          "name": "member"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/memberTaskResponse/messages/response"
        }
      ]
    },
    "sendMemberTaskFeedback": {
      "action": "send",
      "title": "Sends member task feedback",
      "channel": {
        "$ref": "#/channels/memberTaskFeedback"
      },
      "summary": "Sends member task feedback (role: member)",
      "tags": [
        {
          "name": "member"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/memberTaskFeedback/messages/feedback"
        }
      ]
    },
    "receiveSwarmIntentCommand": {
      "action": "receive",
      "title": "Receives swarm intent command",
      "channel": {
        "$ref": "#/channels/swarmIntentCommand"
      },
      "summary": "Receives swarm intent command (role: agent)",
      "tags": [
        {
          "name": "agent"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/swarmIntentCommand/messages/command"
        }
      ]
    },
    "sendSwarmIntentResponse": {
      "action": "send",
      "title": "Sends swarm intent response",
      "channel": {
        "$ref": "#/channels/swarmIntentResponse"
      },
      "summary": "Sends swarm intent response (role: agent)",
      "tags": [
        {
          "name": "agent"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/swarmIntentResponse/messages/response"
        }
      ]
    },
    "sendSwarmIntentFeedback": {
      "action": "send",
      "title": "Sends swarm intent feedback",
      "channel": {
        "$ref": "#/channels/swarmIntentFeedback"
      },
      "summary": "Sends swarm intent feedback (role: agent)",
      "tags": [
        {
          "name": "agent"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/swarmIntentFeedback/messages/feedback"
        }
      ]
    },
    "sendAgentSwarmMembership": {
      "action": "send",
      "title": "Sends agent swarm membership",
      "channel": {
        "$ref": "#/channels/agentSwarmMembership"
      },
      "summary": "Sends agent swarm membership (role: agent)",
      "tags": [
        {
          "name": "agent"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/agentSwarmMembership/messages/membership"
        }
      ]
    },
    "receiveAgentSwarmMembership": {
      "action": "receive",
      "title": "Receives agent swarm membership",
      "channel": {
        "$ref": "#/channels/agentSwarmMembership"
      },
      "summary": "Receives agent swarm membership (role: leader)",
      "tags": [
        {
          "name": "leader"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/agentSwarmMembership/messages/membership"
        }
      ]
    },
    "sendAgentSensorInfo": {
      "action": "send",
      "title": "Sends agent sensor info",
      "channel": {
        "$ref": "#/channels/agentSensorInfo"
      },
      "summary": "Sends agent sensor info (role: agent)",
      "tags": [
        {
          "name": "agent"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/agentSensorInfo/messages/sensorInfo"
        }
      ]
    },
    "receiveAgentSensorInfo": {
      "action": "receive",
      "title": "Receives agent sensor info",
      "channel": {
        "$ref": "#/channels/agentSensorInfo"
      },
      "summary": "Receives agent sensor info (role: leader)",
      "tags": [
        {
          "name": "leader"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/agentSensorInfo/messages/sensorInfo"
        }
      ]
    },
    "sendAgentDirectExecutionInfo": {
      "action": "send",
      "title": "Sends agent direct execution info",
      "channel": {
        "$ref": "#/channels/agentDirectExecutionInfo"
      },
      "summary": "Sends agent direct execution info (role: agent)",
      "tags": [
        {
          "name": "agent"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/agentDirectExecutionInfo/messages/directExecutionInfo"
        }
      ]
    },
    "receiveAgentDirectExecutionInfo": {
      "action": "receive",
      "title": "Receives agent direct execution info",
      "channel": {
        "$ref": "#/channels/agentDirectExecutionInfo"
      },
      "summary": "Receives agent direct execution info (role: leader)",
      "tags": [
        {
          "name": "leader"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/agentDirectExecutionInfo/messages/directExecutionInfo"
        }
      ]
    },
    "sendSwarmUnitHeartbeat": {
      "action": "send",
      "title": "Sends swarm unit heartbeat",
      "channel": {
        "$ref": "#/channels/swarmUnitHeartbeat"
      },
      "summary": "Sends swarm unit heartbeat (role: leader)",
      "tags": [
        {
          "name": "leader"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/swarmUnitHeartbeat/messages/heartbeat"
        }
      ]
    },
    "receiveSwarmUnitHeartbeat": {
      "action": "receive",
      "title": "Receives swarm unit heartbeat",
      "channel": {
        "$ref": "#/channels/swarmUnitHeartbeat"
      },
      "summary": "Receives swarm unit heartbeat (role: member)",
      "tags": [
        {
          "name": "member"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/swarmUnitHeartbeat/messages/heartbeat"
        }
      ]
    },
    "sendSwarmUnitSensorInfo": {
      "action": "send",
      "title": "Sends swarm unit sensor info",
      "channel": {
        "$ref": "#/channels/swarmUnitSensorInfo"
      },
      "summary": "Sends swarm unit sensor info (role: leader)",
      "tags": [
        {
          "name": "leader"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/swarmUnitSensorInfo/messages/sensorInfo"
        }
      ]
    },
    "sendSwarmUnitDirectExecutionInfo": {
      "action": "send",
      "title": "Sends swarm unit direct execution info",
      "channel": {
        "$ref": "#/channels/swarmUnitDirectExecutionInfo"
      },
      "summary": "Sends swarm unit direct execution info (role: leader)",
      "tags": [
        {
          "name": "leader"
        }
      ],
      "messages": [
        {
          "$ref": "#/channels/swarmUnitDirectExecutionInfo/messages/directExecutionInfo"
        }
      ]
    }
  },
  "components": {
    "securitySchemes": {
      "tls": {
        "type": "X509",
        "x-securityScheme": "tls",
        "description": "TLS client certificate for secure connection"
      }
    },
    "parameters": {
      "task-id": {
        "description": "UUID of the task (task-uuid) that the topic belongs to. Format: UUID.",
        "examples": [
          "1a2b3c4d-5e6f-4789-9abc-def012345678"
        ]
      },
      "agent-base-topic": {
        "description": "Full WARA-PS AgentBaseTopic of the addressed unit: {organization}/{category}/{domain}/{real_sim}/{agent_name}, see the AgentBaseTopic schema in waraps-api-declarations.json. For Swarm Unit channels it is the Swarm Unit's own topic, waraps/unit/virtual/{real_sim}/Swarm-{swarm-id}, where the Swarm Unit's agent-uuid equals the swarm-id; for member channels it is that member's topic."
      }
    },
    "channelBindings": {
      "SwarmMqttSettings": {
        "mqtt": {
          "qos": 1,
          "retain": false
        }
      },
      "PresenceMqttSettings": {
        "mqtt": {
          "qos": 0,
          "retain": false
        }
      },
      "SwarmSensorMqttSettings": {
        "mqtt": {
          "qos": 1
        }
      }
    },
    "messages": {
      "AdmissionRequest": {
        "payload": {
          "$ref": "#/components/schemas/AdmissionRequest"
        }
      },
      "AdmissionInvite": {
        "payload": {
          "$ref": "#/components/schemas/AdmissionInvite"
        }
      },
      "AdmissionReject": {
        "payload": {
          "$ref": "#/components/schemas/AdmissionReject"
        }
      },
      "ElectionCandidate": {
        "payload": {
          "$ref": "#/components/schemas/ElectionCandidate"
        }
      },
      "ElectionResult": {
        "payload": {
          "$ref": "#/components/schemas/ElectionResult"
        }
      },
      "SwarmRoster": {
        "payload": {
          "$ref": "#/components/schemas/SwarmRoster"
        }
      },
      "LeaderSignal": {
        "payload": {
          "$ref": "#/components/schemas/LeaderSignal"
        }
      },
      "SetFormationTaskCommand": {
        "payload": {
          "$ref": "#/components/schemas/SetFormationTaskCommand"
        }
      },
      "FormationState": {
        "payload": {
          "$ref": "#/components/schemas/FormationState"
        }
      },
      "FormationReference": {
        "payload": {
          "$ref": "#/components/schemas/FormationReference"
        }
      },
      "WaraMoveToCommand": {
        "payload": {
          "$ref": "#/components/schemas/WaraMoveToCommand"
        }
      },
      "WaraSearchAreaCommand": {
        "payload": {
          "$ref": "#/components/schemas/WaraSearchAreaCommand"
        }
      },
      "WaraMovePathCommand": {
        "payload": {
          "$ref": "#/components/schemas/WaraMovePathCommand"
        }
      },
      "TaskAnnouncement": {
        "payload": {
          "$ref": "#/components/schemas/TaskAnnouncement"
        },
        "examples": [
          {
            "name": "Sub-Task announcement",
            "summary": "The first Sub-Task of a Parent Task with agent-count 2",
            "payload": {
              "swarm-id": "2d5082f9-3dca-498c-9157-f152456f9179",
              "task-id": "7d1c2b3a-4e5f-4a69-8b7c-0d1e2f3a4b5c",
              "leader-id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
              "parent-task-id": "1a2b3c4d-5e6f-4789-9abc-def012345678",
              "agent-count": 2,
              "command": {
                "com-uuid": "9c8b7a6f-5e4d-4c3b-9a19-8f7e6d5c4b3a",
                "task-uuid": "7d1c2b3a-4e5f-4a69-8b7c-0d1e2f3a4b5c",
                "parent-task-uuid": "1a2b3c4d-5e6f-4789-9abc-def012345678",
                "parent-com-uuid": "5f3e2c1a-8b7d-4e6f-9a1b-2c3d4e5f6789",
                "command": "start-task",
                "execution-unit": "Swarm-2d5082f9-3dca-498c-9157-f152456f9179",
                "sender": "commander",
                "task": {
                  "name": "move-to",
                  "params": {
                    "waypoint": {
                      "latitude": 57.7611363,
                      "longitude": 16.6805011,
                      "altitude": 47.81
                    },
                    "speed": "standard",
                    "agent-count": 2
                  }
                }
              }
            }
          }
        ]
      },
      "TaskBid": {
        "payload": {
          "$ref": "#/components/schemas/TaskBid"
        }
      },
      "TaskAssignment": {
        "payload": {
          "$ref": "#/components/schemas/TaskAssignment"
        }
      },
      "ParentTaskDecision": {
        "payload": {
          "$ref": "#/components/schemas/ParentTaskDecision"
        },
        "examples": [
          {
            "name": "Commit",
            "summary": "Every Sub-Task is held; the held Sub-Tasks are released to run",
            "payload": {
              "swarm-id": "2d5082f9-3dca-498c-9157-f152456f9179",
              "parent-task-id": "1a2b3c4d-5e6f-4789-9abc-def012345678",
              "leader-id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
              "decision": "commit"
            }
          },
          {
            "name": "Release",
            "summary": "The Parent Round failed; every held Sub-Task is dropped",
            "payload": {
              "swarm-id": "2d5082f9-3dca-498c-9157-f152456f9179",
              "parent-task-id": "1a2b3c4d-5e6f-4789-9abc-def012345678",
              "leader-id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
              "decision": "release"
            }
          }
        ]
      },
      "WaraTaskResponse": {
        "payload": {
          "$ref": "#/components/schemas/WaraTaskResponse"
        },
        "examples": [
          {
            "name": "Parent Task running",
            "summary": "Relayed on the first accepted Sub-Task, listing the Sub-Tasks created so far",
            "payload": {
              "agent-uuid": "2d5082f9-3dca-498c-9157-f152456f9179",
              "com-uuid": "5f3e2c1a-8b7d-4e6f-9a1b-2c3d4e5f6789",
              "task-uuid": "1a2b3c4d-5e6f-4789-9abc-def012345678",
              "response": "running",
              "sub-task-uuids": [
                "7d1c2b3a-4e5f-4a69-8b7c-0d1e2f3a4b5c",
                "8e2d3c4b-5f60-4b7a-9c8d-1e2f3a4b5c6d"
              ]
            }
          },
          {
            "name": "Parent Task failed",
            "summary": "Too few Agents for agent-count",
            "payload": {
              "agent-uuid": "2d5082f9-3dca-498c-9157-f152456f9179",
              "com-uuid": "5f3e2c1a-8b7d-4e6f-9a1b-2c3d4e5f6789",
              "task-uuid": "1a2b3c4d-5e6f-4789-9abc-def012345678",
              "response": "failed",
              "response-to": "5f3e2c1a-8b7d-4e6f-9a1b-2c3d4e5f6789",
              "fail-reason": "insufficient-agents"
            }
          },
          {
            "name": "Parent Task failed on a Sub-Task",
            "summary": "A replacement Sub-Task failed too; failed-sub-task-uuid names it",
            "payload": {
              "agent-uuid": "2d5082f9-3dca-498c-9157-f152456f9179",
              "com-uuid": "5f3e2c1a-8b7d-4e6f-9a1b-2c3d4e5f6789",
              "task-uuid": "1a2b3c4d-5e6f-4789-9abc-def012345678",
              "response": "failed",
              "response-to": "5f3e2c1a-8b7d-4e6f-9a1b-2c3d4e5f6789",
              "fail-reason": "executor refused",
              "sub-task-uuids": [
                "7d1c2b3a-4e5f-4a69-8b7c-0d1e2f3a4b5c",
                "8e2d3c4b-5f60-4b7a-9c8d-1e2f3a4b5c6d"
              ],
              "failed-sub-task-uuid": "8e2d3c4b-5f60-4b7a-9c8d-1e2f3a4b5c6d"
            }
          }
        ]
      },
      "WaraTaskFeedback": {
        "payload": {
          "$ref": "#/components/schemas/WaraTaskFeedback"
        }
      },
      "TaskIngressCapacityFailureResponse": {
        "payload": {
          "$ref": "#/components/schemas/TaskIngressCapacityFailureResponse"
        }
      },
      "TaskIngressCapacityFailureFeedback": {
        "payload": {
          "$ref": "#/components/schemas/TaskIngressCapacityFailureFeedback"
        }
      },
      "TaskIngressWarmUpFailureResponse": {
        "payload": {
          "$ref": "#/components/schemas/TaskIngressWarmUpFailureResponse"
        }
      },
      "TaskIngressWarmUpFailureFeedback": {
        "payload": {
          "$ref": "#/components/schemas/TaskIngressWarmUpFailureFeedback"
        }
      },
      "WaraTaskSignal": {
        "payload": {
          "$ref": "#/components/schemas/WaraTaskSignal"
        }
      },
      "SwarmTaskSignal": {
        "payload": {
          "$ref": "#/components/schemas/SwarmTaskSignal"
        }
      },
      "SetSwarmIntentCommand": {
        "name": "set-swarm-intent",
        "title": "Set swarm intent",
        "summary": "Found, join or leave a Swarm at runtime",
        "description": "Standard start-task message for setting Swarm intent.",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/SetSwarmIntentCommand"
        },
        "examples": [
          {
            "name": "Found or join a Swarm",
            "summary": "A non-empty swarm-id sets the intent; the Agent then applies for Admission",
            "payload": {
              "com-uuid": "5f3e2c1a-8b7d-4e6f-9a1b-2c3d4e5f6789",
              "task-uuid": "1a2b3c4d-5e6f-4789-9abc-def012345678",
              "command": "start-task",
              "execution-unit": "SimUSV1",
              "sender": "operator",
              "task": {
                "name": "set-swarm-intent",
                "params": {
                  "swarm-id": "2d5082f9-3dca-498c-9157-f152456f9179"
                }
              }
            }
          },
          {
            "name": "Found a named Swarm",
            "summary": "swarm-name is only used when founding; later leaders carry it on the roster",
            "payload": {
              "com-uuid": "5f3e2c1a-8b7d-4e6f-9a1b-2c3d4e5f6789",
              "task-uuid": "1a2b3c4d-5e6f-4789-9abc-def012345678",
              "command": "start-task",
              "execution-unit": "SimUSV1",
              "sender": "operator",
              "task": {
                "name": "set-swarm-intent",
                "params": {
                  "swarm-id": "2d5082f9-3dca-498c-9157-f152456f9179",
                  "swarm-name": "Harbour patrol"
                }
              }
            }
          },
          {
            "name": "Leave the Swarm (Departure)",
            "summary": "An empty swarm-id clears the intent and republishes the membership sensor at once",
            "payload": {
              "com-uuid": "5f3e2c1a-8b7d-4e6f-9a1b-2c3d4e5f6789",
              "task-uuid": "1a2b3c4d-5e6f-4789-9abc-def012345678",
              "command": "start-task",
              "execution-unit": "SimUSV1",
              "sender": "operator",
              "task": {
                "name": "set-swarm-intent",
                "params": {
                  "swarm-id": ""
                }
              }
            }
          }
        ]
      },
      "SetSwarmIntentResponse": {
        "name": "response",
        "title": "Set swarm intent response",
        "summary": "Immediate answer to set-swarm-intent",
        "description": "Standard task-response message for set-swarm-intent.",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/WaraTaskResponse"
        },
        "examples": [
          {
            "name": "Accepted, now running",
            "summary": "Intent accepted",
            "payload": {
              "agent-uuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
              "com-uuid": "5f3e2c1a-8b7d-4e6f-9a1b-2c3d4e5f6789",
              "task-uuid": "1a2b3c4d-5e6f-4789-9abc-def012345678",
              "response": "running"
            }
          },
          {
            "name": "Rejected, invalid swarm-id",
            "summary": "swarm-id is not a UUID",
            "payload": {
              "agent-uuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
              "com-uuid": "5f3e2c1a-8b7d-4e6f-9a1b-2c3d4e5f6789",
              "task-uuid": "1a2b3c4d-5e6f-4789-9abc-def012345678",
              "response": "failed",
              "response-to": "5f3e2c1a-8b7d-4e6f-9a1b-2c3d4e5f6789",
              "fail-reason": "invalid swarm-id"
            }
          },
          {
            "name": "Rejected, other Swarm",
            "summary": "The Agent already holds intent for another Swarm",
            "payload": {
              "agent-uuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
              "com-uuid": "5f3e2c1a-8b7d-4e6f-9a1b-2c3d4e5f6789",
              "task-uuid": "1a2b3c4d-5e6f-4789-9abc-def012345678",
              "response": "failed",
              "response-to": "5f3e2c1a-8b7d-4e6f-9a1b-2c3d4e5f6789",
              "fail-reason": "swarm intent already set for swarm 7c9e6679-7425-40de-944b-e07fc1f90ae7"
            }
          }
        ]
      },
      "SetSwarmIntentFeedback": {
        "name": "feedback",
        "title": "Set swarm intent feedback",
        "summary": "Progress of set-swarm-intent",
        "description": "Standard task-feedback message for set-swarm-intent.",
        "contentType": "application/json",
        "payload": {
          "$ref": "#/components/schemas/WaraTaskFeedback"
        },
        "examples": [
          {
            "name": "Applying for Admission",
            "summary": "The Agent holds intent and waits for the Swarm Leader",
            "payload": {
              "agent-uuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
              "com-uuid": "5f3e2c1a-8b7d-4e6f-9a1b-2c3d4e5f6789",
              "task-uuid": "1a2b3c4d-5e6f-4789-9abc-def012345678",
              "status": "running"
            }
          },
          {
            "name": "Admitted",
            "summary": "The Agent is in the Swarm Roster",
            "payload": {
              "agent-uuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
              "com-uuid": "5f3e2c1a-8b7d-4e6f-9a1b-2c3d4e5f6789",
              "task-uuid": "1a2b3c4d-5e6f-4789-9abc-def012345678",
              "status": "finished"
            }
          },
          {
            "name": "Admission rejected",
            "summary": "The Swarm Leader rejected the application",
            "payload": {
              "agent-uuid": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
              "com-uuid": "5f3e2c1a-8b7d-4e6f-9a1b-2c3d4e5f6789",
              "task-uuid": "1a2b3c4d-5e6f-4789-9abc-def012345678",
              "status": "failed",
              "fail-reason": "missing-position-sensor"
            }
          }
        ]
      },
      "SwarmMembershipSensor": {
        "payload": {
          "$ref": "#/components/schemas/SwarmMembershipSensor"
        }
      },
      "SwarmSensorInfo": {
        "payload": {
          "$ref": "#/components/schemas/SwarmSensorInfo"
        }
      },
      "SwarmDirectExecutionInfo": {
        "payload": {
          "$ref": "#/components/schemas/SwarmDirectExecutionInfo"
        }
      },
      "AgentDirectExecutionInfo": {
        "payload": {
          "$ref": "#/components/schemas/AgentDirectExecutionInfo"
        }
      }
    },
    "schemas": {
      "AgentId": {
        "type": "string",
        "format": "uuid"
      },
      "SwarmId": {
        "type": "string",
        "format": "uuid"
      },
      "TaskId": {
        "type": "string",
        "format": "uuid"
      },
      "AgentBaseTopic": {
        "type": "string",
        "description": "The exact WARA-PS AgentBaseTopic used to reach one member's standard declarations, sensors, and task execution topics."
      },
      "AgentSensorName": {
        "type": "string",
        "enum": [
          "position",
          "speed",
          "heading",
          "course",
          "battery_status",
          "energy_level",
          "waypoints",
          "control_system_version",
          "cargo",
          "armable",
          "mode",
          "state",
          "ip_address",
          "videoserver_url",
          "swarm_membership",
          "election",
          "members",
          "formation",
          "reference",
          "task"
        ]
      },
      "SwarmSensorInfo": {
        "type": "object",
        "required": [
          "sensor-data-provided",
          "name",
          "rate",
          "stamp",
          "type"
        ],
        "properties": {
          "sensor-data-provided": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentSensorName"
            }
          },
          "name": {
            "type": "string"
          },
          "rate": {
            "type": "number"
          },
          "stamp": {
            "type": "number"
          },
          "type": {
            "const": "SensorInfo"
          }
        }
      },
      "AgentDirectExecutionInfo": {
        "type": "object",
        "required": [
          "tasks-available",
          "tasks-executing",
          "name",
          "rate",
          "stamp",
          "type"
        ],
        "properties": {
          "tasks-available": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "$ref": "./waraps-api-declarations.json#/components/schemas/AvailableTasks"
                },
                "signals": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "$abort",
                      "$enough",
                      "$pause",
                      "$continue"
                    ]
                  }
                }
              }
            }
          },
          "tasks-executing": {
            "type": "array",
            "description": "Executing task entries, including the Sub-Task parent identifiers defined below.",
            "items": {
              "allOf": [
                {
                  "$ref": "./waraps-api-declarations.json#/components/schemas/ExecutingTask"
                },
                {
                  "type": "object",
                  "properties": {
                    "parent-task-uuid": {
                      "$ref": "#/components/schemas/TaskId",
                      "description": "Parent Task UUID associated with this Sub-Task."
                    },
                    "parent-com-uuid": {
                      "$ref": "#/components/schemas/TaskId",
                      "description": "Correlation UUID of the Parent Task command."
                    }
                  }
                }
              ]
            }
          },
          "name": {
            "type": "string"
          },
          "rate": {
            "type": "number"
          },
          "stamp": {
            "type": "number"
          },
          "type": {
            "const": "DirectExecutionInfo"
          }
        }
      },
      "SwarmDirectExecutionInfo": {
        "allOf": [
          {
            "$ref": "#/components/schemas/AgentDirectExecutionInfo"
          },
          {
            "type": "object",
            "properties": {
              "tasks-executing": {
                "description": "Executing task entries with an agent field identifying the executing Agent.",
                "items": {
                  "type": "object",
                  "required": [
                    "agent"
                  ],
                  "properties": {
                    "agent": {
                      "$ref": "#/components/schemas/AgentId",
                      "description": "ID of the Agent associated with this task entry."
                    }
                  }
                }
              }
            }
          }
        ]
      },
      "SwarmMembershipSensor": {
        "type": "object",
        "required": [
          "swarm-id",
          "role"
        ],
        "properties": {
          "swarm-id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "role": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "leader",
                  "member"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "swarm-name": {
            "type": "string",
            "maxLength": 64,
            "description": "Optional human-readable Swarm name."
          }
        }
      },
      "GeoPoint": {
        "type": "object",
        "required": [
          "latitude",
          "longitude",
          "altitude"
        ],
        "properties": {
          "latitude": {
            "type": "number"
          },
          "longitude": {
            "type": "number"
          },
          "altitude": {
            "type": "number"
          }
        }
      },
      "AdmissionRequest": {
        "type": "object",
        "required": [
          "com-uuid",
          "command",
          "execution-unit",
          "sender",
          "swarm-id",
          "agent-id",
          "agent-base-topic"
        ],
        "properties": {
          "com-uuid": {
            "type": "string",
            "format": "uuid"
          },
          "command": {
            "const": "admission-request"
          },
          "execution-unit": {
            "type": "string"
          },
          "sender": {
            "$ref": "#/components/schemas/AgentId"
          },
          "swarm-id": {
            "$ref": "#/components/schemas/SwarmId"
          },
          "agent-id": {
            "$ref": "#/components/schemas/AgentId"
          },
          "agent-base-topic": {
            "$ref": "#/components/schemas/AgentBaseTopic"
          }
        }
      },
      "AdmissionInvite": {
        "type": "object",
        "required": [
          "agent-uuid",
          "com-uuid",
          "response-to",
          "response",
          "swarm-id",
          "agent-id",
          "agent-base-topic",
          "leader-id"
        ],
        "properties": {
          "agent-uuid": {
            "$ref": "#/components/schemas/AgentId"
          },
          "com-uuid": {
            "type": "string",
            "format": "uuid"
          },
          "response-to": {
            "type": "string",
            "format": "uuid"
          },
          "response": {
            "const": "invite"
          },
          "swarm-id": {
            "$ref": "#/components/schemas/SwarmId"
          },
          "agent-id": {
            "$ref": "#/components/schemas/AgentId"
          },
          "agent-base-topic": {
            "$ref": "#/components/schemas/AgentBaseTopic"
          },
          "leader-id": {
            "$ref": "#/components/schemas/AgentId"
          }
        }
      },
      "AdmissionReject": {
        "type": "object",
        "required": [
          "agent-uuid",
          "com-uuid",
          "response-to",
          "response",
          "swarm-id",
          "agent-id",
          "fail-reason"
        ],
        "properties": {
          "agent-uuid": {
            "$ref": "#/components/schemas/AgentId"
          },
          "com-uuid": {
            "type": "string",
            "format": "uuid"
          },
          "response-to": {
            "type": "string",
            "format": "uuid"
          },
          "response": {
            "const": "reject"
          },
          "swarm-id": {
            "$ref": "#/components/schemas/SwarmId"
          },
          "agent-id": {
            "$ref": "#/components/schemas/AgentId"
          },
          "fail-reason": {
            "type": "string",
            "description": "Machine-readable rejection code such as missing-position-sensor."
          }
        }
      },
      "ElectionCandidate": {
        "type": "object",
        "required": [
          "swarm-id",
          "agent-id",
          "election-round"
        ],
        "properties": {
          "swarm-id": {
            "$ref": "#/components/schemas/SwarmId"
          },
          "agent-id": {
            "$ref": "#/components/schemas/AgentId"
          },
          "election-round": {
            "type": "integer",
            "minimum": 1
          },
          "can-lead": {
            "type": "boolean"
          }
        }
      },
      "ElectionResult": {
        "type": "object",
        "required": [
          "swarm-id",
          "leader-id",
          "election-round"
        ],
        "properties": {
          "swarm-id": {
            "$ref": "#/components/schemas/SwarmId"
          },
          "leader-id": {
            "$ref": "#/components/schemas/AgentId"
          },
          "election-round": {
            "type": "integer",
            "minimum": 1
          }
        }
      },
      "RosterEntry": {
        "type": "object",
        "required": [
          "agent-id",
          "agent-base-topic",
          "role"
        ],
        "properties": {
          "agent-id": {
            "$ref": "#/components/schemas/AgentId"
          },
          "agent-base-topic": {
            "$ref": "#/components/schemas/AgentBaseTopic"
          },
          "role": {
            "type": "string",
            "enum": [
              "leader",
              "member"
            ]
          }
        }
      },
      "SwarmRoster": {
        "type": "object",
        "required": [
          "swarm-id",
          "leader-id",
          "members"
        ],
        "properties": {
          "swarm-id": {
            "$ref": "#/components/schemas/SwarmId"
          },
          "leader-id": {
            "$ref": "#/components/schemas/AgentId"
          },
          "members": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RosterEntry"
            }
          },
          "swarm-name": {
            "type": "string",
            "maxLength": 64,
            "description": "Optional human-readable Swarm name."
          }
        }
      },
      "LeaderSignal": {
        "type": "object",
        "required": [
          "leader-id",
          "leader-base-topic",
          "since"
        ],
        "properties": {
          "leader-id": {
            "$ref": "#/components/schemas/AgentId"
          },
          "leader-base-topic": {
            "$ref": "#/components/schemas/AgentBaseTopic"
          },
          "since": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SetFormationTaskCommand": {
        "type": "object",
        "required": [
          "task"
        ],
        "allOf": [
          {
            "$ref": "./waraps-api-tasks.json#/components/schemas/StartTaskBase"
          }
        ],
        "properties": {
          "task": {
            "type": "object",
            "required": [
              "name",
              "params"
            ],
            "properties": {
              "name": {
                "const": "set-formation"
              },
              "params": {
                "type": "object",
                "required": [
                  "type"
                ],
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "cube",
                      "none"
                    ]
                  },
                  "spacing-m": {
                    "type": "number",
                    "minimum": 30,
                    "maximum": 1000
                  },
                  "swarm": {
                    "$ref": "#/components/schemas/SwarmFlag"
                  },
                  "agent-count": {
                    "$ref": "#/components/schemas/AgentCount"
                  }
                },
                "allOf": [
                  {
                    "if": {
                      "properties": {
                        "type": {
                          "const": "cube"
                        }
                      }
                    },
                    "then": {
                      "required": [
                        "spacing-m"
                      ]
                    }
                  }
                ]
              }
            }
          }
        }
      },
      "FormationState": {
        "type": "object",
        "required": [
          "swarm-id",
          "command-id",
          "type",
          "leader-id",
          "applied-at"
        ],
        "properties": {
          "swarm-id": {
            "$ref": "#/components/schemas/SwarmId"
          },
          "command-id": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TaskId"
              },
              {
                "const": "default"
              }
            ]
          },
          "type": {
            "type": "string",
            "enum": [
              "cube",
              "none"
            ]
          },
          "spacing-m": {
            "type": "number",
            "minimum": 30,
            "maximum": 1000
          },
          "leader-id": {
            "$ref": "#/components/schemas/AgentId"
          },
          "applied-at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "allOf": [
          {
            "if": {
              "properties": {
                "type": {
                  "const": "cube"
                }
              }
            },
            "then": {
              "required": [
                "spacing-m"
              ]
            }
          }
        ]
      },
      "FormationReference": {
        "type": "object",
        "required": [
          "swarm-id",
          "leader-id",
          "position",
          "published-at"
        ],
        "properties": {
          "swarm-id": {
            "$ref": "#/components/schemas/SwarmId"
          },
          "leader-id": {
            "$ref": "#/components/schemas/AgentId"
          },
          "position": {
            "allOf": [
              {
                "$ref": "#/components/schemas/GeoPoint"
              }
            ],
            "description": "Geographic formation anchor position."
          },
          "speed": {
            "type": "number",
            "minimum": 0,
            "description": "Optional leader speed in metres per second."
          },
          "published-at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SwarmFlag": {
        "type": "boolean",
        "default": false,
        "description": "Optional params.swarm, allowed on any task. Each task name decides what it means; a task with no Swarm meaning ignores it. Absent or false behaves as if the flag did not exist. A non-boolean value fails the task with 'invalid task payload'. On a move-to or move-path, true makes it a Swarm Move, flown by the Swarm Leader for the whole Swarm."
      },
      "AgentCount": {
        "type": "integer",
        "minimum": 1,
        "default": 1,
        "description": "Optional params.agent-count, allowed on any task: how many Agents the task asks for; absent behaves as 1. A non-integer, a value below 1, or a value combined with params.swarm true fails with 'invalid-agent-count'; above 1 on a task name that gives it no meaning fails with 'agent-count-unsupported'; above the Swarm roster size, or above 1 on a standalone Agent, fails with 'insufficient-agents'; a search-area asking for more Agents than its area has lawnmower tracks fails with 'area-too-small'. Above 1, a move-to or move-path runs as a Parent Task of that many Sub-Tasks, each flying the whole move-path route, and a search-area is split into that many parts."
      },
      "WaraMoveToCommand": {
        "allOf": [
          {
            "$ref": "./waraps-api-tasks.json#/components/schemas/MoveToPayload"
          },
          {
            "type": "object",
            "properties": {
              "task": {
                "type": "object",
                "properties": {
                  "params": {
                    "type": "object",
                    "properties": {
                      "swarm": {
                        "$ref": "#/components/schemas/SwarmFlag"
                      },
                      "agent-count": {
                        "$ref": "#/components/schemas/AgentCount"
                      }
                    }
                  }
                }
              },
              "parent-task-uuid": {
                "$ref": "#/components/schemas/TaskId",
                "description": "Parent Task UUID for this Sub-Task."
              },
              "parent-com-uuid": {
                "$ref": "#/components/schemas/TaskId",
                "description": "Correlation UUID of the Parent Task command."
              }
            }
          }
        ]
      },
      "WaraSearchAreaCommand": {
        "allOf": [
          {
            "$ref": "./waraps-api-tasks.json#/components/schemas/SearchAreaPayload"
          },
          {
            "type": "object",
            "properties": {
              "task": {
                "type": "object",
                "properties": {
                  "params": {
                    "type": "object",
                    "properties": {
                      "swarm": {
                        "$ref": "#/components/schemas/SwarmFlag"
                      },
                      "agent-count": {
                        "$ref": "#/components/schemas/AgentCount"
                      }
                    }
                  }
                }
              },
              "parent-task-uuid": {
                "$ref": "#/components/schemas/TaskId",
                "description": "Parent Task UUID for this Sub-Task."
              },
              "parent-com-uuid": {
                "$ref": "#/components/schemas/TaskId",
                "description": "Correlation UUID of the Parent Task command."
              }
            }
          }
        ]
      },
      "WaraMovePathCommand": {
        "allOf": [
          {
            "$ref": "./waraps-api-tasks.json#/components/schemas/MovePathPayload"
          },
          {
            "type": "object",
            "properties": {
              "task": {
                "type": "object",
                "properties": {
                  "params": {
                    "type": "object",
                    "properties": {
                      "swarm": {
                        "$ref": "#/components/schemas/SwarmFlag"
                      },
                      "agent-count": {
                        "$ref": "#/components/schemas/AgentCount"
                      }
                    }
                  }
                }
              },
              "parent-task-uuid": {
                "$ref": "#/components/schemas/TaskId",
                "description": "Parent Task UUID for this Sub-Task."
              },
              "parent-com-uuid": {
                "$ref": "#/components/schemas/TaskId",
                "description": "Correlation UUID of the Parent Task command."
              }
            }
          }
        ]
      },
      "WaraTaskResponse": {
        "allOf": [
          {
            "$ref": "./waraps-api-tasks.json#/components/schemas/TaskResponsePayload"
          },
          {
            "type": "object",
            "properties": {
              "sub-task-uuids": {
                "$ref": "#/components/schemas/SubTaskUuids"
              },
              "failed-sub-task-uuid": {
                "$ref": "#/components/schemas/FailedSubTaskUuid"
              }
            }
          }
        ]
      },
      "SubTaskUuids": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/TaskId"
        },
        "description": "Task UUIDs of Sub-Tasks associated with this Parent Task."
      },
      "WaraTaskFeedback": {
        "allOf": [
          {
            "$ref": "./waraps-api-tasks.json#/components/schemas/TaskFeedbackPayload"
          },
          {
            "type": "object",
            "properties": {
              "sub-task-uuids": {
                "$ref": "#/components/schemas/SubTaskUuids"
              },
              "failed-sub-task-uuid": {
                "$ref": "#/components/schemas/FailedSubTaskUuid"
              }
            }
          }
        ]
      },
      "FailedSubTaskUuid": {
        "$ref": "#/components/schemas/TaskId",
        "description": "Task UUID of the Sub-Task associated with this Parent Task failure."
      },
      "WaraTaskSignal": {
        "$ref": "./waraps-api-tasks.json#/components/schemas/TaskSignalPayload"
      },
      "TaskAnnouncement": {
        "type": "object",
        "required": [
          "swarm-id",
          "task-id",
          "command",
          "leader-id"
        ],
        "properties": {
          "swarm-id": {
            "$ref": "#/components/schemas/SwarmId"
          },
          "task-id": {
            "$ref": "#/components/schemas/TaskId"
          },
          "command": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/WaraMoveToCommand"
              },
              {
                "$ref": "#/components/schemas/WaraSearchAreaCommand"
              },
              {
                "$ref": "#/components/schemas/WaraMovePathCommand"
              }
            ]
          },
          "leader-id": {
            "$ref": "#/components/schemas/AgentId"
          },
          "parent-task-id": {
            "$ref": "#/components/schemas/TaskId",
            "description": "Present when the announced task is a Sub-Task: the uuid of its Parent Task."
          },
          "agent-count": {
            "$ref": "#/components/schemas/AgentCount",
            "description": "Parent Task agent-count."
          }
        }
      },
      "TaskBid": {
        "type": "object",
        "required": [
          "swarm-id",
          "task-id",
          "agent-id",
          "cost"
        ],
        "properties": {
          "swarm-id": {
            "$ref": "#/components/schemas/SwarmId"
          },
          "task-id": {
            "$ref": "#/components/schemas/TaskId"
          },
          "agent-id": {
            "$ref": "#/components/schemas/AgentId"
          },
          "cost": {
            "type": "number",
            "minimum": 0
          },
          "estimated-distance": {
            "type": "number",
            "minimum": 0
          }
        }
      },
      "ParentTaskDecision": {
        "type": "object",
        "required": [
          "swarm-id",
          "parent-task-id",
          "leader-id",
          "decision"
        ],
        "properties": {
          "swarm-id": {
            "$ref": "#/components/schemas/SwarmId"
          },
          "parent-task-id": {
            "$ref": "#/components/schemas/TaskId",
            "description": "The Parent Task's uuid; equals the task-id in the topic."
          },
          "leader-id": {
            "$ref": "#/components/schemas/AgentId"
          },
          "decision": {
            "type": "string",
            "enum": [
              "commit",
              "release"
            ],
            "description": "Parent-task allocation decision."
          }
        }
      },
      "TaskAssignment": {
        "type": "object",
        "required": [
          "swarm-id",
          "task-id",
          "leader-id",
          "status"
        ],
        "properties": {
          "swarm-id": {
            "$ref": "#/components/schemas/SwarmId"
          },
          "task-id": {
            "$ref": "#/components/schemas/TaskId"
          },
          "leader-id": {
            "$ref": "#/components/schemas/AgentId"
          },
          "executor-id": {
            "$ref": "#/components/schemas/AgentId"
          },
          "status": {
            "type": "string",
            "enum": [
              "assigned",
              "no-bid",
              "failed"
            ]
          },
          "failure-reason": {
            "type": "string",
            "enum": [
              "no-bid",
              "missing executor topic",
              "executor acknowledgement timeout",
              "executor refused",
              "task aborted by commander"
            ],
            "description": "Present when status is no-bid or failed."
          }
        },
        "allOf": [
          {
            "if": {
              "properties": {
                "status": {
                  "const": "assigned"
                }
              }
            },
            "then": {
              "required": [
                "executor-id"
              ]
            }
          },
          {
            "if": {
              "properties": {
                "status": {
                  "enum": [
                    "no-bid",
                    "failed"
                  ]
                }
              }
            },
            "then": {
              "required": [
                "failure-reason"
              ]
            }
          }
        ]
      },
      "TaskIngressCapacityFailureResponse": {
        "type": "object",
        "required": [
          "agent-uuid",
          "com-uuid",
          "response-to",
          "task-uuid",
          "response",
          "fail-reason"
        ],
        "properties": {
          "agent-uuid": {
            "$ref": "#/components/schemas/AgentId"
          },
          "com-uuid": {
            "type": "string",
            "format": "uuid",
            "description": "The original command correlation."
          },
          "response-to": {
            "type": "string",
            "format": "uuid",
            "description": "Equal to the original com-uuid."
          },
          "task-uuid": {
            "$ref": "#/components/schemas/TaskId"
          },
          "response": {
            "const": "failed"
          },
          "fail-reason": {
            "const": "pending task capacity exceeded"
          }
        }
      },
      "TaskIngressWarmUpFailureResponse": {
        "type": "object",
        "required": [
          "agent-uuid",
          "com-uuid",
          "response-to",
          "task-uuid",
          "response",
          "fail-reason"
        ],
        "properties": {
          "agent-uuid": {
            "$ref": "#/components/schemas/AgentId"
          },
          "com-uuid": {
            "type": "string",
            "format": "uuid",
            "description": "The original command correlation."
          },
          "response-to": {
            "type": "string",
            "format": "uuid",
            "description": "Equal to the original com-uuid."
          },
          "task-uuid": {
            "$ref": "#/components/schemas/TaskId"
          },
          "response": {
            "const": "failed"
          },
          "fail-reason": {
            "const": "leader warming up"
          }
        }
      },
      "TaskIngressCapacityFailureFeedback": {
        "type": "object",
        "required": [
          "agent-uuid",
          "com-uuid",
          "task-uuid",
          "status",
          "fail-reason"
        ],
        "properties": {
          "agent-uuid": {
            "$ref": "#/components/schemas/AgentId"
          },
          "com-uuid": {
            "type": "string",
            "format": "uuid",
            "description": "The original command correlation."
          },
          "task-uuid": {
            "$ref": "#/components/schemas/TaskId"
          },
          "status": {
            "const": "failed"
          },
          "fail-reason": {
            "const": "pending task capacity exceeded"
          }
        }
      },
      "TaskIngressWarmUpFailureFeedback": {
        "type": "object",
        "required": [
          "agent-uuid",
          "com-uuid",
          "task-uuid",
          "status",
          "fail-reason"
        ],
        "properties": {
          "agent-uuid": {
            "$ref": "#/components/schemas/AgentId"
          },
          "com-uuid": {
            "type": "string",
            "format": "uuid",
            "description": "The original command correlation."
          },
          "task-uuid": {
            "$ref": "#/components/schemas/TaskId"
          },
          "status": {
            "const": "failed"
          },
          "fail-reason": {
            "const": "leader warming up"
          }
        }
      },
      "SwarmTaskSignal": {
        "type": "object",
        "required": [
          "swarm-id",
          "task-id",
          "signal"
        ],
        "properties": {
          "swarm-id": {
            "$ref": "#/components/schemas/SwarmId"
          },
          "task-id": {
            "$ref": "#/components/schemas/TaskId"
          },
          "signal": {
            "$ref": "#/components/schemas/WaraTaskSignal"
          }
        }
      },
      "SetSwarmIntentCommand": {
        "type": "object",
        "description": "Standard start-task envelope (StartTaskBase) whose task is set-swarm-intent, sent to the Agent's own exec/command. execution-unit must name the addressed Agent.",
        "required": [
          "task"
        ],
        "allOf": [
          {
            "$ref": "./waraps-api-tasks.json#/components/schemas/StartTaskBase"
          }
        ],
        "properties": {
          "task": {
            "type": "object",
            "description": "The set-swarm-intent task payload.",
            "required": [
              "name",
              "params"
            ],
            "properties": {
              "name": {
                "const": "set-swarm-intent",
                "description": "Task name."
              },
              "params": {
                "type": "object",
                "description": "Swarm intent parameters.",
                "required": [
                  "swarm-id"
                ],
                "properties": {
                  "swarm-id": {
                    "anyOf": [
                      {
                        "$ref": "#/components/schemas/SwarmId"
                      },
                      {
                        "type": "string",
                        "maxLength": 0
                      }
                    ],
                    "description": "Swarm UUID, or an empty string.",
                    "examples": [
                      "2d5082f9-3dca-498c-9157-f152456f9179",
                      ""
                    ]
                  },
                  "swarm-name": {
                    "type": "string",
                    "maxLength": 64,
                    "description": "Optional human-readable Swarm name, maximum 64 characters.",
                    "examples": [
                      "Harbour patrol"
                    ]
                  },
                  "swarm": {
                    "$ref": "#/components/schemas/SwarmFlag"
                  },
                  "agent-count": {
                    "$ref": "#/components/schemas/AgentCount"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "x-upstream-waraps-v1.1.0": {
    "declarations": {
      "heartbeat": "./waraps-api-declarations.json#/components/messages/HeartbeatMessage",
      "sensor-info": "./waraps-api-declarations.json#/components/messages/SensorInfoMessage",
      "direct-execution-info": "./waraps-api-declarations.json#/components/messages/DirectExecutionInfoMessage"
    },
    "sensors": {
      "position": "./waraps-api-sensors.json#/components/messages/PositionSensorMessage",
      "energy-level": "./waraps-api-sensors.json#/components/messages/EnergyLevelSensorMessage"
    },
    "task-execution": {
      "move-to": "./waraps-api-tasks.json#/components/messages/MoveToTaskMessage",
      "response": "./waraps-api-tasks.json#/components/messages/TaskResponseMessage",
      "feedback": "./waraps-api-tasks.json#/components/messages/TaskFeedbackMessage",
      "signal": "./waraps-api-tasks.json#/components/messages/SignalMessage"
    }
  },
  "x-swarm-sensor-interval-seconds": 1
}
