{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://weverlabs.com/schemas/agent-replay-package.schema.json",
  "title": "Wever Labs Agent Replay Package",
  "description": "Public-safe replay package for continuing or rerunning a paid agent task from a known state after an exception has been reviewed.",
  "type": "object",
  "required": [
    "object_type",
    "replay_package_id",
    "agent_task_run_id",
    "exception_id",
    "requested_tool",
    "replay_status",
    "created_at"
  ],
  "properties": {
    "object_type": {
      "const": "agent_replay_package"
    },
    "replay_package_id": {
      "type": "string"
    },
    "agent_task_run_id": {
      "type": "string"
    },
    "exception_id": {
      "type": "string"
    },
    "requested_tool": {
      "type": "string",
      "enum": [
        "packetops",
        "distributionops",
        "tokenops",
        "wever_labs_os"
      ]
    },
    "replay_status": {
      "type": "string",
      "enum": [
        "not_ready",
        "ready",
        "queued",
        "replayed",
        "closed"
      ]
    },
    "resume_from_state": {
      "type": "string"
    },
    "approved_recovery_action": {
      "type": "string"
    },
    "safe_to_replay": {
      "type": "boolean"
    },
    "credit_debit_policy": {
      "type": "string",
      "enum": [
        "no_additional_debit",
        "meter_delta_only",
        "requires_new_credit",
        "manual_review"
      ]
    },
    "included_context": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "excluded_context": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "ledger_url": {
      "type": "string",
      "format": "uri"
    },
    "result_url": {
      "type": "string",
      "format": "uri"
    },
    "callback_payload_url": {
      "type": "string",
      "format": "uri"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "additionalProperties": true
}
