import { it } from "vitest";
import { appendFileSync } from "node:fs";
import { normalizeAcpRegistryCommands } from "@t3tools/provider-acp-registry/testing";
const time = (label: string, input: any[]) => {
  const t = performance.now();
  const out = normalizeAcpRegistryCommands(input);
  appendFileSync("/tmp/issue-lead-33757-r1/implement/run-1794299209/results.txt", [label, input.length, "->", out.slashCommands.length, "slash,", out.skills.length, "skills,", (performance.now() - t).toFixed(1), "ms"].join(" ") + "\n");
};
it("timing", () => {
  time("100k distinct", Array.from({ length: 100_000 }, (_, i) => ({ name: i % 10 === 0 ? `$skill_${i}` : `cmd_${i}`, description: "d".repeat(200), input: { hint: "h" } })));
  time("100k duplicates (case)", Array.from({ length: 100_000 }, (_, i) => ({ name: i % 2 ? "DUP" : "dup", description: "" })));
  time("3000 malformed tokens", Array.from({ length: 3000 }, (_, i) => ({ name: i % 3 === 0 ? "" : i % 3 === 1 ? "$" : " ".repeat(5000) + "\u0000x".repeat(3000), description: "\u0000".repeat(5000) })));
  time("3000 oversize names", Array.from({ length: 3000 }, (_, i) => ({ name: `n${i}` + "a".repeat(10_000), description: "x".repeat(50_000) })));
});
