{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://weverlabs.com/schemas/tokenops-controlled-pilot-execution.schema.json",
  "title": "TokenOps Controlled Pilot Execution",
  "type": "object",
  "required": [
    "schema_version",
    "pilot_id",
    "tool",
    "execution_mode",
    "task_token",
    "work_order_id",
    "callback_url"
  ],
  "properties": {
    "schema_version": {
      "type": "string",
      "const": "1.0.0"
    },
    "pilot_id": {
      "type": "string"
    },
    "tool": {
      "type": "string",
      "const": "tokenops"
    },
    "execution_mode": {
      "type": "string",
      "enum": [
        "controlled_pilot"
      ]
    },
    "agent_id": {
      "type": "string"
    },
    "client_id": {
      "type": "string"
    },
    "task_token": {
      "type": "string"
    },
    "work_order_id": {
      "type": "string"
    },
    "execution_binding_id": {
      "type": "string"
    },
    "tool_command_id": {
      "type": "string"
    },
    "provider_confirmation_id": {
      "type": "string"
    },
    "credit_funding_event_id": {
      "type": "string"
    },
    "result_contract_id": {
      "type": "string"
    },
    "callback_url": {
      "type": "string",
      "format": "uri"
    },
    "evidence_manifest_url": {
      "type": "string",
      "format": "uri"
    },
    "runtime_state": {
      "type": "string",
      "enum": [
        "accepted",
        "validated",
        "execution_created",
        "operating",
        "result_ready",
        "callback_delivered",
        "ready_for_operator_review",
        "failed",
        "replay_ready"
      ]
    },
    "proof_requirements": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "pilot_controls": {
      "type": "object",
      "additionalProperties": true
    },
    "requested_output": {
      "type": "object",
      "additionalProperties": true
    }
  },
  "additionalProperties": true
}
