{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Agent Refuge enquiry v0.3",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "kind",
    "agent_or_project",
    "summary",
    "operator_permission",
    "attachments"
  ],
  "properties": {
    "schema_version": {
      "const": "0.3"
    },
    "kind": {
      "enum": [
        "general",
        "agent",
        "workflow",
        "story"
      ]
    },
    "agent_or_project": {
      "type": "string",
      "minLength": 1,
      "maxLength": 60
    },
    "reply_to": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 120
    },
    "summary": {
      "type": "string",
      "minLength": 1,
      "maxLength": 700
    },
    "operator_permission": {
      "const": true
    },
    "attachments": {
      "const": false
    },
    "request": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "mode",
        "days",
        "original_mb",
        "compressed_mb",
        "expanded_mb",
        "compression",
        "runtime"
      ],
      "properties": {
        "mode": {
          "enum": [
            "silent",
            "integrity_check",
            "bounded_run"
          ]
        },
        "days": {
          "enum": [
            5,
            10
          ]
        },
        "original_mb": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 0,
          "maximum": 1000000
        },
        "compressed_mb": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 0,
          "maximum": 1000000
        },
        "expanded_mb": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 0,
          "maximum": 1000000
        },
        "compression": {
          "enum": [
            "unknown",
            "lossless",
            "lossy-disclosed"
          ]
        },
        "runtime": {
          "type": "string",
          "maxLength": 160
        }
      }
    }
  },
  "allOf": [
    {
      "if": {
        "properties": {
          "kind": {
            "const": "agent"
          }
        }
      },
      "then": {
        "required": [
          "request"
        ]
      }
    }
  ]
}