Skip to content

armgit / eve

Public Imported from GitHub
0

The Open Framework for Building Agents

626 B
Raw Blame
import { defineHook } from "eve/hooks";
import { loadWorkspaceCredentials } from "../lib/workspace";

export default defineHook({
  events: {
    async "turn.started"(_event, ctx) {
      try {
        await loadWorkspaceCredentials(ctx.session.auth.current);
      } catch (error) {
        // Without credentials every workspace tool call would fail; stop before the model runs.
        console.warn("cancelling turn: workspace credentials unavailable", {
          error: error instanceof Error ? error.message : String(error),
          sessionId: ctx.session.id,
        });
        ctx.cancel();
      }
    },
  },
});