Skip to content

armgit / eve

Public Imported from GitHub
0

The Open Framework for Building Agents

645 B
Raw Blame
import { defineTool } from "eve/tools";
import { always } from "eve/tools/approval";
import { z } from "zod";

export default defineTool({
  description: "Check whether the executing caller has fixture release access.",
  inputSchema: z.object({}),
  approval: {
    request: always(),
    response: ({ response }) =>
      response.principal.principalId === "bob"
        ? { status: "allowed" }
        : { status: "rejected", reason: "Only bob can approve this fixture." },
  },
  execute: (_input, ctx) => ({
    actor: ctx.session.auth.current?.principalId ?? "none",
    allowed: ctx.session.auth.current?.principalId === "bob",
  }),
});