import { parseAgentEnv } from "@code/env/agent";
import { defineAgent } from "@flue/runtime";

import INSTRUCTIONS from "../prompts/zopu-instructions.md" with { type: "markdown" };
import { createSliceOneTools } from "../tools/slice-one";

export {
  convexAgentRoute as attachments,
  convexAgentRoute as route,
} from "../auth";

export default defineAgent(({ env, id }) => {
  const { AGENT_MODEL_NAME, AGENT_MODEL_PROVIDER } = parseAgentEnv(env);

  return {
    description:
      "Turns actionable conversation into provenanced Signals and proposed Work.",
    instructions: INSTRUCTIONS,
    model: `${AGENT_MODEL_PROVIDER}/${AGENT_MODEL_NAME}`,
    thinkingLevel: "medium",
    tools: createSliceOneTools(id, env),
  };
});
