package page→ /work/approvals.md
pages/work/approvals.md
40 lines, 1.6 KB. As a page.
- ---
- type: Collection
- title: Approvals
- description: "The agent asks, the person answers: one record is one command that the agent will run only after a \"yes\"."
- itemType: Approval
- items: {mode: path, path: /work/approvals, recursive: false}
- writeTo: /work/approvals
- properties:
- command: {kind: text, label: "Command (exactly the one that will be run)"}
- why: {kind: text, label: "What will happen and whether it can be rolled back"}
- askedOn: {kind: date, label: "Asked"}
- answer:
- kind: select
- label: "Person's answer"
- options:
- - {name: "yes", label: "Yes", color: green}
- - {name: "no", label: "No", color: red}
- answeredOn: {kind: date, label: "Answered"}
- usedOn: {kind: date, label: "Used"}
- views:
- - id: approvals--table
- name: All approvals
- 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}
- ---
- The agent creates a record when the hook did not let through a command from the [gate list](/base/human-gate.md). In the header: `title` is what and why, `command` is exactly that command, `why` is what will happen and whether it can be rolled back, and `askedOn`.
- The person answers in the same record: `answer: yes` or `answer: no` and `answeredOn`. The agent does not write these fields: the hook will not let it.
- One "yes" lets one run through: the hook writes `usedOn` into the record. A repeat needs a new record.