import assert from "node:assert/strict";
import test from "node:test";
import { fromPrismaProvider, serializeProviderFields, toPrismaProvider } from "../src/llm/provider-ids.js";

test("Hermes Agent provider id maps between API and Prisma enum forms", () => {
  assert.equal(toPrismaProvider("hermes-agent"), "hermes_agent");
  assert.equal(fromPrismaProvider("hermes_agent"), "hermes-agent");
  assert.equal(toPrismaProvider("gemini"), "gemini");
  assert.equal(fromPrismaProvider("gemini"), "gemini");
  assert.deepEqual(serializeProviderFields({ initiatedProvider: "hermes_agent", lastUsedProvider: "gemini" }), {
    initiatedProvider: "hermes-agent",
    lastUsedProvider: "gemini",
  });
});
