import { defineCommand, arg } from "politty";
import { z } from "zod";
import { executeCommand } from "../../lib/command-result";
import { runMockValidate } from "./validate";

export const validateCommand = defineCommand({
  name: "validate",
  description: "Validate mock scenario configs",
  args: z.object({
    mocksRoot: arg(z.string().default("./mocks"), {
      description: "Path to mocks directory",
    }),
    paths: arg(z.array(z.string()).default([]), {
      positional: true,
      description: "Specific scenario paths to validate",
    }),
  }),
  run: (args) => {
    return executeCommand(() => runMockValidate(args.mocksRoot, args.paths));
  },
});
