包页面→ /work/approvals.md
pages/work/approvals.md
40 行, 1.6 KB. 以页面形式查看.
- ---
- type: Collection
- title: 批准记录
- description: "智能体提问,人作答:每条记录对应一个命令,智能体只有在得到“是”之后才会运行它。"
- itemType: Approval
- items: {mode: path, path: /work/approvals, recursive: false}
- writeTo: /work/approvals
- properties:
- command: {kind: text, label: "命令(与将要运行的命令完全一致)"}
- why: {kind: text, label: "会发生什么,以及能否回滚"}
- askedOn: {kind: date, label: "提问日期"}
- answer:
- kind: select
- label: "人的答复"
- options:
- - {name: "yes", label: "是", color: green}
- - {name: "no", label: "否", color: red}
- answeredOn: {kind: date, label: "答复日期"}
- usedOn: {kind: date, label: "使用日期"}
- views:
- - id: approvals--table
- name: "全部批准记录"
- layout: table
- fields: {}
- sorting:
- - {propertyId: askedOn, direction: descending}
- properties:
- - {name: title, visible: true, width: 360}
- - {name: command, visible: true, width: 320}
- - {name: answer, visible: true}
- - {name: askedOn, visible: true}
- - {name: answeredOn, visible: true}
- - {name: usedOn, visible: true}
- ---
- 当钩子未放行[闸门清单](/base/human-gate.md)中的某条命令时,智能体会新建一条记录。页头中:`title` 写明做什么、为什么;`command` 恰好是该命令;`why` 写明会发生什么以及能否回滚;`askedOn` 为提问日期。
- 人在同一条记录中作答:`answer: yes` 或 `answer: no`,以及 `answeredOn`。智能体不写入这些字段:钩子不会允许它这样做。
- 一个“是”只放行一次运行:钩子会在记录中写入 `usedOn`。若要重复运行,需要新的记录。