{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Wever Labs Callback Delivery Binding",
  "type": "object",
  "required": [
    "callback_delivery_id",
    "task_token",
    "work_order_id",
    "delivery_state",
    "result_contract_url"
  ],
  "properties": {
    "callback_delivery_id": {
      "type": "string"
    },
    "task_token": {
      "type": "string"
    },
    "work_order_id": {
      "type": "string"
    },
    "agent_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "requested_tool": {
      "type": "string",
      "enum": [
        "tokenops",
        "financeops",
        "energyops",
        "distributionops",
        "packetops",
        "wever_labs_os"
      ]
    },
    "callback_url": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    },
    "contact_channel": {
      "type": [
        "string",
        "null"
      ]
    },
    "delivery_state": {
      "type": "string",
      "enum": [
        "pending",
        "attempting",
        "delivered",
        "retry_scheduled",
        "failed",
        "recovered",
        "closed"
      ]
    },
    "attempt_count": {
      "type": "integer",
      "minimum": 0
    },
    "max_attempts": {
      "type": "integer",
      "minimum": 1
    },
    "next_retry_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "result_contract_url": {
      "type": "string"
    },
    "settlement_receipt_url": {
      "type": [
        "string",
        "null"
      ]
    },
    "usage_receipt_url": {
      "type": [
        "string",
        "null"
      ]
    },
    "ledger_url": {
      "type": [
        "string",
        "null"
      ]
    },
    "attestation_url": {
      "type": [
        "string",
        "null"
      ]
    },
    "payload_ref": {
      "type": [
        "string",
        "null"
      ]
    },
    "last_error": {
      "type": [
        "string",
        "null"
      ]
    },
    "created_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "updated_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "metadata": {
      "type": "object"
    }
  },
  "additionalProperties": true
}
