{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://weverlabs.com/schemas/agent-recovery-request.schema.json",
  "title": "Wever Labs Agent Recovery Request",
  "description": "Public-safe request shape for recovering a paused or partial paid agent task without creating a blind duplicate run.",
  "type": "object",
  "required": [
    "object_type",
    "exception_id",
    "agent_task_run_id",
    "requested_tool",
    "recovery_action",
    "submitted_by",
    "submitted_at"
  ],
  "properties": {
    "object_type": {
      "const": "agent_recovery_request"
    },
    "exception_id": {
      "type": "string"
    },
    "agent_task_run_id": {
      "type": "string"
    },
    "requested_tool": {
      "type": "string",
      "enum": [
        "packetops",
        "distributionops",
        "tokenops",
        "wever_labs_os"
      ]
    },
    "recovery_action": {
      "type": "string",
      "enum": [
        "add_evidence",
        "retry_callback",
        "rerun_tool_step",
        "request_manual_review",
        "cancel_and_close",
        "convert_to_new_work_order"
      ]
    },
    "submitted_by": {
      "type": "string"
    },
    "submitted_at": {
      "type": "string",
      "format": "date-time"
    },
    "new_evidence_items": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "file_manifest": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "callback_url": {
      "type": "string",
      "format": "uri"
    },
    "operator_note": {
      "type": "string"
    },
    "requested_result": {
      "type": "string"
    },
    "credit_policy": {
      "type": "string",
      "enum": [
        "no_additional_debit",
        "estimate_before_debit",
        "debit_existing_entitlement",
        "requires_new_quote"
      ]
    }
  },
  "additionalProperties": true
}
