# Generated public contract; edit the source and localization catalog.
openapi: 3.1.0
jsonSchemaDialect: https://json-schema.org/draft/2020-12/schema
info:
  title: OrbitSpace Agent services API
  version: 1.0.0
  description: Public v1 application contract for agent services. Protocol lifecycle and capability availability are documented in the integration guides.
servers:
  - url: https://api.orbitspace.dev
security:
  - bearerAuth: []
paths:
  /api/v1/agent-deployments:
    get:
      tags:
        - ApplicationService
      operationId: ApplicationService_ListAgentDeployments
      parameters:
        - name: workspace_id
          in: query
          schema:
            type: string
          description: Workspace identifier. A Workspace is a persistent collaboration context, distinct from a per-task worktree.
        - name: include_disabled
          in: query
          schema:
            type: boolean
          description: Include disabled.
        - name: page_size
          in: query
          schema:
            type: integer
            format: int32
          description: Requested page size, subject to the endpoint limits.
        - name: page_token
          in: query
          schema:
            type: string
          description: Opaque pagination token returned by the previous page. Do not construct or modify it.
      responses:
        "200":
          description: Successful response.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListAgentDeploymentsResponse"
        default:
          description: RFC 9457 Problem Details.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: List Agent deployments
      description: List Agent deployments. Use the declared pagination parameters to continue through results.
    post:
      tags:
        - ApplicationService
      operationId: ApplicationService_CreateAgentDeployment
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateAgentDeploymentRequest"
        required: true
        description: Request body for create agent deployment.
      responses:
        "200":
          description: Successful response.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AgentDeployment"
        default:
          description: RFC 9457 Problem Details.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: Create Agent deployment
      description: Create an Agent service configuration for application callers. It binds an admitted Agent to its execution configuration and input/output adapters; it does not create a Kubernetes Deployment.
  /api/v1/agent-deployments/{deployment_id}/invocations:
    post:
      tags:
        - ApplicationService
      operationId: ApplicationService_CreateInvocation
      parameters:
        - name: deployment_id
          in: path
          required: true
          schema:
            type: string
          description: Agent service deployment identifier; this refers to an application service configuration.
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateInvocationRequest"
            examples:
              invoke-service:
                summary: Invoke a published Agent service
                description: Replace deployment_id in the URL with an enabled service. The deployment input adapter determines the accepted input shape.
                value:
                  idempotency_key: invocation-example-001
                  input:
                    message: Summarize the supplied document.
        required: true
        description: Request body for create invocation.
      responses:
        "200":
          description: Successful response.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Invocation"
        default:
          description: RFC 9457 Problem Details.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: Create invocation
      description: Invoke the enabled Agent service identified by deployment_id in the URL. Its input adapter defines the input shape. Use idempotency_key to correlate retries of the same submission. external_subject_hash is caller correlation metadata and does not itself grant access or isolate execution.
  /api/v1/agent-deployments/{deployment_id}/revisions:
    get:
      tags:
        - ApplicationService
      operationId: ApplicationService_ListAgentDeploymentRevisions
      parameters:
        - name: deployment_id
          in: path
          required: true
          schema:
            type: string
          description: Agent service deployment identifier; this refers to an application service configuration.
        - name: page_size
          in: query
          schema:
            type: integer
            format: int32
          description: Requested page size, subject to the endpoint limits.
        - name: page_token
          in: query
          schema:
            type: string
          description: Opaque pagination token returned by the previous page. Do not construct or modify it.
      responses:
        "200":
          description: Successful response.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListAgentDeploymentRevisionsResponse"
        default:
          description: RFC 9457 Problem Details.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: List Agent deployment revisions
      description: List Agent deployment revisions. Use the declared pagination parameters to continue through results.
  /api/v1/agent-deployments/{id}:
    get:
      tags:
        - ApplicationService
      operationId: ApplicationService_GetAgentDeployment
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: Identifier of the resource addressed by this schema or URL.
      responses:
        "200":
          description: Successful response.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AgentDeployment"
        default:
          description: RFC 9457 Problem Details.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: Get Agent deployment
      description: Get Agent deployment.
  /api/v1/agent-deployments/{id}:disable:
    post:
      tags:
        - ApplicationService
      operationId: ApplicationService_DisableAgentDeployment
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: Identifier of the resource addressed by this schema or URL.
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DisableAgentDeploymentRequest"
        required: true
        description: Request body for disable agent deployment.
      responses:
        "200":
          description: Successful response.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AgentDeployment"
        default:
          description: RFC 9457 Problem Details.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: Disable Agent deployment
      description: Disable Agent deployment. Supply the fields defined in the request schema.
  /api/v1/agent-deployments/{id}:enable:
    post:
      tags:
        - ApplicationService
      operationId: ApplicationService_EnableAgentDeployment
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: Identifier of the resource addressed by this schema or URL.
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/EnableAgentDeploymentRequest"
        required: true
        description: Request body for enable agent deployment.
      responses:
        "200":
          description: Successful response.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AgentDeployment"
        default:
          description: RFC 9457 Problem Details.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: Enable Agent deployment
      description: Enable Agent deployment. Supply the fields defined in the request schema.
  /api/v1/agent-deployments/{id}:revise:
    post:
      tags:
        - ApplicationService
      operationId: ApplicationService_ReviseAgentDeployment
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: Identifier of the resource addressed by this schema or URL.
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ReviseAgentDeploymentRequest"
        required: true
        description: Request body for revise agent deployment.
      responses:
        "200":
          description: Successful response.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AgentDeployment"
        default:
          description: RFC 9457 Problem Details.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: Revise Agent deployment
      description: Revise Agent deployment. Supply the fields defined in the request schema.
  /api/v1/application-metrics:
    get:
      tags:
        - ApplicationService
      operationId: ApplicationService_GetApplicationMetrics
      parameters:
        - name: integration_client_id
          in: query
          schema:
            type: string
          description: Integration client id.
        - name: from
          in: query
          schema:
            type: string
            format: date-time
          description: From.
        - name: to
          in: query
          schema:
            type: string
            format: date-time
          description: To.
      responses:
        "200":
          description: Successful response.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApplicationMetrics"
        default:
          description: RFC 9457 Problem Details.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: Get application metrics
      description: Get application metrics.
  /api/v1/invocations:
    get:
      tags:
        - ApplicationService
      operationId: ApplicationService_ListInvocations
      parameters:
        - name: deployment_id
          in: query
          schema:
            type: string
          description: Agent service deployment identifier; this refers to an application service configuration.
        - name: status
          in: query
          schema:
            enum:
              - INVOCATION_STATUS_UNSPECIFIED
              - INVOCATION_STATUS_ADMITTED
              - INVOCATION_STATUS_QUEUED
              - INVOCATION_STATUS_PLANNING
              - INVOCATION_STATUS_PROVISIONING
              - INVOCATION_STATUS_RUNNING
              - INVOCATION_STATUS_WAITING_APPROVAL
              - INVOCATION_STATUS_WAITING_INPUT
              - INVOCATION_STATUS_PAUSED
              - INVOCATION_STATUS_COMPLETED
              - INVOCATION_STATUS_FAILED
              - INVOCATION_STATUS_CANCELLED
            type: string
            format: enum
            description: Status.
            x-enum-descriptions:
              INVOCATION_STATUS_UNSPECIFIED: unspecified
              INVOCATION_STATUS_ADMITTED: admitted
              INVOCATION_STATUS_QUEUED: queued
              INVOCATION_STATUS_PLANNING: planning
              INVOCATION_STATUS_PROVISIONING: provisioning
              INVOCATION_STATUS_RUNNING: running
              INVOCATION_STATUS_WAITING_APPROVAL: waiting approval
              INVOCATION_STATUS_WAITING_INPUT: waiting input
              INVOCATION_STATUS_PAUSED: paused
              INVOCATION_STATUS_COMPLETED: completed
              INVOCATION_STATUS_FAILED: failed
              INVOCATION_STATUS_CANCELLED: cancelled
          description: Status.
        - name: page_size
          in: query
          schema:
            type: integer
            format: int32
          description: Requested page size, subject to the endpoint limits.
        - name: page_token
          in: query
          schema:
            type: string
          description: Opaque pagination token returned by the previous page. Do not construct or modify it.
      responses:
        "200":
          description: Successful response.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListInvocationsResponse"
        default:
          description: RFC 9457 Problem Details.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: List invocations
      description: List invocations. Use the declared pagination parameters to continue through results.
  /api/v1/invocations/{id}:
    get:
      tags:
        - ApplicationService
      operationId: ApplicationService_GetInvocation
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: Identifier of the resource addressed by this schema or URL.
      responses:
        "200":
          description: Successful response.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Invocation"
        default:
          description: RFC 9457 Problem Details.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: Get invocation
      description: Get invocation.
  /api/v1/invocations/{id}:cancel:
    post:
      tags:
        - ApplicationService
      operationId: ApplicationService_CancelInvocation
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: Identifier of the resource addressed by this schema or URL.
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CancelInvocationRequest"
        required: true
        description: Request body for cancel invocation.
      responses:
        "200":
          description: Successful response.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Invocation"
        default:
          description: RFC 9457 Problem Details.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: Cancel invocation
      description: Cancel invocation. Supply the fields defined in the request schema.
  /api/v1/invocations/{id}:retry:
    post:
      tags:
        - ApplicationService
      operationId: ApplicationService_RetryInvocation
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: Identifier of the resource addressed by this schema or URL.
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RetryInvocationRequest"
        required: true
        description: Request body for retry invocation.
      responses:
        "200":
          description: Successful response.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Invocation"
        default:
          description: RFC 9457 Problem Details.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: Retry invocation
      description: Retry invocation. Supply the fields defined in the request schema.
  /api/v1/invocations/{invocation_id}/events:
    get:
      tags:
        - ApplicationService
      operationId: ApplicationService_ListInvocationEvents
      parameters:
        - name: invocation_id
          in: path
          required: true
          schema:
            type: string
          description: Invocation id.
        - name: after_sequence
          in: query
          schema:
            type: string
          description: Read events after this sequence number. Preserve exact integer precision when persisting a cursor.
        - name: page_size
          in: query
          schema:
            type: integer
            format: int32
          description: Requested page size, subject to the endpoint limits.
        - name: tail
          in: query
          description: |-
            Return the newest page in ascending sequence order. A streaming client
             normally starts from the snapshot and resumes with Last-Event-ID.
          schema:
            type: boolean
      responses:
        "200":
          description: Successful response.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListInvocationEventsResponse"
        default:
          description: RFC 9457 Problem Details.
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: List invocation events
      description: Read progress events for an application invocation. Reconcile the invocation snapshot with its ordered events; a repeated delivery is not a new invocation.
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
  schemas:
    AgentDeployment:
      type: object
      properties:
        id:
          type: string
          description: Identifier of the resource addressed by this schema or URL.
        tenant_id:
          type: string
          description: Tenant identifier used with the authenticated access context. Supplying an ID does not grant access.
        workspace_id:
          type: string
          description: Workspace identifier. A Workspace is a persistent collaboration context, distinct from a per-task worktree.
        policy_scope_id:
          type: string
          description: Policy scope id.
        key:
          type: string
          description: Key.
        name:
          type: string
          description: Name.
        description:
          type: string
          description: Description.
        status:
          enum:
            - AGENT_DEPLOYMENT_STATUS_UNSPECIFIED
            - AGENT_DEPLOYMENT_STATUS_ACTIVE
            - AGENT_DEPLOYMENT_STATUS_DISABLED
          type: string
          format: enum
          description: Status.
          x-enum-descriptions:
            AGENT_DEPLOYMENT_STATUS_UNSPECIFIED: unspecified
            AGENT_DEPLOYMENT_STATUS_ACTIVE: active
            AGENT_DEPLOYMENT_STATUS_DISABLED: disabled
        state_version:
          type: string
          description: State revision used for optimistic concurrency. Preserve its exact decimal representation.
        current_revision:
          $ref: "#/components/schemas/AgentDeploymentRevision"
          description: Current revision.
        created_by:
          type: string
          description: Created by.
        disabled_by:
          type: string
          description: Disabled by.
        disabled_at:
          type: string
          format: date-time
          description: Disabled at as an RFC 3339 timestamp.
        created_at:
          type: string
          format: date-time
          description: Created at as an RFC 3339 timestamp.
        updated_at:
          type: string
          format: date-time
          description: Updated at as an RFC 3339 timestamp.
      description: Application-facing Agent service configuration, including execution bindings and adapters. This is not a Kubernetes Deployment.
    AgentDeploymentRevision:
      type: object
      properties:
        id:
          type: string
          description: Identifier of the resource addressed by this schema or URL.
        deployment_id:
          type: string
          description: Agent service deployment identifier; this refers to an application service configuration.
        revision:
          type: integer
          format: int32
          description: Revision.
        workspace_agent_binding_id:
          type: string
          description: Identifier of the Agent binding in the selected Workspace.
        agent_version_id:
          type: string
          description: Agent version id.
        environment_version_id:
          type: string
          description: Environment version id.
        workflow_registry_version_id:
          type: string
          description: Workflow registry version id.
        input_schema:
          type: object
          description: Input schema.
        output_schema:
          type: object
          description: Output schema.
        input_media_types:
          type: array
          items:
            type: string
          description: Input media types list.
        output_media_types:
          type: array
          items:
            type: string
          description: Output media types list.
        placement_policy:
          type: object
          description: Placement policy.
        data_retention_policy:
          type: object
          description: Data retention policy.
        approval_mode:
          enum:
            - INVOCATION_APPROVAL_MODE_UNSPECIFIED
            - INVOCATION_APPROVAL_MODE_MANUAL
            - INVOCATION_APPROVAL_MODE_AUTO
          type: string
          format: enum
          description: Approval mode.
          x-enum-descriptions:
            INVOCATION_APPROVAL_MODE_UNSPECIFIED: unspecified
            INVOCATION_APPROVAL_MODE_MANUAL: manual
            INVOCATION_APPROVAL_MODE_AUTO: auto
        max_concurrency:
          type: integer
          format: int32
          description: Max concurrency.
        timeout:
          pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
          type: string
          description: Timeout.
        created_by:
          type: string
          description: Created by.
        created_at:
          type: string
          format: date-time
          description: Created at as an RFC 3339 timestamp.
      description: Agent deployment revision representation.
    AgentDeploymentRevisionSpec:
      type: object
      properties:
        workspace_agent_binding_id:
          type: string
          description: Identifier of the Agent binding in the selected Workspace.
        workflow_registry_version_id:
          type: string
          description: Workflow registry version id.
        input_schema:
          type: object
          description: Input schema.
        output_schema:
          type: object
          description: Output schema.
        input_media_types:
          type: array
          items:
            type: string
          description: Input media types list.
        output_media_types:
          type: array
          items:
            type: string
          description: Output media types list.
        placement_policy:
          type: object
          description: Placement policy.
        data_retention_policy:
          type: object
          description: Data retention policy.
        approval_mode:
          enum:
            - INVOCATION_APPROVAL_MODE_UNSPECIFIED
            - INVOCATION_APPROVAL_MODE_MANUAL
            - INVOCATION_APPROVAL_MODE_AUTO
          type: string
          format: enum
          description: Approval mode.
          x-enum-descriptions:
            INVOCATION_APPROVAL_MODE_UNSPECIFIED: unspecified
            INVOCATION_APPROVAL_MODE_MANUAL: manual
            INVOCATION_APPROVAL_MODE_AUTO: auto
        max_concurrency:
          type: integer
          format: int32
          description: Max concurrency.
        timeout:
          pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
          type: string
          description: Timeout.
      description: Agent deployment revision spec representation.
    ApplicationMetrics:
      type: object
      properties:
        from:
          type: string
          format: date-time
          description: From as an RFC 3339 timestamp.
        to:
          type: string
          format: date-time
          description: To as an RFC 3339 timestamp.
        clients:
          type: array
          items:
            $ref: "#/components/schemas/ClientApplicationMetrics"
          description: Clients list.
      description: Application metrics representation.
    CancelInvocationRequest:
      type: object
      properties:
        id:
          type: string
          description: Identifier of the resource addressed by this schema or URL.
        expected_state_version:
          type: string
          description: Expected state revision for optimistic concurrency. Copy the current revision exactly; do not round it through a JavaScript Number.
      description: Cancel invocation request.
    ClientApplicationMetrics:
      type: object
      properties:
        integration_client_id:
          type: string
          description: Integration client id.
        request_count:
          type: string
          description: Request count.
        completed_count:
          type: string
          description: Completed count.
        error_count:
          type: string
          description: Error count.
        cancelled_count:
          type: string
          description: Cancelled count.
        active_count:
          type: string
          description: Active count.
        latency_sample_count:
          type: string
          description: Latency sample count.
        average_latency_ms:
          type: string
          description: Average latency ms.
        p50_latency_ms:
          type: string
          description: P50 latency ms.
        p95_latency_ms:
          type: string
          description: P95 latency ms.
        p99_latency_ms:
          type: string
          description: P99 latency ms.
        usage:
          $ref: "#/components/schemas/InvocationUsage"
          description: Usage.
      description: Client application metrics representation.
    CreateAgentDeploymentRequest:
      type: object
      properties:
        workspace_id:
          type: string
          description: Workspace identifier. A Workspace is a persistent collaboration context, distinct from a per-task worktree.
        key:
          type: string
          description: Key.
        name:
          type: string
          description: Name.
        description:
          type: string
          description: Description.
        revision:
          $ref: "#/components/schemas/AgentDeploymentRevisionSpec"
          description: Revision.
      description: Create Agent deployment request.
    CreateInvocationRequest:
      type: object
      properties:
        deployment_id:
          type: string
          description: Agent service deployment identifier; this refers to an application service configuration.
        idempotency_key:
          type: string
          description: Idempotency key for this operation. Reuse it only when retrying the same submission with the same payload.
        external_subject_hash:
          type: string
          description: Opaque caller-supplied subject correlation. This value alone is not an authorization or execution isolation boundary.
        input:
          type: object
          description: Input accepted by this request. Its declared schema and, for invocations, the configured input adapter determine the shape.
        input_artifact_ids:
          type: array
          items:
            type: string
          description: Input artifact ids list.
        edge_resource_handle_ids:
          type: array
          items:
            type: string
          description: Edge resource handle ids list.
      description: Create invocation request.
    DisableAgentDeploymentRequest:
      type: object
      properties:
        id:
          type: string
          description: Identifier of the resource addressed by this schema or URL.
        expected_state_version:
          type: string
          description: Expected state revision for optimistic concurrency. Copy the current revision exactly; do not round it through a JavaScript Number.
      description: Disable Agent deployment request.
    EnableAgentDeploymentRequest:
      type: object
      properties:
        id:
          type: string
          description: Identifier of the resource addressed by this schema or URL.
        expected_state_version:
          type: string
          description: Expected state revision for optimistic concurrency. Copy the current revision exactly; do not round it through a JavaScript Number.
      description: Enable Agent deployment request.
    Invocation:
      type: object
      properties:
        id:
          type: string
          description: Identifier of the resource addressed by this schema or URL.
        tenant_id:
          type: string
          description: Tenant identifier used with the authenticated access context. Supplying an ID does not grant access.
        deployment_id:
          type: string
          description: Agent service deployment identifier; this refers to an application service configuration.
        deployment_revision_id:
          type: string
          description: Deployment revision id.
        deployment_revision:
          type: integer
          format: int32
          description: Deployment revision.
        integration_client_id:
          type: string
          description: Integration client id.
        actor_identity_id:
          type: string
          description: Actor identity id.
        idempotency_key:
          type: string
          description: Idempotency key for this operation. Reuse it only when retrying the same submission with the same payload.
        external_subject_hash:
          type: string
          description: Opaque caller-supplied subject correlation. This value alone is not an authorization or execution isolation boundary.
        input:
          type: object
          description: Input accepted by this request. Its declared schema and, for invocations, the configured input adapter determine the shape.
        input_artifact_ids:
          type: array
          items:
            type: string
          description: Input artifact ids list.
        execution_snapshot:
          type: object
          description: Execution snapshot.
        status:
          enum:
            - INVOCATION_STATUS_UNSPECIFIED
            - INVOCATION_STATUS_ADMITTED
            - INVOCATION_STATUS_QUEUED
            - INVOCATION_STATUS_PLANNING
            - INVOCATION_STATUS_PROVISIONING
            - INVOCATION_STATUS_RUNNING
            - INVOCATION_STATUS_WAITING_APPROVAL
            - INVOCATION_STATUS_WAITING_INPUT
            - INVOCATION_STATUS_PAUSED
            - INVOCATION_STATUS_COMPLETED
            - INVOCATION_STATUS_FAILED
            - INVOCATION_STATUS_CANCELLED
          type: string
          format: enum
          description: Status.
          x-enum-descriptions:
            INVOCATION_STATUS_UNSPECIFIED: unspecified
            INVOCATION_STATUS_ADMITTED: admitted
            INVOCATION_STATUS_QUEUED: queued
            INVOCATION_STATUS_PLANNING: planning
            INVOCATION_STATUS_PROVISIONING: provisioning
            INVOCATION_STATUS_RUNNING: running
            INVOCATION_STATUS_WAITING_APPROVAL: waiting approval
            INVOCATION_STATUS_WAITING_INPUT: waiting input
            INVOCATION_STATUS_PAUSED: paused
            INVOCATION_STATUS_COMPLETED: completed
            INVOCATION_STATUS_FAILED: failed
            INVOCATION_STATUS_CANCELLED: cancelled
        progress:
          $ref: "#/components/schemas/InvocationProgress"
          description: Progress.
        output:
          type: object
          description: Output.
        output_artifact_ids:
          type: array
          items:
            type: string
          description: Output artifact ids list.
        error_code:
          type: string
          description: Error code.
        error_message:
          type: string
          description: Error message.
        usage:
          $ref: "#/components/schemas/InvocationUsage"
          description: Usage.
        retry_count:
          type: integer
          format: int32
          description: Retry count.
        state_version:
          type: string
          description: State revision used for optimistic concurrency. Preserve its exact decimal representation.
        started_at:
          type: string
          format: date-time
          description: Started at as an RFC 3339 timestamp.
        finished_at:
          type: string
          format: date-time
          description: Finished at as an RFC 3339 timestamp.
        created_at:
          type: string
          format: date-time
          description: Created at as an RFC 3339 timestamp.
        updated_at:
          type: string
          format: date-time
          description: Updated at as an RFC 3339 timestamp.
        execution_id:
          type: string
          description: |-
            Opaque execution correlation ID. Callers must not infer the internal
             Task/Run representation from this value.
        deadline_at:
          type: string
          description: Absolute wall-clock deadline captured from the admitted immutable revision.
          format: date-time
        edge_resource_handle_ids:
          type: array
          items:
            type: string
          description: Edge resource handle ids list.
        required_runtime_host_id:
          type: string
          description: Required runtime host id.
      description: One application call to an Agent service, with its execution state and correlated Task information.
    InvocationEvent:
      type: object
      properties:
        event_id:
          type: string
          description: Event id.
        schema_version:
          type: integer
          format: int32
          description: Schema version.
        type:
          type: string
          description: Type.
        invocation_id:
          type: string
          description: Invocation id.
        sequence:
          type: string
          description: Event sequence number used for ordering and deduplication.
        occurred_at:
          type: string
          format: date-time
          description: Occurred at as an RFC 3339 timestamp.
        change_type:
          type: string
          description: Change type.
        data:
          type: object
          description: Data.
      description: |-
        InvocationEvent is the stable, application-facing projection of an
         execution event. It deliberately omits internal Task/Run identifiers and
         raw provider or tool payloads.
    InvocationProgress:
      type: object
      properties:
        last_event_sequence:
          type: string
          description: Last event sequence.
        model_round_count:
          type: string
          description: Model round count.
        model_retry_count:
          type: string
          description: Model retry count.
        tool_call_count:
          type: string
          description: Tool call count.
        tool_running_count:
          type: string
          description: Tool running count.
        tool_completed_count:
          type: string
          description: Tool completed count.
        tool_failed_count:
          type: string
          description: Tool failed count.
        approval_pending_count:
          type: string
          description: Approval pending count.
        delegation_count:
          type: string
          description: Delegation count.
        delegation_running_count:
          type: string
          description: Delegation running count.
        delegation_completed_count:
          type: string
          description: Delegation completed count.
        delegation_failed_count:
          type: string
          description: Delegation failed count.
      description: Invocation progress representation.
    InvocationUsage:
      type: object
      properties:
        input_tokens:
          type: string
          description: Input tokens.
        output_tokens:
          type: string
          description: Output tokens.
        cache_read_input_tokens:
          type: string
          description: Cache read input tokens.
        cache_write_input_tokens:
          type: string
          description: Cache write input tokens.
        cache_read_reported:
          type: boolean
          description: Cache read reported.
        cache_write_reported:
          type: boolean
          description: Cache write reported.
        model_cost_microunits:
          type: string
          description: Model cost microunits.
        compute_ms:
          type: string
          description: Compute ms.
        gpu_ms:
          type: string
          description: Gpu ms.
        attempt_count:
          type: string
          description: Attempt count.
        elapsed_ms:
          type: string
          description: Elapsed ms.
        input_artifact_count:
          type: string
          description: Input artifact count.
        input_artifact_bytes:
          type: string
          description: Input artifact bytes.
        output_artifact_count:
          type: string
          description: Output artifact count.
        output_artifact_bytes:
          type: string
          description: Output artifact bytes.
      description: Invocation usage representation.
    ListAgentDeploymentRevisionsResponse:
      type: object
      properties:
        revisions:
          type: array
          items:
            $ref: "#/components/schemas/AgentDeploymentRevision"
          description: Revisions list.
        next_page_token:
          type: string
          description: Pagination token for the next page. An empty value indicates there is no next page.
      description: List Agent deployment revisions response.
    ListAgentDeploymentsResponse:
      type: object
      properties:
        deployments:
          type: array
          items:
            $ref: "#/components/schemas/AgentDeployment"
          description: Deployments list.
        next_page_token:
          type: string
          description: Pagination token for the next page. An empty value indicates there is no next page.
      description: List Agent deployments response.
    ListInvocationEventsResponse:
      type: object
      properties:
        events:
          type: array
          items:
            $ref: "#/components/schemas/InvocationEvent"
          description: Events list.
        next_sequence:
          type: string
          description: Next sequence.
        snapshot:
          $ref: "#/components/schemas/Invocation"
          description: Snapshot.
      description: List invocation events response.
    ListInvocationsResponse:
      type: object
      properties:
        invocations:
          type: array
          items:
            $ref: "#/components/schemas/Invocation"
          description: Invocations list.
        next_page_token:
          type: string
          description: Pagination token for the next page. An empty value indicates there is no next page.
      description: List invocations response.
    ProblemDetails:
      type: object
      description: RFC 9457 Problem Details with OrbitSpace correlation extensions.
      required:
        - type
        - title
        - status
        - detail
        - request_id
      properties:
        type:
          type: string
          format: uri
          description: Type.
        title:
          type: string
          description: Title.
        status:
          type: integer
          minimum: 400
          maximum: 599
          description: Status.
        detail:
          type: string
          description: Detail.
        instance:
          type: string
          format: uri-reference
          description: Instance.
        code:
          type: string
          pattern: ^[A-Z][A-Z0-9_]*$
          description: Code.
        request_id:
          type: string
          format: uuid
          description: Request id.
    RetryInvocationRequest:
      type: object
      properties:
        id:
          type: string
          description: Identifier of the resource addressed by this schema or URL.
        expected_state_version:
          type: string
          description: Expected state revision for optimistic concurrency. Copy the current revision exactly; do not round it through a JavaScript Number.
      description: Retry invocation request.
    ReviseAgentDeploymentRequest:
      type: object
      properties:
        id:
          type: string
          description: Identifier of the resource addressed by this schema or URL.
        expected_state_version:
          type: string
          description: Expected state revision for optimistic concurrency. Copy the current revision exactly; do not round it through a JavaScript Number.
        name:
          type: string
          description: Name.
        description:
          type: string
          description: Description.
        revision:
          $ref: "#/components/schemas/AgentDeploymentRevisionSpec"
          description: Revision.
      description: Revise Agent deployment request.
tags:
  - name: ApplicationService
    x-displayName: Agent services and invocations
    description: Agent services and invocations operations.
