{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/iterant-ai/json-schema/iterant-ai-public-agent-task-list-schema.json",
  "title": "PublicAgentTaskList",
  "description": "The schema for what ``paginated`` builds. Kept beside it deliberately.\n\nA list operation whose ``responses`` named the *item* serializer with\n``many=True`` published a bare array while the runtime returned this object,\nso a generated client broke on its first call. Subclasses add ``items``:\neach operation needs its own named component or the item type is erased.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/iterant-ai-openapi.json#/components/schemas/PublicAgentTaskList",
  "type": "object",
  "properties": {
    "total": {
      "type": "integer",
      "description": "Rows matching the query, before `limit` and `offset`."
    },
    "offset": {
      "type": "integer",
      "description": "Rows skipped. Echoed back so a caller can page without bookkeeping."
    },
    "limit": {
      "type": "integer",
      "description": "Cap actually applied, which may be lower than the one requested."
    },
    "note": {
      "type": "string",
      "description": "How to narrow, when the cap hid rows. Empty when the response is the whole answer."
    },
    "items": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/PublicAgentTask"
      }
    }
  },
  "required": [
    "items",
    "limit",
    "note",
    "offset",
    "total"
  ],
  "$defs": {
    "CommandEnum": {
      "enum": [
        "prompt",
        "build_page"
      ],
      "type": "string",
      "description": "* `prompt` - Prompt\n* `build_page` - Build page"
    },
    "PublicAgentTask": {
      "type": "object",
      "properties": {
        "taskId": {
          "type": "string",
          "format": "uuid"
        },
        "command": {
          "$ref": "#/$defs/CommandEnum"
        },
        "status": {
          "$ref": "#/$defs/StatusEnum"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "finishedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Null while the task is running."
        },
        "resultingRoute": {
          "type": "string",
          "description": "The route the build produced. Always empty for a \"prompt\" task: a free-form turn has no single route, so its result is the chat thread."
        },
        "chatUrl": {
          "type": "string"
        },
        "error": {
          "type": "string",
          "description": "Present only when `status` is `failed`."
        }
      },
      "required": [
        "chatUrl",
        "command",
        "createdAt",
        "finishedAt",
        "resultingRoute",
        "status",
        "taskId"
      ]
    },
    "StatusEnum": {
      "enum": [
        "running",
        "succeeded",
        "failed"
      ],
      "type": "string",
      "description": "* `running` - Running\n* `succeeded` - Succeeded\n* `failed` - Failed"
    }
  }
}