import type { ToolInput } from "../../core/io/input-types";
import type { ToolResult } from "../../core/io/output-types";
import type { ToolContext } from "../../core/plugins/plugin-types";
import type { UuidOptions } from "./index";

export async function runUuidGenerator(
  _input: ToolInput,
  options: UuidOptions,
  _context: ToolContext
): Promise<ToolResult> {
  void _input;
  void _context;
  const count = options.count || 1;
  const uuids: string[] = [];

  for (let i = 0; i < count; i++) {
    uuids.push(crypto.randomUUID());
  }

  return {
    type: "text",
    value: uuids.join("\n"),
  };
}
