{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://xcodebuildmcp.com/schemas/structured-output/xcodebuildmcp.output.ui-action-result/1.schema.json",
  "type": "object",
  "additionalProperties": false,
  "allOf": [
    {
      "$ref": "https://xcodebuildmcp.com/schemas/structured-output/_defs/common.schema.json#/$defs/errorConsistency"
    }
  ],
  "properties": {
    "schema": {
      "const": "xcodebuildmcp.output.ui-action-result"
    },
    "schemaVersion": {
      "const": "1"
    },
    "didError": {
      "type": "boolean"
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "data": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "summary": {
          "$ref": "https://xcodebuildmcp.com/schemas/structured-output/_defs/common.schema.json#/$defs/statusSummary"
        },
        "action": {
          "oneOf": [
            {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "type": {
                  "const": "tap"
                },
                "x": {
                  "type": "number"
                },
                "y": {
                  "type": "number"
                },
                "id": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                }
              },
              "required": [
                "type"
              ]
            },
            {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "type": {
                  "const": "swipe"
                },
                "from": {
                  "$ref": "https://xcodebuildmcp.com/schemas/structured-output/_defs/common.schema.json#/$defs/point"
                },
                "to": {
                  "$ref": "https://xcodebuildmcp.com/schemas/structured-output/_defs/common.schema.json#/$defs/point"
                },
                "durationSeconds": {
                  "type": "number",
                  "minimum": 0
                }
              },
              "required": [
                "type"
              ]
            },
            {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "type": {
                  "const": "touch"
                },
                "event": {
                  "type": "string"
                },
                "x": {
                  "type": "number"
                },
                "y": {
                  "type": "number"
                }
              },
              "required": [
                "type"
              ]
            },
            {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "type": {
                  "const": "long-press"
                },
                "x": {
                  "type": "number"
                },
                "y": {
                  "type": "number"
                },
                "durationMs": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "required": [
                "type",
                "x",
                "y",
                "durationMs"
              ]
            },
            {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "type": {
                  "const": "button"
                },
                "button": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "button"
              ]
            },
            {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "type": {
                  "const": "gesture"
                },
                "gesture": {
                  "type": "string"
                }
              },
              "required": [
                "type",
                "gesture"
              ]
            },
            {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "type": {
                  "const": "type-text"
                }
              },
              "required": [
                "type"
              ]
            },
            {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "type": {
                  "const": "key-press"
                },
                "keyCode": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "required": [
                "type",
                "keyCode"
              ]
            },
            {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "type": {
                  "const": "key-sequence"
                },
                "keyCodes": {
                  "type": "array",
                  "items": {
                    "type": "integer",
                    "minimum": 0
                  }
                }
              },
              "required": [
                "type",
                "keyCodes"
              ]
            }
          ]
        },
        "artifacts": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "simulatorId": {
              "type": "string"
            }
          },
          "required": [
            "simulatorId"
          ]
        },
        "diagnostics": {
          "$ref": "https://xcodebuildmcp.com/schemas/structured-output/_defs/common.schema.json#/$defs/basicDiagnostics"
        }
      },
      "required": [
        "summary",
        "action",
        "artifacts"
      ]
    }
  },
  "required": [
    "schema",
    "schemaVersion",
    "didError",
    "error",
    "data"
  ]
}
