openapi: 3.1.0
info:
  title: Agentex API
  version: 0.1.0
paths:
  /agents/{agent_id}:
    get:
      tags:
        - Agents
      summary: Get Agent by ID
      description: Get an agent by its unique ID.
      operationId: get_agent_by_id_agents__agent_id__get
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            title: Agent Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Agent'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
        - Agents
      summary: Delete Agent by ID
      description: Delete an agent by its unique ID.
      operationId: delete_agent_by_id_agents__agent_id__delete
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            title: Agent Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /agents/name/{agent_name}:
    get:
      tags:
        - Agents
      summary: Get Agent by Name
      description: Get an agent by its unique name.
      operationId: get_agent_by_name_agents_name__agent_name__get
      parameters:
        - name: agent_name
          in: path
          required: true
          schema:
            type: string
            title: Agent Name
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Agent'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
        - Agents
      summary: Delete Agent by Name
      description: Delete an agent by its unique name.
      operationId: delete_agent_by_name_agents_name__agent_name__delete
      parameters:
        - name: agent_name
          in: path
          required: true
          schema:
            type: string
            title: Agent Name
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /agents:
    get:
      tags:
        - Agents
      summary: List Agents
      description: List all registered agents, optionally filtered by query parameters.
      operationId: list_agents_agents_get
      parameters:
        - name: task_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Task ID
            title: Task Id
          description: Task ID
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            description: Limit
            default: 50
            title: Limit
          description: Limit
        - name: page_number
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            description: Page number
            default: 1
            title: Page Number
          description: Page number
        - name: order_by
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Field to order by
            title: Order By
          description: Field to order by
        - name: order_direction
          in: query
          required: false
          schema:
            type: string
            description: Order direction (asc or desc)
            default: desc
            title: Order Direction
          description: Order direction (asc or desc)
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Agent'
                title: Response List Agents Agents Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /agents/register:
    post:
      tags:
        - Agents
      summary: Register Agent
      description: Register a new agent or update an existing one.
      operationId: register_agent_agents_register_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RegisterAgentRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RegisterAgentResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /agents/register-build:
    post:
      tags:
        - Agents
      summary: Register Build
      description: >-
        Register an agent at build time, before it is deployed, so it can be permissioned and shared prior to
        deploy. Idempotent by name.
      operationId: register_build_agents_register_build_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RegisterBuildRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Agent'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /agents/forward/name/{agent_name}/{path}:
    get:
      tags:
        - Agents
      summary: Forward GET request to agent by name
      description: Forward a GET request to an agent by its name.
      operationId: forward_get_request_to_agent_agents_forward_name__agent_name___path__get
      parameters:
        - name: agent_name
          in: path
          required: true
          schema:
            type: string
            title: Agent Name
        - name: path
          in: path
          required: true
          schema:
            type: string
            title: Path
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
        - Agents
      summary: Forward POST request to agent by name
      description: Forward a POST request to an agent by its name.
      operationId: forward_post_request_to_agent_agents_forward_name__agent_name___path__post
      parameters:
        - name: agent_name
          in: path
          required: true
          schema:
            type: string
            title: Agent Name
        - name: path
          in: path
          required: true
          schema:
            type: string
            title: Path
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /agents/{agent_id}/rpc:
    post:
      tags:
        - Agents
      summary: Handle Agent RPC by ID
      description: Handle JSON-RPC requests for an agent by its unique ID.
      operationId: handle_agent_rpc_by_id_agents__agent_id__rpc_post
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            title: Agent Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentRPCRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentRPCResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /agents/name/{agent_name}/rpc:
    post:
      tags:
        - Agents
      summary: Handle Agent RPC by Name
      description: Handle JSON-RPC requests for an agent by its unique name.
      operationId: handle_agent_rpc_by_name_agents_name__agent_name__rpc_post
      parameters:
        - name: agent_name
          in: path
          required: true
          schema:
            type: string
            title: Agent Name
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentRPCRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentRPCResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /tasks/{task_id}:
    get:
      tags:
        - Tasks
      summary: Get Task by ID
      description: Get a task by its unique ID.
      operationId: get_task_tasks__task_id__get
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            type: string
            title: Task Id
        - name: relationships
          in: query
          required: false
          schema:
            type: array
            items:
              $ref: '#/components/schemas/TaskRelationships'
            title: Relationships
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
        - Tasks
      summary: Delete Task by ID
      description: Delete a task by its unique ID.
      operationId: delete_task_tasks__task_id__delete
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            type: string
            title: Task Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    put:
      tags:
        - Tasks
      summary: Update Task by ID
      description: Update mutable fields for a task by its unique ID.
      operationId: update_task_tasks__task_id__put
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            type: string
            title: Task Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateTaskRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Task'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /tasks/name/{task_name}:
    get:
      tags:
        - Tasks
      summary: Get Task by Name
      description: Get a task by its unique name.
      operationId: get_task_by_name_tasks_name__task_name__get
      parameters:
        - name: task_name
          in: path
          required: true
          schema:
            type: string
            title: Task Name
        - name: relationships
          in: query
          required: false
          schema:
            type: array
            items:
              $ref: '#/components/schemas/TaskRelationships'
            title: Relationships
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
        - Tasks
      summary: Delete Task by Name
      description: Delete a task by its unique name.
      operationId: delete_task_by_name_tasks_name__task_name__delete
      parameters:
        - name: task_name
          in: path
          required: true
          schema:
            type: string
            title: Task Name
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    put:
      tags:
        - Tasks
      summary: Update Task by Name
      description: Update mutable fields for a task by its unique Name.
      operationId: update_task_by_name_tasks_name__task_name__put
      parameters:
        - name: task_name
          in: path
          required: true
          schema:
            type: string
            title: Task Name
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateTaskRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Task'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /tasks:
    get:
      tags:
        - Tasks
      summary: List Tasks
      description: List all tasks.
      operationId: list_tasks_tasks_get
      parameters:
        - name: agent_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Agent Id
        - name: agent_name
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Agent Name
        - name: status
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/TaskStatus'
              - type: 'null'
            description: Filter tasks by status (e.g. RUNNING, COMPLETED).
            title: Status
          description: Filter tasks by status (e.g. RUNNING, COMPLETED).
        - name: task_metadata
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              JSON-encoded object used to filter tasks via JSONB containment. Example: {"created_by_user_id":
              "abc-123"}.
            title: Task Metadata
          description: >-
            JSON-encoded object used to filter tasks via JSONB containment. Example: {"created_by_user_id":
            "abc-123"}.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 50
            title: Limit
        - name: page_number
          in: query
          required: false
          schema:
            type: integer
            default: 1
            title: Page Number
        - name: order_by
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Order By
        - name: order_direction
          in: query
          required: false
          schema:
            type: string
            default: desc
            title: Order Direction
        - name: relationships
          in: query
          required: false
          schema:
            type: array
            items:
              $ref: '#/components/schemas/TaskRelationships'
            title: Relationships
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TaskResponse'
                title: Response List Tasks Tasks Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /tasks/{task_id}/complete:
    post:
      tags:
        - Tasks
      summary: Complete Task
      description: Mark a running task as completed.
      operationId: complete_task_tasks__task_id__complete_post
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            type: string
            title: Task Id
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/TaskStatusReasonRequest'
                - type: 'null'
              title: Request
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Task'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /tasks/{task_id}/fail:
    post:
      tags:
        - Tasks
      summary: Fail Task
      description: Mark a running task as failed.
      operationId: fail_task_tasks__task_id__fail_post
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            type: string
            title: Task Id
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/TaskStatusReasonRequest'
                - type: 'null'
              title: Request
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Task'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /tasks/{task_id}/cancel:
    post:
      tags:
        - Tasks
      summary: Cancel Task
      description: Mark a running task as canceled.
      operationId: cancel_task_tasks__task_id__cancel_post
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            type: string
            title: Task Id
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/TaskStatusReasonRequest'
                - type: 'null'
              title: Request
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Task'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /tasks/{task_id}/interrupt:
    post:
      tags:
        - Tasks
      summary: Interrupt Task
      description: >-
        Stop the in-flight turn without terminating the task. Transitions a running task to the non-terminal
        INTERRUPTED status; the task stays continuable and the next message or event resumes it.
      operationId: interrupt_task_tasks__task_id__interrupt_post
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            type: string
            title: Task Id
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/TaskStatusReasonRequest'
                - type: 'null'
              title: Request
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Task'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /tasks/{task_id}/terminate:
    post:
      tags:
        - Tasks
      summary: Terminate Task
      description: Mark a running task as terminated.
      operationId: terminate_task_tasks__task_id__terminate_post
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            type: string
            title: Task Id
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/TaskStatusReasonRequest'
                - type: 'null'
              title: Request
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Task'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /tasks/{task_id}/timeout:
    post:
      tags:
        - Tasks
      summary: Timeout Task
      description: Mark a running task as timed out.
      operationId: timeout_task_tasks__task_id__timeout_post
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            type: string
            title: Task Id
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/TaskStatusReasonRequest'
                - type: 'null'
              title: Request
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Task'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /tasks/{task_id}/stream:
    get:
      tags:
        - Tasks
      summary: Stream Task Events by ID
      description: Stream events for a task by its unique ID.
      operationId: stream_task_events_tasks__task_id__stream_get
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            type: string
            title: Task Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /tasks/name/{task_name}/stream:
    get:
      tags:
        - Tasks
      summary: Stream Task Events by Name
      description: Stream events for a task by its unique name.
      operationId: stream_task_events_by_name_tasks_name__task_name__stream_get
      parameters:
        - name: task_name
          in: path
          required: true
          schema:
            type: string
            title: Task Name
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /tasks/{task_id}/query/{query_name}:
    get:
      tags:
        - Tasks
      summary: Query Task Workflow
      description: Query a Temporal workflow associated with a task for its current state.
      operationId: query_task_workflow_tasks__task_id__query__query_name__get
      parameters:
        - name: query_name
          in: path
          required: true
          schema:
            type: string
            title: Query Name
        - name: task_id
          in: path
          required: true
          schema:
            type: string
            title: Task Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response Query Task Workflow Tasks  Task Id  Query  Query Name  Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /messages/batch:
    put:
      tags:
        - Messages
      summary: Batch Update Messages
      operationId: batch_update_messages_messages_batch_put
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchUpdateTaskMessagesRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/TaskMessage'
                type: array
                title: Response Batch Update Messages Messages Batch Put
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
        - Messages
      summary: Batch Create Messages
      operationId: batch_create_messages_messages_batch_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BatchCreateTaskMessagesRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/TaskMessage'
                type: array
                title: Response Batch Create Messages Messages Batch Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /messages:
    post:
      tags:
        - Messages
      summary: Create Message
      operationId: create_message_messages_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTaskMessageRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskMessage'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    get:
      tags:
        - Messages
      summary: List Messages
      description: |-
        List messages for a task with offset-based pagination.

        For cursor-based pagination with infinite scroll support, use /messages/paginated.
      operationId: list_messages_messages_get
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 50
            title: Limit
        - name: page_number
          in: query
          required: false
          schema:
            type: integer
            default: 1
            title: Page Number
        - name: order_by
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Order By
        - name: order_direction
          in: query
          required: false
          schema:
            type: string
            default: desc
            title: Order Direction
        - name: filters
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: |
              JSON-encoded array of TaskMessageEntityFilter objects.

              Schema: {
                "$defs": {
                  "DataContentEntityOptional": {
                    "properties": {
                      "type": {
                        "anyOf": [
                          {
                            "const": "data",
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The type of the message, in this case `data`.",
                        "title": "Type"
                      },
                      "author": {
                        "anyOf": [
                          {
                            "$ref": "#/$defs/MessageAuthor"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The role of the messages author, in this case `system`, `user`, `assistant`, or `tool`."
                      },
                      "style": {
                        "anyOf": [
                          {
                            "$ref": "#/$defs/MessageStyle"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The style of the message. This is used by the client to determine how to display the message."
                      },
                      "data": {
                        "anyOf": [
                          {
                            "additionalProperties": true,
                            "type": "object"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The contents of the data message.",
                        "title": "Data"
                      }
                    },
                    "title": "DataContentEntityOptional",
                    "type": "object"
                  },
                  "FileAttachmentEntity": {
                    "description": "Represents a file attachment in messages.",
                    "properties": {
                      "file_id": {
                        "description": "The unique ID of the attached file",
                        "title": "File Id",
                        "type": "string"
                      },
                      "name": {
                        "description": "The name of the file",
                        "title": "Name",
                        "type": "string"
                      },
                      "size": {
                        "description": "The size of the file in bytes",
                        "title": "Size",
                        "type": "integer"
                      },
                      "type": {
                        "description": "The MIME type or content type of the file",
                        "title": "Type",
                        "type": "string"
                      }
                    },
                    "required": [
                      "file_id",
                      "name",
                      "size",
                      "type"
                    ],
                    "title": "FileAttachmentEntity",
                    "type": "object"
                  },
                  "MessageAuthor": {
                    "enum": [
                      "user",
                      "agent"
                    ],
                    "title": "MessageAuthor",
                    "type": "string"
                  },
                  "MessageStyle": {
                    "enum": [
                      "static",
                      "active"
                    ],
                    "title": "MessageStyle",
                    "type": "string"
                  },
                  "ReasoningContentEntityOptional": {
                    "properties": {
                      "type": {
                        "anyOf": [
                          {
                            "const": "reasoning",
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The type of the message, in this case `reasoning`.",
                        "title": "Type"
                      },
                      "author": {
                        "anyOf": [
                          {
                            "$ref": "#/$defs/MessageAuthor"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The role of the messages author, in this case `system`, `user`, `assistant`, or `tool`."
                      },
                      "style": {
                        "anyOf": [
                          {
                            "$ref": "#/$defs/MessageStyle"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The style of the message. This is used by the client to determine how to display the message."
                      },
                      "summary": {
                        "anyOf": [
                          {
                            "items": {
                              "type": "string"
                            },
                            "type": "array"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "A list of short reasoning summaries",
                        "title": "Summary"
                      },
                      "content": {
                        "anyOf": [
                          {
                            "items": {
                              "type": "string"
                            },
                            "type": "array"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The reasoning content or chain-of-thought text",
                        "title": "Content"
                      }
                    },
                    "title": "ReasoningContentEntityOptional",
                    "type": "object"
                  },
                  "TextContentEntityOptional": {
                    "properties": {
                      "type": {
                        "anyOf": [
                          {
                            "const": "text",
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The type of the message, in this case `text`.",
                        "title": "Type"
                      },
                      "author": {
                        "anyOf": [
                          {
                            "$ref": "#/$defs/MessageAuthor"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The role of the messages author, in this case `system`, `user`, `assistant`, or `tool`."
                      },
                      "style": {
                        "anyOf": [
                          {
                            "$ref": "#/$defs/MessageStyle"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The style of the message. This is used by the client to determine how to display the message."
                      },
                      "format": {
                        "anyOf": [
                          {
                            "$ref": "#/$defs/TextFormat"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The format of the message. This is used by the client to determine how to display the message."
                      },
                      "content": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The contents of the text message.",
                        "title": "Content"
                      },
                      "attachments": {
                        "anyOf": [
                          {
                            "items": {
                              "$ref": "#/$defs/FileAttachmentEntity"
                            },
                            "type": "array"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "Optional list of file attachments with structured metadata.",
                        "title": "Attachments"
                      }
                    },
                    "title": "TextContentEntityOptional",
                    "type": "object"
                  },
                  "TextFormat": {
                    "enum": [
                      "markdown",
                      "plain",
                      "code"
                    ],
                    "title": "TextFormat",
                    "type": "string"
                  },
                  "ToolRequestContentEntityOptional": {
                    "properties": {
                      "type": {
                        "anyOf": [
                          {
                            "const": "tool_request",
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The type of the message, in this case `tool_request`.",
                        "title": "Type"
                      },
                      "author": {
                        "anyOf": [
                          {
                            "$ref": "#/$defs/MessageAuthor"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The role of the messages author, in this case `system`, `user`, `assistant`, or `tool`."
                      },
                      "style": {
                        "anyOf": [
                          {
                            "$ref": "#/$defs/MessageStyle"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The style of the message. This is used by the client to determine how to display the message."
                      },
                      "tool_call_id": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The ID of the tool call that is being requested.",
                        "title": "Tool Call Id"
                      },
                      "name": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The name of the tool that is being requested.",
                        "title": "Name"
                      },
                      "arguments": {
                        "anyOf": [
                          {
                            "additionalProperties": true,
                            "type": "object"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The arguments to the tool.",
                        "title": "Arguments"
                      }
                    },
                    "title": "ToolRequestContentEntityOptional",
                    "type": "object"
                  },
                  "ToolResponseContentEntityOptional": {
                    "properties": {
                      "type": {
                        "anyOf": [
                          {
                            "const": "tool_response",
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The type of the message, in this case `tool_response`.",
                        "title": "Type"
                      },
                      "author": {
                        "anyOf": [
                          {
                            "$ref": "#/$defs/MessageAuthor"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The role of the messages author, in this case `system`, `user`, `assistant`, or `tool`."
                      },
                      "style": {
                        "anyOf": [
                          {
                            "$ref": "#/$defs/MessageStyle"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The style of the message. This is used by the client to determine how to display the message."
                      },
                      "tool_call_id": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The ID of the tool call that is being responded to.",
                        "title": "Tool Call Id"
                      },
                      "name": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The name of the tool that is being responded to.",
                        "title": "Name"
                      },
                      "content": {
                        "anyOf": [
                          {},
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The result of the tool.",
                        "title": "Content"
                      },
                      "is_error": {
                        "anyOf": [
                          {
                            "type": "boolean"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "Whether the tool call resulted in an error. `None` when the harness does not report a status.",
                        "title": "Is Error"
                      }
                    },
                    "title": "ToolResponseContentEntityOptional",
                    "type": "object"
                  }
                },
                "description": "Filter model for TaskMessage - all fields optional for flexible filtering.\n\nThe `exclude` field determines whether this filter is inclusionary or exclusionary.\nWhen multiple filters are provided:\n- Inclusionary filters (exclude=False) are OR'd together\n- Exclusionary filters (exclude=True) are OR'd together and negated with $nor\n- The two groups are AND'd: (include1 OR include2) AND NOT (exclude1 OR exclude2)",
                "properties": {
                  "content": {
                    "anyOf": [
                      {
                        "$ref": "#/$defs/ToolRequestContentEntityOptional"
                      },
                      {
                        "$ref": "#/$defs/DataContentEntityOptional"
                      },
                      {
                        "$ref": "#/$defs/TextContentEntityOptional"
                      },
                      {
                        "$ref": "#/$defs/ToolResponseContentEntityOptional"
                      },
                      {
                        "$ref": "#/$defs/ReasoningContentEntityOptional"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null,
                    "description": "Filter by message content",
                    "title": "Content"
                  },
                  "streaming_status": {
                    "anyOf": [
                      {
                        "enum": [
                          "IN_PROGRESS",
                          "DONE"
                        ],
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null,
                    "description": "Filter by streaming status",
                    "title": "Streaming Status"
                  },
                  "exclude": {
                    "default": false,
                    "description": "If true, this filter excludes matching messages",
                    "title": "Exclude",
                    "type": "boolean"
                  }
                },
                "title": "TaskMessageEntityFilter",
                "type": "object"
              }

              Each filter can include:
              - `content`: Filter by message content (type, author, data fields)
              - `streaming_status`: Filter by status ("IN_PROGRESS" or "DONE")
              - `exclude`: If true, excludes matching messages (default: false)

              Multiple filters are combined: inclusionary filters (exclude=false) are OR'd together,
              exclusionary filters (exclude=true) are OR'd and negated, then both groups are AND'd.
            title: Filters
          description: |
            JSON-encoded array of TaskMessageEntityFilter objects.

            Schema: {
              "$defs": {
                "DataContentEntityOptional": {
                  "properties": {
                    "type": {
                      "anyOf": [
                        {
                          "const": "data",
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The type of the message, in this case `data`.",
                      "title": "Type"
                    },
                    "author": {
                      "anyOf": [
                        {
                          "$ref": "#/$defs/MessageAuthor"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The role of the messages author, in this case `system`, `user`, `assistant`, or `tool`."
                    },
                    "style": {
                      "anyOf": [
                        {
                          "$ref": "#/$defs/MessageStyle"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The style of the message. This is used by the client to determine how to display the message."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "additionalProperties": true,
                          "type": "object"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The contents of the data message.",
                      "title": "Data"
                    }
                  },
                  "title": "DataContentEntityOptional",
                  "type": "object"
                },
                "FileAttachmentEntity": {
                  "description": "Represents a file attachment in messages.",
                  "properties": {
                    "file_id": {
                      "description": "The unique ID of the attached file",
                      "title": "File Id",
                      "type": "string"
                    },
                    "name": {
                      "description": "The name of the file",
                      "title": "Name",
                      "type": "string"
                    },
                    "size": {
                      "description": "The size of the file in bytes",
                      "title": "Size",
                      "type": "integer"
                    },
                    "type": {
                      "description": "The MIME type or content type of the file",
                      "title": "Type",
                      "type": "string"
                    }
                  },
                  "required": [
                    "file_id",
                    "name",
                    "size",
                    "type"
                  ],
                  "title": "FileAttachmentEntity",
                  "type": "object"
                },
                "MessageAuthor": {
                  "enum": [
                    "user",
                    "agent"
                  ],
                  "title": "MessageAuthor",
                  "type": "string"
                },
                "MessageStyle": {
                  "enum": [
                    "static",
                    "active"
                  ],
                  "title": "MessageStyle",
                  "type": "string"
                },
                "ReasoningContentEntityOptional": {
                  "properties": {
                    "type": {
                      "anyOf": [
                        {
                          "const": "reasoning",
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The type of the message, in this case `reasoning`.",
                      "title": "Type"
                    },
                    "author": {
                      "anyOf": [
                        {
                          "$ref": "#/$defs/MessageAuthor"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The role of the messages author, in this case `system`, `user`, `assistant`, or `tool`."
                    },
                    "style": {
                      "anyOf": [
                        {
                          "$ref": "#/$defs/MessageStyle"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The style of the message. This is used by the client to determine how to display the message."
                    },
                    "summary": {
                      "anyOf": [
                        {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "A list of short reasoning summaries",
                      "title": "Summary"
                    },
                    "content": {
                      "anyOf": [
                        {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The reasoning content or chain-of-thought text",
                      "title": "Content"
                    }
                  },
                  "title": "ReasoningContentEntityOptional",
                  "type": "object"
                },
                "TextContentEntityOptional": {
                  "properties": {
                    "type": {
                      "anyOf": [
                        {
                          "const": "text",
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The type of the message, in this case `text`.",
                      "title": "Type"
                    },
                    "author": {
                      "anyOf": [
                        {
                          "$ref": "#/$defs/MessageAuthor"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The role of the messages author, in this case `system`, `user`, `assistant`, or `tool`."
                    },
                    "style": {
                      "anyOf": [
                        {
                          "$ref": "#/$defs/MessageStyle"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The style of the message. This is used by the client to determine how to display the message."
                    },
                    "format": {
                      "anyOf": [
                        {
                          "$ref": "#/$defs/TextFormat"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The format of the message. This is used by the client to determine how to display the message."
                    },
                    "content": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The contents of the text message.",
                      "title": "Content"
                    },
                    "attachments": {
                      "anyOf": [
                        {
                          "items": {
                            "$ref": "#/$defs/FileAttachmentEntity"
                          },
                          "type": "array"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "Optional list of file attachments with structured metadata.",
                      "title": "Attachments"
                    }
                  },
                  "title": "TextContentEntityOptional",
                  "type": "object"
                },
                "TextFormat": {
                  "enum": [
                    "markdown",
                    "plain",
                    "code"
                  ],
                  "title": "TextFormat",
                  "type": "string"
                },
                "ToolRequestContentEntityOptional": {
                  "properties": {
                    "type": {
                      "anyOf": [
                        {
                          "const": "tool_request",
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The type of the message, in this case `tool_request`.",
                      "title": "Type"
                    },
                    "author": {
                      "anyOf": [
                        {
                          "$ref": "#/$defs/MessageAuthor"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The role of the messages author, in this case `system`, `user`, `assistant`, or `tool`."
                    },
                    "style": {
                      "anyOf": [
                        {
                          "$ref": "#/$defs/MessageStyle"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The style of the message. This is used by the client to determine how to display the message."
                    },
                    "tool_call_id": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The ID of the tool call that is being requested.",
                      "title": "Tool Call Id"
                    },
                    "name": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The name of the tool that is being requested.",
                      "title": "Name"
                    },
                    "arguments": {
                      "anyOf": [
                        {
                          "additionalProperties": true,
                          "type": "object"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The arguments to the tool.",
                      "title": "Arguments"
                    }
                  },
                  "title": "ToolRequestContentEntityOptional",
                  "type": "object"
                },
                "ToolResponseContentEntityOptional": {
                  "properties": {
                    "type": {
                      "anyOf": [
                        {
                          "const": "tool_response",
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The type of the message, in this case `tool_response`.",
                      "title": "Type"
                    },
                    "author": {
                      "anyOf": [
                        {
                          "$ref": "#/$defs/MessageAuthor"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The role of the messages author, in this case `system`, `user`, `assistant`, or `tool`."
                    },
                    "style": {
                      "anyOf": [
                        {
                          "$ref": "#/$defs/MessageStyle"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The style of the message. This is used by the client to determine how to display the message."
                    },
                    "tool_call_id": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The ID of the tool call that is being responded to.",
                      "title": "Tool Call Id"
                    },
                    "name": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The name of the tool that is being responded to.",
                      "title": "Name"
                    },
                    "content": {
                      "anyOf": [
                        {},
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The result of the tool.",
                      "title": "Content"
                    },
                    "is_error": {
                      "anyOf": [
                        {
                          "type": "boolean"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "Whether the tool call resulted in an error. `None` when the harness does not report a status.",
                      "title": "Is Error"
                    }
                  },
                  "title": "ToolResponseContentEntityOptional",
                  "type": "object"
                }
              },
              "description": "Filter model for TaskMessage - all fields optional for flexible filtering.\n\nThe `exclude` field determines whether this filter is inclusionary or exclusionary.\nWhen multiple filters are provided:\n- Inclusionary filters (exclude=False) are OR'd together\n- Exclusionary filters (exclude=True) are OR'd together and negated with $nor\n- The two groups are AND'd: (include1 OR include2) AND NOT (exclude1 OR exclude2)",
              "properties": {
                "content": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/ToolRequestContentEntityOptional"
                    },
                    {
                      "$ref": "#/$defs/DataContentEntityOptional"
                    },
                    {
                      "$ref": "#/$defs/TextContentEntityOptional"
                    },
                    {
                      "$ref": "#/$defs/ToolResponseContentEntityOptional"
                    },
                    {
                      "$ref": "#/$defs/ReasoningContentEntityOptional"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Filter by message content",
                  "title": "Content"
                },
                "streaming_status": {
                  "anyOf": [
                    {
                      "enum": [
                        "IN_PROGRESS",
                        "DONE"
                      ],
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Filter by streaming status",
                  "title": "Streaming Status"
                },
                "exclude": {
                  "default": false,
                  "description": "If true, this filter excludes matching messages",
                  "title": "Exclude",
                  "type": "boolean"
                }
              },
              "title": "TaskMessageEntityFilter",
              "type": "object"
            }

            Each filter can include:
            - `content`: Filter by message content (type, author, data fields)
            - `streaming_status`: Filter by status ("IN_PROGRESS" or "DONE")
            - `exclude`: If true, excludes matching messages (default: false)

            Multiple filters are combined: inclusionary filters (exclude=false) are OR'd together,
            exclusionary filters (exclude=true) are OR'd and negated, then both groups are AND'd.
          examples:
            single_filter:
              summary: Filter by content type
              value: '{"content": {"type": "text"}}'
            multiple_types:
              summary: Filter multiple content types (OR)
              value: '[{"content": {"type": "text"}}, {"content": {"type": "data"}}]'
            with_exclusion:
              summary: Include data messages, exclude specific data types
              value: >-
                [{"content": {"type": "data"}}, {"content": {"data": {"type": "error_report"}}, "exclude":
                true}]
            nested_data:
              summary: Filter by nested data field
              value: '{"content": {"data": {"type": "report_status_update"}}}'
        - name: task_id
          in: query
          required: true
          schema:
            type: string
            description: The task ID
            title: Task Id
          description: The task ID
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TaskMessage'
                title: Response List Messages Messages Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /messages/{message_id}:
    put:
      tags:
        - Messages
      summary: Update Message
      operationId: update_message_messages__message_id__put
      parameters:
        - name: message_id
          in: path
          required: true
          schema:
            type: string
            title: Message Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateTaskMessageRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskMessage'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    get:
      tags:
        - Messages
      summary: Get Message
      operationId: get_message_messages__message_id__get
      parameters:
        - name: message_id
          in: path
          required: true
          schema:
            type: string
            title: Message Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskMessage'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /messages/paginated:
    get:
      tags:
        - Messages
      summary: List Messages Paginated
      description: |-
        List messages for a task with cursor-based pagination.

        This endpoint is designed for infinite scroll UIs where new messages may arrive
        while paginating through older ones.

        Args:
            task_id: The task ID to filter messages by
            limit: Maximum number of messages to return (default: 50)
            cursor: Opaque cursor string for pagination. Pass the `next_cursor` from
                    a previous response to get the next page.
            direction: Pagination direction - "older" to get older messages (default),
                       "newer" to get newer messages.

        Returns:
            PaginatedMessagesResponse with:
            - data: List of messages (newest first when direction="older")
            - next_cursor: Cursor for fetching the next page (null if no more pages)
            - has_more: Whether there are more messages to fetch

        Example:
            First request: GET /messages/paginated?task_id=xxx&limit=50
            Next page: GET /messages/paginated?task_id=xxx&limit=50&cursor=<next_cursor>
      operationId: list_messages_paginated_messages_paginated_get
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 50
            title: Limit
        - name: cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Cursor
        - name: direction
          in: query
          required: false
          schema:
            enum:
              - older
              - newer
            type: string
            default: older
            title: Direction
        - name: filters
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: |
              JSON-encoded array of TaskMessageEntityFilter objects.

              Schema: {
                "$defs": {
                  "DataContentEntityOptional": {
                    "properties": {
                      "type": {
                        "anyOf": [
                          {
                            "const": "data",
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The type of the message, in this case `data`.",
                        "title": "Type"
                      },
                      "author": {
                        "anyOf": [
                          {
                            "$ref": "#/$defs/MessageAuthor"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The role of the messages author, in this case `system`, `user`, `assistant`, or `tool`."
                      },
                      "style": {
                        "anyOf": [
                          {
                            "$ref": "#/$defs/MessageStyle"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The style of the message. This is used by the client to determine how to display the message."
                      },
                      "data": {
                        "anyOf": [
                          {
                            "additionalProperties": true,
                            "type": "object"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The contents of the data message.",
                        "title": "Data"
                      }
                    },
                    "title": "DataContentEntityOptional",
                    "type": "object"
                  },
                  "FileAttachmentEntity": {
                    "description": "Represents a file attachment in messages.",
                    "properties": {
                      "file_id": {
                        "description": "The unique ID of the attached file",
                        "title": "File Id",
                        "type": "string"
                      },
                      "name": {
                        "description": "The name of the file",
                        "title": "Name",
                        "type": "string"
                      },
                      "size": {
                        "description": "The size of the file in bytes",
                        "title": "Size",
                        "type": "integer"
                      },
                      "type": {
                        "description": "The MIME type or content type of the file",
                        "title": "Type",
                        "type": "string"
                      }
                    },
                    "required": [
                      "file_id",
                      "name",
                      "size",
                      "type"
                    ],
                    "title": "FileAttachmentEntity",
                    "type": "object"
                  },
                  "MessageAuthor": {
                    "enum": [
                      "user",
                      "agent"
                    ],
                    "title": "MessageAuthor",
                    "type": "string"
                  },
                  "MessageStyle": {
                    "enum": [
                      "static",
                      "active"
                    ],
                    "title": "MessageStyle",
                    "type": "string"
                  },
                  "ReasoningContentEntityOptional": {
                    "properties": {
                      "type": {
                        "anyOf": [
                          {
                            "const": "reasoning",
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The type of the message, in this case `reasoning`.",
                        "title": "Type"
                      },
                      "author": {
                        "anyOf": [
                          {
                            "$ref": "#/$defs/MessageAuthor"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The role of the messages author, in this case `system`, `user`, `assistant`, or `tool`."
                      },
                      "style": {
                        "anyOf": [
                          {
                            "$ref": "#/$defs/MessageStyle"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The style of the message. This is used by the client to determine how to display the message."
                      },
                      "summary": {
                        "anyOf": [
                          {
                            "items": {
                              "type": "string"
                            },
                            "type": "array"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "A list of short reasoning summaries",
                        "title": "Summary"
                      },
                      "content": {
                        "anyOf": [
                          {
                            "items": {
                              "type": "string"
                            },
                            "type": "array"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The reasoning content or chain-of-thought text",
                        "title": "Content"
                      }
                    },
                    "title": "ReasoningContentEntityOptional",
                    "type": "object"
                  },
                  "TextContentEntityOptional": {
                    "properties": {
                      "type": {
                        "anyOf": [
                          {
                            "const": "text",
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The type of the message, in this case `text`.",
                        "title": "Type"
                      },
                      "author": {
                        "anyOf": [
                          {
                            "$ref": "#/$defs/MessageAuthor"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The role of the messages author, in this case `system`, `user`, `assistant`, or `tool`."
                      },
                      "style": {
                        "anyOf": [
                          {
                            "$ref": "#/$defs/MessageStyle"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The style of the message. This is used by the client to determine how to display the message."
                      },
                      "format": {
                        "anyOf": [
                          {
                            "$ref": "#/$defs/TextFormat"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The format of the message. This is used by the client to determine how to display the message."
                      },
                      "content": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The contents of the text message.",
                        "title": "Content"
                      },
                      "attachments": {
                        "anyOf": [
                          {
                            "items": {
                              "$ref": "#/$defs/FileAttachmentEntity"
                            },
                            "type": "array"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "Optional list of file attachments with structured metadata.",
                        "title": "Attachments"
                      }
                    },
                    "title": "TextContentEntityOptional",
                    "type": "object"
                  },
                  "TextFormat": {
                    "enum": [
                      "markdown",
                      "plain",
                      "code"
                    ],
                    "title": "TextFormat",
                    "type": "string"
                  },
                  "ToolRequestContentEntityOptional": {
                    "properties": {
                      "type": {
                        "anyOf": [
                          {
                            "const": "tool_request",
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The type of the message, in this case `tool_request`.",
                        "title": "Type"
                      },
                      "author": {
                        "anyOf": [
                          {
                            "$ref": "#/$defs/MessageAuthor"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The role of the messages author, in this case `system`, `user`, `assistant`, or `tool`."
                      },
                      "style": {
                        "anyOf": [
                          {
                            "$ref": "#/$defs/MessageStyle"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The style of the message. This is used by the client to determine how to display the message."
                      },
                      "tool_call_id": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The ID of the tool call that is being requested.",
                        "title": "Tool Call Id"
                      },
                      "name": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The name of the tool that is being requested.",
                        "title": "Name"
                      },
                      "arguments": {
                        "anyOf": [
                          {
                            "additionalProperties": true,
                            "type": "object"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The arguments to the tool.",
                        "title": "Arguments"
                      }
                    },
                    "title": "ToolRequestContentEntityOptional",
                    "type": "object"
                  },
                  "ToolResponseContentEntityOptional": {
                    "properties": {
                      "type": {
                        "anyOf": [
                          {
                            "const": "tool_response",
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The type of the message, in this case `tool_response`.",
                        "title": "Type"
                      },
                      "author": {
                        "anyOf": [
                          {
                            "$ref": "#/$defs/MessageAuthor"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The role of the messages author, in this case `system`, `user`, `assistant`, or `tool`."
                      },
                      "style": {
                        "anyOf": [
                          {
                            "$ref": "#/$defs/MessageStyle"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The style of the message. This is used by the client to determine how to display the message."
                      },
                      "tool_call_id": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The ID of the tool call that is being responded to.",
                        "title": "Tool Call Id"
                      },
                      "name": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The name of the tool that is being responded to.",
                        "title": "Name"
                      },
                      "content": {
                        "anyOf": [
                          {},
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "The result of the tool.",
                        "title": "Content"
                      },
                      "is_error": {
                        "anyOf": [
                          {
                            "type": "boolean"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "description": "Whether the tool call resulted in an error. `None` when the harness does not report a status.",
                        "title": "Is Error"
                      }
                    },
                    "title": "ToolResponseContentEntityOptional",
                    "type": "object"
                  }
                },
                "description": "Filter model for TaskMessage - all fields optional for flexible filtering.\n\nThe `exclude` field determines whether this filter is inclusionary or exclusionary.\nWhen multiple filters are provided:\n- Inclusionary filters (exclude=False) are OR'd together\n- Exclusionary filters (exclude=True) are OR'd together and negated with $nor\n- The two groups are AND'd: (include1 OR include2) AND NOT (exclude1 OR exclude2)",
                "properties": {
                  "content": {
                    "anyOf": [
                      {
                        "$ref": "#/$defs/ToolRequestContentEntityOptional"
                      },
                      {
                        "$ref": "#/$defs/DataContentEntityOptional"
                      },
                      {
                        "$ref": "#/$defs/TextContentEntityOptional"
                      },
                      {
                        "$ref": "#/$defs/ToolResponseContentEntityOptional"
                      },
                      {
                        "$ref": "#/$defs/ReasoningContentEntityOptional"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null,
                    "description": "Filter by message content",
                    "title": "Content"
                  },
                  "streaming_status": {
                    "anyOf": [
                      {
                        "enum": [
                          "IN_PROGRESS",
                          "DONE"
                        ],
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "default": null,
                    "description": "Filter by streaming status",
                    "title": "Streaming Status"
                  },
                  "exclude": {
                    "default": false,
                    "description": "If true, this filter excludes matching messages",
                    "title": "Exclude",
                    "type": "boolean"
                  }
                },
                "title": "TaskMessageEntityFilter",
                "type": "object"
              }

              Each filter can include:
              - `content`: Filter by message content (type, author, data fields)
              - `streaming_status`: Filter by status ("IN_PROGRESS" or "DONE")
              - `exclude`: If true, excludes matching messages (default: false)

              Multiple filters are combined: inclusionary filters (exclude=false) are OR'd together,
              exclusionary filters (exclude=true) are OR'd and negated, then both groups are AND'd.
            title: Filters
          description: |
            JSON-encoded array of TaskMessageEntityFilter objects.

            Schema: {
              "$defs": {
                "DataContentEntityOptional": {
                  "properties": {
                    "type": {
                      "anyOf": [
                        {
                          "const": "data",
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The type of the message, in this case `data`.",
                      "title": "Type"
                    },
                    "author": {
                      "anyOf": [
                        {
                          "$ref": "#/$defs/MessageAuthor"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The role of the messages author, in this case `system`, `user`, `assistant`, or `tool`."
                    },
                    "style": {
                      "anyOf": [
                        {
                          "$ref": "#/$defs/MessageStyle"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The style of the message. This is used by the client to determine how to display the message."
                    },
                    "data": {
                      "anyOf": [
                        {
                          "additionalProperties": true,
                          "type": "object"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The contents of the data message.",
                      "title": "Data"
                    }
                  },
                  "title": "DataContentEntityOptional",
                  "type": "object"
                },
                "FileAttachmentEntity": {
                  "description": "Represents a file attachment in messages.",
                  "properties": {
                    "file_id": {
                      "description": "The unique ID of the attached file",
                      "title": "File Id",
                      "type": "string"
                    },
                    "name": {
                      "description": "The name of the file",
                      "title": "Name",
                      "type": "string"
                    },
                    "size": {
                      "description": "The size of the file in bytes",
                      "title": "Size",
                      "type": "integer"
                    },
                    "type": {
                      "description": "The MIME type or content type of the file",
                      "title": "Type",
                      "type": "string"
                    }
                  },
                  "required": [
                    "file_id",
                    "name",
                    "size",
                    "type"
                  ],
                  "title": "FileAttachmentEntity",
                  "type": "object"
                },
                "MessageAuthor": {
                  "enum": [
                    "user",
                    "agent"
                  ],
                  "title": "MessageAuthor",
                  "type": "string"
                },
                "MessageStyle": {
                  "enum": [
                    "static",
                    "active"
                  ],
                  "title": "MessageStyle",
                  "type": "string"
                },
                "ReasoningContentEntityOptional": {
                  "properties": {
                    "type": {
                      "anyOf": [
                        {
                          "const": "reasoning",
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The type of the message, in this case `reasoning`.",
                      "title": "Type"
                    },
                    "author": {
                      "anyOf": [
                        {
                          "$ref": "#/$defs/MessageAuthor"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The role of the messages author, in this case `system`, `user`, `assistant`, or `tool`."
                    },
                    "style": {
                      "anyOf": [
                        {
                          "$ref": "#/$defs/MessageStyle"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The style of the message. This is used by the client to determine how to display the message."
                    },
                    "summary": {
                      "anyOf": [
                        {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "A list of short reasoning summaries",
                      "title": "Summary"
                    },
                    "content": {
                      "anyOf": [
                        {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The reasoning content or chain-of-thought text",
                      "title": "Content"
                    }
                  },
                  "title": "ReasoningContentEntityOptional",
                  "type": "object"
                },
                "TextContentEntityOptional": {
                  "properties": {
                    "type": {
                      "anyOf": [
                        {
                          "const": "text",
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The type of the message, in this case `text`.",
                      "title": "Type"
                    },
                    "author": {
                      "anyOf": [
                        {
                          "$ref": "#/$defs/MessageAuthor"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The role of the messages author, in this case `system`, `user`, `assistant`, or `tool`."
                    },
                    "style": {
                      "anyOf": [
                        {
                          "$ref": "#/$defs/MessageStyle"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The style of the message. This is used by the client to determine how to display the message."
                    },
                    "format": {
                      "anyOf": [
                        {
                          "$ref": "#/$defs/TextFormat"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The format of the message. This is used by the client to determine how to display the message."
                    },
                    "content": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The contents of the text message.",
                      "title": "Content"
                    },
                    "attachments": {
                      "anyOf": [
                        {
                          "items": {
                            "$ref": "#/$defs/FileAttachmentEntity"
                          },
                          "type": "array"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "Optional list of file attachments with structured metadata.",
                      "title": "Attachments"
                    }
                  },
                  "title": "TextContentEntityOptional",
                  "type": "object"
                },
                "TextFormat": {
                  "enum": [
                    "markdown",
                    "plain",
                    "code"
                  ],
                  "title": "TextFormat",
                  "type": "string"
                },
                "ToolRequestContentEntityOptional": {
                  "properties": {
                    "type": {
                      "anyOf": [
                        {
                          "const": "tool_request",
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The type of the message, in this case `tool_request`.",
                      "title": "Type"
                    },
                    "author": {
                      "anyOf": [
                        {
                          "$ref": "#/$defs/MessageAuthor"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The role of the messages author, in this case `system`, `user`, `assistant`, or `tool`."
                    },
                    "style": {
                      "anyOf": [
                        {
                          "$ref": "#/$defs/MessageStyle"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The style of the message. This is used by the client to determine how to display the message."
                    },
                    "tool_call_id": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The ID of the tool call that is being requested.",
                      "title": "Tool Call Id"
                    },
                    "name": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The name of the tool that is being requested.",
                      "title": "Name"
                    },
                    "arguments": {
                      "anyOf": [
                        {
                          "additionalProperties": true,
                          "type": "object"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The arguments to the tool.",
                      "title": "Arguments"
                    }
                  },
                  "title": "ToolRequestContentEntityOptional",
                  "type": "object"
                },
                "ToolResponseContentEntityOptional": {
                  "properties": {
                    "type": {
                      "anyOf": [
                        {
                          "const": "tool_response",
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The type of the message, in this case `tool_response`.",
                      "title": "Type"
                    },
                    "author": {
                      "anyOf": [
                        {
                          "$ref": "#/$defs/MessageAuthor"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The role of the messages author, in this case `system`, `user`, `assistant`, or `tool`."
                    },
                    "style": {
                      "anyOf": [
                        {
                          "$ref": "#/$defs/MessageStyle"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The style of the message. This is used by the client to determine how to display the message."
                    },
                    "tool_call_id": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The ID of the tool call that is being responded to.",
                      "title": "Tool Call Id"
                    },
                    "name": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The name of the tool that is being responded to.",
                      "title": "Name"
                    },
                    "content": {
                      "anyOf": [
                        {},
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "The result of the tool.",
                      "title": "Content"
                    },
                    "is_error": {
                      "anyOf": [
                        {
                          "type": "boolean"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "default": null,
                      "description": "Whether the tool call resulted in an error. `None` when the harness does not report a status.",
                      "title": "Is Error"
                    }
                  },
                  "title": "ToolResponseContentEntityOptional",
                  "type": "object"
                }
              },
              "description": "Filter model for TaskMessage - all fields optional for flexible filtering.\n\nThe `exclude` field determines whether this filter is inclusionary or exclusionary.\nWhen multiple filters are provided:\n- Inclusionary filters (exclude=False) are OR'd together\n- Exclusionary filters (exclude=True) are OR'd together and negated with $nor\n- The two groups are AND'd: (include1 OR include2) AND NOT (exclude1 OR exclude2)",
              "properties": {
                "content": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/ToolRequestContentEntityOptional"
                    },
                    {
                      "$ref": "#/$defs/DataContentEntityOptional"
                    },
                    {
                      "$ref": "#/$defs/TextContentEntityOptional"
                    },
                    {
                      "$ref": "#/$defs/ToolResponseContentEntityOptional"
                    },
                    {
                      "$ref": "#/$defs/ReasoningContentEntityOptional"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Filter by message content",
                  "title": "Content"
                },
                "streaming_status": {
                  "anyOf": [
                    {
                      "enum": [
                        "IN_PROGRESS",
                        "DONE"
                      ],
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "default": null,
                  "description": "Filter by streaming status",
                  "title": "Streaming Status"
                },
                "exclude": {
                  "default": false,
                  "description": "If true, this filter excludes matching messages",
                  "title": "Exclude",
                  "type": "boolean"
                }
              },
              "title": "TaskMessageEntityFilter",
              "type": "object"
            }

            Each filter can include:
            - `content`: Filter by message content (type, author, data fields)
            - `streaming_status`: Filter by status ("IN_PROGRESS" or "DONE")
            - `exclude`: If true, excludes matching messages (default: false)

            Multiple filters are combined: inclusionary filters (exclude=false) are OR'd together,
            exclusionary filters (exclude=true) are OR'd and negated, then both groups are AND'd.
          examples:
            single_filter:
              summary: Filter by content type
              value: '{"content": {"type": "text"}}'
            multiple_types:
              summary: Filter multiple content types (OR)
              value: '[{"content": {"type": "text"}}, {"content": {"type": "data"}}]'
            with_exclusion:
              summary: Include data messages, exclude specific data types
              value: >-
                [{"content": {"type": "data"}}, {"content": {"data": {"type": "error_report"}}, "exclude":
                true}]
            nested_data:
              summary: Filter by nested data field
              value: '{"content": {"data": {"type": "report_status_update"}}}'
        - name: task_id
          in: query
          required: true
          schema:
            type: string
            description: The task ID
            title: Task Id
          description: The task ID
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedMessagesResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /spans:
    post:
      tags:
        - Spans
      summary: Create Span
      description: Create a new span with the provided parameters
      operationId: create_span_spans_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSpanRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Span'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    get:
      tags:
        - Spans
      summary: List Spans
      description: List spans, optionally filtered by trace_id and/or task_id
      operationId: list_spans_spans_get
      parameters:
        - name: trace_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Trace Id
        - name: task_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Task Id
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 1000
            minimum: 1
            default: 50
            title: Limit
        - name: page_number
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            default: 1
            title: Page Number
        - name: order_by
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Order By
        - name: order_direction
          in: query
          required: false
          schema:
            type: string
            default: desc
            title: Order Direction
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Span'
                title: Response List Spans Spans Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /spans/{span_id}:
    patch:
      tags:
        - Spans
      summary: Partial Update Span
      description: Update a span with the provided output data and mark it as complete
      operationId: partial_update_span_spans__span_id__patch
      parameters:
        - name: span_id
          in: path
          required: true
          schema:
            type: string
            title: Span Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateSpanRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Span'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    get:
      tags:
        - Spans
      summary: Get Span
      description: Get a span by ID
      operationId: get_span_spans__span_id__get
      parameters:
        - name: span_id
          in: path
          required: true
          schema:
            type: string
            title: Span Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Span'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /states:
    post:
      tags:
        - States
      summary: Create Task State
      operationId: create_task_state_states_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateStateRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/State'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    get:
      tags:
        - States
      summary: List States
      description: List all states, optionally filtered by query parameters.
      operationId: filter_states_states_get
      parameters:
        - name: task_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Task ID
            title: Task Id
          description: Task ID
        - name: agent_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Agent ID
            title: Agent Id
          description: Agent ID
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            description: Limit
            default: 50
            title: Limit
          description: Limit
        - name: page_number
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            description: Page number
            default: 1
            title: Page Number
          description: Page number
        - name: order_by
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Field to order by
            title: Order By
          description: Field to order by
        - name: order_direction
          in: query
          required: false
          schema:
            type: string
            description: Order direction (asc or desc)
            default: desc
            title: Order Direction
          description: Order direction (asc or desc)
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/State'
                title: Response Filter States States Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /states/{state_id}:
    get:
      tags:
        - States
      summary: Get State by State ID
      description: Get a state by its unique state ID.
      operationId: get_state_states__state_id__get
      parameters:
        - name: state_id
          in: path
          required: true
          schema:
            type: string
            title: State Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/State'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    put:
      tags:
        - States
      summary: Update Task State
      operationId: update_task_state_states__state_id__put
      parameters:
        - name: state_id
          in: path
          required: true
          schema:
            type: string
            title: State Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateStateRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/State'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
        - States
      summary: Delete Task State
      operationId: delete_task_state_states__state_id__delete
      parameters:
        - name: state_id
          in: path
          required: true
          schema:
            type: string
            title: State Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/State'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /events/{event_id}:
    get:
      tags:
        - Events
      summary: Get Event
      operationId: get_event_events__event_id__get
      parameters:
        - name: event_id
          in: path
          required: true
          schema:
            type: string
            title: Event Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Event'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /events:
    get:
      tags:
        - Events
      summary: List Events
      description: |-
        List events for a specific task and agent.

        Optionally filter for events after a specific sequence ID.
        Results are ordered by sequence_id.
      operationId: list_events_events_get
      parameters:
        - name: last_processed_event_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Optional event ID to get events after this ID
            title: Last Processed Event Id
          description: Optional event ID to get events after this ID
        - name: limit
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
                maximum: 1000
                minimum: 1
              - type: 'null'
            description: Optional limit on number of results
            title: Limit
          description: Optional limit on number of results
        - name: task_id
          in: query
          required: true
          schema:
            type: string
            description: The task ID to filter events by
            title: Task Id
          description: The task ID to filter events by
        - name: agent_id
          in: query
          required: true
          schema:
            type: string
            description: The agent ID to filter events by
            title: Agent Id
          description: The agent ID to filter events by
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Event'
                title: Response List Events Events Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /tracker/{tracker_id}:
    get:
      tags:
        - Agent Task Tracker
      summary: Get Agent Task Tracker
      description: Get agent task tracker by tracker ID
      operationId: get_agent_task_tracker_tracker__tracker_id__get
      parameters:
        - name: tracker_id
          in: path
          required: true
          schema:
            type: string
            title: Tracker Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentTaskTracker'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    put:
      tags:
        - Agent Task Tracker
      summary: Update Agent Task Tracker
      description: Update agent task tracker by tracker ID
      operationId: update_agent_task_tracker_tracker__tracker_id__put
      parameters:
        - name: tracker_id
          in: path
          required: true
          schema:
            type: string
            title: Tracker Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAgentTaskTrackerRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentTaskTracker'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /tracker:
    get:
      tags:
        - Agent Task Tracker
      summary: List Agent Task Trackers
      description: List all agent task trackers, optionally filtered by query parameters.
      operationId: filter_agent_task_tracker_tracker_get
      parameters:
        - name: agent_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Agent ID
            title: Agent Id
          description: Agent ID
        - name: task_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Task ID
            title: Task Id
          description: Task ID
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            description: Limit
            default: 50
            title: Limit
          description: Limit
        - name: page_number
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            description: Page number
            default: 1
            title: Page Number
          description: Page number
        - name: order_by
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Field to order by
            title: Order By
          description: Field to order by
        - name: order_direction
          in: query
          required: false
          schema:
            type: string
            description: Order direction (asc or desc)
            default: desc
            title: Order Direction
          description: Order direction (asc or desc)
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AgentTaskTracker'
                title: Response Filter Agent Task Tracker Tracker Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /agent_api_keys:
    post:
      tags:
        - Agent APIKeys
      summary: Create Api Key
      operationId: create_api_key_agent_api_keys_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAPIKeyRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateAPIKeyResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    get:
      tags:
        - Agent APIKeys
      summary: List API keys for an agent ID
      description: List API keys for an agent ID.
      operationId: list_agent_api_keys_agent_api_keys_get
      parameters:
        - name: agent_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Agent Id
        - name: agent_name
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Agent Name
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 1000
            minimum: 1
            default: 50
            title: Limit
        - name: page_number
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            default: 1
            title: Page Number
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AgentAPIKey'
                title: Response List Agent Api Keys Agent Api Keys Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /agent_api_keys/webhook-trigger:
    post:
      tags:
        - Agent APIKeys
      summary: Create Webhook Trigger
      description: |-
        Wire a webhook trigger in one call.

        Registers the source's signature-verification key (github/slack) for the agent and
        returns the ready-to-paste forward webhook URL plus the signing secret (shown once).
        The webhook then flows through the existing /agents/forward ingress, which verifies
        the signature against this key. Bundles the existing key-create + URL composition so
        a UI (or a curl) can set up a trigger without two steps.
      operationId: create_webhook_trigger_agent_api_keys_webhook_trigger_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWebhookTriggerRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateWebhookTriggerResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /agent_api_keys/name/{name}:
    get:
      tags:
        - Agent APIKeys
      summary: Return named API key for the agent ID
      description: Return named API key for the agent ID.
      operationId: get_agent_api_key_by_name_agent_api_keys_name__name__get
      parameters:
        - name: name
          in: path
          required: true
          schema:
            type: string
            title: Name
        - name: agent_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Agent Id
        - name: agent_name
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Agent Name
        - name: api_key_type
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/AgentAPIKeyType'
            default: external
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentAPIKey'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /agent_api_keys/{id}:
    get:
      tags:
        - Agent APIKeys
      summary: Return the API key by ID
      description: Return API key by ID.
      operationId: get_agent_api_key_agent_api_keys__id__get
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            title: Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentAPIKey'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
        - Agent APIKeys
      summary: Delete API key by ID
      description: Delete API key by ID.
      operationId: delete_agent_api_key_agent_api_keys__id__delete
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            title: Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: string
                title: Response Delete Agent Api Key Agent Api Keys  Id  Delete
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /agent_api_keys/name/{api_key_name}:
    delete:
      tags:
        - Agent APIKeys
      summary: Delete API key by name
      description: Delete API key by name.
      operationId: delete_agent_api_key_by_name_agent_api_keys_name__api_key_name__delete
      parameters:
        - name: api_key_name
          in: path
          required: true
          schema:
            type: string
            title: Api Key Name
        - name: agent_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Agent Id
        - name: agent_name
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Agent Name
        - name: api_key_type
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/AgentAPIKeyType'
            default: external
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: string
                title: Response Delete Agent Api Key By Name Agent Api Keys Name  Api Key Name  Delete
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /deployment-history/{deployment_id}:
    get:
      tags:
        - Deployment History
      summary: Get Deployment by ID
      description: Get a deployment record by its unique ID.
      operationId: get_deployment_by_id_deployment_history__deployment_id__get
      parameters:
        - name: deployment_id
          in: path
          required: true
          schema:
            type: string
            title: Deployment Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeploymentHistory'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /deployment-history:
    get:
      tags:
        - Deployment History
      summary: List Deployments for an agent
      description: List deployment history for an agent.
      operationId: list_deployments_deployment_history_get
      parameters:
        - name: agent_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Agent Id
        - name: agent_name
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Agent Name
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 50
            title: Limit
        - name: page_number
          in: query
          required: false
          schema:
            type: integer
            default: 1
            title: Page Number
        - name: order_by
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Order By
        - name: order_direction
          in: query
          required: false
          schema:
            type: string
            default: desc
            title: Order Direction
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DeploymentHistory'
                title: Response List Deployments Deployment History Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /agents/{agent_id}/deployments:
    post:
      tags:
        - Deployments
      summary: Create Deployment
      description: Create a new deployment record in PENDING status.
      operationId: create_deployment_agents__agent_id__deployments_post
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            title: Agent Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDeploymentRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Deployment'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    get:
      tags:
        - Deployments
      summary: List Deployments
      description: List deployments for an agent, newest first.
      operationId: list_deployments_agents__agent_id__deployments_get
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            title: Agent Id
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            description: Limit
            default: 50
            title: Limit
          description: Limit
        - name: page_number
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            description: Page number
            default: 1
            title: Page Number
          description: Page number
        - name: order_by
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Field to order by
            title: Order By
          description: Field to order by
        - name: order_direction
          in: query
          required: false
          schema:
            type: string
            description: Order direction (asc or desc)
            default: desc
            title: Order Direction
          description: Order direction (asc or desc)
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Deployment'
                title: Response List Deployments Agents  Agent Id  Deployments Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /agents/{agent_id}/deployments/{deployment_id}:
    get:
      tags:
        - Deployments
      summary: Get Deployment
      description: Get a specific deployment by ID.
      operationId: get_deployment_agents__agent_id__deployments__deployment_id__get
      parameters:
        - name: deployment_id
          in: path
          required: true
          schema:
            type: string
            title: Deployment Id
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            title: Agent Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Deployment'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
        - Deployments
      summary: Delete Deployment
      description: Delete a non-production deployment.
      operationId: delete_deployment_agents__agent_id__deployments__deployment_id__delete
      parameters:
        - name: deployment_id
          in: path
          required: true
          schema:
            type: string
            title: Deployment Id
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            title: Agent Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /agents/{agent_id}/deployments/{deployment_id}/promote:
    post:
      tags:
        - Deployments
      summary: Promote Deployment
      description: Promote a deployment to production with atomic cutover.
      operationId: promote_deployment_agents__agent_id__deployments__deployment_id__promote_post
      parameters:
        - name: deployment_id
          in: path
          required: true
          schema:
            type: string
            title: Deployment Id
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            title: Agent Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Deployment'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /agents/{agent_id}/deployments/{deployment_id}/rpc:
    post:
      tags:
        - Deployments
      summary: Preview RPC
      description: Send an RPC request to a specific deployment (for preview testing).
      operationId: handle_deployment_rpc_agents__agent_id__deployments__deployment_id__rpc_post
      parameters:
        - name: deployment_id
          in: path
          required: true
          schema:
            type: string
            title: Deployment Id
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            title: Agent Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentRPCRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentRPCResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /agents/{agent_id}/schedules:
    post:
      tags:
        - Schedules
      summary: Create Run Schedule
      description: Create a recurring schedule that starts a fresh agent run on each fire.
      operationId: create_run_schedule_agents__agent_id__schedules_post
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            title: Agent Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAgentRunScheduleRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentRunScheduleResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    get:
      tags:
        - Schedules
      summary: List Run Schedules
      description: List run schedules for an agent.
      operationId: list_run_schedules_agents__agent_id__schedules_get
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            title: Agent Id
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 1000
            minimum: 1
            default: 100
            title: Limit
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentRunScheduleListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /agents/{agent_id}/schedules/name/{name}:
    get:
      tags:
        - Schedules
      summary: Get Run Schedule By Name
      description: Get a run schedule by its active name.
      operationId: get_run_schedule_by_name_agents__agent_id__schedules_name__name__get
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            title: Agent Id
        - name: name
          in: path
          required: true
          schema:
            type: string
            title: Name
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentRunScheduleResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    patch:
      tags:
        - Schedules
      summary: Update Run Schedule By Name
      description: Partially update a run schedule's definition by its active name.
      operationId: update_run_schedule_by_name_agents__agent_id__schedules_name__name__patch
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            title: Agent Id
        - name: name
          in: path
          required: true
          schema:
            type: string
            title: Name
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAgentRunScheduleRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentRunScheduleResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
        - Schedules
      summary: Delete Run Schedule By Name
      description: Delete a run schedule by its active name.
      operationId: delete_run_schedule_by_name_agents__agent_id__schedules_name__name__delete
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            title: Agent Id
        - name: name
          in: path
          required: true
          schema:
            type: string
            title: Name
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /agents/{agent_id}/schedules/{schedule_id}:
    get:
      tags:
        - Schedules
      summary: Get Run Schedule
      description: Get a run schedule by its id.
      operationId: get_run_schedule_agents__agent_id__schedules__schedule_id__get
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            title: Agent Id
        - name: schedule_id
          in: path
          required: true
          schema:
            type: string
            title: Schedule Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentRunScheduleResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    patch:
      tags:
        - Schedules
      summary: Update Run Schedule
      description: Partially update a run schedule's definition (cadence, window, input, etc.).
      operationId: update_run_schedule_agents__agent_id__schedules__schedule_id__patch
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            title: Agent Id
        - name: schedule_id
          in: path
          required: true
          schema:
            type: string
            title: Schedule Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAgentRunScheduleRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentRunScheduleResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
        - Schedules
      summary: Delete Run Schedule
      description: Delete a run schedule permanently.
      operationId: delete_run_schedule_agents__agent_id__schedules__schedule_id__delete
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            title: Agent Id
        - name: schedule_id
          in: path
          required: true
          schema:
            type: string
            title: Schedule Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /agents/{agent_id}/schedules/name/{name}/trigger:
    post:
      tags:
        - Schedules
      summary: Trigger Run Schedule By Name
      description: Trigger an immediate, out-of-band run of the schedule by its active name.
      operationId: trigger_run_schedule_by_name_agents__agent_id__schedules_name__name__trigger_post
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            title: Agent Id
        - name: name
          in: path
          required: true
          schema:
            type: string
            title: Name
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentRunScheduleResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /agents/{agent_id}/schedules/{schedule_id}/trigger:
    post:
      tags:
        - Schedules
      summary: Trigger Run Schedule
      description: Trigger an immediate, out-of-band run of the schedule (in addition to its cadence).
      operationId: trigger_run_schedule_agents__agent_id__schedules__schedule_id__trigger_post
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            title: Agent Id
        - name: schedule_id
          in: path
          required: true
          schema:
            type: string
            title: Schedule Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentRunScheduleResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /agents/{agent_id}/schedules/{schedule_id}/skip:
    post:
      tags:
        - Schedules
      summary: Skip Run Schedule Action
      description: Skip a recurring fire of the schedule.
      operationId: skip_run_schedule_action_agents__agent_id__schedules__schedule_id__skip_post
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            title: Agent Id
        - name: schedule_id
          in: path
          required: true
          schema:
            type: string
            title: Schedule Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SkipRunScheduleRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentRunScheduleResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /agents/{agent_id}/schedules/{schedule_id}/unskip:
    post:
      tags:
        - Schedules
      summary: Unskip Run Schedule Action
      description: Remove a skip for a recurring fire of the schedule.
      operationId: unskip_run_schedule_action_agents__agent_id__schedules__schedule_id__unskip_post
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            title: Agent Id
        - name: schedule_id
          in: path
          required: true
          schema:
            type: string
            title: Schedule Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UnskipRunScheduleRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentRunScheduleResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /agents/{agent_id}/schedules/name/{name}/pause:
    post:
      tags:
        - Schedules
      summary: Pause Run Schedule By Name
      description: Pause a run schedule by its active name.
      operationId: pause_run_schedule_by_name_agents__agent_id__schedules_name__name__pause_post
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            title: Agent Id
        - name: name
          in: path
          required: true
          schema:
            type: string
            title: Name
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/PauseRunScheduleRequest'
                - type: 'null'
              title: Request
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentRunScheduleResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /agents/{agent_id}/schedules/{schedule_id}/pause:
    post:
      tags:
        - Schedules
      summary: Pause Run Schedule
      description: Pause a run schedule so it stops firing.
      operationId: pause_run_schedule_agents__agent_id__schedules__schedule_id__pause_post
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            title: Agent Id
        - name: schedule_id
          in: path
          required: true
          schema:
            type: string
            title: Schedule Id
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/PauseRunScheduleRequest'
                - type: 'null'
              title: Request
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentRunScheduleResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /agents/{agent_id}/schedules/name/{name}/resume:
    post:
      tags:
        - Schedules
      summary: Resume Run Schedule By Name
      description: Resume a paused run schedule by its active name.
      operationId: resume_run_schedule_by_name_agents__agent_id__schedules_name__name__resume_post
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            title: Agent Id
        - name: name
          in: path
          required: true
          schema:
            type: string
            title: Name
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/ResumeRunScheduleRequest'
                - type: 'null'
              title: Request
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentRunScheduleResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /agents/{agent_id}/schedules/{schedule_id}/resume:
    post:
      tags:
        - Schedules
      summary: Resume Run Schedule
      description: Resume a paused run schedule so it fires again.
      operationId: resume_run_schedule_agents__agent_id__schedules__schedule_id__resume_post
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            title: Agent Id
        - name: schedule_id
          in: path
          required: true
          schema:
            type: string
            title: Schedule Id
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/ResumeRunScheduleRequest'
                - type: 'null'
              title: Request
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentRunScheduleResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /checkpoints/get-tuple:
    post:
      tags:
        - Checkpoints
      summary: Get Checkpoint Tuple
      operationId: get_checkpoint_tuple_checkpoints_get_tuple_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetCheckpointTupleRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/CheckpointTupleResponse'
                  - type: 'null'
                title: Response Get Checkpoint Tuple Checkpoints Get Tuple Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /checkpoints/put:
    post:
      tags:
        - Checkpoints
      summary: Put Checkpoint
      operationId: put_checkpoint_checkpoints_put_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PutCheckpointRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PutCheckpointResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /checkpoints/put-writes:
    post:
      tags:
        - Checkpoints
      summary: Put Writes
      operationId: put_writes_checkpoints_put_writes_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PutWritesRequest'
        required: true
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /checkpoints/list:
    post:
      tags:
        - Checkpoints
      summary: List Checkpoints
      operationId: list_checkpoints_checkpoints_list_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ListCheckpointsRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/CheckpointListItem'
                type: array
                title: Response List Checkpoints Checkpoints List Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /checkpoints/delete-thread:
    post:
      tags:
        - Checkpoints
      summary: Delete Thread
      operationId: delete_thread_checkpoints_delete_thread_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeleteThreadRequest'
        required: true
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /tasks/{task_id}/export:
    get:
      tags:
        - task-retention
      summary: Export Task
      description: |-
        Build a self-contained snapshot of a task's content surfaces.

        Returns the exact payload format that POST /rehydrate accepts, so
        export → clean → rehydrate is a round-trip-equivalent operation.
      operationId: export_task_tasks__task_id__export_get
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            type: string
            title: Task Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExportTaskResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
        - task-retention
      summary: Export Task To Url
      description: |-
        Build the task snapshot and PUT it to a caller-supplied presigned URL.

        Use this when the snapshot is too large for a JSON response body (long
        conversations, deep reasoning content, many attachments). The upload URL
        must be https and resolve to a public address — see SSRF guard.
      operationId: export_task_to_url_tasks__task_id__export_post
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            type: string
            title: Task Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExportTaskToUrlRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExportTaskToUrlResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /tasks/{task_id}/clean:
    post:
      tags:
        - task-retention
      summary: Clean Task
      description: |-
        Delete content-bearing rows for a stale task.

        Refuses on active tasks, in-flight workflows, or unprocessed events
        regardless of `force`. The `force=true` flag only bypasses the
        idle-threshold check.
      operationId: clean_task_tasks__task_id__clean_post
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            type: string
            title: Task Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CleanTaskRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CleanTaskResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /tasks/{task_id}/rehydrate:
    post:
      tags:
        - task-retention
      summary: Rehydrate Task
      description: |-
        Restore content-bearing rows from a snapshot.

        Two modes:
        - Inline: caller provides messages and task_states in the request body.
        - URL: caller provides snapshot_url; Agentex downloads and parses it.

        Refuses if the task isn't currently in a cleaned state, or if any supplied
        message/state ID already exists in Mongo (catches double-rehydrate).
      operationId: rehydrate_task_tasks__task_id__rehydrate_post
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            type: string
            title: Task Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RehydrateTaskRequest'
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ACPType:
      type: string
      enum:
        - sync
        - async
        - agentic
      title: ACPType
    Agent:
      properties:
        id:
          type: string
          title: Id
          description: The unique identifier of the agent.
        name:
          type: string
          title: Name
          description: The unique name of the agent.
        description:
          type: string
          title: Description
          description: The description of the action.
        status:
          $ref: '#/components/schemas/AgentStatus'
          description: The status of the action, indicating if it's building, ready, failed, etc.
          default: Unknown
        acp_type:
          $ref: '#/components/schemas/ACPType'
          description: The type of the ACP Server (Either sync or async)
        status_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Status Reason
          description: The reason for the status of the action.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: The timestamp when the agent was created
        updated_at:
          type: string
          format: date-time
          title: Updated At
          description: The timestamp when the agent was last updated
        registration_metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Registration Metadata
          description: The metadata for the agent's registration.
        registered_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Registered At
          description: The timestamp when the agent was last registered
        agent_input_type:
          anyOf:
            - $ref: '#/components/schemas/AgentInputType'
            - type: 'null'
          description: The type of input the agent expects.
        production_deployment_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Production Deployment Id
          description: ID of the current production deployment.
      type: object
      required:
        - id
        - name
        - description
        - acp_type
        - created_at
        - updated_at
      title: Agent
    AgentAPIKey:
      properties:
        id:
          type: string
          title: Id
          description: The unique identifier of the agent API key.
        agent_id:
          type: string
          title: Agent Id
          description: The UUID of the agent
        created_at:
          type: string
          format: date-time
          title: Created At
          description: When the agent API key was created
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: The optional name of the agent API key.
        api_key_type:
          $ref: '#/components/schemas/AgentAPIKeyType'
          description: The type of the agent API key (either internal or external)
      type: object
      required:
        - id
        - agent_id
        - created_at
        - name
        - api_key_type
      title: AgentAPIKey
    AgentAPIKeyType:
      type: string
      enum:
        - internal
        - external
        - github
        - slack
      title: AgentAPIKeyType
    AgentInputType:
      type: string
      enum:
        - text
        - json
      title: AgentInputType
    AgentRPCMethod:
      type: string
      enum:
        - event/send
        - task/create
        - message/send
        - task/cancel
        - task/interrupt
      title: AgentRPCMethod
    AgentRPCParams:
      anyOf:
        - $ref: '#/components/schemas/CreateTaskRequest'
        - $ref: '#/components/schemas/CancelTaskRequest'
        - $ref: '#/components/schemas/InterruptTaskRequest'
        - $ref: '#/components/schemas/SendMessageRequest'
        - $ref: '#/components/schemas/SendEventRequest'
      title: AgentRPCParams
      description: The parameters for the agent RPC request
    AgentRPCRequest:
      properties:
        jsonrpc:
          type: string
          const: '2.0'
          title: Jsonrpc
          default: '2.0'
        method:
          $ref: '#/components/schemas/AgentRPCMethod'
        params:
          $ref: '#/components/schemas/AgentRPCParams'
        id:
          anyOf:
            - type: integer
            - type: string
            - type: 'null'
          title: Id
      type: object
      required:
        - method
        - params
      title: AgentRPCRequest
    AgentRPCResponse:
      properties:
        jsonrpc:
          type: string
          const: '2.0'
          title: Jsonrpc
          default: '2.0'
        result:
          $ref: '#/components/schemas/AgentRPCResult'
          description: The result of the agent RPC request
        error:
          anyOf:
            - {}
            - type: 'null'
          title: Error
        id:
          anyOf:
            - type: integer
            - type: string
            - type: 'null'
          title: Id
      type: object
      required:
        - result
      title: AgentRPCResponse
    AgentRPCResult:
      anyOf:
        - items:
            $ref: '#/components/schemas/TaskMessage'
          type: array
        - $ref: '#/components/schemas/TaskMessageUpdate'
        - $ref: '#/components/schemas/Task'
        - $ref: '#/components/schemas/Event'
        - type: 'null'
      title: AgentRPCResult
    AgentRunScheduleListResponse:
      properties:
        run_schedules:
          items:
            $ref: '#/components/schemas/AgentRunScheduleResponse'
          type: array
          title: Run Schedules
          description: The list of run schedules.
        total:
          type: integer
          title: Total
          description: The number of run schedules returned.
      type: object
      required:
        - run_schedules
        - total
      title: AgentRunScheduleListResponse
      description: Response model for listing run schedules.
    AgentRunScheduleResponse:
      properties:
        id:
          type: string
          title: Id
          description: The unique identifier of the run schedule.
        agent_id:
          type: string
          title: Agent Id
          description: The agent this schedule belongs to.
        name:
          type: string
          title: Name
          description: Human-readable schedule name.
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Optional description.
        cron_expression:
          anyOf:
            - type: string
            - type: 'null'
          title: Cron Expression
          description: Cron cadence, if cron-based.
        interval_seconds:
          anyOf:
            - type: integer
            - type: 'null'
          title: Interval Seconds
          description: Interval cadence in seconds, if interval-based.
        timezone:
          type: string
          title: Timezone
          description: Timezone the cron expression is evaluated in.
          default: UTC
        start_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Start At
          description: Schedule activation time.
        end_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: End At
          description: Schedule deactivation time.
        paused:
          type: boolean
          title: Paused
          description: Whether the schedule is paused.
          default: false
        task_params:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Task Params
          description: Task params at fire time.
        task_metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Task Metadata
          description: Task metadata at fire time.
        initial_input:
          $ref: '#/components/schemas/ScheduleInitialInput'
          description: The initial input.
        initial_input_method:
          type: string
          title: Initial Input Method
          description: Delivery method, inferred from the agent's ACP type.
        creator_principal:
          anyOf:
            - $ref: '#/components/schemas/ScheduleCreatorPrincipal'
            - type: 'null'
          description: Credential-free creator identity.
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
          description: When the schedule was created.
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
          description: When the schedule was updated.
        state:
          $ref: '#/components/schemas/RunScheduleState'
          description: Live schedule state from Temporal.
          default: ACTIVE
        next_action_times:
          items:
            type: string
            format: date-time
          type: array
          title: Next Action Times
          description: Upcoming scheduled fire times.
        skipped_action_times:
          items:
            type: string
            format: date-time
          type: array
          title: Skipped Action Times
          description: Skipped one-off scheduled fire times.
        last_action_time:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Action Time
          description: When the schedule last fired.
        num_actions_taken:
          type: integer
          title: Num Actions Taken
          description: Number of times the schedule has fired.
          default: 0
      type: object
      required:
        - id
        - agent_id
        - name
        - initial_input
        - initial_input_method
      title: AgentRunScheduleResponse
      description: Response model describing a scheduled agent run.
    AgentStatus:
      type: string
      enum:
        - Ready
        - Failed
        - Unknown
        - Deleted
        - Unhealthy
        - BuildOnly
      title: AgentStatus
    AgentTaskTracker:
      properties:
        id:
          type: string
          title: Id
          description: The UUID of the agent task tracker
        agent_id:
          type: string
          title: Agent Id
          description: The UUID of the agent
        task_id:
          type: string
          title: Task Id
          description: The UUID of the task
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
          description: Processing status
        status_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Status Reason
          description: Optional status reason
        last_processed_event_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Processed Event Id
          description: The last processed event ID
        created_at:
          type: string
          format: date-time
          title: Created At
          description: When the agent task tracker was created
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
          description: When the agent task tracker was last updated
      type: object
      required:
        - id
        - agent_id
        - task_id
        - created_at
      title: AgentTaskTracker
    BatchCreateTaskMessagesRequest:
      properties:
        task_id:
          type: string
          title: The unique id of the task to send the messages to
        contents:
          items:
            $ref: '#/components/schemas/TaskMessageContent'
          type: array
          title: >-
            The messages to send to the task. The order of the messages will be the order they are added to
            the task.
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Optional caller-supplied base creation timestamp for the batch
          description: >-
            Optional base timestamp. Each message in the batch is stamped with base + i milliseconds to
            guarantee unique, monotonic ordering. If omitted, the server stamps datetime.now(UTC) at insert
            time.
      type: object
      required:
        - task_id
        - contents
      title: BatchCreateTaskMessagesRequest
    BatchUpdateTaskMessagesRequest:
      properties:
        task_id:
          type: string
          title: The unique id of the task to update the messages of
        updates:
          additionalProperties:
            $ref: '#/components/schemas/TaskMessageContent'
          type: object
          title: >-
            The updates to apply to the messages. The key is the TaskMessage id and the value is the
            TaskMessageContent to update the message with.
      type: object
      required:
        - task_id
        - updates
      title: BatchUpdateTaskMessagesRequest
    BlobData:
      properties:
        channel:
          type: string
          title: Channel name
        version:
          type: string
          title: Channel version
        type:
          type: string
          title: Serialization type tag
        blob:
          anyOf:
            - type: string
            - type: 'null'
          title: Base64-encoded binary data
      type: object
      required:
        - channel
        - version
        - type
      title: BlobData
    BlobResponse:
      properties:
        channel:
          type: string
          title: Channel
        version:
          type: string
          title: Version
        type:
          type: string
          title: Type
        blob:
          anyOf:
            - type: string
            - type: 'null'
          title: Blob
      type: object
      required:
        - channel
        - version
        - type
      title: BlobResponse
    CancelTaskRequest:
      properties:
        task_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Task Id
          description: The ID of the task to cancel. Either this or task_name must be provided.
        task_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Task Name
          description: The name of the task to cancel. Either this or task_id must be provided.
      type: object
      title: CancelTaskRequest
    CheckpointListItem:
      properties:
        thread_id:
          type: string
          title: Thread Id
        checkpoint_ns:
          type: string
          title: Checkpoint Ns
        checkpoint_id:
          type: string
          title: Checkpoint Id
        parent_checkpoint_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Checkpoint Id
        checkpoint:
          additionalProperties: true
          type: object
          title: Checkpoint
        metadata:
          additionalProperties: true
          type: object
          title: Metadata
      type: object
      required:
        - thread_id
        - checkpoint_ns
        - checkpoint_id
        - checkpoint
        - metadata
      title: CheckpointListItem
    CheckpointTupleResponse:
      properties:
        thread_id:
          type: string
          title: Thread Id
        checkpoint_ns:
          type: string
          title: Checkpoint Ns
        checkpoint_id:
          type: string
          title: Checkpoint Id
        parent_checkpoint_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Checkpoint Id
        checkpoint:
          additionalProperties: true
          type: object
          title: Checkpoint
        metadata:
          additionalProperties: true
          type: object
          title: Metadata
        blobs:
          items:
            $ref: '#/components/schemas/BlobResponse'
          type: array
          title: Blobs
        pending_writes:
          items:
            $ref: '#/components/schemas/WriteResponse'
          type: array
          title: Pending Writes
      type: object
      required:
        - thread_id
        - checkpoint_ns
        - checkpoint_id
        - checkpoint
        - metadata
      title: CheckpointTupleResponse
    CleanTaskRequest:
      properties:
        force:
          type: boolean
          title: Force
          description: >-
            Skip the idle-threshold check. Active-workflow and unprocessed-events checks still apply. Admin
            use only.
          default: false
        idle_days:
          type: integer
          minimum: 1
          title: Idle Days
          description: Idle threshold in days (ignored when force=true).
          default: 7
      type: object
      title: CleanTaskRequest
    CleanTaskResponse:
      properties:
        task_id:
          type: string
          title: Task Id
        cleaned_at:
          type: string
          format: date-time
          title: Cleaned At
        messages_deleted:
          type: integer
          title: Messages Deleted
        task_states_deleted:
          type: integer
          title: Task States Deleted
        events_deleted:
          type: integer
          title: Events Deleted
      type: object
      required:
        - task_id
        - cleaned_at
        - messages_deleted
        - task_states_deleted
        - events_deleted
      title: CleanTaskResponse
    CreateAPIKeyRequest:
      properties:
        agent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent Id
          description: The UUID of the agent
        agent_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent Name
          description: The name of the agent - if not provided, the agent_id must be set.
        name:
          type: string
          title: Name
          description: The name of the agent's API key.
        api_key_type:
          $ref: '#/components/schemas/AgentAPIKeyType'
          description: The type of the agent API key (external by default).
          default: external
        api_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Api Key
          description: Optionally provide the API key value - if not set, one will be generated.
      type: object
      required:
        - name
      title: CreateAPIKeyRequest
    CreateAPIKeyResponse:
      properties:
        id:
          type: string
          title: Id
          description: The unique identifier of the agent API key.
        agent_id:
          type: string
          title: Agent Id
          description: The UUID of the agent
        created_at:
          type: string
          format: date-time
          title: Created At
          description: When the agent API key was created
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: The optional name of the agent API key.
        api_key_type:
          $ref: '#/components/schemas/AgentAPIKeyType'
          description: The type of the created agent API key (external).
        api_key:
          type: string
          title: Api Key
          description: The value of the newly created API key.
      type: object
      required:
        - id
        - agent_id
        - created_at
        - name
        - api_key_type
        - api_key
      title: CreateAPIKeyResponse
    CreateAgentRunScheduleRequest:
      properties:
        name:
          type: string
          maxLength: 64
          minLength: 1
          pattern: ^[a-z0-9][a-z0-9-]*[a-z0-9]$|^[a-z0-9]$
          title: Schedule Name
          description: Human-readable name, unique among active schedules for the agent.
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Optional description of what this schedule does.
        cron_expression:
          anyOf:
            - type: string
            - type: 'null'
          title: Cron Expression
          description: >-
            Cron expression for the cadence (e.g. '0 17 * * MON-FRI'). Mutually exclusive with
            interval_seconds.
        interval_seconds:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Interval Seconds
          description: Interval cadence in seconds. Mutually exclusive with cron_expression.
        timezone:
          type: string
          title: Timezone
          description: IANA timezone the cron expression is evaluated in (e.g. 'America/New_York').
          default: UTC
        start_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Start At
          description: When the schedule should start being active.
        end_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: End At
          description: When the schedule should stop being active.
        paused:
          type: boolean
          title: Paused
          description: Whether to create the schedule in a paused state.
          default: false
        task_params:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Task Params
          description: Resolved config forwarded as task `params` at fire time.
        task_metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Task Metadata
          description: Metadata copied onto each created task at fire time.
        initial_input:
          $ref: '#/components/schemas/ScheduleInitialInput'
          description: The first input delivered to each created task.
      type: object
      required:
        - name
        - initial_input
      title: CreateAgentRunScheduleRequest
      description: Request body for creating a scheduled agent run.
    CreateDeploymentRequest:
      properties:
        docker_image:
          type: string
          title: Docker Image
          description: Full Docker image URI.
        registration_metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Registration Metadata
          description: Git/build metadata (commit_hash, branch_name, author_name, author_email, build_timestamp).
        sgp_deploy_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Sgp Deploy Id
          description: SGP deployment ID.
        helm_release_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Helm Release Name
          description: Helm release name.
      type: object
      required:
        - docker_image
      title: CreateDeploymentRequest
    CreateSpanRequest:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Unique Span ID
          description: Unique identifier for the span. If not provided, an ID will be generated.
        trace_id:
          type: string
          title: The trace ID for this span
          description: Unique identifier for the trace this span belongs to
        task_id:
          anyOf:
            - type: string
            - type: 'null'
          title: The task ID this span is associated with
          description: ID of the task this span belongs to
        parent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: The parent span ID if this is a child span
          description: ID of the parent span if this is a child span in a trace
        name:
          type: string
          title: The name of the span
          description: Name that describes what operation this span represents
        start_time:
          type: string
          format: date-time
          title: The start time of the span
          description: The time the span started
        end_time:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: The end time of the span
          description: The time the span ended
        input:
          anyOf:
            - additionalProperties: true
              type: object
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: The input data for the span
          description: Input parameters or data for the operation
        output:
          anyOf:
            - additionalProperties: true
              type: object
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: The output data from the span
          description: Output data resulting from the operation
        data:
          anyOf:
            - additionalProperties: true
              type: object
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Additional data associated with the span
          description: Any additional metadata or context for the span
      type: object
      required:
        - trace_id
        - name
        - start_time
      title: CreateSpanRequest
    CreateStateRequest:
      properties:
        task_id:
          type: string
          title: The unique id of the task to send the state to
        agent_id:
          type: string
          title: The unique id of the agent to send the state to
        state:
          additionalProperties: true
          type: object
          title: The state to send to the task.
      type: object
      required:
        - task_id
        - agent_id
        - state
      title: CreateStateRequest
    CreateTaskMessageRequest:
      properties:
        task_id:
          type: string
          title: The unique id of the task to send the message to
        content:
          $ref: '#/components/schemas/TaskMessageContent'
          title: The message to send to the task.
        streaming_status:
          anyOf:
            - type: string
              enum:
                - IN_PROGRESS
                - DONE
            - type: 'null'
          title: The streaming status of the message
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Optional caller-supplied creation timestamp
          description: >-
            Optional timestamp for the message. Workflow callers should pass workflow.now() (Temporal's
            deterministic monotonic clock) so that two awaited messages.create calls from the same workflow
            are guaranteed to have monotonic timestamps regardless of HTTP scheduling at the server. If
            omitted, the server's wall clock at insert time is used.
      type: object
      required:
        - task_id
        - content
      title: CreateTaskMessageRequest
    CreateTaskRequest:
      properties:
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: >-
            Optional human-readable name for the task. When set it must be globally unique. task/create is
            get-or-create by name: reusing an existing name returns the existing task (with its prior history)
            instead of creating a new one, so omit name (or make it unique, e.g. by appending a UUID) whenever
            each call should produce a fresh task.
        params:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Params
          description: >-
            The parameters for the task. On a get-or-create by name, providing params overwrites the existing
            task's params (it is not a pure read).
        task_metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Task Metadata
          description: >-
            Caller-provided metadata to persist on the task row. Only applied at task creation; ignored if a
            task with this name already exists. Forwarded to the agent inside the ACP payload for backward
            compatibility.
      type: object
      title: CreateTaskRequest
    CreateWebhookTriggerRequest:
      properties:
        agent_name:
          type: string
          title: Agent Name
          description: The agent the webhook drives.
        source:
          $ref: '#/components/schemas/AgentAPIKeyType'
          description: Webhook source whose signature is verified (github or slack).
          default: github
        name:
          type: string
          title: Name
          description: >-
            Signature-lookup key: the repo full_name (github) or api_app_id (slack) that the forward ingress
            matches the incoming webhook against.
        forward_path:
          type: string
          title: Forward Path
          description: >-
            Subpath the agent's own route handles, e.g. 'github-pr/<config-id>'. Appended to
            /agents/forward/name/{agent_name}/ to form the webhook URL.
        secret:
          anyOf:
            - type: string
            - type: 'null'
          title: Secret
          description: >-
            Signing secret. For GitHub, omit to generate one, or provide an existing webhook secret. For
            Slack, this is required and must be the Slack app's Signing Secret.
        base_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Base Url
          description: >-
            Optional public agentex base URL for the returned webhook_url; defaults to the AGENTEX_PUBLIC_URL
            env var.
      type: object
      required:
        - agent_name
        - name
        - forward_path
      title: CreateWebhookTriggerRequest
      description: |-
        One-call setup for a webhook trigger: register the source's signature key and
        get back the ready-to-paste forward webhook URL.
    CreateWebhookTriggerResponse:
      properties:
        key_id:
          type: string
          title: Key Id
          description: The created agent API key id.
        agent_name:
          type: string
          title: Agent Name
          description: The agent the webhook drives.
        source:
          $ref: '#/components/schemas/AgentAPIKeyType'
          description: Webhook source (github or slack).
        name:
          type: string
          title: Name
          description: Signature-lookup key (repo full_name / api_app_id).
        secret:
          type: string
          title: Secret
          description: The signing secret — shown once; paste into the source's webhook config.
        webhook_path:
          type: string
          title: Webhook Path
          description: The forward path to POST webhooks to.
        webhook_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Webhook Url
          description: Full webhook URL to paste into the source (None if no base URL configured).
      type: object
      required:
        - key_id
        - agent_name
        - source
        - name
        - secret
        - webhook_path
      title: CreateWebhookTriggerResponse
    DataContent:
      properties:
        type:
          type: string
          const: data
          title: Type
          description: The type of the message, in this case `data`.
          default: data
        author:
          $ref: '#/components/schemas/MessageAuthor'
          description: The role of the messages author, in this case `system`, `user`, `assistant`, or `tool`.
        style:
          $ref: '#/components/schemas/MessageStyle'
          description: The style of the message. This is used by the client to determine how to display the message.
          default: static
        data:
          additionalProperties: true
          type: object
          title: Data
          description: The contents of the data message.
      type: object
      required:
        - author
        - data
      title: DataContent
    DataContentEntity:
      properties:
        type:
          type: string
          const: data
          title: Type
          description: The type of the message, in this case `data`.
          default: data
        author:
          $ref: '#/components/schemas/MessageAuthor'
          description: The role of the messages author, in this case `system`, `user`, `assistant`, or `tool`.
        style:
          $ref: '#/components/schemas/MessageStyle'
          description: The style of the message. This is used by the client to determine how to display the message.
          default: static
        data:
          additionalProperties: true
          type: object
          title: Data
          description: The contents of the data message.
      type: object
      required:
        - author
        - data
      title: DataContentEntity
    DataDelta:
      properties:
        type:
          type: string
          const: data
          title: Type
          default: data
        data_delta:
          anyOf:
            - type: string
            - type: 'null'
          title: Data Delta
          default: ''
      type: object
      title: DataDelta
      description: Delta for data updates
    DeleteResponse:
      properties:
        id:
          type: string
          title: Id
        message:
          type: string
          title: Message
      type: object
      required:
        - id
        - message
      title: DeleteResponse
    DeleteThreadRequest:
      properties:
        thread_id:
          type: string
          title: Thread ID
      type: object
      required:
        - thread_id
      title: DeleteThreadRequest
    Deployment:
      properties:
        id:
          type: string
          title: Id
          description: The unique identifier of the deployment.
        agent_id:
          type: string
          title: Agent Id
          description: The agent this deployment belongs to.
        docker_image:
          type: string
          title: Docker Image
          description: Full Docker image URI.
        registration_metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Registration Metadata
          description: Git/build metadata from the agent pod.
        status:
          $ref: '#/components/schemas/DeploymentStatus'
          description: Current deployment status.
        acp_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Acp Url
          description: ACP URL set when agent registers.
        is_production:
          type: boolean
          title: Is Production
          description: Whether this is the production deployment.
        sgp_deploy_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Sgp Deploy Id
          description: Correlates to SGP's agentex_deploys.id.
        helm_release_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Helm Release Name
          description: Helm release name for cleanup.
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
          description: When the deployment was created.
        promoted_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Promoted At
          description: When promoted to production.
        expires_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expires At
          description: When marked for cleanup.
      type: object
      required:
        - id
        - agent_id
        - docker_image
        - status
        - is_production
      title: Deployment
    DeploymentHistory:
      properties:
        id:
          type: string
          title: Id
          description: The unique identifier of the deployment record
        agent_id:
          type: string
          title: Agent Id
          description: The ID of the agent this deployment belongs to
        author_name:
          type: string
          title: Author Name
          description: Name of the commit author
        author_email:
          type: string
          title: Author Email
          description: Email of the commit author
        branch_name:
          type: string
          title: Branch Name
          description: Name of the branch
        build_timestamp:
          type: string
          format: date-time
          title: Build Timestamp
          description: When the build was created
        deployment_timestamp:
          type: string
          format: date-time
          title: Deployment Timestamp
          description: When this deployment was first seen in the system
        commit_hash:
          type: string
          title: Commit Hash
          description: Git commit hash for this deployment
      type: object
      required:
        - id
        - agent_id
        - author_name
        - author_email
        - branch_name
        - build_timestamp
        - deployment_timestamp
        - commit_hash
      title: DeploymentHistory
      description: API schema for deployment history.
    DeploymentStatus:
      type: string
      enum:
        - Pending
        - Ready
        - Failed
      title: DeploymentStatus
    Event:
      properties:
        id:
          type: string
          title: Id
          description: The UUID of the event
        sequence_id:
          type: integer
          title: Sequence Id
          description: The sequence ID of the event
        task_id:
          type: string
          title: Task Id
          description: The UUID of the task that the event belongs to
        agent_id:
          type: string
          title: Agent Id
          description: The UUID of the agent that the event belongs to
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
          description: The timestamp of the event
        content:
          anyOf:
            - $ref: '#/components/schemas/TaskMessageContent'
            - type: 'null'
          description: The content of the event
      type: object
      required:
        - id
        - sequence_id
        - task_id
        - agent_id
      title: Event
    ExportTaskResponse:
      properties:
        task_id:
          type: string
          title: Task Id
        messages:
          items:
            $ref: '#/components/schemas/TaskMessageEntity'
          type: array
          title: Messages
        task_states:
          items:
            $ref: '#/components/schemas/StateEntity'
          type: array
          title: Task States
      type: object
      required:
        - task_id
      title: ExportTaskResponse
      description: Wire format mirrors the entity directly — schema parity is intentional.
    ExportTaskToUrlRequest:
      properties:
        upload_url:
          type: string
          maxLength: 2083
          minLength: 1
          format: uri
          title: Upload Url
          description: >-
            Presigned PUT URL where Agentex will upload the task snapshot as JSON. Must be https; must resolve
            to a public address.
      type: object
      required:
        - upload_url
      title: ExportTaskToUrlRequest
    ExportTaskToUrlResponse:
      properties:
        task_id:
          type: string
          title: Task Id
        upload_url:
          type: string
          title: Upload Url
        uploaded_bytes:
          type: integer
          title: Uploaded Bytes
        messages_count:
          type: integer
          title: Messages Count
        task_states_count:
          type: integer
          title: Task States Count
      type: object
      required:
        - task_id
        - upload_url
        - uploaded_bytes
        - messages_count
        - task_states_count
      title: ExportTaskToUrlResponse
    FileAttachment:
      properties:
        file_id:
          type: string
          title: File Id
          description: The unique ID of the attached file
        name:
          type: string
          title: Name
          description: The name of the file
        size:
          type: integer
          title: Size
          description: The size of the file in bytes
        type:
          type: string
          title: Type
          description: The MIME type or content type of the file
      type: object
      required:
        - file_id
        - name
        - size
        - type
      title: FileAttachment
      description: Represents a file attachment in messages.
    FileAttachmentEntity:
      properties:
        file_id:
          type: string
          title: File Id
          description: The unique ID of the attached file
        name:
          type: string
          title: Name
          description: The name of the file
        size:
          type: integer
          title: Size
          description: The size of the file in bytes
        type:
          type: string
          title: Type
          description: The MIME type or content type of the file
      type: object
      required:
        - file_id
        - name
        - size
        - type
      title: FileAttachmentEntity
      description: Represents a file attachment in messages.
    GetCheckpointTupleRequest:
      properties:
        thread_id:
          type: string
          title: Thread ID
        checkpoint_ns:
          type: string
          title: Checkpoint namespace
          default: ''
        checkpoint_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Checkpoint ID (None = latest)
      type: object
      required:
        - thread_id
      title: GetCheckpointTupleRequest
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    InterruptTaskRequest:
      properties:
        task_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Task Id
          description: The ID of the task to interrupt. Either this or task_name must be provided.
        task_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Task Name
          description: The name of the task to interrupt. Either this or task_id must be provided.
      type: object
      title: InterruptTaskRequest
    ListCheckpointsRequest:
      properties:
        thread_id:
          type: string
          title: Thread ID
        checkpoint_ns:
          anyOf:
            - type: string
            - type: 'null'
          title: Checkpoint namespace
        before_checkpoint_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Before checkpoint ID
        filter_metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata filter (JSONB @>)
        limit:
          type: integer
          maximum: 1000
          minimum: 1
          title: Max results
          default: 100
      type: object
      required:
        - thread_id
      title: ListCheckpointsRequest
    MessageAuthor:
      type: string
      enum:
        - user
        - agent
      title: MessageAuthor
    MessageStyle:
      type: string
      enum:
        - static
        - active
      title: MessageStyle
    PaginatedMessagesResponse:
      properties:
        data:
          items:
            $ref: '#/components/schemas/TaskMessage'
          type: array
          title: Data
          description: List of messages
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
          description: Cursor for fetching the next page of older messages
        has_more:
          type: boolean
          title: Has More
          description: Whether there are more messages to fetch
          default: false
      type: object
      required:
        - data
      title: PaginatedMessagesResponse
      description: Response with cursor pagination metadata.
    PauseRunScheduleRequest:
      properties:
        note:
          anyOf:
            - type: string
            - type: 'null'
          title: Note
          description: Optional note explaining the pause.
      type: object
      title: PauseRunScheduleRequest
    PutCheckpointRequest:
      properties:
        thread_id:
          type: string
          title: Thread ID
        checkpoint_ns:
          type: string
          title: Checkpoint namespace
          default: ''
        checkpoint_id:
          type: string
          title: Checkpoint ID
        parent_checkpoint_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent checkpoint ID
        checkpoint:
          additionalProperties: true
          type: object
          title: Checkpoint JSONB payload
        metadata:
          additionalProperties: true
          type: object
          title: Checkpoint metadata
        blobs:
          items:
            $ref: '#/components/schemas/BlobData'
          type: array
          title: Channel blob data
      type: object
      required:
        - thread_id
        - checkpoint_id
        - checkpoint
      title: PutCheckpointRequest
    PutCheckpointResponse:
      properties:
        thread_id:
          type: string
          title: Thread Id
        checkpoint_ns:
          type: string
          title: Checkpoint Ns
        checkpoint_id:
          type: string
          title: Checkpoint Id
      type: object
      required:
        - thread_id
        - checkpoint_ns
        - checkpoint_id
      title: PutCheckpointResponse
    PutWritesRequest:
      properties:
        thread_id:
          type: string
          title: Thread ID
        checkpoint_ns:
          type: string
          title: Checkpoint namespace
          default: ''
        checkpoint_id:
          type: string
          title: Checkpoint ID
        writes:
          items:
            $ref: '#/components/schemas/WriteData'
          type: array
          title: Write data
        upsert:
          type: boolean
          title: Upsert mode
          default: false
      type: object
      required:
        - thread_id
        - checkpoint_id
        - writes
      title: PutWritesRequest
    ReasoningContent:
      properties:
        type:
          type: string
          const: reasoning
          title: Type
          description: The type of the message, in this case `reasoning`.
          default: reasoning
        author:
          $ref: '#/components/schemas/MessageAuthor'
          description: The role of the messages author, in this case `system`, `user`, `assistant`, or `tool`.
        style:
          $ref: '#/components/schemas/MessageStyle'
          description: The style of the message. This is used by the client to determine how to display the message.
          default: static
        summary:
          items:
            type: string
          type: array
          title: Summary
          description: A list of short reasoning summaries
        content:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Content
          description: The reasoning content or chain-of-thought text
      type: object
      required:
        - author
        - summary
      title: ReasoningContent
    ReasoningContentDelta:
      properties:
        type:
          type: string
          const: reasoning_content
          title: Type
          default: reasoning_content
        content_index:
          type: integer
          title: Content Index
        content_delta:
          anyOf:
            - type: string
            - type: 'null'
          title: Content Delta
          default: ''
      type: object
      required:
        - content_index
      title: ReasoningContentDelta
      description: Delta for reasoning content updates
    ReasoningContentEntity:
      properties:
        type:
          type: string
          const: reasoning
          title: Type
          description: The type of the message, in this case `reasoning`.
          default: reasoning
        author:
          $ref: '#/components/schemas/MessageAuthor'
          description: The role of the messages author, in this case `system`, `user`, `assistant`, or `tool`.
        style:
          $ref: '#/components/schemas/MessageStyle'
          description: The style of the message. This is used by the client to determine how to display the message.
          default: static
        summary:
          items:
            type: string
          type: array
          title: Summary
          description: A list of short reasoning summaries
        content:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Content
          description: The reasoning content or chain-of-thought text
      type: object
      required:
        - author
        - summary
      title: ReasoningContentEntity
    ReasoningSummaryDelta:
      properties:
        type:
          type: string
          const: reasoning_summary
          title: Type
          default: reasoning_summary
        summary_index:
          type: integer
          title: Summary Index
        summary_delta:
          anyOf:
            - type: string
            - type: 'null'
          title: Summary Delta
          default: ''
      type: object
      required:
        - summary_index
      title: ReasoningSummaryDelta
      description: Delta for reasoning summary updates
    RegisterAgentRequest:
      properties:
        name:
          type: string
          pattern: ^[a-z0-9-]+$
          title: Name
          description: The unique name of the agent.
        description:
          type: string
          title: Description
          description: The description of the agent.
        acp_url:
          type: string
          title: Acp Url
          description: The URL of the ACP server for the agent.
        agent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent Id
          description: Optional agent ID if the agent already exists and needs to be updated.
        acp_type:
          $ref: '#/components/schemas/ACPType'
          description: The type of ACP to use for the agent.
        principal_context:
          anyOf:
            - {}
            - type: 'null'
          title: Principal Context
          description: Principal used for authorization
        registration_metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Registration Metadata
          description: The metadata for the agent's registration.
        agent_input_type:
          anyOf:
            - $ref: '#/components/schemas/AgentInputType'
            - type: 'null'
          description: The type of input the agent expects.
      type: object
      required:
        - name
        - description
        - acp_url
        - acp_type
      title: RegisterAgentRequest
    RegisterAgentResponse:
      properties:
        id:
          type: string
          title: Id
          description: The unique identifier of the agent.
        name:
          type: string
          title: Name
          description: The unique name of the agent.
        description:
          type: string
          title: Description
          description: The description of the action.
        status:
          $ref: '#/components/schemas/AgentStatus'
          description: The status of the action, indicating if it's building, ready, failed, etc.
          default: Unknown
        acp_type:
          $ref: '#/components/schemas/ACPType'
          description: The type of the ACP Server (Either sync or async)
        status_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Status Reason
          description: The reason for the status of the action.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: The timestamp when the agent was created
        updated_at:
          type: string
          format: date-time
          title: Updated At
          description: The timestamp when the agent was last updated
        registration_metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Registration Metadata
          description: The metadata for the agent's registration.
        registered_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Registered At
          description: The timestamp when the agent was last registered
        agent_input_type:
          anyOf:
            - $ref: '#/components/schemas/AgentInputType'
            - type: 'null'
          description: The type of input the agent expects.
        production_deployment_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Production Deployment Id
          description: ID of the current production deployment.
        agent_api_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent Api Key
          description: The API key for the agent, if applicable.
      type: object
      required:
        - id
        - name
        - description
        - acp_type
        - created_at
        - updated_at
      title: RegisterAgentResponse
      description: Response model for registering an agent.
    RegisterBuildRequest:
      properties:
        name:
          type: string
          pattern: ^[a-z0-9-]+$
          title: Name
          description: The unique name of the agent.
        description:
          type: string
          title: Description
          description: The description of the agent.
        registration_metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Registration Metadata
          description: The metadata for the agent's build registration.
        agent_input_type:
          anyOf:
            - $ref: '#/components/schemas/AgentInputType'
            - type: 'null'
          description: The type of input the agent expects.
      type: object
      required:
        - name
        - description
      title: RegisterBuildRequest
      description: |-
        Request model for registering an agent at build time (pre-deploy).

        Unlike RegisterAgentRequest, there is no acp_url (the agent is not running
        yet) and no acp_type is required. The created agent is left in BUILD_ONLY
        status so it can be permissioned/shared before it is deployed.
    RehydrateTaskRequest:
      properties:
        task_id:
          type: string
          title: Task Id
        messages:
          items:
            $ref: '#/components/schemas/TaskMessageEntity'
          type: array
          title: Messages
        task_states:
          items:
            $ref: '#/components/schemas/StateEntity'
          type: array
          title: Task States
        snapshot_url:
          anyOf:
            - type: string
              maxLength: 2083
              minLength: 1
              format: uri
            - type: 'null'
          title: Snapshot Url
          description: >-
            Presigned GET URL whose body is a JSON-encoded TaskSnapshotEntity. Must be https; must resolve to
            a public address. When set, messages/task_states must be empty.
      type: object
      required:
        - task_id
      title: RehydrateTaskRequest
      description: |-
        Either provide inline content (messages + task_states) or a snapshot_url
        pointing at a presigned JSON download. Mixing both is rejected.

        The inline form is the canonical shape used by export's GET response, so
        snapshot → clean → rehydrate round-trips cleanly without serialization
        changes.
    ResumeRunScheduleRequest:
      properties:
        note:
          anyOf:
            - type: string
            - type: 'null'
          title: Note
          description: Optional note explaining the resume.
      type: object
      title: ResumeRunScheduleRequest
    RunScheduleState:
      type: string
      enum:
        - ACTIVE
        - PAUSED
      title: RunScheduleState
      description: Live state of a run schedule, derived from Temporal.
    ScheduleCreatorPrincipal:
      properties:
        principal_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Principal Type
          description: e.g. 'user' or 'service_account'.
        user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: User Id
          description: Creator user id, if a user principal.
        service_account_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Service Account Id
          description: Creator service-account id, if a service principal.
        account_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Account Id
          description: Account/workspace id of the creator.
      type: object
      title: ScheduleCreatorPrincipal
      description: |-
        Credential-free creator identity stored with the schedule.

        Never carries cookies, JWTs, API keys, OAuth tokens, or request headers — it
        is creator *context* used only for AuthZ and ownership at fire time.
    ScheduleInitialInput:
      properties:
        type:
          type: string
          const: text
          title: Type
          description: Input content type.
          default: text
        author:
          $ref: '#/components/schemas/MessageAuthor'
          description: The author attributed to the initial input.
          default: user
        content:
          type: string
          title: Content
          description: The initial prompt delivered to the task.
      type: object
      required:
        - content
      title: ScheduleInitialInput
      description: The first input delivered to each freshly created scheduled task.
    SendEventRequest:
      properties:
        task_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Task Id
          description: The ID of the task that the event was sent to
        task_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Task Name
          description: The name of the task that the event was sent to
        content:
          anyOf:
            - $ref: '#/components/schemas/TaskMessageContent'
            - type: 'null'
          description: The content to send to the event
      type: object
      title: SendEventRequest
    SendMessageRequest:
      properties:
        task_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Task Id
          description: The ID of the task that the message was sent to
        task_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Task Name
          description: The name of the task that the message was sent to
        content:
          $ref: '#/components/schemas/AnishsCoolSchema'
        stream:
          type: boolean
          title: Stream
          description: Whether to stream the response message back to the client
          default: false
        task_params:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Task Params
          description: The parameters for the task (only used when creating new tasks)
      type: object
      required:
        - content
      title: SendMessageRequest
    SkipRunScheduleRequest:
      properties:
        scheduled_time:
          type: string
          format: date-time
          title: Scheduled Time
          description: Specific scheduled fire time to skip.
      type: object
      required:
        - scheduled_time
      title: SkipRunScheduleRequest
    Span:
      properties:
        id:
          type: string
          title: Unique Span ID
        trace_id:
          type: string
          title: The trace ID for this span
          description: Unique identifier for the trace this span belongs to
        task_id:
          anyOf:
            - type: string
            - type: 'null'
          title: The task ID this span is associated with
          description: ID of the task this span belongs to
        parent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: The parent span ID if this is a child span
          description: ID of the parent span if this is a child span in a trace
        name:
          type: string
          title: The name of the span
          description: Name that describes what operation this span represents
        start_time:
          type: string
          format: date-time
          title: The start time of the span
          description: The time the span started
        end_time:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: The end time of the span
          description: The time the span ended
        input:
          anyOf:
            - additionalProperties: true
              type: object
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: The input data for the span
          description: Input parameters or data for the operation
        output:
          anyOf:
            - additionalProperties: true
              type: object
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: The output data from the span
          description: Output data resulting from the operation
        data:
          anyOf:
            - additionalProperties: true
              type: object
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Additional data associated with the span
          description: Any additional metadata or context for the span
      type: object
      required:
        - id
        - trace_id
        - name
        - start_time
      title: Span
    State:
      properties:
        task_id:
          type: string
          title: The unique id of the task to send the state to
        agent_id:
          type: string
          title: The unique id of the agent to send the state to
        state:
          additionalProperties: true
          type: object
          title: The state to send to the task.
        id:
          type: string
          title: Id
          description: The task state's unique id
        created_at:
          type: string
          format: date-time
          title: Created At
          description: The timestamp when the state was created
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
          description: The timestamp when the state was last updated
      type: object
      required:
        - task_id
        - agent_id
        - state
        - id
        - created_at
      title: State
      description: |-
        Represents a state in the agent system. A state is associated uniquely with a task and an agent.

        This entity is used to store states in MongoDB, with each state
        associated with a specific task and agent. The combination of task_id and agent_id is globally unique.

        The state is a dictionary of arbitrary data.
    StateEntity:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: The task state's unique id
        task_id:
          type: string
          title: Task Id
          description: ID of the task this state belongs to. The combination of task_id and agent_id is globally unique.
        agent_id:
          type: string
          title: Agent Id
          description: ID of the agent this state belongs to. The combination of task_id and agent_id is globally unique.
        state:
          additionalProperties: true
          type: object
          title: State
          description: The state object that contains arbitrary data
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
          description: The timestamp when the state was created
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
          description: The timestamp when the state was last updated
      type: object
      required:
        - task_id
        - agent_id
        - state
      title: StateEntity
      description: |-
        Represents a state in the agent system. A state is associated uniquely with a task and an agent.

        This entity is used to store states in MongoDB, with each state
        associated with a specific task and agent. The combination of task_id and agent_id is globally unique.

        The state is a dictionary of arbitrary data.
    StreamTaskMessageDelta:
      properties:
        type:
          type: string
          const: delta
          title: Type
          default: delta
        index:
          anyOf:
            - type: integer
            - type: 'null'
          title: Index
        parent_task_message:
          anyOf:
            - $ref: '#/components/schemas/TaskMessage'
            - type: 'null'
        delta:
          anyOf:
            - $ref: '#/components/schemas/TaskMessageDelta'
            - type: 'null'
      type: object
      title: StreamTaskMessageDelta
      description: Event for streaming chunks of content
    StreamTaskMessageDone:
      properties:
        type:
          type: string
          const: done
          title: Type
          default: done
        index:
          anyOf:
            - type: integer
            - type: 'null'
          title: Index
        parent_task_message:
          anyOf:
            - $ref: '#/components/schemas/TaskMessage'
            - type: 'null'
      type: object
      title: StreamTaskMessageDone
      description: Event for indicating the task is done
    StreamTaskMessageFull:
      properties:
        type:
          type: string
          const: full
          title: Type
          default: full
        index:
          anyOf:
            - type: integer
            - type: 'null'
          title: Index
        parent_task_message:
          anyOf:
            - $ref: '#/components/schemas/TaskMessage'
            - type: 'null'
        content:
          $ref: '#/components/schemas/TaskMessageContent'
      type: object
      required:
        - content
      title: StreamTaskMessageFull
      description: Event for streaming the full content
    StreamTaskMessageStart:
      properties:
        type:
          type: string
          const: start
          title: Type
          default: start
        index:
          anyOf:
            - type: integer
            - type: 'null'
          title: Index
        parent_task_message:
          anyOf:
            - $ref: '#/components/schemas/TaskMessage'
            - type: 'null'
        content:
          $ref: '#/components/schemas/TaskMessageContent'
      type: object
      required:
        - content
      title: StreamTaskMessageStart
      description: Event for starting a streaming message
    Task:
      properties:
        id:
          type: string
          title: Unique Task ID
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Unique name of the task
        status:
          anyOf:
            - $ref: '#/components/schemas/TaskStatus'
            - type: 'null'
          title: The current status of the task
        status_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: The reason for the current task status
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: The timestamp when the task was created
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: The timestamp when the task was last updated
        cleaned_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: The timestamp when the task's content was cleaned for retention compliance; null when active
        params:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Task parameters
        task_metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Task metadata
      type: object
      required:
        - id
      title: Task
    TaskMessage:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: The task message's unique id
        task_id:
          type: string
          title: Task Id
          description: ID of the task this message belongs to
        content:
          $ref: '#/components/schemas/TaskMessageContent'
          description: >-
            The content of the message. This content is not OpenAI compatible. These are messages that are
            meant to be displayed to the user.
        streaming_status:
          anyOf:
            - type: string
              enum:
                - IN_PROGRESS
                - DONE
            - type: 'null'
          title: >-
            In case of streaming, this indicates whether the message is still being streamed or has been
            completed
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
          description: The timestamp when the message was created
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
          description: The timestamp when the message was last updated
      type: object
      required:
        - task_id
        - content
      title: TaskMessage
      description: |-
        Represents a message in the agent system.

        This entity is used to store messages in MongoDB, with each message
        associated with a specific task.
    TaskMessageContent:
      oneOf:
        - $ref: '#/components/schemas/TextContent'
        - $ref: '#/components/schemas/ReasoningContent'
        - $ref: '#/components/schemas/DataContent'
        - $ref: '#/components/schemas/ToolRequestContent'
        - $ref: '#/components/schemas/ToolResponseContent'
      title: TaskMessageContent
      discriminator:
        propertyName: type
        mapping:
          data: '#/components/schemas/DataContent'
          reasoning: '#/components/schemas/ReasoningContent'
          text: '#/components/schemas/TextContent'
          tool_request: '#/components/schemas/ToolRequestContent'
          tool_response: '#/components/schemas/ToolResponseContent'
    TaskMessageDelta:
      oneOf:
        - $ref: '#/components/schemas/TextDelta'
        - $ref: '#/components/schemas/DataDelta'
        - $ref: '#/components/schemas/ToolRequestDelta'
        - $ref: '#/components/schemas/ToolResponseDelta'
        - $ref: '#/components/schemas/ReasoningSummaryDelta'
        - $ref: '#/components/schemas/ReasoningContentDelta'
      title: TaskMessageDelta
      discriminator:
        propertyName: type
        mapping:
          data: '#/components/schemas/DataDelta'
          reasoning_content: '#/components/schemas/ReasoningContentDelta'
          reasoning_summary: '#/components/schemas/ReasoningSummaryDelta'
          text: '#/components/schemas/TextDelta'
          tool_request: '#/components/schemas/ToolRequestDelta'
          tool_response: '#/components/schemas/ToolResponseDelta'
    TaskMessageEntity:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: The task message's unique id
        task_id:
          type: string
          title: Task Id
          description: ID of the task this message belongs to
        content:
          oneOf:
            - $ref: '#/components/schemas/TextContentEntity'
            - $ref: '#/components/schemas/DataContentEntity'
            - $ref: '#/components/schemas/ToolRequestContentEntity'
            - $ref: '#/components/schemas/ToolResponseContentEntity'
            - $ref: '#/components/schemas/ReasoningContentEntity'
          title: Content
          description: >-
            The content of the message. This content is not OpenAI compatible. These are messages that are
            meant to be displayed to the user.
          discriminator:
            propertyName: type
            mapping:
              data: '#/components/schemas/DataContentEntity'
              reasoning: '#/components/schemas/ReasoningContentEntity'
              text: '#/components/schemas/TextContentEntity'
              tool_request: '#/components/schemas/ToolRequestContentEntity'
              tool_response: '#/components/schemas/ToolResponseContentEntity'
        streaming_status:
          anyOf:
            - type: string
              enum:
                - IN_PROGRESS
                - DONE
            - type: 'null'
          title: >-
            In case of streaming, this indicates whether the message is still being streamed or has been
            completed
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
          description: The timestamp when the message was created
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
          description: The timestamp when the message was last updated
      type: object
      required:
        - task_id
        - content
      title: TaskMessageEntity
      description: |-
        Represents a message in the agent system.

        This entity is used to store messages in MongoDB, with each message
        associated with a specific task.
    TaskMessageUpdate:
      oneOf:
        - $ref: '#/components/schemas/StreamTaskMessageStart'
        - $ref: '#/components/schemas/StreamTaskMessageDelta'
        - $ref: '#/components/schemas/StreamTaskMessageFull'
        - $ref: '#/components/schemas/StreamTaskMessageDone'
      title: TaskMessageUpdate
      discriminator:
        propertyName: type
        mapping:
          delta: '#/components/schemas/StreamTaskMessageDelta'
          done: '#/components/schemas/StreamTaskMessageDone'
          full: '#/components/schemas/StreamTaskMessageFull'
          start: '#/components/schemas/StreamTaskMessageStart'
    TaskRelationships:
      type: string
      enum:
        - agents
      title: TaskRelationships
      description: Task relationships that can be loaded
    TaskResponse:
      properties:
        id:
          type: string
          title: Unique Task ID
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Unique name of the task
        status:
          anyOf:
            - $ref: '#/components/schemas/TaskStatus'
            - type: 'null'
          title: The current status of the task
        status_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: The reason for the current task status
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: The timestamp when the task was created
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: The timestamp when the task was last updated
        cleaned_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: The timestamp when the task's content was cleaned for retention compliance; null when active
        params:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Task parameters
        task_metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Task metadata
        agents:
          anyOf:
            - items:
                $ref: '#/components/schemas/Agent'
              type: array
            - type: 'null'
          title: Agents associated with this task (only populated when 'agent' view is requested)
      type: object
      required:
        - id
      title: TaskResponse
      description: Task response model with optional related data based on relationships
    TaskStatus:
      type: string
      enum:
        - CANCELED
        - COMPLETED
        - FAILED
        - RUNNING
        - INTERRUPTED
        - TERMINATED
        - TIMED_OUT
        - DELETED
      title: TaskStatus
    TaskStatusReasonRequest:
      properties:
        reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Optional reason for the status change
      type: object
      title: TaskStatusReasonRequest
    TextContent:
      properties:
        type:
          type: string
          const: text
          title: Type
          description: The type of the message, in this case `text`.
          default: text
        author:
          $ref: '#/components/schemas/MessageAuthor'
          description: The role of the messages author, in this case `system`, `user`, `assistant`, or `tool`.
        style:
          $ref: '#/components/schemas/MessageStyle'
          description: The style of the message. This is used by the client to determine how to display the message.
          default: static
        format:
          $ref: '#/components/schemas/TextFormat'
          description: The format of the message. This is used by the client to determine how to display the message.
          default: plain
        content:
          type: string
          title: Content
          description: The contents of the text message.
        attachments:
          anyOf:
            - items:
                $ref: '#/components/schemas/FileAttachment'
              type: array
            - type: 'null'
          title: Attachments
          description: Optional list of file attachments with structured metadata.
      type: object
      required:
        - author
        - content
      title: TextContent
    TextContentEntity:
      properties:
        type:
          type: string
          const: text
          title: Type
          description: The type of the message, in this case `text`.
          default: text
        author:
          $ref: '#/components/schemas/MessageAuthor'
          description: The role of the messages author, in this case `system`, `user`, `assistant`, or `tool`.
        style:
          $ref: '#/components/schemas/MessageStyle'
          description: The style of the message. This is used by the client to determine how to display the message.
          default: static
        format:
          $ref: '#/components/schemas/TextFormat'
          description: The format of the message. This is used by the client to determine how to display the message.
          default: plain
        content:
          type: string
          title: Content
          description: The contents of the text message.
        attachments:
          anyOf:
            - items:
                $ref: '#/components/schemas/FileAttachmentEntity'
              type: array
            - type: 'null'
          title: Attachments
          description: Optional list of file attachments with structured metadata.
      type: object
      required:
        - author
        - content
      title: TextContentEntity
    TextDelta:
      properties:
        type:
          type: string
          const: text
          title: Type
          default: text
        text_delta:
          anyOf:
            - type: string
            - type: 'null'
          title: Text Delta
          default: ''
      type: object
      title: TextDelta
      description: Delta for text updates
    TextFormat:
      type: string
      enum:
        - markdown
        - plain
        - code
      title: TextFormat
    ToolRequestContent:
      properties:
        type:
          type: string
          const: tool_request
          title: Type
          description: The type of the message, in this case `tool_request`.
          default: tool_request
        author:
          $ref: '#/components/schemas/MessageAuthor'
          description: The role of the messages author, in this case `system`, `user`, `assistant`, or `tool`.
        style:
          $ref: '#/components/schemas/MessageStyle'
          description: The style of the message. This is used by the client to determine how to display the message.
          default: static
        tool_call_id:
          type: string
          title: Tool Call Id
          description: The ID of the tool call that is being requested.
        name:
          type: string
          title: Name
          description: The name of the tool that is being requested.
        arguments:
          additionalProperties: true
          type: object
          title: Arguments
          description: The arguments to the tool.
      type: object
      required:
        - author
        - tool_call_id
        - name
        - arguments
      title: ToolRequestContent
    ToolRequestContentEntity:
      properties:
        type:
          type: string
          const: tool_request
          title: Type
          description: The type of the message, in this case `tool_request`.
          default: tool_request
        author:
          $ref: '#/components/schemas/MessageAuthor'
          description: The role of the messages author, in this case `system`, `user`, `assistant`, or `tool`.
        style:
          $ref: '#/components/schemas/MessageStyle'
          description: The style of the message. This is used by the client to determine how to display the message.
          default: static
        tool_call_id:
          type: string
          title: Tool Call Id
          description: The ID of the tool call that is being requested.
        name:
          type: string
          title: Name
          description: The name of the tool that is being requested.
        arguments:
          additionalProperties: true
          type: object
          title: Arguments
          description: The arguments to the tool.
      type: object
      required:
        - author
        - tool_call_id
        - name
        - arguments
      title: ToolRequestContentEntity
    ToolRequestDelta:
      properties:
        type:
          type: string
          const: tool_request
          title: Type
          default: tool_request
        tool_call_id:
          type: string
          title: Tool Call Id
        name:
          type: string
          title: Name
        arguments_delta:
          anyOf:
            - type: string
            - type: 'null'
          title: Arguments Delta
          default: ''
      type: object
      required:
        - tool_call_id
        - name
      title: ToolRequestDelta
      description: Delta for tool request updates
    ToolResponseContent:
      properties:
        type:
          type: string
          const: tool_response
          title: Type
          description: The type of the message, in this case `tool_response`.
          default: tool_response
        author:
          $ref: '#/components/schemas/MessageAuthor'
          description: The role of the messages author, in this case `system`, `user`, `assistant`, or `tool`.
        style:
          $ref: '#/components/schemas/MessageStyle'
          description: The style of the message. This is used by the client to determine how to display the message.
          default: static
        tool_call_id:
          type: string
          title: Tool Call Id
          description: The ID of the tool call that is being responded to.
        name:
          type: string
          title: Name
          description: The name of the tool that is being responded to.
        content:
          title: Content
          description: The result of the tool.
        is_error:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Error
          description: Whether the tool call resulted in an error. `None` when the harness does not report a status.
      type: object
      required:
        - author
        - tool_call_id
        - name
        - content
      title: ToolResponseContent
    ToolResponseContentEntity:
      properties:
        type:
          type: string
          const: tool_response
          title: Type
          description: The type of the message, in this case `tool_response`.
          default: tool_response
        author:
          $ref: '#/components/schemas/MessageAuthor'
          description: The role of the messages author, in this case `system`, `user`, `assistant`, or `tool`.
        style:
          $ref: '#/components/schemas/MessageStyle'
          description: The style of the message. This is used by the client to determine how to display the message.
          default: static
        tool_call_id:
          type: string
          title: Tool Call Id
          description: The ID of the tool call that is being responded to.
        name:
          type: string
          title: Name
          description: The name of the tool that is being responded to.
        content:
          title: Content
          description: The result of the tool.
        is_error:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Error
          description: Whether the tool call resulted in an error. `None` when the harness does not report a status.
      type: object
      required:
        - author
        - tool_call_id
        - name
        - content
      title: ToolResponseContentEntity
    ToolResponseDelta:
      properties:
        type:
          type: string
          const: tool_response
          title: Type
          default: tool_response
        tool_call_id:
          type: string
          title: Tool Call Id
        name:
          type: string
          title: Name
        content_delta:
          anyOf:
            - type: string
            - type: 'null'
          title: Content Delta
          default: ''
      type: object
      required:
        - tool_call_id
        - name
      title: ToolResponseDelta
      description: Delta for tool response updates
    UnskipRunScheduleRequest:
      properties:
        scheduled_time:
          type: string
          format: date-time
          title: Scheduled Time
          description: Specific scheduled fire time to unskip.
      type: object
      required:
        - scheduled_time
      title: UnskipRunScheduleRequest
    UpdateAgentRunScheduleRequest:
      properties:
        name:
          anyOf:
            - type: string
              maxLength: 64
              minLength: 1
              pattern: ^[a-z0-9][a-z0-9-]*[a-z0-9]$|^[a-z0-9]$
            - type: 'null'
          title: Schedule Name
          description: Human-readable name, unique among active schedules for the agent.
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Optional description of what this schedule does.
        cron_expression:
          anyOf:
            - type: string
            - type: 'null'
          title: Cron Expression
          description: New cron cadence. Mutually exclusive with interval_seconds.
        interval_seconds:
          anyOf:
            - type: integer
              minimum: 1
            - type: 'null'
          title: Interval Seconds
          description: New interval cadence in seconds. Mutually exclusive with cron_expression.
        timezone:
          anyOf:
            - type: string
            - type: 'null'
          title: Timezone
          description: IANA timezone the cron expression is evaluated in.
        start_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Start At
          description: When the schedule should start being active.
        end_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: End At
          description: When the schedule should stop being active.
        paused:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Paused
          description: Pause/resume the schedule as part of the update.
        task_params:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Task Params
          description: Resolved config forwarded as task `params` at fire time.
        task_metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Task Metadata
          description: Metadata copied onto each created task at fire time.
        initial_input:
          anyOf:
            - $ref: '#/components/schemas/ScheduleInitialInput'
            - type: 'null'
          description: Replacement initial input delivered to each created task.
      type: object
      title: UpdateAgentRunScheduleRequest
      description: |-
        Partial update for a scheduled agent run.

        Only fields present in the request body are changed. Setting
        ``cron_expression`` clears ``interval_seconds`` and vice versa; providing both
        is rejected.
    UpdateAgentTaskTrackerRequest:
      properties:
        last_processed_event_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Processed Event Id
          description: The most recent processed event ID (omit to leave unchanged)
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
          description: Processing status
        status_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Status Reason
          description: Optional status reason
      type: object
      title: UpdateAgentTaskTrackerRequest
      description: Request model for updating an agent task tracker.
    UpdateSpanRequest:
      properties:
        trace_id:
          anyOf:
            - type: string
            - type: 'null'
          title: The trace ID for this span
          description: Unique identifier for the trace this span belongs to
        task_id:
          anyOf:
            - type: string
            - type: 'null'
          title: The task ID this span is associated with
          description: ID of the task this span belongs to
        parent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: The parent span ID if this is a child span
          description: ID of the parent span if this is a child span in a trace
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: The name of the span
          description: Name that describes what operation this span represents
        start_time:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: The start time of the span
          description: The time the span started
        end_time:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: The end time of the span
          description: The time the span ended
        input:
          anyOf:
            - additionalProperties: true
              type: object
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: The input data for the span
          description: Input parameters or data for the operation
        output:
          anyOf:
            - additionalProperties: true
              type: object
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: The output data from the span
          description: Output data resulting from the operation
        data:
          anyOf:
            - additionalProperties: true
              type: object
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Additional data associated with the span
          description: Any additional metadata or context for the span
      type: object
      title: UpdateSpanRequest
    UpdateStateRequest:
      properties:
        state:
          additionalProperties: true
          type: object
          title: The state to update the state with.
      type: object
      required:
        - state
      title: UpdateStateRequest
    UpdateTaskMessageRequest:
      properties:
        task_id:
          type: string
          title: The unique id of the task to update the message of
        content:
          $ref: '#/components/schemas/TaskMessageContent'
          title: The message to update the message with.
        streaming_status:
          anyOf:
            - type: string
              enum:
                - IN_PROGRESS
                - DONE
            - type: 'null'
          title: The streaming status of the message
      type: object
      required:
        - task_id
        - content
      title: UpdateTaskMessageRequest
    UpdateTaskRequest:
      properties:
        task_metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: If provided, replaces task_metadata with this value
        merge_params:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: >-
            Optional shallow-merge patch applied to the task's params column. Top-level keys overwrite; pass
            full nested objects to change subfields.
      type: object
      title: UpdateTaskRequest
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    WriteData:
      properties:
        task_id:
          type: string
          title: Task ID
        idx:
          type: integer
          title: Write index
        channel:
          type: string
          title: Channel name
        type:
          anyOf:
            - type: string
            - type: 'null'
          title: Serialization type tag
        blob:
          type: string
          title: Base64-encoded binary data
        task_path:
          type: string
          title: Task path
          default: ''
      type: object
      required:
        - task_id
        - idx
        - channel
        - blob
      title: WriteData
    WriteResponse:
      properties:
        task_id:
          type: string
          title: Task Id
        idx:
          type: integer
          title: Idx
        channel:
          type: string
          title: Channel
        type:
          anyOf:
            - type: string
            - type: 'null'
          title: Type
        blob:
          anyOf:
            - type: string
            - type: 'null'
          title: Blob
      type: object
      required:
        - task_id
        - idx
        - channel
      title: WriteResponse
    AnishsCoolSchema:
      $ref: '#/components/schemas/TaskMessageContent'
      description: The message that was sent to the agent
