Skip to content
refs
History
7 lines · 446 BRaw
1import type { Outcome, Repo } from "@refs/backend/contract";
2import { formText } from "./session";
3
4/** Answers the tool approval a permission card posted: its session, its request and the button the human pressed. */
5export 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}