{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/algenta-ai/json-schema/algenta-ai-capability-execution-response-schema.json",
  "title": "CapabilityExecutionResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/algenta-ai-capability-plane-api-openapi.yml#/components/schemas/CapabilityExecutionResponse",
  "properties": {
    "execution_session_id": {
      "type": "string",
      "title": "Execution Session Id"
    },
    "capability_id": {
      "type": "string",
      "title": "Capability Id"
    },
    "provider_id": {
      "type": "string",
      "title": "Provider Id"
    },
    "binding_id": {
      "type": "string",
      "title": "Binding Id"
    },
    "execution_owner": {
      "$ref": "#/$defs/ExecutionOwner"
    },
    "status": {
      "$ref": "#/$defs/ExecutionSessionStatus"
    },
    "output": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Output"
    },
    "error": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Error"
    },
    "started_at": {
      "type": "string",
      "format": "date-time",
      "title": "Started At"
    },
    "completed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Completed At"
    },
    "plan_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Plan Id",
      "description": "Set when this capability is approval_required: identifies the pending or decided execution plan."
    },
    "plan_hash": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Plan Hash",
      "description": "Hash of the proposed plan; an approval is bound to this."
    },
    "nonce": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Nonce",
      "description": "Single-use approval challenge -- present only when a new plan is proposed."
    },
    "receipt": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Receipt",
      "description": "The versioned ExecutionReceipt (apps.api_server.schemas.receipt), present once a plan is proposed (status='approval_required') or actually executed (status='executed'/'failed')."
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "execution_session_id",
    "capability_id",
    "provider_id",
    "binding_id",
    "execution_owner",
    "status",
    "started_at"
  ],
  "$defs": {
    "ExecutionOwner": {
      "type": "string",
      "enum": [
        "algenta_managed",
        "client_managed"
      ],
      "title": "ExecutionOwner"
    },
    "ExecutionSessionStatus": {
      "type": "string",
      "enum": [
        "started",
        "succeeded",
        "failed"
      ],
      "title": "ExecutionSessionStatus"
    }
  }
}