{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/algenta-ai/json-schema/algenta-ai-agent-run-resource-schema.json",
  "title": "AgentRunResource",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/algenta-ai-agent-runtime-api-openapi.yml#/components/schemas/AgentRunResource",
  "properties": {
    "run_id": {
      "type": "string",
      "title": "Run Id"
    },
    "status": {
      "type": "string",
      "enum": [
        "running",
        "paused",
        "requires_approval",
        "completed",
        "cancelled"
      ],
      "title": "Status"
    },
    "task": {
      "type": "string",
      "title": "Task"
    },
    "output_format": {
      "type": "string",
      "title": "Output Format"
    },
    "approval_mode": {
      "type": "string",
      "enum": [
        "auto",
        "manual"
      ],
      "title": "Approval Mode"
    },
    "pending_action": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "resume",
            "approve"
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Pending Action"
    },
    "selected_tool": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Selected Tool"
    },
    "result": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Result"
    },
    "tools_available": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Tools Available"
    },
    "tools_used": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Tools Used"
    },
    "steps": {
      "items": {
        "$ref": "#/$defs/AgentStep"
      },
      "type": "array",
      "title": "Steps"
    },
    "request_hash": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Request Hash"
    },
    "decision_hash": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Decision Hash"
    },
    "policy_snapshot_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Policy Snapshot Id"
    },
    "schema_snapshot_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Schema Snapshot Id"
    },
    "manifest_version": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Manifest Version"
    },
    "replayable": {
      "type": "boolean",
      "title": "Replayable",
      "default": false
    },
    "artifact_refs": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Artifact Refs"
    },
    "latest_checkpoint_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Latest Checkpoint Id"
    },
    "checkpoint_count": {
      "type": "integer",
      "minimum": 0.0,
      "title": "Checkpoint Count",
      "default": 0
    },
    "source_run_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Source Run Id"
    },
    "source_checkpoint_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Source Checkpoint Id"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "title": "Updated At"
    },
    "latency_ms": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Latency Ms"
    }
  },
  "type": "object",
  "required": [
    "run_id",
    "status",
    "task",
    "output_format",
    "approval_mode",
    "created_at",
    "updated_at"
  ],
  "$defs": {
    "AgentStep": {
      "properties": {
        "step": {
          "type": "integer",
          "title": "Step"
        },
        "action": {
          "type": "string",
          "title": "Action"
        },
        "tool": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Tool"
        },
        "result": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Result"
        },
        "status": {
          "type": "string",
          "title": "Status",
          "default": "completed"
        }
      },
      "type": "object",
      "required": [
        "step",
        "action"
      ],
      "title": "AgentStep"
    }
  }
}