# 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 服务 API
  version: 1.0.0
  description: Agent 服务的公开 v1 应用接口契约。协议生命周期与能力可用状态见集成指南。
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: 工作空间标识。工作空间是持续协作上下文，与按任务使用的工作树不同。
        - name: include_disabled
          in: query
          schema:
            type: boolean
          description: 包括停用。
        - name: page_size
          in: query
          schema:
            type: integer
            format: int32
          description: 请求的每页条数，受接口上限约束。
        - name: page_token
          in: query
          schema:
            type: string
          description: 上一页返回的不透明分页令牌，请勿自行构造或修改。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListAgentDeploymentsResponse"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 列出Agent 服务
      description: 列出Agent 服务。 如需继续读取结果，请使用接口声明的分页参数。
    post:
      tags:
        - ApplicationService
      operationId: ApplicationService_CreateAgentDeployment
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateAgentDeploymentRequest"
        required: true
        description: 创建Agent 服务的请求体。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AgentDeployment"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 创建Agent 服务
      description: 为应用调用方创建 Agent 服务配置，关联准入的 Agent、执行配置及输入输出适配器。此处的 deployment 表示服务配置，不是 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 服务配置的标识，指应用可调用的服务配置。
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateInvocationRequest"
            examples:
              invoke-service:
                summary: 调用已发布的 Agent 服务
                description: 将 URL 中的 deployment_id 替换为已启用的服务标识。接受的输入格式由服务的输入适配器决定。
                value:
                  idempotency_key: invocation-example-001
                  input:
                    message: Summarize the supplied document.
        required: true
        description: 创建应用调用的请求体。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Invocation"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 创建应用调用
      description: 调用 URL 中 deployment_id 指定的已启用 Agent 服务。输入格式由服务的输入适配器定义；重试同一次提交时使用相同的 idempotency_key。external_subject_hash 仅用于关联调用方主体，本身不授予访问权，也不提供执行隔离。
  /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 服务配置的标识，指应用可调用的服务配置。
        - name: page_size
          in: query
          schema:
            type: integer
            format: int32
          description: 请求的每页条数，受接口上限约束。
        - name: page_token
          in: query
          schema:
            type: string
          description: 上一页返回的不透明分页令牌，请勿自行构造或修改。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListAgentDeploymentRevisionsResponse"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 列出Agent 服务修订
      description: 列出Agent 服务修订。 如需继续读取结果，请使用接口声明的分页参数。
  /api/v1/agent-deployments/{id}:
    get:
      tags:
        - ApplicationService
      operationId: ApplicationService_GetAgentDeployment
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: 当前 Schema 或 URL 所指资源的标识。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AgentDeployment"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 读取Agent 服务
      description: 读取Agent 服务。
  /api/v1/agent-deployments/{id}:disable:
    post:
      tags:
        - ApplicationService
      operationId: ApplicationService_DisableAgentDeployment
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: 当前 Schema 或 URL 所指资源的标识。
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DisableAgentDeploymentRequest"
        required: true
        description: 停用Agent 服务的请求体。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AgentDeployment"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 停用Agent 服务
      description: 停用Agent 服务。 请求字段应遵循下方的 Schema。
  /api/v1/agent-deployments/{id}:enable:
    post:
      tags:
        - ApplicationService
      operationId: ApplicationService_EnableAgentDeployment
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: 当前 Schema 或 URL 所指资源的标识。
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/EnableAgentDeploymentRequest"
        required: true
        description: 启用Agent 服务的请求体。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AgentDeployment"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 启用Agent 服务
      description: 启用Agent 服务。 请求字段应遵循下方的 Schema。
  /api/v1/agent-deployments/{id}:revise:
    post:
      tags:
        - ApplicationService
      operationId: ApplicationService_ReviseAgentDeployment
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: 当前 Schema 或 URL 所指资源的标识。
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ReviseAgentDeploymentRequest"
        required: true
        description: 修订Agent 服务的请求体。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AgentDeployment"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 修订Agent 服务
      description: 修订Agent 服务。 请求字段应遵循下方的 Schema。
  /api/v1/application-metrics:
    get:
      tags:
        - ApplicationService
      operationId: ApplicationService_GetApplicationMetrics
      parameters:
        - name: integration_client_id
          in: query
          schema:
            type: string
          description: 集成客户端标识符。
        - name: from
          in: query
          schema:
            type: string
            format: date-time
          description: 来源。
        - name: to
          in: query
          schema:
            type: string
            format: date-time
          description: 目标。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ApplicationMetrics"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 读取应用指标
      description: 读取应用指标。
  /api/v1/invocations:
    get:
      tags:
        - ApplicationService
      operationId: ApplicationService_ListInvocations
      parameters:
        - name: deployment_id
          in: query
          schema:
            type: string
          description: Agent 服务配置的标识，指应用可调用的服务配置。
        - 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: 状态。
            x-enum-descriptions:
              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: 已取消
          description: 状态。
        - name: page_size
          in: query
          schema:
            type: integer
            format: int32
          description: 请求的每页条数，受接口上限约束。
        - name: page_token
          in: query
          schema:
            type: string
          description: 上一页返回的不透明分页令牌，请勿自行构造或修改。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListInvocationsResponse"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 列出应用调用
      description: 列出应用调用。 如需继续读取结果，请使用接口声明的分页参数。
  /api/v1/invocations/{id}:
    get:
      tags:
        - ApplicationService
      operationId: ApplicationService_GetInvocation
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: 当前 Schema 或 URL 所指资源的标识。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Invocation"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 读取应用调用
      description: 读取应用调用。
  /api/v1/invocations/{id}:cancel:
    post:
      tags:
        - ApplicationService
      operationId: ApplicationService_CancelInvocation
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: 当前 Schema 或 URL 所指资源的标识。
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CancelInvocationRequest"
        required: true
        description: 取消应用调用的请求体。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Invocation"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 取消应用调用
      description: 取消应用调用。 请求字段应遵循下方的 Schema。
  /api/v1/invocations/{id}:retry:
    post:
      tags:
        - ApplicationService
      operationId: ApplicationService_RetryInvocation
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: 当前 Schema 或 URL 所指资源的标识。
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RetryInvocationRequest"
        required: true
        description: 重试应用调用的请求体。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Invocation"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 重试应用调用
      description: 重试应用调用。 请求字段应遵循下方的 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: 调用标识符。
        - name: after_sequence
          in: query
          schema:
            type: string
          description: 读取此序号之后的事件。保存游标时须保留整数精度。
        - name: page_size
          in: query
          schema:
            type: integer
            format: int32
          description: 请求的每页条数，受接口上限约束。
        - name: tail
          in: query
          description: 读取最新一页，并按递增序号返回。流式客户端通常先读取快照，再通过 Last-Event-ID 续接。
          schema:
            type: boolean
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListInvocationEventsResponse"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 列出应用调用事件
      description: 读取应用调用的进展事件。将调用快照与有序事件对照处理；重复投递不表示产生了新的调用。
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
  schemas:
    AgentDeployment:
      type: object
      properties:
        id:
          type: string
          description: 当前 Schema 或 URL 所指资源的标识。
        tenant_id:
          type: string
          description: 与已认证的访问上下文配合使用的租户标识；提供标识并不授予访问权。
        workspace_id:
          type: string
          description: 工作空间标识。工作空间是持续协作上下文，与按任务使用的工作树不同。
        policy_scope_id:
          type: string
          description: 策略权限范围标识符。
        key:
          type: string
          description: 键。
        name:
          type: string
          description: 名称。
        description:
          type: string
          description: 说明。
        status:
          enum:
            - AGENT_DEPLOYMENT_STATUS_UNSPECIFIED
            - AGENT_DEPLOYMENT_STATUS_ACTIVE
            - AGENT_DEPLOYMENT_STATUS_DISABLED
          type: string
          format: enum
          description: 状态。
          x-enum-descriptions:
            AGENT_DEPLOYMENT_STATUS_UNSPECIFIED: 未指定
            AGENT_DEPLOYMENT_STATUS_ACTIVE: 已启用
            AGENT_DEPLOYMENT_STATUS_DISABLED: 已停用
        state_version:
          type: string
          description: 用于乐观并发控制的状态版本，须保留精确的十进制表示。
        current_revision:
          $ref: "#/components/schemas/AgentDeploymentRevision"
          description: 当前修订。
        created_by:
          type: string
          description: 创建操作者。
        disabled_by:
          type: string
          description: 停用操作者。
        disabled_at:
          type: string
          format: date-time
          description: 停用时间，使用 RFC 3339 时间格式。
        created_at:
          type: string
          format: date-time
          description: 创建时间，使用 RFC 3339 时间格式。
        updated_at:
          type: string
          format: date-time
          description: 更新时间，使用 RFC 3339 时间格式。
      description: 面向应用的 Agent 服务配置，包含执行绑定和适配器；不是 Kubernetes Deployment。
    AgentDeploymentRevision:
      type: object
      properties:
        id:
          type: string
          description: 当前 Schema 或 URL 所指资源的标识。
        deployment_id:
          type: string
          description: Agent 服务配置的标识，指应用可调用的服务配置。
        revision:
          type: integer
          format: int32
          description: 修订。
        workspace_agent_binding_id:
          type: string
          description: 所选工作空间中的 Agent 绑定标识。
        agent_version_id:
          type: string
          description: Agent版本标识符。
        environment_version_id:
          type: string
          description: 执行环境版本标识符。
        workflow_registry_version_id:
          type: string
          description: 工作流注册表版本标识符。
        input_schema:
          type: object
          description: 输入Schema。
        output_schema:
          type: object
          description: 输出Schema。
        input_media_types:
          type: array
          items:
            type: string
          description: 输入媒体类型列表。
        output_media_types:
          type: array
          items:
            type: string
          description: 输出媒体类型列表。
        placement_policy:
          type: object
          description: 调度策略。
        data_retention_policy:
          type: object
          description: 数据保留策略。
        approval_mode:
          enum:
            - INVOCATION_APPROVAL_MODE_UNSPECIFIED
            - INVOCATION_APPROVAL_MODE_MANUAL
            - INVOCATION_APPROVAL_MODE_AUTO
          type: string
          format: enum
          description: 审批模式。
          x-enum-descriptions:
            INVOCATION_APPROVAL_MODE_UNSPECIFIED: 未指定
            INVOCATION_APPROVAL_MODE_MANUAL: 人工
            INVOCATION_APPROVAL_MODE_AUTO: 自动
        max_concurrency:
          type: integer
          format: int32
          description: 最大并发。
        timeout:
          pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
          type: string
          description: 超时。
        created_by:
          type: string
          description: 创建操作者。
        created_at:
          type: string
          format: date-time
          description: 创建时间，使用 RFC 3339 时间格式。
      description: Agent部署修订结构。
    AgentDeploymentRevisionSpec:
      type: object
      properties:
        workspace_agent_binding_id:
          type: string
          description: 所选工作空间中的 Agent 绑定标识。
        workflow_registry_version_id:
          type: string
          description: 工作流注册表版本标识符。
        input_schema:
          type: object
          description: 输入Schema。
        output_schema:
          type: object
          description: 输出Schema。
        input_media_types:
          type: array
          items:
            type: string
          description: 输入媒体类型列表。
        output_media_types:
          type: array
          items:
            type: string
          description: 输出媒体类型列表。
        placement_policy:
          type: object
          description: 调度策略。
        data_retention_policy:
          type: object
          description: 数据保留策略。
        approval_mode:
          enum:
            - INVOCATION_APPROVAL_MODE_UNSPECIFIED
            - INVOCATION_APPROVAL_MODE_MANUAL
            - INVOCATION_APPROVAL_MODE_AUTO
          type: string
          format: enum
          description: 审批模式。
          x-enum-descriptions:
            INVOCATION_APPROVAL_MODE_UNSPECIFIED: 未指定
            INVOCATION_APPROVAL_MODE_MANUAL: 人工
            INVOCATION_APPROVAL_MODE_AUTO: 自动
        max_concurrency:
          type: integer
          format: int32
          description: 最大并发。
        timeout:
          pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
          type: string
          description: 超时。
      description: Agent部署修订规范结构。
    ApplicationMetrics:
      type: object
      properties:
        from:
          type: string
          format: date-time
          description: 来源，使用 RFC 3339 时间格式。
        to:
          type: string
          format: date-time
          description: 目标，使用 RFC 3339 时间格式。
        clients:
          type: array
          items:
            $ref: "#/components/schemas/ClientApplicationMetrics"
          description: 客户端列表。
      description: 应用指标结构。
    CancelInvocationRequest:
      type: object
      properties:
        id:
          type: string
          description: 当前 Schema 或 URL 所指资源的标识。
        expected_state_version:
          type: string
          description: 用于乐观并发控制的预期状态版本。请原样复制当前版本，不要经 JavaScript Number 转换而损失精度。
      description: 取消应用调用的请求结构。
    ClientApplicationMetrics:
      type: object
      properties:
        integration_client_id:
          type: string
          description: 集成客户端标识符。
        request_count:
          type: string
          description: 请求数量。
        completed_count:
          type: string
          description: 已完成数量。
        error_count:
          type: string
          description: 错误数量。
        cancelled_count:
          type: string
          description: 已取消数量。
        active_count:
          type: string
          description: 活跃数量。
        latency_sample_count:
          type: string
          description: 延迟采样数量。
        average_latency_ms:
          type: string
          description: 平均延迟毫秒。
        p50_latency_ms:
          type: string
          description: P50延迟毫秒。
        p95_latency_ms:
          type: string
          description: P95延迟毫秒。
        p99_latency_ms:
          type: string
          description: P99延迟毫秒。
        usage:
          $ref: "#/components/schemas/InvocationUsage"
          description: 用量。
      description: 客户端应用指标结构。
    CreateAgentDeploymentRequest:
      type: object
      properties:
        workspace_id:
          type: string
          description: 工作空间标识。工作空间是持续协作上下文，与按任务使用的工作树不同。
        key:
          type: string
          description: 键。
        name:
          type: string
          description: 名称。
        description:
          type: string
          description: 说明。
        revision:
          $ref: "#/components/schemas/AgentDeploymentRevisionSpec"
          description: 修订。
      description: 创建Agent 服务的请求结构。
    CreateInvocationRequest:
      type: object
      properties:
        deployment_id:
          type: string
          description: Agent 服务配置的标识，指应用可调用的服务配置。
        idempotency_key:
          type: string
          description: 本次操作的幂等键，仅在重试同一次、同内容的提交时复用。
        external_subject_hash:
          type: string
          description: 调用方提供的不透明主体关联值；此值本身不是授权或执行隔离边界。
        input:
          type: object
          description: 本请求接受的输入。格式由字段 Schema 决定；应用调用还需遵循配置的输入适配器。
        input_artifact_ids:
          type: array
          items:
            type: string
          description: 输入产物标识符列表列表。
        edge_resource_handle_ids:
          type: array
          items:
            type: string
          description: 边缘资源句柄标识符列表列表。
      description: 创建应用调用的请求结构。
    DisableAgentDeploymentRequest:
      type: object
      properties:
        id:
          type: string
          description: 当前 Schema 或 URL 所指资源的标识。
        expected_state_version:
          type: string
          description: 用于乐观并发控制的预期状态版本。请原样复制当前版本，不要经 JavaScript Number 转换而损失精度。
      description: 停用Agent 服务的请求结构。
    EnableAgentDeploymentRequest:
      type: object
      properties:
        id:
          type: string
          description: 当前 Schema 或 URL 所指资源的标识。
        expected_state_version:
          type: string
          description: 用于乐观并发控制的预期状态版本。请原样复制当前版本，不要经 JavaScript Number 转换而损失精度。
      description: 启用Agent 服务的请求结构。
    Invocation:
      type: object
      properties:
        id:
          type: string
          description: 当前 Schema 或 URL 所指资源的标识。
        tenant_id:
          type: string
          description: 与已认证的访问上下文配合使用的租户标识；提供标识并不授予访问权。
        deployment_id:
          type: string
          description: Agent 服务配置的标识，指应用可调用的服务配置。
        deployment_revision_id:
          type: string
          description: 部署修订标识符。
        deployment_revision:
          type: integer
          format: int32
          description: 部署修订。
        integration_client_id:
          type: string
          description: 集成客户端标识符。
        actor_identity_id:
          type: string
          description: 操作者身份标识符。
        idempotency_key:
          type: string
          description: 本次操作的幂等键，仅在重试同一次、同内容的提交时复用。
        external_subject_hash:
          type: string
          description: 调用方提供的不透明主体关联值；此值本身不是授权或执行隔离边界。
        input:
          type: object
          description: 本请求接受的输入。格式由字段 Schema 决定；应用调用还需遵循配置的输入适配器。
        input_artifact_ids:
          type: array
          items:
            type: string
          description: 输入产物标识符列表列表。
        execution_snapshot:
          type: object
          description: 执行快照。
        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: 状态。
          x-enum-descriptions:
            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: 已取消
        progress:
          $ref: "#/components/schemas/InvocationProgress"
          description: 进展。
        output:
          type: object
          description: 输出。
        output_artifact_ids:
          type: array
          items:
            type: string
          description: 输出产物标识符列表列表。
        error_code:
          type: string
          description: 错误代码。
        error_message:
          type: string
          description: 错误消息。
        usage:
          $ref: "#/components/schemas/InvocationUsage"
          description: 用量。
        retry_count:
          type: integer
          format: int32
          description: 重试数量。
        state_version:
          type: string
          description: 用于乐观并发控制的状态版本，须保留精确的十进制表示。
        started_at:
          type: string
          format: date-time
          description: 启动时间，使用 RFC 3339 时间格式。
        finished_at:
          type: string
          format: date-time
          description: 完成时间，使用 RFC 3339 时间格式。
        created_at:
          type: string
          format: date-time
          description: 创建时间，使用 RFC 3339 时间格式。
        updated_at:
          type: string
          format: date-time
          description: 更新时间，使用 RFC 3339 时间格式。
        execution_id:
          type: string
          description: 不透明的执行关联标识；调用者不能根据其内容推断内部 Task/Run 的表示方式。
        deadline_at:
          type: string
          description: 从已准入的不可变修订中固定下来的绝对截止时间，按实际经过时间计算。
          format: date-time
        edge_resource_handle_ids:
          type: array
          items:
            type: string
          description: 边缘资源句柄标识符列表列表。
        required_runtime_host_id:
          type: string
          description: 必需Runtime宿主标识符。
      description: 应用对 Agent 服务的一次调用，包含执行状态及关联的任务信息。
    InvocationEvent:
      type: object
      properties:
        event_id:
          type: string
          description: 事件标识符。
        schema_version:
          type: integer
          format: int32
          description: Schema版本。
        type:
          type: string
          description: 类型。
        invocation_id:
          type: string
          description: 调用标识符。
        sequence:
          type: string
          description: 用于排序和去重的事件序号。
        occurred_at:
          type: string
          format: date-time
          description: 发生时间，使用 RFC 3339 时间格式。
        change_type:
          type: string
          description: 变更类型。
        data:
          type: object
          description: 数据。
      description: InvocationEvent 是面向应用的稳定执行事件投影，省略内部 Task/Run 标识及服务商、工具的原始负载。
    InvocationProgress:
      type: object
      properties:
        last_event_sequence:
          type: string
          description: 最近事件序号。
        model_round_count:
          type: string
          description: 模型轮次数量。
        model_retry_count:
          type: string
          description: 模型重试数量。
        tool_call_count:
          type: string
          description: 工具调用数量。
        tool_running_count:
          type: string
          description: 工具执行中数量。
        tool_completed_count:
          type: string
          description: 工具已完成数量。
        tool_failed_count:
          type: string
          description: 工具失败数量。
        approval_pending_count:
          type: string
          description: 审批待处理数量。
        delegation_count:
          type: string
          description: 委派数量。
        delegation_running_count:
          type: string
          description: 委派执行中数量。
        delegation_completed_count:
          type: string
          description: 委派已完成数量。
        delegation_failed_count:
          type: string
          description: 委派失败数量。
      description: 调用进展结构。
    InvocationUsage:
      type: object
      properties:
        input_tokens:
          type: string
          description: 输入Token。
        output_tokens:
          type: string
          description: 输出Token。
        cache_read_input_tokens:
          type: string
          description: 缓存读取输入Token。
        cache_write_input_tokens:
          type: string
          description: 缓存写入输入Token。
        cache_read_reported:
          type: boolean
          description: 缓存读取已报告。
        cache_write_reported:
          type: boolean
          description: 缓存写入已报告。
        model_cost_microunits:
          type: string
          description: 模型成本微单位。
        compute_ms:
          type: string
          description: 计算毫秒。
        gpu_ms:
          type: string
          description: GPU毫秒。
        attempt_count:
          type: string
          description: 尝试数量。
        elapsed_ms:
          type: string
          description: 实际耗时毫秒。
        input_artifact_count:
          type: string
          description: 输入产物数量。
        input_artifact_bytes:
          type: string
          description: 输入产物字节。
        output_artifact_count:
          type: string
          description: 输出产物数量。
        output_artifact_bytes:
          type: string
          description: 输出产物字节。
      description: 调用用量结构。
    ListAgentDeploymentRevisionsResponse:
      type: object
      properties:
        revisions:
          type: array
          items:
            $ref: "#/components/schemas/AgentDeploymentRevision"
          description: 修订列表。
        next_page_token:
          type: string
          description: 下一页的分页令牌；为空表示没有下一页。
      description: 列出Agent 服务修订的响应结构。
    ListAgentDeploymentsResponse:
      type: object
      properties:
        deployments:
          type: array
          items:
            $ref: "#/components/schemas/AgentDeployment"
          description: 部署列表。
        next_page_token:
          type: string
          description: 下一页的分页令牌；为空表示没有下一页。
      description: 列出Agent 服务的响应结构。
    ListInvocationEventsResponse:
      type: object
      properties:
        events:
          type: array
          items:
            $ref: "#/components/schemas/InvocationEvent"
          description: 事件列表。
        next_sequence:
          type: string
          description: 下一序号。
        snapshot:
          $ref: "#/components/schemas/Invocation"
          description: 快照。
      description: 列出应用调用事件的响应结构。
    ListInvocationsResponse:
      type: object
      properties:
        invocations:
          type: array
          items:
            $ref: "#/components/schemas/Invocation"
          description: 调用列表。
        next_page_token:
          type: string
          description: 下一页的分页令牌；为空表示没有下一页。
      description: 列出应用调用的响应结构。
    ProblemDetails:
      type: object
      description: RFC 9457 Problem Details 错误对象，包含 OrbitSpace 的关联标识扩展字段。
      required:
        - type
        - title
        - status
        - detail
        - request_id
      properties:
        type:
          type: string
          format: uri
          description: 类型。
        title:
          type: string
          description: 标题。
        status:
          type: integer
          minimum: 400
          maximum: 599
          description: 状态。
        detail:
          type: string
          description: 详情。
        instance:
          type: string
          format: uri-reference
          description: 实例。
        code:
          type: string
          pattern: ^[A-Z][A-Z0-9_]*$
          description: 代码。
        request_id:
          type: string
          format: uuid
          description: 请求标识符。
    RetryInvocationRequest:
      type: object
      properties:
        id:
          type: string
          description: 当前 Schema 或 URL 所指资源的标识。
        expected_state_version:
          type: string
          description: 用于乐观并发控制的预期状态版本。请原样复制当前版本，不要经 JavaScript Number 转换而损失精度。
      description: 重试应用调用的请求结构。
    ReviseAgentDeploymentRequest:
      type: object
      properties:
        id:
          type: string
          description: 当前 Schema 或 URL 所指资源的标识。
        expected_state_version:
          type: string
          description: 用于乐观并发控制的预期状态版本。请原样复制当前版本，不要经 JavaScript Number 转换而损失精度。
        name:
          type: string
          description: 名称。
        description:
          type: string
          description: 说明。
        revision:
          $ref: "#/components/schemas/AgentDeploymentRevisionSpec"
          description: 修订。
      description: 修订Agent 服务的请求结构。
tags:
  - name: ApplicationService
    x-displayName: Agent 服务与调用
    description: Agent 服务与调用相关操作。
