{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aixbt-tech/json-schema/aixbt-tech-recipe-execution-result-schema.json",
  "title": "RecipeExecutionResult",
  "x-generated": "2026-11-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/aixbt-tech-v2-openapi.yaml#/components/schemas/RecipeExecutionResult",
  "oneOf": [
    {
      "type": "object",
      "required": [
        "status",
        "recipe",
        "version",
        "step",
        "instructions",
        "returns",
        "data",
        "tokenCount",
        "progress",
        "remaining"
      ],
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "awaiting_agent"
          ]
        },
        "recipe": {
          "type": "string"
        },
        "version": {
          "type": "string"
        },
        "step": {
          "type": "string"
        },
        "instructions": {
          "type": "string"
        },
        "returns": {
          "type": "object",
          "additionalProperties": true
        },
        "data": {
          "type": "object",
          "additionalProperties": true
        },
        "tokenCount": {
          "type": "integer",
          "minimum": 0
        },
        "progress": {
          "type": "object",
          "required": [
            "stepsCompleted",
            "stepsTotal",
            "segmentIndex",
            "segmentsTotal"
          ],
          "properties": {
            "stepsCompleted": {
              "type": "integer",
              "minimum": 0
            },
            "stepsTotal": {
              "type": "integer",
              "minimum": 0
            },
            "segmentIndex": {
              "type": "integer",
              "minimum": 0
            },
            "segmentsTotal": {
              "type": "integer",
              "minimum": 0
            }
          }
        },
        "remaining": {
          "type": "string"
        },
        "parallel": {
          "type": "object",
          "required": [
            "items",
            "itemKey",
            "concurrency",
            "perItemContext",
            "sharedContext"
          ],
          "properties": {
            "items": {
              "type": "array",
              "items": {}
            },
            "itemKey": {
              "type": "string"
            },
            "concurrency": {
              "type": "integer",
              "minimum": 1
            },
            "perItemContext": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "sharedContext": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        },
        "parallelExecution": {
          "type": "string"
        },
        "contextHints": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "carryForward": {
          "type": "object",
          "additionalProperties": true
        },
        "meta": {
          "$ref": "#/$defs/HistoryResponseMeta"
        }
      },
      "additionalProperties": true
    },
    {
      "type": "object",
      "required": [
        "status",
        "recipe",
        "version",
        "timestamp",
        "data",
        "tokenCount"
      ],
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "complete"
          ]
        },
        "recipe": {
          "type": "string"
        },
        "version": {
          "type": "string"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time"
        },
        "data": {
          "type": "object",
          "additionalProperties": true
        },
        "tokenCount": {
          "type": "integer",
          "minimum": 0
        },
        "hints": {
          "type": "object",
          "properties": {
            "combine": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "key": {
              "type": "string"
            },
            "include": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        },
        "analysis": {
          "type": "object",
          "required": [
            "instructions"
          ],
          "properties": {
            "instructions": {
              "type": "string"
            },
            "output": {
              "type": "string"
            },
            "context": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        },
        "contextHints": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "meta": {
          "$ref": "#/$defs/HistoryResponseMeta"
        }
      },
      "additionalProperties": true
    }
  ],
  "$defs": {
    "HistoryAccessMeta": {
      "type": "object",
      "required": [
        "lookbackDays",
        "earliestAvailableAt"
      ],
      "properties": {
        "lookbackDays": {
          "type": [
            "integer",
            "null"
          ]
        },
        "earliestAvailableAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    },
    "HistoryResponseMeta": {
      "type": "object",
      "required": [
        "history"
      ],
      "properties": {
        "history": {
          "$ref": "#/$defs/HistoryAccessMeta"
        }
      }
    }
  }
}