import assert from "node:assert/strict";
import { createEvaluator, evaluateCandidates } from "../src/index.mjs";
import { loadFlatDomains } from "../src/loader.mjs";
import { resolveDomains } from "../src/route.mjs";

assert.ok(typeof createEvaluator === "function");
assert.ok(typeof evaluateCandidates === "function");
assert.ok(typeof loadFlatDomains === "function");
assert.ok(typeof resolveDomains === "function");

const evaluator = createEvaluator({ dimensions: ["clarity", "impact"] });
const results = evaluator.score(
  [{ text: "hello world here" }],
  [{ id: "d", data: { schemaVersion: 1, id: "d", x_eval: { rules: [{ id: "r", dimensions: ["clarity"], condition: { path: "text.length", op: "gt", value: 3 }, effect: { value: 10 } }] } } }]
);
assert.equal(results[0].dimensions.clarity, 60);

console.log("ESM smoke: all exports OK");
