import type { PlimiPlugin } from "../../core/plugins/plugin-types";
import { runUuidGenerator } from "./run";

export interface UuidOptions {
  count: number;
}

export const uuidGeneratorPlugin: PlimiPlugin<UuidOptions> = {
  manifest: {
    id: "crypto-uuid",
    name: "UUID Generator",
    description: "Generate cryptographically secure v4 UUIDs.",
    category: "crypto",
    version: "1.0.0",
    tags: ["uuid", "guid", "crypto", "random"],
    input: { type: "none" },
    output: { type: "text" },
    offlineReady: true,
  },

  optionsSchema: {
    fields: [
      {
        type: "slider",
        key: "count",
        label: "Count",
        defaultValue: 1,
        min: 1,
        max: 100,
        step: 1,
      },
    ],
  },

  capabilities: {
    cancelable: false,
    worker: false,
  },

  run: runUuidGenerator,
};
