chore: commit workspace updates

This commit is contained in:
ddCat
2026-09-14 01:11:56 +08:00
parent 01a2d171f5
commit 9727656b2b
491 changed files with 12826 additions and 72249 deletions

View File

@@ -21,7 +21,158 @@ tags:
- name: resources
- name: tasks
- name: assets
- name: agent
paths:
/agent/capabilities:
get:
tags: [agent]
summary: 读取云端 Agent 能力
responses:
"200":
description: 信封 data 包含 version、permissionModes、contextScopes、skills、writeTools、billing、maxHistoryPairs
/agent/runs:
post:
tags: [agent]
summary: 创建一轮云端 Agent 任务
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/CloudAgentRequest"
responses:
"200":
description: 信封 data.run,包含新一轮 id、canvasId、status、permissionMode、model 及时间
"400":
description: 参数、能力、模型或预算不符合要求,未创建任务
"409":
description: 幂等键已用于不同请求
/agent/runs/{id}:
parameters:
- $ref: "#/components/parameters/AgentRunID"
get:
tags: [agent]
summary: 读取当前用户的 Agent 轮次
responses:
"200":
description: 信封 data.run
"404":
description: 轮次不存在或不属于当前用户
/agent/runs/{id}/messages:
parameters:
- $ref: "#/components/parameters/AgentRunID"
post:
tags: [agent]
summary: 从服务端父轮历史创建新轮次
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/CloudAgentRequest"
responses:
"200":
description: 信封 data.run(新的 ID)
"409":
description: 父轮仍在执行或幂等键冲突
/agent/runs/{id}/cancel:
parameters:
- $ref: "#/components/parameters/AgentRunID"
post:
tags: [agent]
summary: 取消当前用户的 Agent 轮次
responses:
"200":
description: 信封 data.accepted
/agent/runs/{id}/undo:
parameters:
- $ref: "#/components/parameters/AgentRunID"
post:
tags: [agent]
summary: 撤销当前 Agent 运行产生的最新画布变更
description: 仅撤销仍是最新快照、且未提交生成任务的画布变更;不会取消任务或退款。
requestBody:
required: true
content:
application/json:
schema:
type: object
additionalProperties: false
required: [expectedSnapshotHash]
properties:
stepId:
type: string
maxLength: 160
expectedSnapshotHash:
type: string
minLength: 64
maxLength: 64
pattern: '^[0-9a-fA-F]{64}$'
reason:
type: string
maxLength: 2000
responses:
"200":
description: 信封 data.accepted 与当前快照哈希
"400":
description: 请求无效、快照不可撤销或已提交任务不能撤销
"409":
description: 画布已发生后续变化、操作已处理或 stepId 不匹配
/agent/runs/{id}/approvals/{approvalId}/decision:
parameters:
- $ref: "#/components/parameters/AgentRunID"
- name: approvalId
in: path
required: true
schema:
type: string
post:
tags: [agent]
summary: 提交 Agent 工具审批决定
requestBody:
required: true
content:
application/json:
schema:
type: object
additionalProperties: false
required: [decision]
properties:
decision:
type: string
enum: [approve, reject]
reason:
type: string
maxLength: 2000
responses:
"200":
description: 信封 data.accepted
"409":
description: 审批不存在、已过期或决定冲突
/agent/runs/{id}/events:
parameters:
- $ref: "#/components/parameters/AgentRunID"
get:
tags: [agent]
summary: Agent 运行事件回放与持续订阅
parameters:
- name: after
in: query
schema:
type: integer
minimum: 0
- name: Last-Event-ID
in: header
schema:
type: integer
minimum: 0
responses:
"200":
description: 首次及 revision 变化时发送紧凑 run_snapshot;无变化时 heartbeat;agent_event.seq 为递增游标,cleanupPending 期间持续发送
content:
text/event-stream:
schema:
type: string
/openapi.yaml:
get:
tags: [meta]
@@ -150,12 +301,74 @@ paths:
"200":
$ref: "#/components/responses/Envelope"
components:
parameters:
AgentRunID:
name: id
in: path
required: true
schema:
type: string
securitySchemes:
sessionCookie:
type: apiKey
in: cookie
name: open_ai_canvas_session
schemas:
CloudAgentRequest:
type: object
additionalProperties: false
required: [canvasId, prompt, permissionMode, contextScope, budget, idempotencyKey]
properties:
canvasId:
type: string
maxLength: 80
prompt:
type: string
description: 非空,最多 16000 字节
logicalModelId:
type: string
model:
type: string
channelId:
type: string
channelModelKey:
type: string
permissionMode:
type: string
enum: [read_only, request_approval, auto]
skillIds:
type: array
maxItems: 8
items:
type: string
contextScope:
type: array
maxItems: 1
items:
type: string
enum: [canvas]
budget:
type: object
additionalProperties: false
required: [maxCredits]
properties:
maxCredits:
type: number
minimum: 0
exclusiveMinimum: true
maximum: 1000000
maxGenerationTasks:
type: integer
minimum: 0
maximum: 8
maxVideoSeconds:
type: integer
minimum: 0
maximum: 120
idempotencyKey:
type: string
minLength: 8
maxLength: 128
Envelope:
type: object
required: [code, msg]