aps-agent/shared/schemas/ui_block.schema.json

33 lines
1.4 KiB
JSON
Raw Normal View History

2026-07-21 11:05:57 +08:00
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "aps://shared/ui_block",
"title": "UIBlock",
"description": "UI 块:后端/LLM 与前端之间的渲染契约(plan.md §6.2)。M1 实现 text 与 confirm-card 两种。",
"type": "object",
"required": ["blockId", "type", "props"],
"properties": {
"blockId": { "description": "块唯一 ID", "type": "string" },
"type": {
"description": "块类型(M2 子集;后续按 §6.2 扩展 gantt/due-board 等)",
"type": "string",
"enum": ["text", "confirm-card", "evidence", "scenario-cards", "report"]
},
"props": { "description": "该块的数据载荷", "type": "object" },
"actions": {
"description": "块内可触发的动作(回传给后端)",
"type": "array",
"items": {
"type": "object",
"required": ["actionId", "label", "power"],
"properties": {
"actionId": { "description": "动作 ID", "type": "string" },
"label": { "description": "按钮文案", "type": "string" },
"power": { "description": "权力等级(P2/P3 须过门禁)", "type": "string", "enum": ["P0", "P1", "P2", "P3"] },
"payload": { "description": "携带参数", "type": "object" }
}
}
},
"evidenceRefs": { "description": "关联证据 ID 列表", "type": "array", "items": { "type": "string" } }
}
}