import { mutation, role, t, target } from "@bijectionhq/bijection";
import { answer, question, type Answer } from "@bijectionhq/app-agents";
export const reviewer = role({ clear: [desk] });
export const questions = target({ label: desk, via: [reviewer], args: question, returns: answer, within: { hours: 24 } });
export const reply = mutation(
{ under: desk, allow: [reviewer], args: { task: t.task(questions), approved: t.boolean, value: t.json } },
async (ctx, { task, approved, value }) => {
const given: Answer = { approved, value, by: [ctx.frame.as.id] };
await ctx.answer(task, { ok: true, value: given });
return null;
},
);
export const support = agents({ transcript: desk, tool: belt.dispatch, ask: questions, settings });