# 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 任务与审批 API
  version: 1.0.0
  description: 任务与审批的公开 v1 应用接口契约。协议生命周期与能力可用状态见集成指南。
servers:
  - url: https://api.orbitspace.dev
security:
  - bearerAuth: []
paths:
  /api/v1/approvals:
    get:
      tags:
        - ApprovalService
      operationId: ApprovalService_ListApprovals
      parameters:
        - name: status
          in: query
          schema:
            enum:
              - APPROVAL_STATUS_UNSPECIFIED
              - APPROVAL_STATUS_PENDING
              - APPROVAL_STATUS_APPROVED
              - APPROVAL_STATUS_DENIED
              - APPROVAL_STATUS_EXPIRED
              - APPROVAL_STATUS_CANCELLED
            type: string
            format: enum
            description: 状态。
            x-enum-descriptions:
              APPROVAL_STATUS_UNSPECIFIED: 未指定
              APPROVAL_STATUS_PENDING: 待处理
              APPROVAL_STATUS_APPROVED: 已批准
              APPROVAL_STATUS_DENIED: 已拒绝
              APPROVAL_STATUS_EXPIRED: 已过期
              APPROVAL_STATUS_CANCELLED: 已取消
          description: 状态。
        - name: page_size
          in: query
          schema:
            type: integer
            format: int32
          description: 请求的每页条数，受接口上限约束。
        - name: page_token
          in: query
          schema:
            type: string
          description: 上一页返回的不透明分页令牌，请勿自行构造或修改。
        - name: status_group
          in: query
          schema:
            type: string
          description: 用于筛选当前或历史记录的状态分组，支持的值以接口契约为准。
        - name: query
          in: query
          schema:
            type: string
          description: 查询。
        - name: summary_only
          in: query
          schema:
            type: boolean
          description: 请求返回摘要记录，而非完整资源内容。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListApprovalsResponse"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 列出审批请求
      description: 列出审批请求。 如需继续读取结果，请使用接口声明的分页参数。
  /api/v1/approvals/{id}:
    get:
      tags:
        - ApprovalService
      operationId: ApprovalService_GetApproval
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: 当前 Schema 或 URL 所指资源的标识。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Approval"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 读取审批请求
      description: 读取审批请求。
  /api/v1/approvals/{id}/approve:
    post:
      tags:
        - ApprovalService
      operationId: ApprovalService_ApproveApproval
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: 当前 Schema 或 URL 所指资源的标识。
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ApproveApprovalRequest"
        required: true
        description: 批准审批请求的请求体。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Approval"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 批准审批请求
      description: 批准审批请求。 请求字段应遵循下方的 Schema。
  /api/v1/approvals/{id}/deny:
    post:
      tags:
        - ApprovalService
      operationId: ApprovalService_DenyApproval
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: 当前 Schema 或 URL 所指资源的标识。
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DenyApprovalRequest"
        required: true
        description: 拒绝审批请求的请求体。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Approval"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 拒绝审批请求
      description: 拒绝审批请求。 请求字段应遵循下方的 Schema。
  /api/v1/conversations/{conversation_id}/settings:
    get:
      tags:
        - TaskService
      operationId: TaskService_GetConversationSettings
      parameters:
        - name: conversation_id
          in: path
          required: true
          schema:
            type: string
          description: 会话标识符。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ConversationSettings"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 读取会话设置
      description: 读取会话设置。
    put:
      tags:
        - TaskService
      operationId: TaskService_UpdateConversationSettings
      parameters:
        - name: conversation_id
          in: path
          required: true
          schema:
            type: string
          description: 会话标识符。
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateConversationSettingsRequest"
        required: true
        description: 更新会话设置的请求体。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ConversationSettings"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 更新会话设置
      description: 更新会话设置。 请求字段应遵循下方的 Schema。
  /api/v1/delegation-joins/{id}:
    get:
      tags:
        - TaskService
      operationId: TaskService_GetDelegationJoin
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: 当前 Schema 或 URL 所指资源的标识。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DelegationJoin"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 读取委派汇合记录
      description: 读取委派汇合记录。
  /api/v1/delegations/{id}:
    get:
      tags:
        - TaskService
      operationId: TaskService_GetDelegation
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: 当前 Schema 或 URL 所指资源的标识。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Delegation"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 读取委派任务
      description: 读取委派任务。
  /api/v1/delegations/{id}/cancel:
    post:
      tags:
        - TaskService
      operationId: TaskService_CancelDelegation
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: 当前 Schema 或 URL 所指资源的标识。
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CancelDelegationRequest"
        required: true
        description: 取消委派任务的请求体。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Delegation"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 取消委派任务
      description: 取消委派任务。 请求字段应遵循下方的 Schema。
  /api/v1/input-requests/{id}:
    get:
      tags:
        - TaskService
      operationId: TaskService_GetTaskInputRequest
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: 当前 Schema 或 URL 所指资源的标识。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RunInputRequest"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 读取任务输入请求
      description: 读取任务输入请求。
  /api/v1/input-requests/{id}:reply:
    post:
      tags:
        - TaskService
      operationId: TaskService_ReplyTaskInputRequest
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: 当前 Schema 或 URL 所指资源的标识。
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ReplyTaskInputRequestRequest"
            examples:
              answer-question:
                summary: 回复指定的待处理输入请求
                description: 替换 URL 中的输入请求 ID。将 state_version 作为十进制字符串原样填入 expected_state_version，response 须符合待处理问题的 JSON Schema。仅在重试同一份回答时复用幂等键。
                value:
                  expected_state_version: "9007199254740993"
                  idempotency_key: input-answer-example-001
                  response:
                    approved: true
        required: true
        description: 回复任务输入请求的请求体。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RunInputRequest"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 回复任务输入请求
      description: 回复 URL 指定的待处理输入请求。将该请求的 state_version 原样填入 expected_state_version，避免数值精度损失；response 必须符合问题要求的 JSON Schema。仅在重试同一份回答时复用 idempotency_key。这是在原任务上继续输入，不会创建新任务。
  /api/v1/skills:package-repository:
    post:
      tags:
        - TaskService
      description: 经过授权的确定性 Runtime 操作，不调用模型，也不发布 Registry 版本；先预览操作生成的 Artifact。
      operationId: TaskService_RequestSkillRepositoryPackage
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RequestSkillRepositoryPackageRequest"
        required: true
        description: 申请仓库 Skill 打包任务的请求体。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Task"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 申请仓库 Skill 打包任务
  /api/v1/tasks:
    get:
      tags:
        - TaskService
      operationId: TaskService_ListTasks
      parameters:
        - name: status
          in: query
          schema:
            enum:
              - TASK_STATUS_UNSPECIFIED
              - TASK_STATUS_QUEUED
              - TASK_STATUS_PLANNING
              - TASK_STATUS_PROVISIONING
              - TASK_STATUS_RUNNING
              - TASK_STATUS_WAITING_APPROVAL
              - TASK_STATUS_WAITING_INPUT
              - TASK_STATUS_PAUSED
              - TASK_STATUS_COMPLETED
              - TASK_STATUS_FAILED
              - TASK_STATUS_CANCELLED
            type: string
            format: enum
            description: 状态。
            x-enum-descriptions:
              TASK_STATUS_UNSPECIFIED: 未指定
              TASK_STATUS_QUEUED: 排队中
              TASK_STATUS_PLANNING: 规划中
              TASK_STATUS_PROVISIONING: 准备中
              TASK_STATUS_RUNNING: 执行中
              TASK_STATUS_WAITING_APPROVAL: 等待审批
              TASK_STATUS_WAITING_INPUT: 等待输入
              TASK_STATUS_PAUSED: 已暂停
              TASK_STATUS_COMPLETED: 已完成
              TASK_STATUS_FAILED: 失败
              TASK_STATUS_CANCELLED: 已取消
          description: 状态。
        - name: page_size
          in: query
          schema:
            type: integer
            format: int32
          description: 请求的每页条数，受接口上限约束。
        - name: page_token
          in: query
          schema:
            type: string
          description: 上一页返回的不透明分页令牌，请勿自行构造或修改。
        - name: conversation_id
          in: query
          schema:
            type: string
          description: 会话标识符。
        - name: root_only
          in: query
          schema:
            type: boolean
          description: 根仅。
        - name: status_group
          in: query
          description: 空值或 all 保持既有行为；current 排除终态任务，history 包括已完成、失败和取消的任务。该分组与 status 条件取交集。
          schema:
            type: string
        - name: query
          in: query
          description: 按输入内容执行不区分大小写的搜索，或输入完整的 Task/Workspace UUID；最多 256 个字符。
          schema:
            type: string
        - name: summary_only
          in: query
          description: 在运维列表中省略完整输入和其他执行配置。
          schema:
            type: boolean
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListTasksResponse"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 列出任务
      description: 列出任务。 如需继续读取结果，请使用接口声明的分页参数。
    post:
      tags:
        - TaskService
      operationId: TaskService_CreateTask
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateTaskRequest"
            examples:
              workspace-binding:
                summary: 使用已启用的工作空间绑定提交任务
                description: 将两个 UUID 替换为可访问的工作空间及其中已启用的 Agent 绑定。服务端通过绑定解析准入的 Agent 与执行环境版本。
                value:
                  workspace_id: 11111111-1111-4111-8111-111111111111
                  workspace_agent_binding_id: 22222222-2222-4222-8222-222222222222
                  input: Summarize the supplied document.
        required: true
        description: 创建任务的请求体。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Task"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 创建任务
      description: 使用可访问的工作空间及其已启用的 workspace_agent_binding_id 提交任务。绑定决定准入的 Agent 与执行环境版本。Task 保存任务本身，Run 记录每次执行。提交后可通过任务事件和待处理的输入请求跟进进展。
  /api/v1/tasks/{id}:
    get:
      tags:
        - TaskService
      operationId: TaskService_GetTask
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: 当前 Schema 或 URL 所指资源的标识。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Task"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 读取任务
      description: 读取任务快照，包括执行状态及关联的 Run 信息。按顺序的进展记录请使用任务事件接口；等待回复的问题请使用输入请求接口。
  /api/v1/tasks/{id}/cancel:
    post:
      tags:
        - TaskService
      operationId: TaskService_CancelTask
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: 当前 Schema 或 URL 所指资源的标识。
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CancelTaskRequest"
        required: true
        description: 取消任务的请求体。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Task"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 取消任务
      description: 取消任务。 请求字段应遵循下方的 Schema。
  /api/v1/tasks/{id}/pause:
    post:
      tags:
        - TaskService
      operationId: TaskService_PauseTask
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: 当前 Schema 或 URL 所指资源的标识。
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PauseTaskRequest"
        required: true
        description: 暂停任务的请求体。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Task"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 暂停任务
      description: 暂停任务。 请求字段应遵循下方的 Schema。
  /api/v1/tasks/{id}/resume:
    post:
      tags:
        - TaskService
      operationId: TaskService_ResumeTask
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: 当前 Schema 或 URL 所指资源的标识。
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ResumeTaskRequest"
        required: true
        description: 恢复任务的请求体。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Task"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 恢复任务
      description: 恢复任务。 请求字段应遵循下方的 Schema。
  /api/v1/tasks/{id}/retry:
    post:
      tags:
        - TaskService
      operationId: TaskService_RetryTask
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: 当前 Schema 或 URL 所指资源的标识。
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RetryTaskRequest"
        required: true
        description: 重试任务的请求体。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Task"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 重试任务
      description: 为允许重试的任务请求新的执行尝试。展示多次执行或归并事件时，应区分 Task 标识与 Run 标识。
  /api/v1/tasks/{parent_task_id}/delegations:
    get:
      tags:
        - TaskService
      operationId: TaskService_ListTaskDelegations
      parameters:
        - name: parent_task_id
          in: path
          required: true
          schema:
            type: string
          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/ListTaskDelegationsResponse"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 列出任务委派记录
      description: 列出任务委派记录。 如需继续读取结果，请使用接口声明的分页参数。
  /api/v1/tasks/{task_id}/events:
    get:
      tags:
        - TaskService
      operationId: TaskService_ListTaskEvents
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            type: string
          description: 任务标识，不能用一次执行的 Run ID 替代。
        - 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: 读取最新一页，并按递增序号返回，适用于会话预览；需要完整历史时，可从 after_sequence=0 开始向前分页。
          schema:
            type: boolean
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListTaskEventsResponse"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 列出任务事件
      description: 使用接口声明的游标和分页参数读取持久化任务事件。保留事件序号，用于排序和去重。快照恢复及独立的实时事件流见集成指南。
  /api/v1/tasks/{task_id}/input-requests:
    get:
      tags:
        - TaskService
      operationId: TaskService_ListTaskInputRequests
      parameters:
        - name: task_id
          in: path
          required: true
          schema:
            type: string
          description: 任务标识，不能用一次执行的 Run ID 替代。
      responses:
        "200":
          description: 请求成功。
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListTaskInputRequestsResponse"
        default:
          description: RFC 9457 格式的错误详情。
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
      summary: 列出任务输入请求
      description: 列出此任务关联的问题或输入请求。提交回答前，应读取请求状态、state_version 及回答的 Schema。
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
  schemas:
    Approval:
      type: object
      properties:
        id:
          type: string
          description: 当前 Schema 或 URL 所指资源的标识。
        tenant_id:
          type: string
          description: 与已认证的访问上下文配合使用的租户标识；提供标识并不授予访问权。
        task_id:
          type: string
          description: 任务标识，不能用一次执行的 Run ID 替代。
        run_id:
          type: string
          description: 关联任务的一次执行 Run 的标识。
        tool_call_id:
          type: string
          description: 工具调用标识符。
        provider_call_id:
          type: string
          description: 服务商调用标识符。
        kind:
          type: string
          description: 类别。
        request_json:
          type: string
          format: bytes
          description: 请求JSON，使用 Base64 编码。
        request_hash:
          type: string
          description: 请求哈希。
        status:
          enum:
            - APPROVAL_STATUS_UNSPECIFIED
            - APPROVAL_STATUS_PENDING
            - APPROVAL_STATUS_APPROVED
            - APPROVAL_STATUS_DENIED
            - APPROVAL_STATUS_EXPIRED
            - APPROVAL_STATUS_CANCELLED
          type: string
          format: enum
          description: 状态。
          x-enum-descriptions:
            APPROVAL_STATUS_UNSPECIFIED: 未指定
            APPROVAL_STATUS_PENDING: 待处理
            APPROVAL_STATUS_APPROVED: 已批准
            APPROVAL_STATUS_DENIED: 已拒绝
            APPROVAL_STATUS_EXPIRED: 已过期
            APPROVAL_STATUS_CANCELLED: 已取消
        decision:
          type: string
          description: 决定。
        decided_by:
          type: string
          description: 决定操作者。
        expires_at:
          type: string
          format: date-time
          description: 到期时间，使用 RFC 3339 时间格式。
        decided_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 时间格式。
        scope_task_id:
          type: string
          description: 权限范围任务标识符。
        delegation_approval_policy:
          enum:
            - DELEGATION_APPROVAL_POLICY_UNSPECIFIED
            - DELEGATION_APPROVAL_POLICY_INHERIT
            - DELEGATION_APPROVAL_POLICY_INDEPENDENT
          type: string
          format: enum
          description: 委派审批策略。
          x-enum-descriptions:
            DELEGATION_APPROVAL_POLICY_UNSPECIFIED: 未指定
            DELEGATION_APPROVAL_POLICY_INHERIT: 继承
            DELEGATION_APPROVAL_POLICY_INDEPENDENT: 独立
        policy_scope_id:
          type: string
          description: 策略权限范围标识符。
        request_summary:
          type: string
          description: 请求摘要。
        manual_decision_required:
          type: boolean
          description: true 表示不可变策略禁止对这次具体工具请求进行系统自动批准。
      description: 审批请求结构。
    ApproveApprovalRequest:
      type: object
      properties:
        id:
          type: string
          description: 当前 Schema 或 URL 所指资源的标识。
      description: 批准审批请求的请求结构。
    CancelDelegationRequest:
      type: object
      properties:
        id:
          type: string
          description: 当前 Schema 或 URL 所指资源的标识。
        expected_child_task_state_version:
          type: string
          description: 预期子级任务状态版本。
      description: 取消委派任务的请求结构。
    CancelTaskRequest:
      type: object
      properties:
        id:
          type: string
          description: 当前 Schema 或 URL 所指资源的标识。
        expected_state_version:
          type: string
          description: 用于乐观并发控制的预期状态版本。请原样复制当前版本，不要经 JavaScript Number 转换而损失精度。
      description: 取消任务的请求结构。
    ConversationSettings:
      type: object
      properties:
        conversation_id:
          type: string
          description: 会话标识符。
        tenant_id:
          type: string
          description: 与已认证的访问上下文配合使用的租户标识；提供标识并不授予访问权。
        approval_mode:
          enum:
            - EXECUTION_APPROVAL_MODE_UNSPECIFIED
            - EXECUTION_APPROVAL_MODE_MANUAL
            - EXECUTION_APPROVAL_MODE_AUTO
          type: string
          format: enum
          description: 审批模式。
          x-enum-descriptions:
            EXECUTION_APPROVAL_MODE_UNSPECIFIED: 未指定
            EXECUTION_APPROVAL_MODE_MANUAL: 人工
            EXECUTION_APPROVAL_MODE_AUTO: 自动
        state_version:
          type: string
          description: 用于乐观并发控制的状态版本，须保留精确的十进制表示。
        created_at:
          type: string
          format: date-time
          description: 创建时间，使用 RFC 3339 时间格式。
        updated_at:
          type: string
          format: date-time
          description: 更新时间，使用 RFC 3339 时间格式。
        workspace_id:
          type: string
          description: 由第一个 Task 或 Goal 设置，并在 Conversation 生命周期内保持不变。
      description: 会话设置结构。
    CreateTaskRequest:
      type: object
      properties:
        agent_version_id:
          type: string
          description: Agent版本标识符。
        workspace_id:
          type: string
          description: 工作空间标识。工作空间是持续协作上下文，与按任务使用的工作树不同。
        input:
          type: string
          description: 本请求接受的输入。格式由字段 Schema 决定；应用调用还需遵循配置的输入适配器。
        priority:
          type: integer
          format: int32
          description: 优先级。
        idempotency_key:
          type: string
          description: 本次操作的幂等键，仅在重试同一次、同内容的提交时复用。
        environment_version_id:
          type: string
          description: 执行环境版本标识符。
        policy_scope_id:
          type: string
          description: 策略权限范围标识符。
        model_config:
          $ref: "#/components/schemas/ModelInvocationConfig"
          description: 模型配置。
        participants:
          type: array
          items:
            $ref: "#/components/schemas/TaskParticipant"
          description: 参与者列表。
        conversation_id:
          type: string
          description: 会话标识符。
        workspace_agent_binding_id:
          type: string
          description: 提供本字段时，从该有效 Workspace 团队绑定解析 agent_version_id 和 environment_version_id。
        result_contract:
          type: object
          description: 结果契约。
        approval_mode:
          enum:
            - EXECUTION_APPROVAL_MODE_UNSPECIFIED
            - EXECUTION_APPROVAL_MODE_MANUAL
            - EXECUTION_APPROVAL_MODE_AUTO
          type: string
          format: enum
          description: 审批模式。
          x-enum-descriptions:
            EXECUTION_APPROVAL_MODE_UNSPECIFIED: 未指定
            EXECUTION_APPROVAL_MODE_MANUAL: 人工
            EXECUTION_APPROVAL_MODE_AUTO: 自动
        input_attachments:
          type: array
          items:
            $ref: "#/components/schemas/TaskInputAttachment"
          description: 输入附件列表。
        worktree_id:
          type: string
          description: 可选的显式工作树分支。留空时，同一 Conversation 复用自己的 Worktree；独立根任务从 Workspace 主分支创建隔离 Worktree。
        token_budget:
          type: string
          description: 任务完整 Run 的可选聚合上限，覆盖全部模型/工具轮次；零表示对应维度不设限。
        cost_budget_microunits:
          type: string
          description: 该金额额度覆盖全部重试和委派后代任务。
        compute_budget_ms:
          type: string
          description: 计算预算毫秒。
        skill_invocations:
          type: array
          items:
            type: string
          description: 由调用者显式调用已固定在 Environment 中的 Skill。Worker 不能提供本字段，委派也不会隐式继承。
        work_contract:
          $ref: "#/components/schemas/WorkContract"
          description: 工作契约。
        cost_budget_currency:
          type: string
          description: 可选的币种一致性断言，与已接受的计费价格币种比较，不执行外汇换算。
      description: 创建任务的请求结构。
    Delegation:
      type: object
      properties:
        id:
          type: string
          description: 当前 Schema 或 URL 所指资源的标识。
        tenant_id:
          type: string
          description: 与已认证的访问上下文配合使用的租户标识；提供标识并不授予访问权。
        parent_task_id:
          type: string
          description: 父级任务标识符。
        parent_run_id:
          type: string
          description: 父级运行标识符。
        child_task_id:
          type: string
          description: 子级任务标识符。
        child_agent_version_id:
          type: string
          description: 子级Agent版本标识符。
        child_environment_version_id:
          type: string
          description: 子级执行环境版本标识符。
        child_workspace_id:
          type: string
          description: 子级工作空间标识符。
        input:
          type: string
          description: 本请求接受的输入。格式由字段 Schema 决定；应用调用还需遵循配置的输入适配器。
        context_refs:
          type: array
          items:
            type: string
          description: 上下文引用列表列表。
        input_artifact_ids:
          type: array
          items:
            type: string
          description: 输入产物标识符列表列表。
        result_contract:
          type: object
          description: 结果契约。
        deadline:
          type: string
          format: date-time
          description: 截止时间，使用 RFC 3339 时间格式。
        token_budget:
          type: string
          description: Token预算。
        cost_budget_microunits:
          type: string
          description: 成本预算微单位。
        compute_budget_ms:
          type: string
          description: 计算预算毫秒。
        depth:
          type: integer
          format: int32
          description: 深度。
        max_depth:
          type: integer
          format: int32
          description: 最大深度。
        cancellation_policy:
          enum:
            - DELEGATION_CANCELLATION_POLICY_UNSPECIFIED
            - DELEGATION_CANCELLATION_POLICY_CASCADE
            - DELEGATION_CANCELLATION_POLICY_DETACH
          type: string
          format: enum
          description: 取消策略。
          x-enum-descriptions:
            DELEGATION_CANCELLATION_POLICY_UNSPECIFIED: 未指定
            DELEGATION_CANCELLATION_POLICY_CASCADE: 级联
            DELEGATION_CANCELLATION_POLICY_DETACH: 分离
        approval_policy:
          enum:
            - DELEGATION_APPROVAL_POLICY_UNSPECIFIED
            - DELEGATION_APPROVAL_POLICY_INHERIT
            - DELEGATION_APPROVAL_POLICY_INDEPENDENT
          type: string
          format: enum
          description: 审批策略。
          x-enum-descriptions:
            DELEGATION_APPROVAL_POLICY_UNSPECIFIED: 未指定
            DELEGATION_APPROVAL_POLICY_INHERIT: 继承
            DELEGATION_APPROVAL_POLICY_INDEPENDENT: 独立
        child_task_status:
          enum:
            - TASK_STATUS_UNSPECIFIED
            - TASK_STATUS_QUEUED
            - TASK_STATUS_PLANNING
            - TASK_STATUS_PROVISIONING
            - TASK_STATUS_RUNNING
            - TASK_STATUS_WAITING_APPROVAL
            - TASK_STATUS_WAITING_INPUT
            - TASK_STATUS_PAUSED
            - TASK_STATUS_COMPLETED
            - TASK_STATUS_FAILED
            - TASK_STATUS_CANCELLED
          type: string
          format: enum
          description: 子级任务状态。
          x-enum-descriptions:
            TASK_STATUS_UNSPECIFIED: 未指定
            TASK_STATUS_QUEUED: 排队中
            TASK_STATUS_PLANNING: 规划中
            TASK_STATUS_PROVISIONING: 准备中
            TASK_STATUS_RUNNING: 执行中
            TASK_STATUS_WAITING_APPROVAL: 等待审批
            TASK_STATUS_WAITING_INPUT: 等待输入
            TASK_STATUS_PAUSED: 已暂停
            TASK_STATUS_COMPLETED: 已完成
            TASK_STATUS_FAILED: 失败
            TASK_STATUS_CANCELLED: 已取消
        created_at:
          type: string
          format: date-time
          description: 创建时间，使用 RFC 3339 时间格式。
        updated_at:
          type: string
          format: date-time
          description: 更新时间，使用 RFC 3339 时间格式。
        child_run_id:
          type: string
          description: 子级运行标识符。
        child_run_status:
          enum:
            - RUN_STATUS_UNSPECIFIED
            - RUN_STATUS_QUEUED
            - RUN_STATUS_CLAIMED
            - RUN_STATUS_RUNNING
            - RUN_STATUS_WAITING_APPROVAL
            - RUN_STATUS_WAITING_INPUT
            - RUN_STATUS_PAUSED
            - RUN_STATUS_COMPLETED
            - RUN_STATUS_FAILED
            - RUN_STATUS_INTERRUPTED
            - RUN_STATUS_CANCELLED
          type: string
          format: enum
          description: 子级运行状态。
          x-enum-descriptions:
            RUN_STATUS_UNSPECIFIED: 未指定
            RUN_STATUS_QUEUED: 排队中
            RUN_STATUS_CLAIMED: 已领取
            RUN_STATUS_RUNNING: 执行中
            RUN_STATUS_WAITING_APPROVAL: 等待审批
            RUN_STATUS_WAITING_INPUT: 等待输入
            RUN_STATUS_PAUSED: 已暂停
            RUN_STATUS_COMPLETED: 已完成
            RUN_STATUS_FAILED: 失败
            RUN_STATUS_INTERRUPTED: 已中断
            RUN_STATUS_CANCELLED: 已取消
        child_final_output:
          type: string
          description: 子级最终输出。
        child_failure_code:
          type: string
          description: 子级失败代码。
        child_failure_message:
          type: string
          description: 子级失败消息。
        wait_for_completion:
          type: boolean
          description: 等待适用完成。
        input_token_usage:
          type: string
          description: 输入Token用量。
        output_token_usage:
          type: string
          description: 输出Token用量。
        cost_usage_microunits:
          type: string
          description: 成本用量微单位。
        compute_usage_ms:
          type: string
          description: 计算用量毫秒。
        budget_exhausted:
          type: boolean
          description: 预算已耗尽。
        budget_exhausted_dimension:
          type: string
          description: 预算已耗尽维度。
        budget_exhausted_at:
          type: string
          format: date-time
          description: 预算已耗尽时间，使用 RFC 3339 时间格式。
        token_usage:
          type: string
          description: Token用量。
        join_id:
          type: string
          description: 汇合标识符。
        result_artifact_ids:
          type: array
          items:
            type: string
          description: 结果产物标识符列表列表。
        model_config:
          $ref: "#/components/schemas/ModelInvocationConfig"
          description: 模型配置。
        child_workspace_agent_binding_id:
          type: string
          description: 子级工作空间Agent绑定标识符。
        workspace_delegation_grant_id:
          type: string
          description: 工作空间委派授权标识符。
        workspace_delegation_grant_state_version:
          type: string
          description: 工作空间委派授权状态版本。
        handoff:
          type: object
          description: 可选的不可变、领域无关的 orbitspace.handoff/v1 交接信封。
        cost_budget_currency:
          type: string
          description: 成本预算币种。
      description: 委派任务结构。
    DelegationJoin:
      type: object
      properties:
        id:
          type: string
          description: 当前 Schema 或 URL 所指资源的标识。
        tenant_id:
          type: string
          description: 与已认证的访问上下文配合使用的租户标识；提供标识并不授予访问权。
        parent_task_id:
          type: string
          description: 父级任务标识符。
        parent_run_id:
          type: string
          description: 父级运行标识符。
        delegation_ids:
          type: array
          items:
            type: string
          description: 委派标识符列表列表。
        result_policy:
          enum:
            - DELEGATION_JOIN_RESULT_POLICY_UNSPECIFIED
            - DELEGATION_JOIN_RESULT_POLICY_REQUIRE_ALL
            - DELEGATION_JOIN_RESULT_POLICY_ALL_SETTLED
          type: string
          format: enum
          description: 结果策略。
          x-enum-descriptions:
            DELEGATION_JOIN_RESULT_POLICY_UNSPECIFIED: 未指定
            DELEGATION_JOIN_RESULT_POLICY_REQUIRE_ALL: 要求全部成功
            DELEGATION_JOIN_RESULT_POLICY_ALL_SETTLED: 等待全部结束
        status:
          enum:
            - DELEGATION_JOIN_STATUS_UNSPECIFIED
            - DELEGATION_JOIN_STATUS_WAITING
            - DELEGATION_JOIN_STATUS_COMPLETED
            - DELEGATION_JOIN_STATUS_FAILED
            - DELEGATION_JOIN_STATUS_CANCELLED
          type: string
          format: enum
          description: 状态。
          x-enum-descriptions:
            DELEGATION_JOIN_STATUS_UNSPECIFIED: 未指定
            DELEGATION_JOIN_STATUS_WAITING: 等待中
            DELEGATION_JOIN_STATUS_COMPLETED: 已完成
            DELEGATION_JOIN_STATUS_FAILED: 失败
            DELEGATION_JOIN_STATUS_CANCELLED: 已取消
        delegations:
          type: array
          items:
            $ref: "#/components/schemas/Delegation"
          description: 委派列表。
        result:
          type: object
          description: 结果。
        completed_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: 委派汇合记录结构。
    DenyApprovalRequest:
      type: object
      properties:
        id:
          type: string
          description: 当前 Schema 或 URL 所指资源的标识。
      description: 拒绝审批请求的请求结构。
    GoogleProtobufValue:
      description: 动态类型的 JSON 值，可为 null、数字、字符串、布尔值、递归结构体或值列表。
    ListApprovalsResponse:
      type: object
      properties:
        approvals:
          type: array
          items:
            $ref: "#/components/schemas/Approval"
          description: 审批列表。
        next_page_token:
          type: string
          description: 下一页的分页令牌；为空表示没有下一页。
        total_count:
          type: string
          description: 总计数量。
      description: 列出审批请求的响应结构。
    ListTaskDelegationsResponse:
      type: object
      properties:
        delegations:
          type: array
          items:
            $ref: "#/components/schemas/Delegation"
          description: 委派列表。
        next_page_token:
          type: string
          description: 下一页的分页令牌；为空表示没有下一页。
      description: 列出任务委派记录的响应结构。
    ListTaskEventsResponse:
      type: object
      properties:
        events:
          type: array
          items:
            $ref: "#/components/schemas/TaskEvent"
          description: 事件列表。
        next_sequence:
          type: string
          description: 下一序号。
      description: 列出任务事件的响应结构。
    ListTaskInputRequestsResponse:
      type: object
      properties:
        requests:
          type: array
          items:
            $ref: "#/components/schemas/RunInputRequest"
          description: 请求列表。
      description: 列出任务输入请求的响应结构。
    ListTasksResponse:
      type: object
      properties:
        tasks:
          type: array
          items:
            $ref: "#/components/schemas/Task"
          description: 任务列表。
        next_page_token:
          type: string
          description: 下一页的分页令牌；为空表示没有下一页。
        total_count:
          type: string
          description: 总计数量。
      description: 列出任务的响应结构。
    ModelContextCompactionAttempt:
      type: object
      properties:
        id:
          type: string
          description: 当前 Schema 或 URL 所指资源的标识。
        input_digest:
          type: string
          description: 输入摘要。
        source_digest:
          type: string
          description: 来源摘要。
        round:
          type: string
          description: 轮次。
        state:
          type: string
          description: 状态。
        compaction_id:
          type: string
          description: 上下文压缩标识符。
      description: 最近一次持久化的上下文压缩尝试，包括被抑制或失败的尝试。
    ModelContextComposition:
      type: object
      properties:
        request_bytes:
          type: string
          description: 请求字节。
        history_bytes:
          type: string
          description: 历史字节。
        media_bytes:
          type: string
          description: 媒体字节。
        media_items:
          type: string
          description: 媒体条目。
        protected_text_bytes:
          type: string
          description: 受保护文本字节。
        compactable_text_bytes:
          type: string
          description: 可压缩文本字节。
        recent_text_bytes:
          type: string
          description: 最近文本字节。
        tool_bytes:
          type: string
          description: 工具字节。
      description: 按类别测量序列化请求的字节数，不将其当成 Token 估算，也不把媒体节点混入文本类别。
    ModelContextProgress:
      type: object
      properties:
        last_event_sequence:
          type: string
          description: 最近事件序号。
        session_id:
          type: string
          description: 会话标识符。
        model:
          type: string
          description: 模型。
        context_window_tokens:
          type: string
          description: 上下文窗口Token。
        max_output_tokens:
          type: string
          description: 最大输出Token。
        output_reserve_tokens:
          type: string
          description: 输出预留Token。
        input_limit_tokens:
          type: string
          description: 输入上限Token。
        input_tokens:
          type: string
          description: 输入Token。
        tokens_reported:
          type: boolean
          description: Token已报告。
        request_bytes:
          type: string
          description: 请求字节。
        bytes_reported:
          type: boolean
          description: 字节已报告。
        trigger_bytes:
          type: string
          description: 触发字节。
        limits_source:
          type: string
          description: 上限来源。
        usage_source:
          type: string
          description: 用量来源。
        compaction_count:
          type: string
          description: 上下文压缩数量。
        compaction_state:
          type: string
          description: 上下文压缩状态。
        last_compaction_id:
          type: string
          description: 最近上下文压缩标识符。
        before_bytes:
          type: string
          description: 之前字节。
        after_bytes:
          type: string
          description: 之后字节。
        source_digest:
          type: string
          description: 来源摘要。
        composition:
          $ref: "#/components/schemas/ModelContextComposition"
          description: 组合。
        retention:
          $ref: "#/components/schemas/ModelContextRetention"
          description: 保留。
        compaction_skip_reason:
          type: string
          description: 上下文压缩跳过原因。
        compaction_attempt_count:
          type: string
          description: 上下文压缩尝试数量。
        constraint_count:
          type: string
          description: 约束数量。
        overflow_recovery_count:
          type: string
          description: 溢出恢复数量。
        latest_compaction_attempt:
          $ref: "#/components/schemas/ModelContextCompactionAttempt"
          description: 最新上下文压缩尝试。
      description: 最近一次请求的测量值及压缩来源信息。未设置已报告标记时，零表示未知；累计消耗仍记录在 TaskStatistics 中。
    ModelContextRetention:
      type: object
      properties:
        items:
          type: string
          description: 条目。
        text_bytes:
          type: string
          description: 文本字节。
        text_budget_bytes:
          type: string
          description: 文本预算字节。
        estimated_text_tokens:
          type: string
          description: 估算文本Token。
        token_budget:
          type: string
          description: Token预算。
        tokens_reported:
          type: boolean
          description: Token已报告。
        token_source:
          type: string
          description: Token来源。
        indivisible_floor_exceeds_budget:
          type: boolean
          description: 不可分割下限超出预算。
      description: 上下文引擎最近一次使用的、大小受限的内容保留决定。
    ModelInvocationConfig:
      type: object
      properties:
        model:
          type: string
          description: 模型。
        reasoning_effort:
          type: string
          description: 思考思考强度。
      description: Agent 默认值、Task 覆盖值和实际 Run 快照共用 ModelInvocationConfig。reasoning_effort 使用服务商公布的标识，例如 low、xhigh、max、ultra 或 thinking；OrbitSpace 不用固定的 protobuf 枚举限制服务商持续演进的取值。Task 留空的字段继承 Agent/服务商默认值。
    PauseTaskRequest:
      type: object
      properties:
        id:
          type: string
          description: 当前 Schema 或 URL 所指资源的标识。
        expected_state_version:
          type: string
          description: 用于乐观并发控制的预期状态版本。请原样复制当前版本，不要经 JavaScript Number 转换而损失精度。
      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: 请求标识符。
    ReplyTaskInputRequestRequest:
      type: object
      properties:
        id:
          type: string
          description: 当前 Schema 或 URL 所指资源的标识。
        expected_state_version:
          type: string
          description: 用于乐观并发控制的预期状态版本。请原样复制当前版本，不要经 JavaScript Number 转换而损失精度。
        response:
          $ref: "#/components/schemas/GoogleProtobufValue"
          description: 响应。
        artifact_ids:
          type: array
          items:
            type: string
          description: 产物标识符列表列表。
        idempotency_key:
          type: string
          description: 本次操作的幂等键，仅在重试同一次、同内容的提交时复用。
      description: 回复任务输入请求的请求结构。
    RepositoryChangeSet:
      type: object
      properties:
        binding_id:
          type: string
          description: 绑定标识符。
        repository_id:
          type: string
          description: 仓库标识符。
        key:
          type: string
          description: 键。
        mount_path:
          type: string
          description: 挂载路径。
        base_commit:
          type: string
          description: 基线提交。
        head_commit:
          type: string
          description: HEAD提交。
        dirty:
          type: boolean
          description: 未提交变更。
        conflicted:
          type: boolean
          description: 存在冲突。
        ahead_count:
          type: string
          description: 领先数量。
        changed_paths:
          type: array
          items:
            $ref: "#/components/schemas/RepositoryChangedPath"
          description: 已变更路径列表。
        insertions:
          type: string
          description: 新增行数。
        deletions:
          type: string
          description: 删除行数。
        patch_artifact_id:
          type: string
          description: 补丁产物标识符。
        patch_complete:
          type: boolean
          description: false 表示未跟踪文件或大小上限导致补丁 Artifact 无法覆盖全部变更字节；这些文件的持久化依据仍是 Workspace Snapshot。
        status_digest:
          type: string
          description: Run 完成时捕获的版本化 Git 证据摘要，包含规范化的基线、HEAD、porcelain 状态和已跟踪文件的二进制差异。
        checkout_id:
          type: string
          description: 捕获该状态时使用的操作 ID 和单调递增的 Worktree fence。另一个 Host 接管工作树后，控制面据此拒绝旧 Worker 的迟到完成回报。
        checkout_fence:
          type: string
          description: 检出隔离栅栏。
      description: 仓库变更设置结构。
    RepositoryChangedPath:
      type: object
      properties:
        path:
          type: string
          description: 路径。
        status:
          type: string
          description: 状态。
      description: 仓库已变更路径结构。
    RequestSkillRepositoryPackageRequest:
      type: object
      properties:
        workspace_id:
          type: string
          description: 工作空间标识。工作空间是持续协作上下文，与按任务使用的工作树不同。
        workspace_agent_binding_id:
          type: string
          description: 所选工作空间中的 Agent 绑定标识。
        repository_binding_id:
          type: string
          description: 仓库绑定标识符。
        commit:
          type: string
          description: 提交。
        skill_path:
          type: string
          description: Skill路径。
        name:
          type: string
          description: 名称。
        version:
          type: string
          description: 版本。
        license_expression:
          type: string
          description: 许可证表达式。
        invocation_policy:
          type: string
          description: 调用策略。
        idempotency_key:
          type: string
          description: 本次操作的幂等键，仅在重试同一次、同内容的提交时复用。
      description: 申请仓库 Skill 打包任务的请求结构。
    ResumeTaskRequest:
      type: object
      properties:
        id:
          type: string
          description: 当前 Schema 或 URL 所指资源的标识。
        expected_state_version:
          type: string
          description: 用于乐观并发控制的预期状态版本。请原样复制当前版本，不要经 JavaScript Number 转换而损失精度。
      description: 恢复任务的请求结构。
    RetryTaskRequest:
      type: object
      properties:
        id:
          type: string
          description: 当前 Schema 或 URL 所指资源的标识。
        expected_state_version:
          type: string
          description: 用于乐观并发控制的预期状态版本。请原样复制当前版本，不要经 JavaScript Number 转换而损失精度。
      description: 重试任务的请求结构。
    RunInputRequest:
      type: object
      properties:
        id:
          type: string
          description: 当前 Schema 或 URL 所指资源的标识。
        task_id:
          type: string
          description: 任务标识，不能用一次执行的 Run ID 替代。
        run_id:
          type: string
          description: 关联任务的一次执行 Run 的标识。
        scope_task_id:
          type: string
          description: 权限范围任务标识符。
        message:
          type: string
          description: 消息。
        response_schema:
          type: object
          description: 响应Schema。
        status:
          type: string
          description: 状态。
        state_version:
          type: string
          description: 用于乐观并发控制的状态版本，须保留精确的十进制表示。
        response:
          $ref: "#/components/schemas/GoogleProtobufValue"
          description: 响应。
        response_artifact_ids:
          type: array
          items:
            type: string
          description: 响应产物标识符列表列表。
        requested_by:
          type: string
          description: 请求操作者。
        responded_by:
          type: string
          description: 响应操作者。
        expires_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 时间格式。
        responded_at:
          type: string
          format: date-time
          description: 响应时间，使用 RFC 3339 时间格式。
      description: 运行输入请求结构。
    SkillInvocation:
      type: object
      properties:
        reference:
          type: string
          description: 引用。
        registry_version_id:
          type: string
          description: 注册表版本标识符。
        content_digest:
          type: string
          description: 内容摘要。
        actor_identity_id:
          type: string
          description: 操作者身份标识符。
      description: 由服务端派生并固定的选择，Agent 不能自行生成运营方同意。
    Task:
      type: object
      properties:
        id:
          type: string
          description: 当前 Schema 或 URL 所指资源的标识。
        tenant_id:
          type: string
          description: 与已认证的访问上下文配合使用的租户标识；提供标识并不授予访问权。
        agent_version_id:
          type: string
          description: Agent版本标识符。
        workspace_id:
          type: string
          description: 工作空间标识。工作空间是持续协作上下文，与按任务使用的工作树不同。
        input:
          type: string
          description: 本请求接受的输入。格式由字段 Schema 决定；应用调用还需遵循配置的输入适配器。
        status:
          enum:
            - TASK_STATUS_UNSPECIFIED
            - TASK_STATUS_QUEUED
            - TASK_STATUS_PLANNING
            - TASK_STATUS_PROVISIONING
            - TASK_STATUS_RUNNING
            - TASK_STATUS_WAITING_APPROVAL
            - TASK_STATUS_WAITING_INPUT
            - TASK_STATUS_PAUSED
            - TASK_STATUS_COMPLETED
            - TASK_STATUS_FAILED
            - TASK_STATUS_CANCELLED
          type: string
          format: enum
          description: 状态。
          x-enum-descriptions:
            TASK_STATUS_UNSPECIFIED: 未指定
            TASK_STATUS_QUEUED: 排队中
            TASK_STATUS_PLANNING: 规划中
            TASK_STATUS_PROVISIONING: 准备中
            TASK_STATUS_RUNNING: 执行中
            TASK_STATUS_WAITING_APPROVAL: 等待审批
            TASK_STATUS_WAITING_INPUT: 等待输入
            TASK_STATUS_PAUSED: 已暂停
            TASK_STATUS_COMPLETED: 已完成
            TASK_STATUS_FAILED: 失败
            TASK_STATUS_CANCELLED: 已取消
        priority:
          type: integer
          format: int32
          description: 优先级。
        state_version:
          type: string
          description: 用于乐观并发控制的状态版本，须保留精确的十进制表示。
        created_at:
          type: string
          format: date-time
          description: 创建时间，使用 RFC 3339 时间格式。
        updated_at:
          type: string
          format: date-time
          description: 更新时间，使用 RFC 3339 时间格式。
        environment_version_id:
          type: string
          description: 执行环境版本标识符。
        parent_task_id:
          type: string
          description: 父级任务标识符。
        parent_run_id:
          type: string
          description: 父级运行标识符。
        delegation_id:
          type: string
          description: 委派标识符。
        delegation_depth:
          type: integer
          format: int32
          description: 委派深度。
        policy_scope_id:
          type: string
          description: 策略权限范围标识符。
        model_config:
          $ref: "#/components/schemas/ModelInvocationConfig"
          description: 模型配置。
        participants:
          type: array
          items:
            $ref: "#/components/schemas/TaskParticipant"
          description: 参与者列表。
        conversation_id:
          type: string
          description: 顶层 Chat 会话；同一会话中可以包含使用不同 Workspace 的任务。
        workspace_agent_binding_id:
          type: string
          description: 从 Workspace 团队中为本任务选择的不可变可执行 Agent/Environment 成员。
        result_contract:
          type: object
          description: 任务完整最终响应的不可变 JSON Schema。设置后，仅当 final_output 是满足 Schema 的单个 JSON 值时，Runtime 才接受完成。
        approval_mode:
          enum:
            - EXECUTION_APPROVAL_MODE_UNSPECIFIED
            - EXECUTION_APPROVAL_MODE_MANUAL
            - EXECUTION_APPROVAL_MODE_AUTO
          type: string
          format: enum
          description: 审批模式。
          x-enum-descriptions:
            EXECUTION_APPROVAL_MODE_UNSPECIFIED: 未指定
            EXECUTION_APPROVAL_MODE_MANUAL: 人工
            EXECUTION_APPROVAL_MODE_AUTO: 自动
        goal_id:
          type: string
          description: 每个由长期 Goal 创建的任务都会携带该字段，包括委派任务和 Workflow 步骤任务。
        execution_input:
          type: string
          description: Agent Runtime 实际执行的不可变输入。对于直接 Chat 轮次，控制面根据会话历史和原始输入生成该内容。
        progress:
          allOf:
            - $ref: "#/components/schemas/TaskProgress"
          description: 由持久化 Task 事件流及当前工具、审批、委派状态生成的累计进展，可重新构建。
        input_artifact_ids:
          type: array
          items:
            type: string
          description: 由用户提供并按固定内容写入 Runtime Workspace 的不可变文件。
        worktree_id:
          type: string
          description: 本任务使用的可变文件系统分支；workspace_id 仍是协作、授权和共享记忆的边界。
        statistics:
          allOf:
            - $ref: "#/components/schemas/TaskStatistics"
          description: 累计所有 Run 尝试的执行统计。GetTask 和 ListTasks 都返回该摘要，使 Chat 和运维列表采用一致的计量与计时口径。
        repository_checkouts:
          type: array
          items:
            $ref: "#/components/schemas/TaskRepositoryCheckout"
          description: 任务准入时固定的不可变仓库输入。
        repository_change_sets:
          type: array
          items:
            $ref: "#/components/schemas/RepositoryChangeSet"
          description: 从终态 Run 捕获的可审核 Git 结果。Runtime 沙箱及本地 .git 目录删除后，这些记录仍持久保留。
        initiator:
          allOf:
            - $ref: "#/components/schemas/TaskInitiator"
          description: 可信的准入时发起者身份快照。未记录发起者的历史任务可能缺失；不接受调用者自行提供。
        input_summary:
          type: string
          description: 用于列表展示的简短纯文本输入；完整输入通过 GetTask 获取。
        inference_only:
          type: boolean
          description: 由服务派生、范围受限的模型任务，不使用工具、记忆或委派。
        handoff_required:
          type: boolean
          description: 仅用于输出；要求 Worker 具备物化已固定交接内容的能力。
        input_requests_used:
          type: boolean
          description: 输入请求已使用。
        skill_invocations:
          type: array
          items:
            $ref: "#/components/schemas/SkillInvocation"
          description: Skill调用列表。
        work_contract:
          allOf:
            - $ref: "#/components/schemas/WorkContract"
          description: 所有 Harness 实现共用的不可变执行契约；旧调用者获得由服务端派生并报告的契约。
        work_contract_outcome:
          allOf:
            - $ref: "#/components/schemas/WorkContractOutcome"
          description: 由控制面持久化的评估结果，不接受模型或 Worker 提供的同名声明。
        platform_operation:
          type: object
          description: 平台操作。
        cost_budget_microunits:
          type: string
          description: 显式任务额度覆盖所有尝试及委派后代；币种在准入时按已接受的租户计费价格固定。
        cost_budget_currency:
          type: string
          description: 成本预算币种。
      description: 持久化的任务单元。Run 记录任务的执行尝试，事件和输入请求用于跟进进展及待处理交互。
    TaskContextSource:
      type: object
      properties:
        kind:
          type: string
          description: 类别。
        resource_id:
          type: string
          description: 资源标识符。
        reference:
          type: string
          description: 引用。
        version_id:
          type: string
          description: 版本标识符。
        content_digest:
          type: string
          description: 内容摘要。
        scope:
          type: string
          description: 权限范围。
        revision:
          type: string
          description: 修订。
        path:
          type: string
          description: 路径。
        source_kind:
          type: string
          description: 来源类别。
        source_id:
          type: string
          description: 来源标识符。
        source_uri:
          type: string
          description: 来源URI。
        index_generation_id:
          type: string
          description: 索引代次标识符。
        first_event_sequence:
          type: string
          description: 首个事件序号。
        last_event_sequence:
          type: string
          description: 最近事件序号。
        access_count:
          type: string
          description: 访问数量。
      description: 任务上下文来源结构。
    TaskEvent:
      type: object
      properties:
        event_id:
          type: string
          description: 事件标识符。
        schema_version:
          type: integer
          format: int32
          description: Schema版本。
        type:
          type: string
          description: 类型。
        tenant_id:
          type: string
          description: 与已认证的访问上下文配合使用的租户标识；提供标识并不授予访问权。
        task_id:
          type: string
          description: 任务标识，不能用一次执行的 Run ID 替代。
        run_id:
          type: string
          description: 关联任务的一次执行 Run 的标识。
        sequence:
          type: string
          description: 用于排序和去重的事件序号。
        occurred_at:
          type: string
          format: date-time
          description: 发生时间，使用 RFC 3339 时间格式。
        trace_id:
          type: string
          description: 追踪标识符。
        payload:
          type: object
          description: 负载。
      description: 关联任务的持久化进展事件。使用序号与标识进行排序和去重。
    TaskInitiator:
      type: object
      properties:
        identity_id:
          type: string
          description: 身份标识符。
        display_name:
          type: string
          description: 展示名称。
        kind:
          type: string
          description: 类别。
        integration_client_id:
          type: string
          description: 集成客户端标识符。
        source:
          type: string
          description: 支持 chat、api、goal、workflow、delegation 或 a2a。
      description: 任务发起者结构。
    TaskInputAttachment:
      type: object
      properties:
        id:
          type: string
          description: 客户端生成的 UUID，用于幂等处理和 Artifact 身份标识。
        name:
          type: string
          description: 名称。
        content_type:
          type: string
          description: 内容类型。
        content:
          type: string
          format: bytes
          description: 内容，使用 Base64 编码。
      description: 任务输入附件结构。
    TaskParticipant:
      type: object
      properties:
        agent_version_id:
          type: string
          description: Agent版本标识符。
        model_config:
          allOf:
            - $ref: "#/components/schemas/ModelInvocationConfig"
          description: 非空字段表示运营方施加的约束；空字段由主 Agent 选择，仍省略时继承参与 Agent 的默认值。
        default_model_config:
          allOf:
            - $ref: "#/components/schemas/ModelInvocationConfig"
          description: 由服务端解析并返回的不可变 Agent 版本默认值。
        workspace_agent_binding_id:
          type: string
          description: 从 Workspace 团队选择参与者时，这些字段将委派固定到其已授权的执行和共享记忆边界。
        workspace_id:
          type: string
          description: 工作空间标识。工作空间是持续协作上下文，与按任务使用的工作树不同。
        environment_version_id:
          type: string
          description: 执行环境版本标识符。
        role:
          type: string
          description: 角色。
        delegation_grant_id:
          type: string
          description: 由服务端解析的另一持久 Workspace 参与者授权快照；请求调用者必须将这些字段留空。
        delegation_grant_state_version:
          type: string
          description: 委派授权状态版本。
        delegation_grant_max_depth:
          type: integer
          format: int32
          description: 委派授权最大深度。
        delegation_grant_token_budget:
          type: string
          description: 委派授权Token预算。
        delegation_grant_cost_budget_microunits:
          type: string
          description: 委派授权成本预算微单位。
        delegation_grant_compute_budget_ms:
          type: string
          description: 委派授权计算预算毫秒。
        delegation_grant_expires_at:
          type: string
          format: date-time
          description: 委派授权到期时间，使用 RFC 3339 时间格式。
        delegation_grant_cost_budget_currency:
          type: string
          description: 委派授权成本预算币种。
      description: TaskParticipant 选择不可变 Agent 版本，并可为当前任务覆盖服务商公布的模型和思考强度。
    TaskProgress:
      type: object
      properties:
        last_event_sequence:
          type: string
          description: 最近事件序号。
        model_round:
          type: string
          description: 模型轮次。
        model_round_count:
          type: string
          description: 模型轮次数量。
        model_retry_count:
          type: string
          description: 模型重试数量。
        model_turn_active:
          type: boolean
          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_count:
          type: string
          description: 审批数量。
        approval_pending_count:
          type: string
          description: 审批待处理数量。
        approval_approved_count:
          type: string
          description: 审批已批准数量。
        approval_denied_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: 委派失败数量。
        context:
          $ref: "#/components/schemas/ModelContextProgress"
          description: 上下文。
        context_sources:
          type: array
          items:
            $ref: "#/components/schemas/TaskContextSource"
          description: 实际返回给模型的 Memory/Skill 不可变标识集合，大小受限。原始内容仍由对应服务及其权限规则保护。
        context_source_omitted_count:
          type: string
          description: 上下文来源省略数量。
      description: 任务进展结构。
    TaskRepositoryCheckout:
      type: object
      properties:
        binding_id:
          type: string
          description: 绑定标识符。
        repository_id:
          type: string
          description: 仓库标识符。
        key:
          type: string
          description: 键。
        mount_path:
          type: string
          description: 挂载路径。
        remote_url:
          type: string
          description: 远端URL。
        source_ref:
          type: string
          description: 来源引用。
        resolved_commit:
          type: string
          description: 已解析提交。
        primary:
          type: boolean
          description: 主。
        binding_state_version:
          type: string
          description: 绑定状态版本。
        connection_id:
          type: string
          description: 连接标识符。
        repository_grant_id:
          type: string
          description: 仓库授权标识符。
        access_mode:
          enum:
            - REPOSITORY_ACCESS_MODE_UNSPECIFIED
            - REPOSITORY_ACCESS_MODE_READ
            - REPOSITORY_ACCESS_MODE_WRITE
            - REPOSITORY_ACCESS_MODE_PUBLISH
          type: string
          format: enum
          description: 访问模式。
          x-enum-descriptions:
            REPOSITORY_ACCESS_MODE_UNSPECIFIED: 未指定
            REPOSITORY_ACCESS_MODE_READ: 读取
            REPOSITORY_ACCESS_MODE_WRITE: 写入
            REPOSITORY_ACCESS_MODE_PUBLISH: 发布
        grant_state_version:
          type: string
          description: 授权状态版本。
        resolved_ref:
          type: string
          description: 已解析引用。
        credential_required:
          type: boolean
          description: 凭据必需。
        comparison_commit:
          type: string
          description: 可信编排可以固定第二份只读快照作比较；Runtime 获取该对象时不移动检出目录的 HEAD。
        comparison_ref:
          type: string
          description: 对照引用。
      description: 任务仓库检出结构。
    TaskStatistics:
      type: object
      properties:
        input_tokens:
          type: string
          description: 输入Token。
        output_tokens:
          type: string
          description: 输出Token。
        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: 从第一次 Run 启动到任务完成或当前时刻的端到端实际耗时。
        run_time_ms:
          type: string
          description: 所有 Run 尝试的活跃实际耗时之和。
        started_at:
          type: string
          format: date-time
          description: 启动时间，使用 RFC 3339 时间格式。
        finished_at:
          type: string
          format: date-time
          description: 完成时间，使用 RFC 3339 时间格式。
        cache_read_input_tokens:
          type: string
          description: 缓存读取输入Token。
        cache_write_input_tokens:
          type: string
          description: 缓存写入输入Token。
        cache_usage_reported:
          type: boolean
          description: false 表示服务商未返回缓存用量细分；这与明确报告缓存读取或写入为零不同。
        cache_read_reported:
          type: boolean
          description: 缓存读取已报告。
        cache_write_reported:
          type: boolean
          description: 缓存写入已报告。
      description: 任务统计结构。
    UpdateConversationSettingsRequest:
      type: object
      properties:
        conversation_id:
          type: string
          description: 会话标识符。
        approval_mode:
          enum:
            - EXECUTION_APPROVAL_MODE_UNSPECIFIED
            - EXECUTION_APPROVAL_MODE_MANUAL
            - EXECUTION_APPROVAL_MODE_AUTO
          type: string
          format: enum
          description: 审批模式。
          x-enum-descriptions:
            EXECUTION_APPROVAL_MODE_UNSPECIFIED: 未指定
            EXECUTION_APPROVAL_MODE_MANUAL: 人工
            EXECUTION_APPROVAL_MODE_AUTO: 自动
      description: 更新会话设置的请求结构。
    WorkContract:
      type: object
      properties:
        schema_version:
          type: string
          description: 由调用者提供时，必须为 orbitspace.work-contract/v1。
        objective:
          type: string
          description: 目标。
        constraints:
          type: array
          items:
            type: string
          description: 约束列表。
        deliverables:
          type: array
          items:
            type: string
          description: 交付物列表。
        result_schema:
          type: object
          description: 完整最终响应的 JSON Schema。result_contract 作为兼容别名保留，同时提供时两者必须一致。
        evidence_requirements:
          type: array
          items:
            $ref: "#/components/schemas/WorkEvidenceRequirement"
          description: 证据要求列表。
        completion_mode:
          enum:
            - WORK_COMPLETION_MODE_UNSPECIFIED
            - WORK_COMPLETION_MODE_REPORTED
            - WORK_COMPLETION_MODE_VERIFIED
          type: string
          format: enum
          description: 完成模式。
          x-enum-descriptions:
            WORK_COMPLETION_MODE_UNSPECIFIED: 未指定
            WORK_COMPLETION_MODE_REPORTED: 已报告
            WORK_COMPLETION_MODE_VERIFIED: 已验证
      description: 工作契约结构。
    WorkContractOutcome:
      type: object
      properties:
        status:
          enum:
            - WORK_CONTRACT_STATUS_UNSPECIFIED
            - WORK_CONTRACT_STATUS_PENDING
            - WORK_CONTRACT_STATUS_REPORTED
            - WORK_CONTRACT_STATUS_VERIFIED
            - WORK_CONTRACT_STATUS_REJECTED
          type: string
          format: enum
          description: 状态。
          x-enum-descriptions:
            WORK_CONTRACT_STATUS_UNSPECIFIED: 未指定
            WORK_CONTRACT_STATUS_PENDING: 待处理
            WORK_CONTRACT_STATUS_REPORTED: 已报告
            WORK_CONTRACT_STATUS_VERIFIED: 已验证
            WORK_CONTRACT_STATUS_REJECTED: 已拒绝
        checks:
          type: array
          items:
            $ref: "#/components/schemas/WorkEvidenceCheck"
          description: 检查列表。
        reason:
          type: string
          description: 原因。
        evaluated_at:
          type: string
          format: date-time
          description: 评估时间，使用 RFC 3339 时间格式。
      description: 工作契约结果结构。
    WorkEvidenceCheck:
      type: object
      properties:
        key:
          type: string
          description: 键。
        kind:
          enum:
            - WORK_EVIDENCE_KIND_UNSPECIFIED
            - WORK_EVIDENCE_KIND_FINAL_OUTPUT
            - WORK_EVIDENCE_KIND_ARTIFACT
            - WORK_EVIDENCE_KIND_REPOSITORY_CHANGE
            - WORK_EVIDENCE_KIND_TOOL_CALL
          type: string
          format: enum
          description: 类别。
          x-enum-descriptions:
            WORK_EVIDENCE_KIND_UNSPECIFIED: 未指定
            WORK_EVIDENCE_KIND_FINAL_OUTPUT: 最终输出
            WORK_EVIDENCE_KIND_ARTIFACT: 产物
            WORK_EVIDENCE_KIND_REPOSITORY_CHANGE: 仓库变更
            WORK_EVIDENCE_KIND_TOOL_CALL: 工具调用
        required:
          type: boolean
          description: 必需。
        passed:
          type: boolean
          description: 已通过。
        matched_count:
          type: string
          description: 已匹配数量。
        summary:
          type: string
          description: 摘要。
        description:
          type: string
          description: 说明。
      description: 工作证据检查结构。
    WorkEvidenceRequirement:
      type: object
      properties:
        key:
          type: string
          description: 由调用者定义的稳定键，用于证据校验和界面投影。
        kind:
          enum:
            - WORK_EVIDENCE_KIND_UNSPECIFIED
            - WORK_EVIDENCE_KIND_FINAL_OUTPUT
            - WORK_EVIDENCE_KIND_ARTIFACT
            - WORK_EVIDENCE_KIND_REPOSITORY_CHANGE
            - WORK_EVIDENCE_KIND_TOOL_CALL
          type: string
          format: enum
          description: 类别。
          x-enum-descriptions:
            WORK_EVIDENCE_KIND_UNSPECIFIED: 未指定
            WORK_EVIDENCE_KIND_FINAL_OUTPUT: 最终输出
            WORK_EVIDENCE_KIND_ARTIFACT: 产物
            WORK_EVIDENCE_KIND_REPOSITORY_CHANGE: 仓库变更
            WORK_EVIDENCE_KIND_TOOL_CALL: 工具调用
        required:
          type: boolean
          description: 必需。
        description:
          type: string
          description: 说明。
        selector:
          type: object
          description: 按证据类别配置、大小受限的选择条件。v1 支持最终输出的 min_bytes；Artifact 的 kind/name/content_type/min_count；仓库的 binding_id/key、path_globs/exclude_path_globs/min_changed_paths/require_commit/require_task_progress；以及工具调用的 kind/min_count。
        deadline_model_round:
          type: integer
          description: 可选的实时进展截止轮次。到达该模型轮次后，Runtime 在所需证据出现前拒绝完成。v1 支持 repository_change 证据的截止点；零表示延后到任务完成时校验。
          format: int32
        when_result:
          type: object
          description: 可选且大小受限的 JSON Schema，用于匹配任务规范化后的最终响应。仅当响应匹配 Schema 时才校验证据要求。条件证据不能声明实时模型轮次截止点，因为是否适用到任务完成时才可确定。
      description: 工作证据要求结构。
tags:
  - name: ApprovalService
    x-displayName: 审批
    description: 审批相关操作。
  - name: TaskService
    x-displayName: 任务
    description: 任务相关操作。
