7 lines · 446 BRaw
| 1 | import type { Outcome, Repo } from "@refs/backend/contract"; |
| 2 | import { formText } from "./session"; |
| 3 | |
| 4 | /** Answers the tool approval a permission card posted: its session, its request and the button the human pressed. */ |
| 5 | export function decidePermission(repo: Repo, form: FormData): Promise<Outcome> { |
| 6 | return repo.decidePermission(formText(form, "session"), formText(form, "request"), formText(form, "behavior") === "allow" ? "allow" : "deny"); |
| 7 | } |